Marshalling does not export recently added properties.

Hi orocos-dev,

I have the following piece of code:

OCL::DeploymentComponent depl;
KDL::Frame frame;
RTT::Property<KDL::Frame> frame_prop=RTT::Property<KDL::Frame>("frame","");
depl.addProperty(frame_prop);
RTT::marsh::MarshallingService marsh(&depl);
marsh.storeProperties("test.cpf");

when I execute it I get the following output:

0.052 [ Info ][PropertyLoader::store] Wrote test.cpf

When I check the contents of test.cpf I only see the original properties of
the deployer but not the one I recently added. Am I missing something obvious
here?

Ruben

Marshalling does not export recently added properties.

On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> Hi orocos-dev,
>
> I have the following piece of code:
>
> OCL::DeploymentComponent depl;
> KDL::Frame frame;
> RTT::Property<KDL::Frame> frame_prop=RTT::Property<KDL::Frame>("frame","");
> depl.addProperty(frame_prop);
> RTT::marsh::MarshallingService marsh(&depl);
> marsh.storeProperties("test.cpf");
>
> when I execute it I get the following output:
>
> 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
>
> When I check the contents of test.cpf I only see the original properties of
> the deployer but not the one I recently added. Am I missing something
> obvious here?

Is the KDL typekit loaded ?

Peter

Ruben Smits's picture

Marshalling does not export recently added properties.

On Monday 17 January 2011 15:01:24 Peter Soetens wrote:
> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> > Hi orocos-dev,
> >
> > I have the following piece of code:
> >
> > OCL::DeploymentComponent depl;
> > KDL::Frame frame;
> > RTT::Property<KDL::Frame>
> > frame_prop=RTT::Property<KDL::Frame>("frame","");
> > depl.addProperty(frame_prop);
> > RTT::marsh::MarshallingService marsh(&depl);
> > marsh.storeProperties("test.cpf");
> >
> > when I execute it I get the following output:
> >
> > 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
> >
> > When I check the contents of test.cpf I only see the original properties
> > of the deployer but not the one I recently added. Am I missing
> > something obvious here?
>
> Is the KDL typekit loaded ?

Yes, I forgot to post the following line of code:

depl.import("kdl_rtt_plugin")

And afterwards I check if it succeeded as follows:

EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Chain>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Frame>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Jacobian>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::JntArray>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Joint>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Rotation>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Segment>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Twist>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Vector>());
EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Wrench>());

Which all returns false, so the TypeInfos are known

> Peter

Ruben

Marshalling does not export recently added properties.

2011/1/17 Ruben Smits <ruben [dot] smits [..] ...>:
> On Monday 17 January 2011 15:01:24 Peter Soetens wrote:
>> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
>> > Hi orocos-dev,
>> >
>> > I have the following piece of code:
>> >
>> > OCL::DeploymentComponent depl;
>> > KDL::Frame frame;
>> > RTT::Property<KDL::Frame>
>> > frame_prop=RTT::Property<KDL::Frame>("frame","");
>> > depl.addProperty(frame_prop);
>> > RTT::marsh::MarshallingService marsh(&depl);
>> > marsh.storeProperties("test.cpf");
>> >
>> > when I execute it I get the following output:
>> >
>> > 0.052 [ Info   ][PropertyLoader::store] Wrote test.cpf
>> >
>> > When I check the contents of test.cpf I only see the original properties
>> > of the deployer but not the one I recently added. Am I missing
>> > something obvious here?
>>
>> Is the KDL typekit loaded ?
>
> Yes, I forgot to post the following line of code:
>
> depl.import("kdl_rtt_plugin")
>
> And afterwards I check if it succeeded as follows:
>
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Chain>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Frame>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Jacobian>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::JntArray>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Joint>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Rotation>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Segment>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Twist>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Vector>());
>    EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Wrench>());
>
> Which all returns false, so the TypeInfos are known

Looks like you have to add the Properties to the deployer in the next
test again. It then effectively writes them to the files!

Steven

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

Marshalling does not export recently added properties.

