feat(transformations): configurable anchor frame + self-describing compensation result#147
Merged
Merged
Conversation
…mpensation result Follow-up to the reference-timestamp work. Make the common anchor frame an explicit parameter and expose the frame IDs in the result so a compensation is fully self-describing. - `MotionCompensator.motion_compensate_points` / `motion_decompensate_points` gain `anchor_frame_id: str = "world"`. The anchor is the common frame the per-point transforms are composed through; the default preserves the previous hard-coded "world" behavior. Decompensation must use the same anchor as compensation (documented). - `MotionCompensationResult` now carries `reference_frame_id` (the sensor frame the compensated points are expressed in, i.e. the sensor_id) and `anchor_frame_id`, alongside the existing points and `reference_timestamp_us`. - `MotionCompensator.from_sensor_rig` gains `anchor_frame_id: str = "world"` and `rig_frame_id: str = "rig"` so the pose-graph node names are no longer hard-coded. All existing callers keep the defaults, so behavior is unchanged. Note: a valid anchor must be a frame the sensor moves relative to within the frame (the dynamic/global frame or one related to it by a static transform). The rig frame is not a valid anchor because the sensor->rig extrinsic is static. Tests: result exposes the expected frame IDs (incl. the empty-input path); compensation is invariant to anchors related by a static transform (world / world_global); and from_sensor_rig honors custom node names with a clean compensate/decompensate round-trip.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
|
/ok to test a5263b9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up to the reference-timestamp work (#146). Make the motion-compensation anchor frame an explicit parameter and expose the frame IDs in the result so a compensation is fully self-describing.
Changes
MotionCompensator.motion_compensate_points/motion_decompensate_pointsgainanchor_frame_id: str = "world". The anchor is the common frame the per-point transforms are composed through; the default preserves the previous hard-coded"world"behavior. Decompensation must use the same anchor as compensation (documented in both docstrings).MotionCompensationResultnow carries:reference_frame_id-- the sensor frame the compensated points are expressed in (equals thesensor_id)anchor_frame_id-- the common anchor frame used to compose the transformsxyz_s_reftime/xyz_e_reftime/reference_timestamp_us.MotionCompensator.from_sensor_riggainsanchor_frame_id: str = "world"andrig_frame_id: str = "rig"so the pose-graph node names are no longer hard-coded.All existing callers keep the defaults, so behavior is unchanged.
Note on valid anchors
A valid anchor must be a frame the sensor actually moves relative to within the frame -- i.e. the dynamic/global frame, or one related to it by a static transform (e.g.
world/world_global). Therigframe is not a valid anchor, because the sensor->rig extrinsic is static, so compensation through it would see no motion. This is reflected in the tests.Testing
bazel test //ncore/impl/common:test_3_11 \ //ncore/impl/data/v4:pytest_compat_3_11 \ //ncore/impl/sensors:pytest_lidar_3_11New tests:
test_result_exposes_frame_ids-- result records the reference (sensor) and anchor frame IDs, including on the empty-input path.test_compensation_independent_of_static_anchor_choice-- anchors related by a static transform (world/world_global) yield identical compensated points; round-trip with the non-default anchor recovers the input.test_from_sensor_rig_custom_frame_names--from_sensor_righonors custom anchor/rig node names with a clean compensate/decompensate round-trip.All of
//ncore/...and the affected//tools/...packages build and type-lint cleanly; the existing compensator/compat/lidar tests still pass.