Ask Your Question

[Stage] topic coordinates are different of those declared in .world file

asked 2013-09-16 09:51:45 -0500

updated 2013-11-18 18:51:56 -0500

tfoote gravatar image


In my world file I have this model:

    name "base_0"       # NE base points W
    pose [1.6 1.6 0 180]    

where pose is [x y z th], so this model is located at the top-right of the origin.

Now, when I subscribe to the topic /base_pose_ground truth, I have this:

      x: 1.6
      y: -1.6
      z: 0.0
      x: 0.0
      y: 0.0
      z: -0.707106781187
      w: 0.707106781187

Why these coordinates are different? Should not they be the same?


I've found this in stageros.cpp:

// Note that we correct for Stage's screwed-up coord system.
    tf::Quaternion q_gpose;
    q_gpose.setRPY(0.0, 0.0, gpose.a-M_PI/2.0);
    tf::Transform gt(q_gpose, tf::Point(gpose.y, -gpose.x, 0.0));
    tf::Quaternion q_gvel;

Why is this considered screwed-up coord system?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-10-02 14:04:32 -0500

The coordinate system was fixed in stage_ros version 1.7.2:


1.7.2 (2013-09-19)

Changed default GUI window size to 600x400
Added velocity to ground truth odometry
Fixed tf (yaw component) for the base_link->camera transform.
**Fixed ground truth pose coordinate system**
edit flag offensive delete link more

answered 2013-09-16 13:51:09 -0500

jgilsenan gravatar image

I had the same issue, its a bug in stageros which causes it to broadcast the negative of the 'x' value as the 'y' value, and broadcast the correct 'y' value as the 'x' value. The fix is as simple as switching it to broadcast the correct values in the source code (near line 400 can't remember the specific line #). If the topic 'odom' broadcast by stageros appears to be correct (aside from its 'error') then you are probably experiencing the same issues that I had before.

As for the comment about stage's messed up coordinate system, if stageros is broadcasting heading incorrectly (ie the angle '0' points along the positive y-axis instead of the desired direction of along the positive x-axis as was the case with my previous issues) then you basically need to remove the 'fix' referred to by the comment, that did the trick for me and realigned the heading with the positive x-axis.

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


Asked: 2013-09-16 09:51:45 -0500

Seen: 636 times

Last updated: Oct 02 '13