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

steering_controllers_library: Add reduce_wheel_speed_until_steering_reached parameter #1314

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

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Oct 13, 2024

Some features are missing in the library to feature-equally integrate the older tricycle_controller (#850).

reduce_wheel_speed_until_steering_reached is one step closer.

The old code

// Reduce wheel speed until the target angle has been reached
double alpha_delta = abs(alpha_write - alpha_read);
double scale;
if (alpha_delta < M_PI / 6)
{
scale = 1;
}
else if (alpha_delta > M_PI_2)
{
scale = 0.01;
}
else
{
// TODO(anyone): find the best function, e.g convex power functions
scale = cos(alpha_delta);
}
Ws_write *= scale;

I modified the function a bit to be continuously differentiable
image

This breaks ABI of the odometry class, but I don't think that lots of people use this directly without the derived controllers.

@christophfroehlich christophfroehlich added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Oct 13, 2024
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.49%. Comparing base (97c1e24) to head (4a35d46).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1314      +/-   ##
==========================================
+ Coverage   80.34%   80.49%   +0.14%     
==========================================
  Files         105      105              
  Lines        9384     9454      +70     
  Branches      826      832       +6     
==========================================
+ Hits         7540     7610      +70     
  Misses       1570     1570              
  Partials      274      274              
Flag Coverage Δ
unittests 80.49% <100.00%> (+0.14%) ⬆️

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

Files with missing lines Coverage Δ
...steering_controllers_library/steering_odometry.hpp 100.00% <ø> (ø)
...llers_library/src/steering_controllers_library.cpp 79.63% <100.00%> (+0.09%) ⬆️
...ring_controllers_library/src/steering_odometry.cpp 82.42% <100.00%> (+1.01%) ⬆️
...ontrollers_library/test/test_steering_odometry.cpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant