[ros-users] private roslaunch parameters

Kevin Watts watts at willowgarage.com
Wed Jul 14 20:37:28 UTC 2010


I think you'll have to post your launch file, and probably a "rosparam get
MY_NAMESPACE". It could be your configuration isn't set up properly.

On Wed, Jul 14, 2010 at 1:18 PM, Mike Purvis
<mpurvis at clearpathrobotics.com>wrote:

> Hi Kevin,
>
> I had gotten that far, but by what name do I then access the parameter from
> my python source? Neither rospy.get_param('port') nor rospy.get_param('~port')
> seem to work.
>
> M.
>
>
>
> On 14 July 2010 15:53, Kevin Watts <watts at willowgarage.com> wrote:
>
>> That's not the correct syntax for private parameters. Your example puts
>> them into the same namespace as the node, but not the private namespace.
>>
>> You can find full details here:
>>
>> http://www.ros.org/wiki/roslaunch/XML/param
>>
>> For your code, it might look like:
>>
>> <node pkg="something" ... >
>>   <param name="port" value="/dev/ttyUSB0" />
>> </node>
>>
>> On Wed, Jul 14, 2010 at 12:41 PM, Mike Purvis <
>> mpurvis at clearpathrobotics.com> wrote:
>>
>>> Hi everyone,
>>>
>>> My current launch file structure is like so:
>>>
>>> <launch>
>>>   <env name="PYTHONPATH" value="$(env PYTHONPATH)" />
>>>   <group ns="clearpath/robots/$(optenv ID default)" clear_params="true">
>>>     <param name="port" value="$(optenv CPR_SERIAL_PORT /dev/ttyUSB0)" />
>>>     <param name="turn_radius" value="0.4" />
>>>
>>>     ...
>>>
>>>     <node pkg="clearpath_horizon" type="horizon.py" name="$(anon
>>> horizon)" output="screen" />
>>>     <node pkg="clearpath_2dnav" type="simple.py" name="$(anon nav)"
>>> output="screen" />
>>>     ....
>>>   </group>
>>> </launch>
>>>
>>> And then inside of horizon.py, I am able to access the parameter
>>> with rospy.get_param('port'). However, that parameter is really not relevant
>>> to any node except horizon.py. From my reading of the documentation, I
>>> should be able to make it private by putting the <param> tag inside the
>>> relevant node tag, and then calling it with rospy.get_param('~port').
>>> However, this doesn't seem to work---I consistently just get the default
>>> parameter.
>>>
>>> What am I doing wrong?
>>>
>>> Thanks.
>>>
>>> _______________________________________________
>>> ros-users mailing list
>>> ros-users at code.ros.org
>>> https://code.ros.org/mailman/listinfo/ros-users
>>>
>>>
>>
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100714/4cda1327/attachment-0003.html>


More information about the ros-users mailing list