Dear Sirs,
I am working on Orocos toolchain 2.3.2.
I am developing some test components using orogen.
I defined the following simple component
name 'viewer3d'
version '1.0'
import_types_from "viewer3d.h"
task_context "Viewer3d" do
# reading of initial values of properties is required
needs_configuration
# output ports
input_port("ActivatedBehaviour","int")
# properties
property("Obstacles","viewer/obstaclesPositions").
doc('sizes of obstacles in the work area')
end
deployment "visualizzatore" do
kifInterface = task("v1","Viewer3d").
realtime.
priority(50).
periodic(1.0).
start
end
In the file viewer3d.h I defined the following types:
class obstacleP
{
public:
double lenght_x;
double lenght_y;
double lenght_z;
obstacleP()
{
lenght_x=0.0;
lenght_y=0.0;
lenght_z=0.0;
}
};
class obstaclesPositions
{
public:
std::vector<obstacleP> obsPosition;
obstaclesPositions()
{
obstacleP oP;
oP.lenght_x=0.0;
oP.lenght_y=0.0;
oP.lenght_z=0.0;
obsPosition.push_back(oP);
}
};
}
I prepared the a cpf file containing a property of type obstaclesPositions with two elements of type obstacleP.
The cpf file is listed at the end.
I loaded marhalling service in deployer-xenomai, then I load an instance V1 of my component and
I ran the command V1.configure.
This action was successfull, but if I inspect the property I cant see both the element I have put in the cpf file.
Only the first one was read.
Can you help me to understand how can I have a property of vector type read with all the values store in the cpf file?
Thank you for your support.
G. Rizzi
ObstaclesDescription.cpf file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "cpf.dtd">
<properties>
<struct name="Obstacles" type="/viewer/obstaclesPositions">
<description>actual number and position of obstacles in the work area<description>
<struct name="obsPosition" type="/std/vector</viewer/obstacleP>">
<description>Part<description>
<struct name="Element0" type="/viewer/obstacleP">
<description>Item<description>
<simple name="lenght_x" type="double"><description>Part<description><value>1<value><simple>
<simple name="lenght_y" type="double"><description>Part<description><value>2<value><simple>
<simple name="lenght_z" type="double"><description>Part<description><value>3<value><simple>
<struct>
<struct name="Element1" type="/viewer/obstacleP">
<description>Item<description>
<simple name="lenght_x" type="double"><description>Part<description><value>4<value><simple>
<simple name="lenght_y" type="double"><description>Part<description><value>5<value><simple>
<simple name="lenght_z" type="double"><description>Part<description><value>6<value><simple>
<struct>
<struct>
<struct>
<properties>