Ask Your Question

Launch variable number of groups [closed]

asked 2015-03-10 09:53:19 -0500

dementor gravatar image

Is there a way where I can take a number as argument and then create that number of groups of the same thing?

I need to deploy N number of robots and want N to be a roslaunch argument.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dementor
close date 2015-06-24 13:43:05.885232

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-10 11:06:56 -0500

updated 2015-03-10 11:07:21 -0500

Not sure what's your specific need.

Maybe this is enough if you want to run something like roslaunch my_file.launch robot_num:=N

edit flag offensive delete link more


But how do I write it in the launch file that the group that specifies the spawning of robot models shoudl be there N times too?

dementor gravatar image dementor  ( 2015-03-10 12:55:50 -0500 )edit

I think it'll be easier to use shell script. For example, you can use in shell script to launch your launch file with different robot_num, then you can change the namespace of group of nodes each time by using arg in launch file.

Po-Jen Lai gravatar image Po-Jen Lai  ( 2015-03-19 09:57:33 -0500 )edit

Question Tools

1 follower


Asked: 2015-03-10 09:53:19 -0500

Seen: 79 times

Last updated: Mar 10 '15