I'm having some issues with visualizing logged laser data and robot pose
data in Player2.0.3 and Stage 2.0. Essentially, if I write the laser scan
(transformed accordingly to a global reference frame using pp.GetYaw() in my
rotation matrix ) and the robot pose information to a file at each timestep
then plot that data, what I see is a jerking effect to the plotted laser
data. In other words, what seems to be happening is that every other laser
scan gets plotted correctly in the global reference frame, and the odd ones
out get plotted slightly skew.
If I look at the logged file, that is in fact the case. The odometry data is
stale for two timesteps while the laser data is continually refreshed at
each timestep. Originally, my thought was that player reads data from the
server at 10Hz (I think I read that somewhere) and the laser data comes in
at something like 75Hz so it would make sense that the log file looks like
that. But then, why is that playerv does not exhibit this feature?
Any insight on this would be greatly appreciated.
From: Brian Gerkey <brian@ge...> - 2007-03-08 01:06:26
On Mar 7, 2007, at 4:51 PM, Jeremy Ma wrote:
> If I look at the logged file, that is in fact the case. The
> odometry data is stale for two timesteps while the laser data is
> continually refreshed at each timestep. Originally, my thought was
> that player reads data from the server at 10Hz (I think I read that
> somewhere) and the laser data comes in at something like 75Hz so it
> would make sense that the log file looks like that. But then, why
> is that playerv does not exhibit this feature?
In general, the data are coming from devices that operate at their
own natural rates, and there's no guarantee that they'll be synced.
The common way to address this issue is to estimate the pose of the
laser when a scan was taken, usually by linearly interpolating the
before and after poses, based on timestamps.
That's the purpose of the laserposeinterpolator driver, which you can
add to your .cfg file when playing back the log:
Given a position2d and a laser, it will interpolate a pose for each
scan and republish the scan with that pose (using the
PLAYER_LASER_DATA_SCANPOSE message, not the more common
One note: there's no accessor for this pose data in the 2.0.3
LaserProxy. This oversight has been fixed in CVS; you can fix your
2.0.3 installation by adding the following lines to playerc++.h, in
the LaserProxy class block:
/// Accessor for the pose of the laser's parent object (e.g., a
/// Filled in by some (but not all) laser data messages.
p.px = mDevice->robot_pose;
p.py = mDevice->robot_pose;
p.pa = mDevice->robot_pose;