Skip to content
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

JointTrajectoryController fails to hold position on effort control #514

Closed
c-rizz opened this issue Feb 1, 2023 · 4 comments
Closed

JointTrajectoryController fails to hold position on effort control #514

c-rizz opened this issue Feb 1, 2023 · 4 comments
Labels

Comments

@c-rizz
Copy link

c-rizz commented Feb 1, 2023

JointTrajectoryController fails to hold position when used with only an effort command interface. I believe this is because when the controller aborts because of a tolerance violation, it sets an empty goal and stops updating the joint_interfaces. In position control this means the position is kept constant, but not when using effort control.
In fact in my gazebo simulation the robot falls on itself when it hits a tolerance violation.

This could be fixed by having the update loop set the trajectory message to the current position in case of an abort, the PID should then manage to keep the position. Could this be done in all the cases in which the goal trajectory is empty? What is the intended behavior when the trajectory is empty?

@c-rizz c-rizz added the bug label Feb 1, 2023
@c-rizz
Copy link
Author

c-rizz commented Feb 1, 2023

I implemented a fix at https://github.com/c-rizz/ros2_controllers/tree/humble. For now I did it on humble, but I verified the problem is also present on master. With the current fix the controller keeps the position correctly in my use case. Also it now keeps the position on startup, I am not sure if that is desirable.
If it is fine I could submit a PR.

@christophfroehlich
Copy link
Contributor

The same applies for canceling goals while using velocity command interface. Your patch solved this also for me, thanks!!
I also like the idea of automatically holding the start position, I solved that now always with sending a goal manually at startup.

I was investigating this issue because I also needed a solution for that -> I've allowed myself to cherrypick your commit and open a PR for the master branch. We then can backport it to humble.

@christophfroehlich
Copy link
Contributor

Edit: now I realized the already existing PR

@christophfroehlich
Copy link
Contributor

Fixed with #558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants