[Rock-dev] Writing a plugin for Orogen

Sylvain Joyeux sylvain.joyeux at dfki.de
Mon Dec 3 10:18:54 CET 2012


On 12/03/2012 09:35 AM, Charles Lesire-Cabaniols wrote:
> Hi rock-devs,
>
> I am trying to extend the standard orogen syntax by providing extra 
> key words. For instance, I would like to standardize an output port of 
> my system components by forcing its name to be 'system_state'.
Are you aware of other methods to achieve the same:
  - subclassing 
(http://www.rock-robotics.org/stable/documentation/orogen/task_inheritance.html)
  - the custom states (I don't know what you want to put in 
'system_state', so that might be absolutely not relevant ;-))

> I hence would like my users to use system_state('my_type') instead of 
> output_port('system_state', 'my_type') to avoid mistakes (as far as 
> possible).
>
> I then decided to implement an orogen plugin.
>
> Having a look at 
> http://rock-robotics.org/stable/documentation/orogen/plugins.html, I 
> tried the simple example: I wrote a file with the first code snippet 
> of the link, and put it on install/share/orogen/plugins.
>
> I then defined a new Orogen component with the instruction
> add_boolean_attribute "test"
>
> But after generating the code with orogen my_component.orogen, I found 
> nothing related to this boolean attribute!
>
> What is wrong in the process I followed?
All the "_base_" methods define stuff on the Base class, i.e. in 
.orogen/tasks/MyTaskBase.hpp. Have you looked there ?

If you want to generate in the user-visible parts, use the user methods, 
i.e. add_user_member instead of add_base_member

Sylvain


More information about the Rock-dev mailing list