Ask Your Question
0

Stage navigation multiple robots

asked 2015-11-20 04:56:12 -0500

gijsje170 gravatar image

Hello,

I want to have multiple robots in stage navigation. I used the stage navigation tutorial code. The problem is I can have gmapping with 1 robot. But if I include a second robot the TF doesnt work and gmapping does not work any more.

My laser.world file:

define obstacle model ( size [0.5 0.5 0.5] gui_nose 0 obstacle_return 1 )

define hokuyo ranger ( sensor( range [ 0.02 4.0 ] fov 180 samples 682 ) block( points 4 point[0] [0 1] point[1] [1 1] point[2] [1 0] point[3] [0 0] z [0 1] ) color "black" size [ 0.05 0.05 0.1 ] )

define roomba position ( block ( points 4 point[0] [ 0.700 0.705 ] point[1] [ 0.700 0.0 ] point[2] [ 0.0 0.0 ] point[3] [ 0.0 0.705 ] z [0 1] ) size [0.7 0.705 0.3] origin [-0.125 0 0 0] color "gray50"

gui_nose 1 obstacle_return 1

drive "diff"

localization "gps" )

define roomba_hokuyo roomba( color "gray90" hokuyo(pose [ 0.1 0.0 0.0 0.0 ]) )

define turtlebot roomba( color "gray90" origin [-0.100 0 0 0] )

define floorplan model ( color "gray30" boundary 1

gui_nose 0 gui_grid 0
gui_outline 0 gui_move 0
gripper_return 0 fiducial_return 0
obstacle_return 1 ranger_return 0.8 )

define zone model ( color "orange"
size [ 4 4 0.01 ]

gui_nose 0 gui_grid 0 gui_move 1 gui_outline 0

obstacle_return 0 ranger_return -1 )

window ( size [ 500.000 400.000 ]
scale 20 center [ 0.0 0.0 ] rotate [ 0 0 ] show_data 1 show_trailarrows 0 ) floorplan (
name "map" size [20.000 15.000 0.800] pose [0 1 0 0] bitmap "map.png" )

roomba_hokuyo (
name "roomba_hokuyo_0" pose [ 0.00 0.00 0 0.00 ] )

roomba_hokuyo (
name "roomba_hokuyo_1" pose [ 1.00 0.00 0 0.00 ] )

Laser_gmapping.launch:

<launch>

  <!-- Launch stage world -->
    <param name="/use_sim_time" value="true"/>
  <include file="$(find stage_worlds)/launch/laser_world.launch" />

  <!-- Launch robot model -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find stage_navigation)/urdf/robot.urdf.xacro'" />

  <!-- Run gmapping -->
  <include file="$(find stage_navigation)/move_base_config/slam_gmapping.xml"/>

  <!-- Run Move Base  -->
  <include file="$(find stage_navigation)/move_base_config/move_base.xml"/>

  <group ns="robot1">
    <param name="tf_prefix" value="robot1_tf" />
    <param name="amcl/initial_pose_x" value="1" />
    <param name="amcl/initial_pose_y" value="1" />
  </group>

  <group ns="robot2">
    <param name="tf_prefix" value="robot2_tf" />
    <param name="amcl/initial_pose_x" value="-1" />
    <param name="amcl/initial_pose_y" value="1" />
  </group>

  <!-- Run rviz -->
  <include file="$(find stage_navigation)/launch/navigation_rviz.launch" />


</launch>

Tell me if you need more files.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-05-03 06:47:02 -0500

gavran gravatar image

The question is similar to this one. I got the answer to it and it is summarized in this github repository

edit flag offensive delete link more
0

answered 2015-11-21 12:03:08 -0500

Note that (ros wiki):

If there is only one position model defined in the world file, all of these topics appear at the top namespace. However, if more than 1 position models exist, these topics are pushed down into their own namespaces, by prefixing the topics with robot_/ , e.g., robot_0/cmd_vel etc.

This means you need to remap some of the topics when adding a second robot.

What exactly do you mean by "tf doesn't work"? Could you paste the output of rosrun tf tf_monitor here if it is not too much and the problem still persists?

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-11-20 04:50:48 -0500

Seen: 895 times

Last updated: May 03 '16