Fix sagging robots in position control #213
Merged
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.
Following up with my remarks on #177 (comment) and a request for a PR.
summary: in the discussion of the reset pos/vel commands it is said that setting position/velocity for joints is overriding physics, and should generally not be used,
I know from past experience with enforcing pose of an object at each time step was not sufficient to hold it in place (drift), velocity had to be set to zero as well. I immediately related the joint sagging issue to that pose drift.
Solution is to set zero velocity as well for that time step. Setting velocity to zero after fixing position is another override that stabilizes the physics and is unrelated to any robot physics.
here is a before and after on 2 robots
ur_broken.mp4
ur_fixed.mp4
kuka_broken.mp4
kuka_fixed.mp4
Other solutions have used max efforts or adding high damping (which probably essentially set velocity to zero)
I believe this PR should therefore fix the following issues without requiring dynamics parameters.
#90
#73
UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation#19