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

Roslaunch : include same .launch several times with different parameters [closed]

asked 2017-02-27 04:48:26 -0500

blevesque gravatar image

updated 2017-02-27 05:19:26 -0500

Hi all,

I have a .launch file who include 6 times the same launch but with different parameters. But they all take the last "model" arg, does someone know why ?

Example with only 2 includes :

<include file="$(find simulation)/launch/spawn_car.launch">
  <arg name="model" value="golf"/>
  <arg name="E1" value="1"/>
  <arg name="immat" value="golf-AAA"/>
</include>

<include file="$(find simulation)/launch/spawn_car.launch">
  <arg name="model" value="miniCooper"/>
  <arg name="F3" value="1"/>
  <arg name="immat" value="miniCooper-AAB"/>
</include>

In spawn_car.launch, I'm using "model" arg like this :

<param name="car_description" command="$(find xacro)/xacro --inorder $(find simulation)/urdf/cars/$(arg model).urdf.xacro custom_car:=true"/>

And cars are spawned with same car_description (here with miniCooper urdf.xacro file).

Help anyone ? :)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by blevesque
close date 2017-02-28 05:39:29.759618

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-02-27 10:15:13 -0500

blevesque gravatar image

I found the answer.

I had to add groups, like this :

<group ns="car1">
  <include file="$(find simulation)/launch/spawn_car.launch">
    <arg name="model" value="golf"/>
    <arg name="E1" value="1"/>
    <arg name="immat" value="golf-AAA"/>
  </include>
</group>

<group ns="car6">
<include file="$(find simulation)/launch/spawn_car.launch">
  <arg name="model" value="delorean"/>
  <arg name="F3" value="1"/>
  <arg name="immat" value="delorean-AAB"/>
</include>
</group>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-27 04:44:00 -0500

Seen: 1,850 times

Last updated: Feb 27 '17