dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
384 stars 126 forks source link

Correct calculation of net orientation of PlatformMountables #966

Closed edwheelhouse-dstl closed 2 months ago

edwheelhouse-dstl commented 3 months ago

Calculation of the net orientation of a PlatformMountable on a Platform looks incorrect for 3D cases. It adds the platform's (MovementController's) orientation to the sensor's rotation_offset. Think of a sensor oriented to the left when its platform pitches up: addition would orient the sensor up too, when it should just roll. Instead, this PR rotates a vector aligned to the x-axis by the platform's orientation and the sensor's rotation_offset. This requires rotations in order: x, y, z. The current functions.init.build_rotation_matrix() does it the other way round (as required for other use cases) so a new build_rotation_matrix_xyz() has been added. Tests have been updated to match: rotation instead of addition requires orientation about x and z to be within +/-pi and in y to be within +/-pi/2.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.46%. Comparing base (10e26e0) to head (353d616). Report is 39 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #966 +/- ## ========================================== - Coverage 93.52% 93.46% -0.07% ========================================== Files 201 201 Lines 12835 12847 +12 Branches 2629 2629 ========================================== + Hits 12004 12007 +3 - Misses 587 592 +5 - Partials 244 248 +4 ``` | [Flag](https://app.codecov.io/gh/dstl/Stone-Soup/pull/966/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dstl/Stone-Soup/pull/966/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `66.29% <100.00%> (+0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/dstl/Stone-Soup/pull/966/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `89.07% <100.00%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.