-
Notifications
You must be signed in to change notification settings - Fork 401
[JTC] Proposal for custom "controller" plugins #885
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
Open
christophfroehlich
wants to merge
54
commits into
ros-controls:master
Choose a base branch
from
christophfroehlich:jtc/controller_plugin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[JTC] Proposal for custom "controller" plugins #885
christophfroehlich
wants to merge
54
commits into
ros-controls:master
from
christophfroehlich:jtc/controller_plugin
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #885 +/- ##
==========================================
- Coverage 85.26% 85.18% -0.08%
==========================================
Files 143 149 +6
Lines 13793 13990 +197
Branches 1196 1215 +19
==========================================
+ Hits 11760 11917 +157
- Misses 1636 1665 +29
- Partials 397 408 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4927435
to
8b249df
Compare
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
9c0252f
to
7e55cc9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
4dc4026
to
771d5bd
Compare
201b41c
to
8e4de92
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Up to now there were only two possibilities of controlling the system with JTC:
The aim of this PR is to create an interface for supporting new control strategies, and enable even creating custom controller plugins by users. This is done by plugins of base class
TrajectoryControllerBase
, loaded by the pluginlib.Together with the change of #809 it will even be supported to integrate state-space controllers, where the system output does not have the same size as the system input: See the following swing-up of a cart-pole from this demo, where I implemented a LQR as plugin.
swingup_lqr_gh.mp4
Why to change JTC in this way:
The API was designed around the following methods:
compute_control_law_non_rt
: called when a new trajectory is received. This may take some time (e.g., calculating the gains for a LQR by solving Riccati equations). This blocks the execution of the new trajectory by JTC until the calculation is finished (seeis_ready()
). The user has to implement a realtime-buffer to switch the old control law to the new one, once it is started (seestart()
).set_hold_position()
), there is acompute_control_law_rt
which needs to finish within one RT loop.update_gains_rt
: A fast update within the RT loop, e.g., update of the PID gains from reconfigured ROS parameters.compute_commands
: Evaluate the control law inside the RT loop with earlier calculated/updated gains.Notes:
joints
thancommand_joints
#809, the map for the gains should becommand_joints
. But most of the time this parameter is empty and copied over fromjoints
in JTC. Because it is a static read-only variable, it is not possible to override the parameter for the plugin from JTC -> I had to make it reconfigurable from the generate_parameter_library, but added a callback afterwards to prohibit a later change from the user. If anyone knows a better way to solve this, please let me know.