-
Notifications
You must be signed in to change notification settings - Fork 287
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
Using prismatic joints, with hard limits #619
Comments
You might need to call It seems the parser should set the switch on when there are position limits by default, though. |
Oh thank you. That would have taken me a while to find. It would probably be good to have that note added to the documentation for the upper and lower limits. Looking at the spec for SDF, it looks to me that it's "required" for a joint: This particular SDF was created in gazebo's model creator, and it populated a limit for every joint, setting the default to -1e308,1e308. So if you setPositionLimitEnforced(true) when the |
Oh, I was hoping I could help out, and add a line or two of code for review/PR, but it's not that simple, because it's not part of the properties, it's part of the joint. So the code that reads the limits is pretty far removed from the code that has a joint. I don't want to make that big a change without knowing the code better. I would also add documentation to the limit properties, to let people know that they are ineffective without enforcing them. |
👍
We might don't want that case. One possible compromise I can come up with now is using threshhold. We make the joint to enforce position limits if the magnitute of the limits are less than the threshhold.
The function that reads the limits (e.g, |
What is the motivation behind having |
@mkoval: jslee above pointed that there is a use case where you would want to disable the enforcement (presumably temporarily) and then add it back in later, without losing the values for the lower/upper. I can't vouch for the validity of that, but I'm sure there's a discussion here about it. Using a threshold would make it easier. I see in the v1.4 version of the SDF spec that it has a default of -1e16,1e16, so that seems like a reasonable threshold: I'm not sure what they mean when they say "required:1" because their example on the right doesn't even have it. And the description says you can omit it if the joint is continuous. I can set it to -1e16,1e16 before the read, and if it's inside that threshold, then I'll enforce it. If that's a simple fix. |
Another motivation in the point of constraint solver view is related to the point @jeffeb3 made. The constraint solver doesn't generate constraints for a joint with I'm aware of that the way of generating (and managing) constraints in const solver is problematic since the constraint solver doesn't responses to the change of |
Perhaps I am missing something: I somewhat understand wanting to have a mechanism to temporarily disable joint limits without changing them. [Note: Like @mkoval and @jeffeb3, I don't know when you would actually want this: every example I can come up with risks horrible consistency problems for trivial computational gains. Even if the solver is running a But OK, let's suppose there is some use case. Why would we not want the default behavior for all loaders to be:
Then people who have some specialized use-case for disabling joint limits can do so, and the average user-- who would not be doing this --does not have to dig around in the API to make their model work. |
I agree with everything @psigen said. Unless I'm missing a specific use case, I really think
This sounds like an efficiency problem in the constraint solver. I'd prefer to modify the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
@jslee02 : I just made a model with a prismatic joint, added joint limits to it, and spent 20 minutes trying to figure out why the prismatic joint limits were being completely ignored... until I found this open issue again. 😓 So I maintain that these should be on by default 😁 |
@psigen I agree that the current API is less intuitive and could cause confusion. Let me create a PR reflecting the comments here. |
I'm trying to create my own model, and it requires modeling linear actuators. I'm assuming a prismatic joint is the right joint to use. I loaded it using an SDF file. But when I run the simulation, it just keeps falling through the limits I've set.
When I query the object's properties, I get the mPositionLowerLimit, mPositionUpperLimit are set to -1,0. These limits are on the PrismaticJointProperties.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: