Using typegen

Hi all,

I had previously completly thrown typegen away because it was not
working nicely with ROS installs in early 2.X versions. So I gived a
new try.
I had a line to my CMakeLogic :
orocos_typegen_headers(src/models/UbiquityStates.hpp)
(UbiquityStates contains simple structs of doubles so it is quite an easy try)

And magically eveything seems to compile and be loaded. Btw thanks for
those who worked behing all this simple line. Having written many
typekits by hand and loosing time in awfull gcc error logs, I can
appreciate the time saved ^^.

I just have 2 errors when deploying :
0.191 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type /std/string
0.236 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type string

Then my own types appears like this :
Out(C) arp_model.MotorState outMotorMeasures => (/arp_model/MotorState)

I would like to customize the way they are printed, as I used to do
with the "<<" operator when creating a personnal typekit.
Is it a way to tell this to typegen ? (like simply defining "<<" for my types )
Should I edit the sources generated by typegen ?

More complete extract of orocos.log :
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingMotorPositions
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingMotorTorques
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingMotorVelocities
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingTurretPositions
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingTurretTorques
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/DrivingTurretVelocities
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/MotorState
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SlippageReport
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringMotorPositions
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringMotorTorques
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringMotorVelocities
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringTurretPositions
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringTurretTorques
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/SteeringTurretVelocities
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /arp_model/TurretState
0.191 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type /std/string
0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
transport for /std/string
0.192 [ Info ][DeploymentComponent::import] Loaded RTT
TypeKit/Transport '/orogen/arp_core/CORBA' from
'arp_core-transport-corba'
0.192 [ Info ][DeploymentComponent::import] Loading plugin libraries
from directory /opt/ard/arp_core/lib/orocos/gnulinux/plugins ...
0.193 [ Info ][DeploymentComponent::import] Loaded RTT Service
'filtering' from 'arp_core-filtering'
0.208 [ Info ][DeploymentComponent::import] Importing directory
/opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux
...
0.208 [ Info ][DeploymentComponent::import] Loading typekit
libraries from directory
/opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux/types
...
0.235 [ Info ][TypekitRepository::Import] Loading Typekit ros-primitives.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type 'int32'
already exists as 'int': I'll alias the original and install the new
instance.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
'int32[]' already exists as 'ints': I'll alias the original and
install the new instance.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type 'uint32'
already exists as 'uint': I'll alias the original and install the new
instance.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
'float32' already exists as 'float': I'll alias the original and
install the new instance.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
'float64' already exists as 'double': I'll alias the original and
install the new instance.
0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
'float64[]' already exists as 'array': I'll alias the original and
install the new instance.
0.236 [ Info ][TypekitRepository::Import] TypeInfo for type 'string'
already exists as '/std/string': I'll alias the original and install
the new instance.
0.236 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type string

Using typegen

2012/4/6 Willy Lambert <lambert [dot] willy [..] ...>

> Hi all,
>

Hi,

>
> I had previously completly thrown typegen away because it was not
> working nicely with ROS installs in early 2.X versions. So I gived a
> new try.
> I had a line to my CMakeLogic :
> orocos_typegen_headers(src/models/UbiquityStates.hpp)
> (UbiquityStates contains simple structs of doubles so it is quite an easy
> try)
>
> And magically eveything seems to compile and be loaded. Btw thanks for
> those who worked behing all this simple line. Having written many
> typekits by hand and loosing time in awfull gcc error logs, I can
> appreciate the time saved ^^.
>
> I just have 2 errors when deploying :
> 0.191 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
> already added for type /std/string
> 0.236 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
> already added for type string
>

This error should be a Warning ;)
It is just because the string type is setup twice (once in RTT, and
probably once when you load your typekit).

>
> Then my own types appears like this :
> Out(C) arp_model.MotorState outMotorMeasures => (/arp_model/MotorState)
>
> I would like to customize the way they are printed, as I used to do
> with the "<<" operator when creating a personnal typekit.
> Is it a way to tell this to typegen ? (like simply defining "<<" for my
> types )
> Should I edit the sources generated by typegen ?
>

Serialization is automatically done by typegen.
outMotorMeasures.last() will print the elements contained in your structure.

Charles.

>
>
>
>
>
> More complete extract of orocos.log :
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingMotorPositions
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingMotorTorques
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingMotorVelocities
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingTurretPositions
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingTurretTorques
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/DrivingTurretVelocities
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/MotorState
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SlippageReport
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringMotorPositions
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringMotorTorques
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringMotorVelocities
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringTurretPositions
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringTurretTorques
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/SteeringTurretVelocities
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /arp_model/TurretState
> 0.191 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
> already added for type /std/string
> 0.191 [ Info ][TypekitRepository::Import] Registered new 'CORBA'
> transport for /std/string
> 0.192 [ Info ][DeploymentComponent::import] Loaded RTT
> TypeKit/Transport '/orogen/arp_core/CORBA' from
> 'arp_core-transport-corba'
> 0.192 [ Info ][DeploymentComponent::import] Loading plugin libraries
> from directory /opt/ard/arp_core/lib/orocos/gnulinux/plugins ...
> 0.193 [ Info ][DeploymentComponent::import] Loaded RTT Service
> 'filtering' from 'arp_core-filtering'
> 0.208 [ Info ][DeploymentComponent::import] Importing directory
> /opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux
> ...
> 0.208 [ Info ][DeploymentComponent::import] Loading typekit
> libraries from directory
> /opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux/types
> ...
> 0.235 [ Info ][TypekitRepository::Import] Loading Typekit ros-primitives.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type 'int32'
> already exists as 'int': I'll alias the original and install the new
> instance.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
> 'int32[]' already exists as 'ints': I'll alias the original and
> install the new instance.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type 'uint32'
> already exists as 'uint': I'll alias the original and install the new
> instance.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
> 'float32' already exists as 'float': I'll alias the original and
> install the new instance.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
> 'float64' already exists as 'double': I'll alias the original and
> install the new instance.
> 0.235 [ Info ][TypekitRepository::Import] TypeInfo for type
> 'float64[]' already exists as 'array': I'll alias the original and
> install the new instance.
> 0.236 [ Info ][TypekitRepository::Import] TypeInfo for type 'string'
> already exists as '/std/string': I'll alias the original and install
> the new instance.
> 0.236 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
> already added for type string
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Using typegen

