Ask Your Question

Revision history [back]

How to send parameters in the method onStart with ROSJava

In every example in the ROSJava tutorial, the method: onStart has a unique parameter: (final Node node) and my question is how to send additional parameters in this method.

When I execute any node, I type in the shell:

rosrun rosjava_bootstrap run.py nxt_lejos_ros org.lejos.ros.nodes.loader.NXTLoader __name:=NXTLoader

or I use a .launch file with the following structure:

<launch>
    <node pkg="rosjava_bootstrap" 
    type="run.py" 
    args="nxt_lejos_ros org.lejos.ros.nodes.loader.NXTLoader" 
    name="NXTLoader" 
    output="screen" />     
</launch>

But my idea, is to send to the node another parameter, for example a YAML file.

How to define in a .launch code an aditional parameter and how to modify the signature of the onStart method?

Many thanks in advance.