imu_transformer: Fix transformation of the orientation of IMU #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #8.
The previous computation was wrong. According to REP-145, IMU orientation should express attitude of the sensor frame in a world frame. imu_transformer changes the sensor frame, so it should just recompute the new attitude by transforming the old sensor frame into the new one.
I added an example launch file and rviz config to the
test
folder which you can launch to visually inspect the situation.I also added a unit test that fails with the old implementation and succeeds with the new one.
I also made one other fix not mentioned in #8 - I do not transform orientation covariance. If I get it correctly, the covariance is relative to the axes of the fixed world frame, so it should not change when using a different sensor frame - at least not in the case of a gravity-aligned IMU. I'm not sure how that would be in completely floating IMUs. But please, check my lines of thought around here. I haven't found a good definition of the exact meaning of orientation covariance, so this is my best guess. In the gravity-aligned case, I understand it so that estimating roll/pitch of an IMU is the same task with the same errors as estimating roll/pitch of base_link. Yaw would be similar even when not georeferenced - in the worst case, there would be some static offset, but that should not affect the covariance in world yaw.