ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Roslaunch with Arguments

asked 2012-03-09 09:36:17 -0500

kmaroney gravatar image

Is it possible to spawn a different URDF to the param server depending on the different configurations of my robot from a single launchfile. I will also launch controllers specific to that robot configuration etc. I would like to only write one controller launch script, rather than for all the different configurations of my robot.

I think this may best be achieved with an argument passed to the launch file. Is this possible?? Something like:

roslaunch my_robot.launch 5_dof


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-09 10:46:31 -0500

updated 2012-03-09 10:49:28 -0500

Yes, see the roslaunch arg reference.

In a nutshell, you would launch it like this:

roslaunch my_robot.launch dof:=5

Inside the launch file, add

<arg name="dof"/>

And to evaluate it,

$(arg dof)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-03-09 09:36:17 -0500

Seen: 15,501 times

Last updated: Mar 09 '12