Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SpeedLimiter Constructor regression #1478

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

After the #1315 and recent tag 4.18.0

I observed a regression in a controller that the SpeedLimiter is offering 2 constructors with default argument and this creates the following error: error: call of overloaded 'SpeedLimiter()' is ambiguous

I think it makes sense to have the new constructor more explicit without any default arguments. Moreover, the construction limiter_angular_(std::numeric_limits<double>::quiet_NaN()) still doesn't help as it is still implicitly casting things to the deprecated constructor

diff_drive_controller.cpp:50:1: warning: ‘diff_drive_controller::SpeedLimiter::SpeedLimiter(bool, bool, bool, double, double, double, double, double, double)’ is deprecated [-Wdeprecated-declarations]

I decided to fix this also in the same PR by changing them to unique_ptr. I don't think it should be a problem as the controller is used as a plugin.

Copy link
Contributor

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

Makes sense, thanks for fixing!

I could have used the unique_ptr from the beginning, you are right about the ABI.

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.85%. Comparing base (6299094) to head (8bdb8b3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1478      +/-   ##
==========================================
+ Coverage   83.81%   83.85%   +0.04%     
==========================================
  Files         122      122              
  Lines       11120    11126       +6     
  Branches      943      943              
==========================================
+ Hits         9320     9330      +10     
+ Misses       1491     1488       -3     
+ Partials      309      308       -1     
Flag Coverage Δ
unittests 83.85% <100.00%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
...de/diff_drive_controller/diff_drive_controller.hpp 100.00% <ø> (ø)
...er/include/diff_drive_controller/speed_limiter.hpp 100.00% <100.00%> (ø)
...iff_drive_controller/src/diff_drive_controller.cpp 71.28% <100.00%> (+0.59%) ⬆️

... and 3 files with indirect coverage changes

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