gz_ros2_control
gz_ros2_control copied to clipboard
PID effort control of joints (+mimic)
Depends on #121
Description
PR introduces mapping all types of command interfaces (position, velocity, effort) to ForceJointCmd
component.:
- For regular joints it does that in the following manner:
- introduces pid controllers for position and velocity
- creates parameter node for each hardware interface so the PID values can be tuned in runtime
- https://github.com/livanov93/ign_ros2_control/blob/pid-with-force-output/ign_ros2_control/src/ign_ros2_control_parameters.yaml
- https://github.com/livanov93/ign_ros2_control/blob/e8ac35e2cb2ffc223d33dfed23334908ca291a34/ign_ros2_control/src/ign_system.cpp#L784-L785
- enables cascade control using https://github.com/livanov93/ign_ros2_control/blob/e8ac35e2cb2ffc223d33dfed23334908ca291a34/ign_ros2_control/src/ign_ros2_control_parameters.yaml#L10-L16
- For mimic joints it does that in the following manner:
-
Using the
MimicJointSystem
that can be found here which is pure ignition/gz system that is disconnected from ROS ecosystem.- it has PID controller which is trying to satisfy desired mimic behavior defined by multiplier and offset. It maps position error to force output which is applied to the joint.
- PID parameters can't be changed in runtime, they must be specified within sdf tags
-
Using the same approach as for regular joints within
ign_ros2_control::IgnitionSystemInterface
here- cascade control is also an option for mimic joints
Can you rename the PR, "PID effort control of a mimic joint" or something like that?
@AndyZe @kylc Please take a look into changes I implemented and comments I had on your questions/suggestions. Thanks!
@livanov93 it would help reviewers a lot in the future if you put a nice, long description in the PR. Especially on a 1,000+ line PR like this. Why did you make the design decisions you have made? Why did you choose to have 2 modes, ABS and PID? Then your reviewers won't have to ask ;)
@livanov93 it would help reviewers a lot in the future if you put a nice, long description in the PR. Especially on a 1,000+ line PR like this. Why did you make the design decisions you have made? Why did you choose to have 2 modes, ABS and PID? Then your reviewers won't have to ask ;)
I was writing it at the moment you wrote this. See here.
I've been hearing good things from testing. For example, this can actually handle contact with the environment. That's a big win 👍
@AndyZe @livanov93 This seems like a great change.
I'm curious what you're seeing re: joint position accuracy. Sounds from some other issues (#113, for example) there are/were kinematic accuracy issues and sag with the prior position controllers anyway.
I'd imagine the cascaded controller coming in here could be better at achieving low joint position error than the effort_controllers/JointTrajectoryController
was for ROS 1 UR simulation in Gazebo Classic. I observed pretty large errors there, while the regular position controller (which I think just drives ODE joint motors) was dead on, but of course couldn't touch anything rigid:
https://github.com/ros-industrial/universal_robot/issues/521#issuecomment-863583091
It'll be really nice to have a simulated robot that can make contact with a rigid environment. I was getting back to working on some ideas about elastic mounting, etc. in Gazebo Classic but maybe I should shift focus and try this out in new Gazebo first.
@ahcorde friendly ping for a review.