why is the coordinate in stage different with the coordinate in Rviz

asked 2014-09-03 05:21:55 -0500

scopus gravatar image

updated 2014-09-03 06:47:06 -0500

Hi, all ,I am learning multi-robot collision avoidance and successfully run collvoid as the instruction on collvoid's page. I did it with 1.7.2 stage_ros in Ubuntu 12.04 with Hydro ROS. Of course, I did some modifications as the instruction. However, When I launch a sim_created.launch, the movement of robots are chaos. I found that the coordinate in stage is different with the coordinate of 2D map in Rviz.

Please see follow two pictures. The purple arrow in the rviz is the origin of the 2D map which is same to the origin in Stage. In the Stage (the first picture), the two robot's positions correspond to topics /robot_0(1)/base_pose_ground_truth which are consistent with the cartesian coordinate system. In the Rviz (the second picture), the two arrows( red and blue ones) also correspond to topics /robot_0(1)/base_pose_ground_truth, but the displayed positions of these two arrows are different with the two circles(robots) in Stage.
By comparing the value of their positions, it seem that the x-axis in Stage corresponds to y-axis in Rviz, and the y-axis in Stage corresponds to x-axis in Rviz.

You can see that the Robot_1 in Stage corresponds to the blue arrows in the second picture. And the local_costmap of the two robots( White square which is different with the grey background in the Rviz) are shown in the center of the Rviz. Theses local_costmap do not correspond to the static map.

What a chaos!! I can't understand why! Please give me some guidance on this. Thank you!

image description image description

edit retag flag offensive close merge delete


I think you may should use the /robot_0/odom topic instead of the /robot_0/base_pose_ground_truth to get the odometry of the robot. Read http://wiki.ros.org/stage published topics there is the difference explained. Hope it works then

pkohout gravatar image pkohout  ( 2014-09-03 06:01:56 -0500 )edit

Thank you for you attention. Please note that comparing with the cartesian coordinate displayed in the first picture( Stage), the coordinate of Rviz is rotated by 90°. That is why he Robot_1 shown in Stage corresponds to the blue arrows in Rviz. So I think the incorrect coordinate is the key point.

scopus gravatar image scopus  ( 2014-09-03 07:21:36 -0500 )edit

I am new to use Stage. If you mean that I should /odom topic. But both the initial value of /robot_0/odom and the value of /robot_1/odom are (0,0,0), that is in the origin of the Stage and Rviz. What should I do to use /odom topic in the project ? Thank you!

scopus gravatar image scopus  ( 2014-09-03 07:50:23 -0500 )edit

try using the odom topic, if it does work,great. If not, please upload a picture where you show the /odom in rviz please.

pkohout gravatar image pkohout  ( 2014-09-04 06:16:19 -0500 )edit

hello friend can i plz have your code i am also trying to do the same thing in Stage ros and rviz but i fail can you please help me by sending your code if possible i need to do a research study on stage ros and rviz for which i need it

naqi.nick gravatar image naqi.nick  ( 2016-01-17 11:39:03 -0500 )edit