Skip to content

Unit tests for the new odometry implementation in diff_drive_controller#2099

Merged
christophfroehlich merged 6 commits intoros-controls:masterfrom
vedh1234:feat/test_diff_drive_controller
Feb 15, 2026
Merged

Unit tests for the new odometry implementation in diff_drive_controller#2099
christophfroehlich merged 6 commits intoros-controls:masterfrom
vedh1234:feat/test_diff_drive_controller

Conversation

@vedh1234
Copy link
Copy Markdown
Contributor

@vedh1234 vedh1234 commented Jan 7, 2026

Fixes #2033

Description
This PR adds unit tests for the Odometry class in diff_drive_controller to verify the new mathematical logic introduced in #1854.

Changes

  • Added test/test_odometry.cpp covering:
    • Exact Arc integration (Curved motion)
    • Linear and Pure Rotation motion
    • Open Loop updates
    • Handling of small dt
  • Updated CMakeLists.txt to build the new test.

Testing

  • Verified locally with colcon test: 8 tests passed, 0 failures.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.86%. Comparing base (272ac69) to head (0b246b1).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2099      +/-   ##
==========================================
+ Coverage   84.80%   84.86%   +0.06%     
==========================================
  Files         151      152       +1     
  Lines       14836    14859      +23     
  Branches     1286     1286              
==========================================
+ Hits        12581    12610      +29     
+ Misses       1784     1778       -6     
  Partials      471      471              
Flag Coverage Δ
unittests 84.86% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
diff_drive_controller/test/test_odometry.cpp 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@Amronos Amronos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the tests! Some minor suggestions.

Copy link
Copy Markdown
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, LGTM!

@christophfroehlich christophfroehlich merged commit 665c60c into ros-controls:master Feb 15, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests for New Odometry Implementation

3 participants