-
Notifications
You must be signed in to change notification settings - Fork 10
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
Extend functional APIs #117
Conversation
0ae5dcd
to
e01b5c2
Compare
e01b5c2
to
c36ae73
Compare
src/jaxsim/api/com.py
Outdated
with data.switch_velocity_representation(VelRepr.Mixed): | ||
W_ṗ_G = average_centroidal_velocity(model=model, data=data)[0:3] | ||
return W_ṗ_G |
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.
What happens for others velocity representation?
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.
This method always returns
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.
Do you think that it can be more uniform returning instead
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.
Yes, that could make sense. Anyhow, I was actually confused by the data.switch_velocity_representation
, but after checking it out now everything is clear.
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.
@traversaro I'm going to merge this PR with jaxsim.api.com.com_linear_velocity
always returning
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.
Ok!
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.
By the way, I looked in iDynTree, and to me it seems that always returning
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.
Ok if this is the intended usage, then I'll update directly this PR instead of doing it in #108.
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 forced pushed this fix, @traversaro can you please confirm that https://github.com/ami-iit/jaxsim/compare/3b63bb8cf6962c6e1e0f71e5120da480964d3f51..b3864af61e37c48ca24a83146a0f96b0d3063dab is what you had in mind?
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.
Minor comments.
c36ae73
to
3b63bb8
Compare
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.
LGTM, thanks Diego!
3b63bb8
to
b3864af
Compare
b3864af
to
45d37b0
Compare
This PR extends the functional APIs with a lot of new functions:
jaxsim.api.com
module.jaxsim.api.com.com_linear_velocity
function.jaxsim.api.com.centroidal_momentum
function.jaxsim.api.com.centroidal_momentum_jacobian
function.jaxsim.api.com.locked_centroidal_spatial_inertia
function.jaxsim.api.com.average_centroidal_velocity
function.jaxsim.api.com.average_centroidal_velocity_jacobian
function.jaxsim.api.contact.collidable_point_forces
function.jaxsim.api.contact.collidable_point_dynamics
function.jaxsim.api.link.velocity
function.jaxsim.api.model.locked_spatial_inertia
function.jaxsim.api.model.total_momentum_jacobian
function.jaxsim.api.model.average_velocity
function.jaxsim.api.model.average_velocity_jacobian
function.jaxsim.api.model.link_contact_forces
function.jaxsim.math.transform
module.Adjoint.from_transform
method.These are particularly useful for (differentiable) model-based control, especially in centroidal coordinates cc @DanielePucci.
Refer to
Traversaro2017a
1 and Section 3.9 ofTraversaro2017b
2 for more details.📚 Documentation preview 📚: https://jaxsim--117.org.readthedocs.build//117/
Footnotes
Traversaro, Pucci, Nori, A Unified View of the Equations of Motion used for Control Design of Humanoid Robots, 2017 url. ↩
Traversaro, Modelling, Estimation and Identification of Humanoid Robots Dynamics, 2017, url. ↩