-
Notifications
You must be signed in to change notification settings - Fork 523
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
Acceleration Limited Smoothing Plugin for Servo #2651
Acceleration Limited Smoothing Plugin for Servo #2651
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2651 +/- ##
==========================================
- Coverage 50.92% 50.74% -0.17%
==========================================
Files 391 392 +1
Lines 32590 32549 -41
==========================================
- Hits 16592 16513 -79
- Misses 15998 16036 +38 ☔ View full report in Codecov by Sentry. |
...it_core/online_signal_smoothing/include/moveit/online_signal_smoothing/acceleration_filter.h
Outdated
Show resolved
Hide resolved
*********************************************************************/ | ||
|
||
/* Author: Paul Gesel | ||
Description: applies smoothing by limiting the acceleration between consecutive commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add more details to description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you feel particularly ambitious, the images in your PR ASCIIfied would be great here. Or otherwise, to add it to a README in this folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ASCII diagrams
|
||
#include <cstddef> | ||
|
||
// Auto-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment referring to moveit_acceleration_parameters.hpp
? If yes, maybe it can be removed since we're using generate_parameters all over the moveit2 codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I am removing it.
moveit_core/online_signal_smoothing/src/acceleration_filter.cpp
Outdated
Show resolved
Hide resolved
*********************************************************************/ | ||
|
||
/* Author: Paul Gesel | ||
Description: applies smoothing by limiting the acceleration between consecutive commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: applies smoothing by limiting the acceleration between consecutive commands |
Usually, we only have a description in the header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
moveit_core/online_signal_smoothing/src/acceleration_filter.cpp
Outdated
Show resolved
Hide resolved
osqp_update_bounds(work_, data_->l.data(), data_->u.data()); | ||
}; | ||
|
||
size_t num_constraints = num_joints_ + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more comments to describe the computation steps
d351f44
to
aaf3af4
Compare
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
aaf3af4
to
aa77647
Compare
aa77647
to
d28596c
Compare
Co-authored-by: Sebastian Jahr <sebastian.jahr@tuta.io>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
225f1e0
to
231f02a
Compare
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome!
My only real comment besides small stuff is that the variable naming and amount of comments in the "meat" of the OSQP code could use some attention.
Oh yeah, also one of the unit tests seems to be failing: https://github.com/ros-planning/moveit2/actions/runs/7562781804/job/20593931009?pr=2651#step:12:9070
*********************************************************************/ | ||
|
||
/* Author: Paul Gesel | ||
Description: applies smoothing by limiting the acceleration between consecutive commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you feel particularly ambitious, the images in your PR ASCIIfied would be great here. Or otherwise, to add it to a README in this folder.
...it_core/online_signal_smoothing/include/moveit/online_signal_smoothing/acceleration_filter.h
Outdated
Show resolved
Hide resolved
moveit_core/online_signal_smoothing/test/test_acceleration_filter.cpp
Outdated
Show resolved
Hide resolved
moveit_core/online_signal_smoothing/test/test_acceleration_filter.cpp
Outdated
Show resolved
Hide resolved
moveit_core/online_signal_smoothing/test/test_acceleration_filter.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
ea7ce4c
to
7b4c6e3
Compare
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's almost there!
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- but let's wait until @sjahr is also good.
Aw man! There are some clang-tidy checks remaining: https://github.com/ros-planning/moveit2/actions/runs/7576392893/job/20635103938?pr=2651#step:12:9525 |
be703cd
to
87bd0a8
Compare
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
87bd0a8
to
05e0918
Compare
Description
This PR adds a new plugin called
AccelerationLimitedPlugin
under theonline_signal_smoothing::SmoothingBaseClass
interface. The purpose of the plugin is to prevent the robot's acceleration limits from being violated by instantaneous changes to the servo command topics. The plugin is not meant to act as a reference tracking controller, rather it's designed to be a layer between the hardware and command interface that prevents infeasible motions.There are three cases considered for acceleration-limiting illustrated in the following figures:
In the figures, the red arrows show the displacement that will occur given the current velocity. The blue line shows the displacement between the current position and the desired position. The black dashed line shows the maximum possible displacements that are within the acceleration limits. The green line shows the acceleration commands that will be used by this acceleration-limiting plugin.
Case B can be solved via linear or quadratic program, hence I added OSQP as a dependency. This approach is compared to a more naive approach (where the required acceleration is scaled to avoid any limits from being violated) on a square tracing servoing motion (Left is this plugin).
The same motions are also shown as functions of time in the following plots. Importantly, the velocity of the left plot goes to zero in order to take the 90-degree turn.
Testing instructions:
demo_ros_api.launch.py
frommoveit_serov
demo_ros_api.launch.py
fromservo_keyboard_input
The update to the ros2_control usage may have broken this example. So to test, you will have to revert that commit.
Checklist