[ros-users] read parameter in launch file

Ken Conley kwc at willowgarage.com
Tue Oct 5 16:42:04 UTC 2010


Hi Ben,

You may want to take a look at the <arg> tag, as it provides the
ability to parameterize launch files with named keys.

In the future, there may be some sort of feature to read parameters
within the launch file, but there is a duality there that is not
present when using the <arg> tag, i.e. the duality between retrieving
the value that is set within the launch file vs. the value on the
parameter server (plus failure behavior if it is not set).

There is also implicit interaction that is not present with <arg>
tags. In the <arg> tag case, I can explicitly model, "this is an input
parameter, it must either be set by a launch file or passed in on the
command-line", i.e. <arg> tags represent parameterization of your
launch file, whereas <param> tags represent parameterization of your
ROS graph.

 - Ken

On Tue, Oct 5, 2010 at 9:04 AM, Axelrod, Benjamin <baxelrod at irobot.com> wrote:
> Is there any way to read a parameter in a launch xml file?  For example, I
> set the value of a parameter at the top of the file, then lower in the file
> I read the parameter and use it for something.  Or must this type of thing
> be done through environment variables?  If so, this seems like a strange
> restriction.  Is there any reasoning behind this?
>
>
>
> Ben Axelrod
>
> Research Scientist
>
> iRobot Corporation
>
> 8 Crosby Drive, Mail Stop 8-1
>
> Bedford, MA 01730
>
> (781) 430-3315 (Tel)
>
> (781) 960-2628 (Fax)
>
> baxelrod at irobot.com
>
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>



More information about the ros-users mailing list