Ask Your Question
0

Two PR2 simulation in gazebo

asked 2013-01-16 19:40:33 -0500

I am on ROS Fuerte, I am using PR2 simulations in gazebo with the pr2_gazebo package,

roslaunch pr2_gazebo pr2_empty_world.launch

I wish to work on two PR2 robots, I tried to add a second robot with the following line in the pr2_empty_world.launch.

  <!-- start pr2 robot -->
  <include file="$(find pr2_gazebo)/launch/pr2.launch"/>

Which gave the following error;

roslaunch file contains multiple nodes named [/spawn_pr2_model].
Please check all <node> 'name' attributes to make sure they are unique.
Also check that $(anon id) use different ids.

Apparently it is a trivial issue, and I have been tinkering with launch files but that has not solved the issue. Any help here would be most welcome.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-16 21:06:58 -0500

Erwan R. gravatar image

Hello.

Nodes must have a unique name when roslaunched Take a look into pr2.launch to see how the launch is exactly done, you'll see that you're roslauching twice the same node with the same name.

edit flag offensive delete link more

Comments

@Erwan R. I get the point, but how do I rectify it ??? I would wish to have 2 nodes as /spawn_pr2_model_1 and /spawn_pr2_model_2 !!! How do I do it ?

Arkapravo gravatar image Arkapravo  ( 2013-01-16 22:39:07 -0500 )edit

Write your own pr2_2robot_empty_world.launch inspired by the original one. You'll have to check the content of the included pr2.launch and, for example, paste it twice into your file with different names for nodes.

Erwan R. gravatar image Erwan R.  ( 2013-01-17 03:46:16 -0500 )edit

Erwan R. Easy said ! but I am trying ! .... :-D

Arkapravo gravatar image Arkapravo  ( 2013-01-17 06:15:39 -0500 )edit

Go deeper : in pr2.launch are included pr2_no_controller.launch where spawn_pr2_model node is launched. You can start from this point and duplicate the node line. Be careful about the -model name too. gazebo needs unique name for each object. Please be more precise if there is still a problem.

Erwan R. gravatar image Erwan R.  ( 2013-01-21 22:18:26 -0500 )edit

Go deeper : in pr2.launch are included pr2_no_controller.launch where spawn_pr2_model node is launched

Erwan R. gravatar image Erwan R.  ( 2013-01-21 22:18:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-16 19:40:33 -0500

Seen: 198 times

Last updated: Jan 16 '13