2012/4/7 Charles Lesire-Cabaniols <charles [dot] lesire [..] ...>:
>
>
> 2012/4/6 Willy Lambert <lambert [dot] willy [..] ...>
>>
>> Hi all,
>
>
> Hi,
>
>>
>>
>> I had previously completly thrown typegen away because it was not
>> working nicely with ROS installs in early 2.X versions. So I gived a
>> new try.
>> I had a line to my CMakeLogic :
>> orocos_typegen_headers(src/models/UbiquityStates.hpp)
>> (UbiquityStates contains simple structs of doubles so it is quite an easy
>> try)
>>
>> And magically eveything seems to compile and be loaded. Btw thanks for
>> those who worked behing all this simple line. Having written many
>> typekits by hand and loosing time in awfull gcc error logs, I can
>> appreciate the time saved ^^.
>>
>> I just have 2 errors when deploying :
>> 0.191 [ ERROR  ][TypekitRepository::Import] A protocol with id 1 was
>> already added for type /std/string
>> 0.236 [ ERROR  ][TypekitRepository::Import] A protocol with id 1 was
>> already added for type string
>
>
> This error should be a Warning ;)
> It is just because the string type is setup twice (once in RTT, and probably
> once when you load your typekit).
>
>>
>>
>> Then my own types appears like this :
>>  Out(C) arp_model.MotorState outMotorMeasures => (/arp_model/MotorState)
>>
>> I would like to customize the way they are printed, as I used to do
>> with the "<<" operator when creating a personnal typekit.
>> Is it a way to tell this to typegen ? (like simply defining "<<" for my
>> types )
>> Should I edit the sources generated by typegen ?
>
>
> Serialization is automatically done by typegen.
> outMotorMeasures.last() will print the elements contained in your structure.
>
> Charles.
>

Yes, I have attributes printing in the Taskbrowser. But :
_ Port are not printed (it seems that attributes are printed from the
boost serialization and port via the ostream <<)
_ I am not happy with the printing. I have structs of structs and it
is barely not readable.

So the question was about the printing with <<, not about the boost
serialization that is great for now.

>>
>>
>>
>>
>>
>>
>> More complete extract of orocos.log :
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingMotorPositions
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingMotorTorques
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingMotorVelocities
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingTurretPositions
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingTurretTorques
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/DrivingTurretVelocities
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/MotorState
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SlippageReport
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringMotorPositions
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringMotorTorques
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringMotorVelocities
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringTurretPositions
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringTurretTorques
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/SteeringTurretVelocities
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /arp_model/TurretState
>> 0.191 [ ERROR  ][TypekitRepository::Import] A protocol with id 1 was
>> already added for type /std/string
>> 0.191 [ Info   ][TypekitRepository::Import] Registered new 'CORBA'
>> transport for /std/string
>> 0.192 [ Info   ][DeploymentComponent::import] Loaded RTT
>> TypeKit/Transport '/orogen/arp_core/CORBA' from
>> 'arp_core-transport-corba'
>> 0.192 [ Info   ][DeploymentComponent::import] Loading plugin libraries
>> from directory /opt/ard/arp_core/lib/orocos/gnulinux/plugins ...
>> 0.193 [ Info   ][DeploymentComponent::import] Loaded RTT Service
>> 'filtering' from 'arp_core-filtering'
>> 0.208 [ Info   ][DeploymentComponent::import] Importing directory
>> /opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux
>> ...
>> 0.208 [ Info   ][DeploymentComponent::import] Loading typekit
>> libraries from directory
>> /opt/ros_addons/rtt_ros_integration/rtt_rosnode/lib/orocos/gnulinux/types
>> ...
>> 0.235 [ Info   ][TypekitRepository::Import] Loading Typekit
>> ros-primitives.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type 'int32'
>> already exists as 'int': I'll alias the original and install the new
>> instance.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type
>> 'int32[]' already exists as 'ints': I'll alias the original and
>> install the new instance.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type 'uint32'
>> already exists as 'uint': I'll alias the original and install the new
>> instance.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type
>> 'float32' already exists as 'float': I'll alias the original and
>> install the new instance.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type
>> 'float64' already exists as 'double': I'll alias the original and
>> install the new instance.
>> 0.235 [ Info   ][TypekitRepository::Import] TypeInfo for type
>> 'float64[]' already exists as 'array': I'll alias the original and
>> install the new instance.
>> 0.236 [ Info   ][TypekitRepository::Import] TypeInfo for type 'string'
>> already exists as '/std/string': I'll alias the original and install
>> the new instance.
>> 0.236 [ ERROR  ][TypekitRepository::Import] A protocol with id 1 was
>> already added for type string
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>