Marshalling vector<double>

Hi all,
I'm sorry for this stupid question but is all the morning that I'm
trying to solve this problem and I didn't find ocl 2.x examples.

I'm preparing a PID controller and I want to load the parameters from a
cpf file using PropertyMarshaller.

This is the code (piece of):

#include <rtt/marsh/PropertyDemarshaller.hp

#include <rtt/marsh/PropertyMarshaller.hp

#include <rtt/marsh/MarshallInterface.hp

#include <rtt/Property.hp

#include <Eigen/Core>
#include <rtt/RTT.hp

#include <iostream>

using namespace KDL;
using namespace Eigen;
using namespace RTT;
using namespace std;

class PdController
: public RTT::TaskContext
{

protected:
...
Property< std::vector<double> > pParameters;
Property< std::vector<double> > iParameters;
Property< std::vector<double> > dParameters;

public:
PdController(string const& name)
: TaskContext(name),
...
pParameters("pParameters","proportional parameters of the axes
",vector<double>(6,0)),
iParameters("iParameters","integrative parameters of the axes
",vector<double>(6,0)),
dParameters("dParameters","derivative parameters of the axes
",vector<double>(6,0))

{

this->properties()->addProperty( pParameters);
this->properties()->addProperty( iParameters);
this->properties()->addProperty( dParameters);
}

bool configureHook()
{

boost::shared_ptr<Marshalling> Marshalling =
this->getProvider<RTT::Marshalling>("marshalling");
result = Marshalling->writeProperties("pidParameters.cpf");

...
}

compiling:
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: ‘Marshalling’ was not declared in this scope
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: template argument 1 is invalid
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: invalid type in declaration before ‘=’ token
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: ‘Marshalling’ is not a member of ‘RTT’
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: ‘Marshalling’ is not a member of ‘RTT’
/root/workspace/stem/pdController/src/pdController-component.hpp:81:
error: no matching function for call to ‘PdController::getProvider(const
char [12])’

What's wrong?

Can I propose a wiki page with the links of all ocl examples available
on internet?

Thanks a lot!
Fabrizio

--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Marshalling vector<double>

On Friday 27 May 2011 12:02:03 Fabrizio wrote:
> Hi all,
> I'm sorry for this stupid question but is all the morning that I'm
> trying to solve this problem and I didn't find ocl 2.x examples.
>
> I'm preparing a PID controller and I want to load the parameters from a
> cpf file using PropertyMarshaller.
>
> This is the code (piece of):
>
> #include <rtt/marsh/PropertyDemarshaller.hp

> #include <rtt/marsh/PropertyMarshaller.hp

> #include <rtt/marsh/MarshallInterface.hp

You don't need these. You should instead include:
#include <rtt/marsh/Marshaller.hp

...
> bool configureHook()
> {
>
>
> boost::shared_ptr<Marshalling> Marshalling =
> this->getProvider<RTT::Marshalling>("marshalling");
> result = Marshalling->writeProperties("pidParameters.cpf");
>
> ...
> }
>
>
> compiling:
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: ‘Marshalling’ was not declared in this scope
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: template argument 1 is invalid
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: invalid type in declaration before ‘=’ token
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: ‘Marshalling’ is not a member of ‘RTT’
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: ‘Marshalling’ is not a member of ‘RTT’
> /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> error: no matching function for call to ‘PdController::getProvider(const
> char [12])’
>
> What's wrong?

You forgot to include the Marshalling.hpp header.

>
> Can I propose a wiki page with the links of all ocl examples available
> on internet?

Of course :-) Make a child page here:
http://www.orocos.org/wiki/orocos/toolchain/getting-started/toolchain-tu...

Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Marshalling vector<double>

On Fri, 2011-05-27 at 12:44 +0200, Peter Soetens wrote:
> On Friday 27 May 2011 12:02:03 Fabrizio wrote:
> > Hi all,
> > I'm sorry for this stupid question but is all the morning that I'm
> > trying to solve this problem and I didn't find ocl 2.x examples.
> >
> > I'm preparing a PID controller and I want to load the parameters from a
> > cpf file using PropertyMarshaller.
> >
> > This is the code (piece of):
> >
> > #include <rtt/marsh/PropertyDemarshaller.hp

> > #include <rtt/marsh/PropertyMarshaller.hp

> > #include <rtt/marsh/MarshallInterface.hp

>
> You don't need these. You should instead include:
> #include <rtt/marsh/Marshaller.hp

>
> ...
> > bool configureHook()
> > {
> >
> >
> > boost::shared_ptr<Marshalling> Marshalling =
> > this->getProvider<RTT::Marshalling>("marshalling");
> > result = Marshalling->writeProperties("pidParameters.cpf");
> >
> > ...
> > }
> >
> >
> > compiling:
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: ‘Marshalling’ was not declared in this scope
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: template argument 1 is invalid
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: invalid type in declaration before ‘=’ token
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: ‘Marshalling’ is not a member of ‘RTT’
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: ‘Marshalling’ is not a member of ‘RTT’
> > /root/workspace/stem/pdController/src/pdController-component.hpp:81:
> > error: no matching function for call to ‘PdController::getProvider(const
> > char [12])’
> >
> > What's wrong?
>
> You forgot to include the Marshalling.hpp header.

Thanks!

> >
> > Can I propose a wiki page with the links of all ocl examples available
> > on internet?
>
> Of course :-) Make a child page here:
> http://www.orocos.org/wiki/orocos/toolchain/getting-started/toolchain-tu...

When our components are ready I'll post there ;)

> Peter
Fabrizio

--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users