Assume that you happened to know the coordinates of your sensor in some Cartesian coordinate system, and you want to derive the coordinates of your robot centre. For the robot configuration you know the offset of the sensor from the robot centre, but not the other way around. The solution:
inversed_offset is the position (and pose) of the robot centre in the coordinate system associated with the sensor.
Step by step demo:
Start with some coordinates (navigation data in the world frame; the specific coordinate system does not matter). A sample data file is attached to this page:
The example uses binary, but this is up to you. The
nav.binfile contains the trajectory of the robot centre (GPS unit) in the world frame.
Get the coordinates of the sensor in the world frame:
sensor.binis the trajectory of the sensor in the world frame. We want to get the trajectory of the robot centre from these data.
Just do it:
Note the use of
Verify by comparing to the original
The output is on the order of. The precision is defined by the accuracy of
inversed_offsetcalculations above. If the
--precision=16option were not given, the comparison would be valid up toor so.