[JTC] Accept larger number of joints than command_joints#809
[JTC] Accept larger number of joints than command_joints#809saikishor merged 29 commits intoros-controls:masterfrom
joints than command_joints#809Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #809 +/- ##
==========================================
+ Coverage 84.88% 85.12% +0.24%
==========================================
Files 124 124
Lines 11564 11701 +137
Branches 985 997 +12
==========================================
+ Hits 9816 9961 +145
+ Misses 1433 1428 -5
+ Partials 315 312 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
This pull request is in conflict. Could you fix it @christophfroehlich? |
9eae4ad to
6aa0b2a
Compare
fa521ca to
3369aae
Compare
3369aae to
4b577b4
Compare
|
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? |
|
This pull request is in conflict. Could you fix it @christophfroehlich? |
saikishor
left a comment
There was a problem hiding this comment.
In generl, looks very good to me.
Just some nitpicking things
joint_trajectory_controller/src/joint_trajectory_controller.cpp
Outdated
Show resolved
Hide resolved
rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/joint_trajectory_controller.py
Show resolved
Hide resolved
joint_trajectory_controller/src/joint_trajectory_controller.cpp
Outdated
Show resolved
Hide resolved
saikishor
left a comment
There was a problem hiding this comment.
Thanks for the explanation.
LGTM
This PR softens the condition that the number of
jointsandcommand_jointshave to be equal: JTC now supports having lesscommand_jointsthanjoints.This gives the opportunity to track the state and error of passive joints, especially joints that are not
command_jointsbut a degree-of-freedom of the physical system.As an example, see the cart-pole example in the following video (a pendulum on a cart). Now it is possible to send a swing-up trajectory of the pendulum including values of the cart and the pendulum joint, JTC will do the trajectory interpolation and publishes the full state including the desired values for the pendulum joint, but it finally only can command the cart-joint.
swingup_gh.mp4
This PR does not directly address passive joints being part of a closed-loop kinematic chain, i.e., joints not being a degree-of-freedom of the system. One could track the trajectory of all joints being part of the closed loop, but the kinematics need to be solved in the hardware interface, e.g., by means of a transmission interface.
A future PR will propose a possibility to implement different control laws than PID, e.g., a state-space controller, which is in fact necessary to control the pendulum from the example above.
More implementation details
command_jointsmust be a subset ofjointsif they don't have the same size.command_joints. (seecheck_interface_names_with_command_jointstest)~/controller_statetopic uses a singlejoint_namesvector for all fields. Hence, entries of the output field being not included incommand_jointswill be NaN.This would break rqt_joint_trajectory_controller, I used now the required state interface instead of claimed hardware interfaces from the contoller_manager msg.