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

How to import two pr2 on gazebo at the same time?

asked 2011-08-09 20:52:49 -0600

sam gravatar image

updated 2011-08-14 16:55:32 -0600

kwc gravatar image

I have tried to use these command but failed when I run second command. If I only run the first one,it will success to import PR2.

 roslaunch pr2_gazebo pr2_empty_world.launch
 roslaunch pr2_gazebo pr2.launch

first terminal:

 [base_hokuyo_node-15] process has died [pid 32688, exit code -11].
 log files: /home/sam/.ros/log/f2be307a-c32b-11e0-98f4-20cf30a2382f/base_hokuyo_node-15*.log
 [tilt_hokuyo_node-16] process has died [pid 32691, exit code -11].
 log files: /home/sam/.ros/log/f2be307a-c32b-11e0-98f4-20cf30a2382f/tilt_hokuyo_node-16*.log
 [camera_synchronizer_node-18] process has died [pid 32693, exit code -11].
 log files: /home/sam/.ros/log/f2be307a-c32b-11e0-98f4-20cf30a2382f/camera_synchronizer_node-18*.log

another terminal:

 [ WARN] [1312965467.351520467]: The input topic '/wide_stereo/left/camera_info' is not yet advertised
 [ WARN] [1312965467.351541765]: The input topic '/wide_stereo/right/image_raw' is not yet advertised
 [ WARN] [1312965467.351567865]: The input topic '/wide_stereo/right/camera_info' is not yet advertised
edit retag flag offensive close merge delete


pr2_empty_world.launch includes pr2.launch, so you are in effect launching some of the nodes twice, hence the errors. You have to setup something like the multi_robot_test.launch instead.
hsu gravatar image hsu  ( 2011-08-25 07:47:44 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-08-17 20:27:21 -0600

hsu gravatar image

updated 2011-08-17 21:15:39 -0600

There is a multi_robot_test.launch that works with trunk of simulator_gazebo. It starts up 3 robots under separate ros namespaces.

I basically started with standard pr2_empty_world.launch and namespaced nodes / added tf_prefixes.

robots spawn and pieces of it are controllable if you configure your teleop to work under a namespace, but otherwise much of this is untested.

edit flag offensive delete link more

answered 2011-08-10 03:52:12 -0600

dornhege gravatar image

I don't know if this is enough to make it work, but you should put each pr2 that your start in its own namespace and possibly set the tf_prefix. Otherwise there will be multiple nodes with the same name (which is probably why the processes are dying).

edit flag offensive delete link more


What should I change? src or launch file? Is there any tutorials about this? Thank you~
sam gravatar image sam  ( 2011-08-10 04:09:40 -0600 )edit
Don't change any sources. The best would be to create a launch file including both in a namespace. You can try from console with environment variables ROS_NAMESPACE set first.
dornhege gravatar image dornhege  ( 2011-08-10 23:23:31 -0600 )edit
I use two terminal has different namespace by `export ROS_NAMESPACE=test` and `export ROS_NAMESPACE=test2`.But when I run `roslaunch pr2_gazebo pr2_empty_world.launch`and`roslaunch pr2_gazebo pr2.launch`,I got an error:Service call failed: service [/gazebo/spawn_urdf_model] responded with an error.
sam gravatar image sam  ( 2011-08-13 00:32:44 -0600 )edit
I'd recomment putting gazebo in the / namesapce and both PR2s in the test(1/2) namespaces and I should add that I never tried multiple PR2s in gazebo.
dornhege gravatar image dornhege  ( 2011-08-13 01:53:37 -0600 )edit

Question Tools



Asked: 2011-08-09 20:52:49 -0600

Seen: 850 times

Last updated: Aug 17 '11