Re: [ros-users] dynamic parameters

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Blaise Gassend
Date:  
To: ros-users
Subject: Re: [ros-users] dynamic parameters
Hi Garratt,

You can use the command tag to <param>

http://www.ros.org/wiki/roslaunch/XML/param

command="$(find pkg-name)/exe &quot;
$(find pkg-name)/arg.txt&quot;"(optional)

      * The output of the command will be read and stored as a string.
        It is strongly recommended that you use the package-relative
        $(find)/file.txt syntax to specify file arguments. You should
        also quote file arguments using &quot;, which is due to XML
        escaping requirements. 


I have asked Ken why there is no $(command ) macro in roslaunch but
never got an answer... I have seen cases beyond parameters where it
would have been handy... but perhaps hacky.

Blaise

On Fri, 2010-04-16 at 11:19 -0400, garratt gallagher wrote:
> Hi,
>
> I'm working on a different solution to the issue of mapping ports to
> sensors. Instead of configuring every computer to automatically map
> usb devices to specific addresses, I wrote a program that uses the
> libudev library (also get ID for hokuyos) to find the serial number of
> the device, so I can query for a serial number and get back the device
> it is plugged into (or determine that it is not there)
> The motivation for doing this:
> - I swap out devices a bit, and configuring the udev is more annoying
> than just changing a parameter
> - I can run the same program with the devices plugged into a different
> computer without having to configure udev.
>
> The problem I am having is in setting the correct parameter to the
> correct port.
> What I would like to do is dynamically substitute in the appropriate
> parameter when running the launch file:
> <node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node"
> respawn="true" output="screen">
>     <param name="port" type="string" value="$(devfind H0902062)"/>
>  </node>    

>
> I see that there is some support for executing functions in the launch
> file:
> http://www.ros.org/wiki/roslaunch/XML#substitution_args
> Would it be possible to add the running of shell commands?
>
> Thanks
> Garratt
>
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users