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

JointLimits violated in simulation mode velocity #8

Open
airballking opened this issue Feb 16, 2017 · 2 comments
Open

JointLimits violated in simulation mode velocity #8

airballking opened this issue Feb 16, 2017 · 2 comments

Comments

@airballking
Copy link

Hi,

this is a great package. Thanks for sharing it! I made a package providing similar functionality similar, but this is cooler! So, I try to switch now.

When playing with the velocity-resolved simulation mode, I discovered that joint limits were not obeyed.

My use case is: I have a prismatic joint with limits (a torso) and send commands of 5cm/s to a controller that just forwards the command. When looking at it in RVIZ, the joint moves nicely upwards with the correct velocity. Unfortunately, it never stops, and the joint just "takes off".

Best,
Georg.

@airballking
Copy link
Author

I think I found a working fix. Basically, the method sim_hw_interface::enforceLimits(ros::Duration& period) always calls the PositionJointSaturationInterface to enforce joint limits. No matter what the selected simulation mode is.

Adding another switch-case-statement there is no problem because the various interfaces are already registered in the generic_hw_interface.

However, there is a catch. I think VelocityJointSaturationInterface is incomplete: It only enforce velocity and effort limits. I do not know why. The VelocityJointSoftLimitsInterface has an extended version of the same algorithm to also enforce joint position limits. I have implemented a fix for that as well, and will shoot a pull request to that repository, too.

Finally, I also realized that generic_hw_interface does not check whether the default initial position of 0.0 violate joint limits. My robot has such joints. I added a check for that too.

I'll open a pull request, soon.

@davetcoleman
Copy link
Member

Thanks for reporting this @airballking !

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

No branches or pull requests

2 participants