Skip to content

Added test for open-loop odometry with clamped input#2280

Open
Devdoot57 wants to merge 2 commits intoros-controls:masterfrom
Devdoot57:open-loop-odom-test
Open

Added test for open-loop odometry with clamped input#2280
Devdoot57 wants to merge 2 commits intoros-controls:masterfrom
Devdoot57:open-loop-odom-test

Conversation

@Devdoot57
Copy link
Copy Markdown

Description

This PR adds the missing test coverage requested in #2279 to verify the open-loop odometry fix.

Implementation Details:

  • Initializes the DiffDriveController with open_loop set to true and strict velocity limits configured for both linear.x and angular.z.
  • Deliberately publishes a Twist command that exceeds the configured limits.
  • Executes the update() loop and asserts that both the instantaneous velocities (getLinear(), getAngular()) and the integrated positions (getX(), getHeading()) are calculated using the successfully clamped values, not the raw commands.

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.

Thank you for submitting a PR. Please install pre-commit acc. to our contributing guidelines, see the failing CI job.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.72%. Comparing base (fafccb5) to head (26cf420).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2280      +/-   ##
==========================================
+ Coverage   84.68%   84.72%   +0.03%     
==========================================
  Files         153      153              
  Lines       15318    15341      +23     
  Branches     1332     1332              
==========================================
+ Hits        12972    12997      +25     
+ Misses       1858     1857       -1     
+ Partials      488      487       -1     
Flag Coverage Δ
unittests 84.72% <100.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
...ive_controller/test/test_diff_drive_controller.cpp 94.88% <100.00%> (+0.31%) ⬆️

... 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.

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.

2 participants