-
Notifications
You must be signed in to change notification settings - Fork 357
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
[JTC] Proposal for custom "controller" plugins #885
base: master
Are you sure you want to change the base?
[JTC] Proposal for custom "controller" plugins #885
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #885 +/- ##
==========================================
- Coverage 85.06% 85.00% -0.07%
==========================================
Files 123 129 +6
Lines 11712 11880 +168
Branches 998 1017 +19
==========================================
+ Hits 9963 10098 +135
- Misses 1434 1457 +23
- Partials 315 325 +10
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 pull request is in conflict. Could you fix it @christophfroehlich? |
1 similar comment
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
…independent_plugins
9c0252f
to
7e55cc9
Compare
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:
computeControlLawNonRT
: 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 acomputeControlLawRT
which needs to finish within one RT loop.updateGainsRT
: A fast update within the RT loop, e.g., update of the PID gains from reconfigured ROS parameters.computeCommands
: 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.