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

Hi,

In my world file I have this model:

laser_base
(
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:

[...]
pose:
pose:
position:
x: 1.6
y: -1.6
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.707106781187
w: 0.707106781187
[...]


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

EDIT 1:

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 close merge delete

Sort by » oldest newest most voted

The coordinate system was fixed in stage_ros version 1.7.2:

CHANGELOG.rst:

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**

more

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.

more