On Monday 17 January 2011 16:09:03 Steven Bellens wrote:
> 2011/1/17 Ruben Smits <ruben [dot] smits [..] ...>:
> > On Monday 17 January 2011 15:01:24 Peter Soetens wrote:
> >> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> >> > Hi orocos-dev,
> >> >
> >> > I have the following piece of code:
> >> >
> >> > OCL::DeploymentComponent depl;
> >> > KDL::Frame frame;
> >> > RTT::Property<KDL::Frame>
> >> > frame_prop=RTT::Property<KDL::Frame>("frame","");
> >> > depl.addProperty(frame_prop);
> >> > RTT::marsh::MarshallingService marsh(&depl);
> >> > marsh.storeProperties("test.cpf");
> >> >
> >> > when I execute it I get the following output:
> >> >
> >> > 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
> >> >
> >> > When I check the contents of test.cpf I only see the original
> >> > properties of the deployer but not the one I recently added. Am I
> >> > missing something obvious here?
> >>
> >> Is the KDL typekit loaded ?
> >
> > Yes, I forgot to post the following line of code:
> >
> > depl.import("kdl_rtt_plugin")
> >
> > And afterwards I check if it succeeded as follows:
> >
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Chain>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Frame>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Jacobian>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::JntArray>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Joint>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Rotation>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Segment>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Twist>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Vector>());
> > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Wrench>());
> >
> > Which all returns false, so the TypeInfos are known
>
> Looks like you have to add the Properties to the deployer in the next
> test again. It then effectively writes them to the files!
>

Which testing framework are you using ? Be aware that all testing frameworks
create a new 'fresh' fixture for each test case, so you can not assume that
state will be kept between tests.

Peter

Ruben Smits's picture

Marshalling does not export recently added properties.

On Monday 17 January 2011 16:34:38 Peter Soetens wrote:
> On Monday 17 January 2011 16:09:03 Steven Bellens wrote:
> > 2011/1/17 Ruben Smits <ruben [dot] smits [..] ...>:
> > > On Monday 17 January 2011 15:01:24 Peter Soetens wrote:
> > >> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> > >> > Hi orocos-dev,
> > >> >
> > >> > I have the following piece of code:
> > >> >
> > >> > OCL::DeploymentComponent depl;
> > >> > KDL::Frame frame;
> > >> > RTT::Property<KDL::Frame>
> > >> > frame_prop=RTT::Property<KDL::Frame>("frame","");
> > >> > depl.addProperty(frame_prop);
> > >> > RTT::marsh::MarshallingService marsh(&depl);
> > >> > marsh.storeProperties("test.cpf");
> > >> >
> > >> > when I execute it I get the following output:
> > >> >
> > >> > 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
> > >> >
> > >> > When I check the contents of test.cpf I only see the original
> > >> > properties of the deployer but not the one I recently added.
> > >> > Am I
> > >> > missing something obvious here?
> > >>
> > >> Is the KDL typekit loaded ?
> > >
> > > Yes, I forgot to post the following line of code:
> > >
> > > depl.import("kdl_rtt_plugin")
> > >
> > > And afterwards I check if it succeeded as follows:
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Chain
> > > >());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Frame
> > > >());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Jacob
> > > ian>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::JntA
> > > rray>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Join
> > > t>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Rota
> > > tion>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Segm
> > > ent>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Twis
> > > t>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Vect
> > > or>());
> > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Wren
> > > ch>());
> > >
> > > Which all returns false, so the TypeInfos are known
> >
> > Looks like you have to add the Properties to the deployer in the next
> > test again. It then effectively writes them to the files!
>
> Which testing framework are you using ? Be aware that all testing
> frameworks create a new 'fresh' fixture for each test case, so you can not
> assume that state will be kept between tests.

Google test, the entire test is added in the attachment for reference. The
properties and the component are members of the test suite so I thought it
should not be a problem.

Ruben

> Peter

Marshalling does not export recently added properties.

