-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support continuous (unbounded) joints properly #59
Conversation
Tested with the Kinova Gen3 and found another bug with the joint value clamping + fixed it. Now it should be good! 2023-09-29.10-29-28.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I don't have a lot of background here but I also pulled this up with the gen3 config and it seems to do the job! Just adding food for thought with my comments, I don't have strong opinions on any of these.
src/robot.cpp
Outdated
var.span = var.max - var.min; | ||
|
||
if (!(var.span >= 0 && var.span < std::numeric_limits<double>::max())) var.span = 1; | ||
var.span = var.bounded ? var.max - var.min : kUnboundedVariableSpan; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should var.span
just be a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want this to be a variable so it doesn't have to be needlessly recalculated multiple times... but with your next comment, I like the idea of providing abstractions to clip variables to limits / generate random values, and then no other code besides these functions would touch the span member variable.
Thanks @eholum -- I made some member functions in the In doing so, I also:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the wrong endpoint frame configured but tested and I get good performance from servo with the Gen3.
This PR correctly handles how to deal with continuous joints by ensuring that none of the RSL samples use the full floating-point span. Also did some slight cleanup along the way.
The key here is that, if a joint is continuous, our sampling now is casting a "spread" of +/- pi radians around the current state. That way the sampling is somewhat limited.
Closes #57