On Monday 17 January 2011 20:25:25 Ruben Smits wrote:
> On Monday 17 January 2011 16:34:38 Peter Soetens wrote:
> > On Monday 17 January 2011 16:09:03 Steven Bellens wrote:
> > > 2011/1/17 Ruben Smits <ruben [dot] smits [..] ...>:
> > > > On Monday 17 January 2011 15:01:24 Peter Soetens wrote:
> > > >> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> > > >> > Hi orocos-dev,
> > > >> >
> > > >> > I have the following piece of code:
> > > >> >
> > > >> > OCL::DeploymentComponent depl;
> > > >> > KDL::Frame frame;
> > > >> > RTT::Property<KDL::Frame>
> > > >> > frame_prop=RTT::Property<KDL::Frame>("frame","");
> > > >> > depl.addProperty(frame_prop);
> > > >> > RTT::marsh::MarshallingService marsh(&depl);
> > > >> > marsh.storeProperties("test.cpf");
> > > >> >
> > > >> > when I execute it I get the following output:
> > > >> >
> > > >> > 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
> > > >> >
> > > >> > When I check the contents of test.cpf I only see the original
> > > >> > properties of the deployer but not the one I recently added.
> > > >> > Am I
> > > >> > missing something obvious here?
> > > >>
> > > >> Is the KDL typekit loaded ?
> > > >
> > > > Yes, I forgot to post the following line of code:
> > > >
> > > > depl.import("kdl_rtt_plugin")
> > > >
> > > > And afterwards I check if it succeeded as follows:
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Chain
> > > >
> > > > >());
> > > >
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Frame
> > > >
> > > > >());
> > > >
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Jacob
> > > > ian>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::JntA
> > > > rray>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Join
> > > > t>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Rota
> > > > tion>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Segm
> > > > ent>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Twis
> > > > t>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Vect
> > > > or>());
> > > > EXPECT_FALSE(NULL==RTT::types::Types()->getTypeInfo<KDL::Wren
> > > > ch>());
> > > >
> > > > Which all returns false, so the TypeInfos are known
> > >
> > > Looks like you have to add the Properties to the deployer in the next
> > > test again. It then effectively writes them to the files!
> >
> > Which testing framework are you using ? Be aware that all testing
> > frameworks create a new 'fresh' fixture for each test case, so you can
> > not assume that state will be kept between tests.
>
> Google test, the entire test is added in the attachment for reference. The
> properties and the component are members of the test suite so I thought it
> should not be a problem.

I don't think so. The KDLPluginTest object is instantiated for each test
function. So in this file, you end up with 4 deployment components and only one
of them knows that the kdl_rtt_plugin is loaded. Also only one of them has the
properties.

This is so for each C++ UT framework I know of. In the better frameworks, you
can also have EXPECT_FOO macros in the SetUp/TearDown functions, which allow
you to do addProperties + import there for example.

Peter

Marshalling does not export recently added properties.

On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> Hi orocos-dev,
>
> I have the following piece of code:
>
> OCL::DeploymentComponent depl;
> KDL::Frame frame;
> RTT::Property<KDL::Frame> frame_prop=RTT::Property<KDL::Frame>("frame","");
> depl.addProperty(frame_prop);
> RTT::marsh::MarshallingService marsh(&depl);

This is not allowed. A service may not live on the stack, but must always be
created with 'new' and be stored in a shared_ptr.

> marsh.storeProperties("test.cpf");
>
> when I execute it I get the following output:
>
> 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
>
> When I check the contents of test.cpf I only see the original properties of
> the deployer but not the one I recently added. Am I missing something
> obvious here?

Did you check frame_prop.ready() ?

Peter

Ruben Smits's picture

Marshalling does not export recently added properties.

On Monday 17 January 2011 14:57:33 Peter Soetens wrote:
> On Monday 17 January 2011 14:02:27 Ruben Smits wrote:
> > Hi orocos-dev,
> >
> > I have the following piece of code:
> >
> > OCL::DeploymentComponent depl;
> > KDL::Frame frame;
> > RTT::Property<KDL::Frame>
> > frame_prop=RTT::Property<KDL::Frame>("frame","");
> > depl.addProperty(frame_prop);
> > RTT::marsh::MarshallingService marsh(&depl);
>
> This is not allowed. A service may not live on the stack, but must always be
> created with 'new' and be stored in a shared_ptr.

Ok I'll fix that, but how is this related to my problem??

> > marsh.storeProperties("test.cpf");
> >
> > when I execute it I get the following output:
> >
> > 0.052 [ Info ][PropertyLoader::store] Wrote test.cpf
> >
> > When I check the contents of test.cpf I only see the original properties
> > of the deployer but not the one I recently added. Am I missing
> > something obvious here?
>
> Did you check frame_prop.ready() ?

Yep, returns true.

> Peter

Ruben