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

Uniform usage of joint_forces and joint_force_references argument names #253

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Oct 4, 2024

In short:

  • joint_forces are the real joint forces that are set to the joint.
  • joint_force_references are the desired joint forces, that might differ from the real joint forces in presence of effects like joint friction.

This PR updates the APIs making sure to use the right argument name so that it should be more clear to callers whether they might expect to lose a fraction of the passed joint force due to physical effects.

@flferretti @xela-95 please let me know if I missed something.

@diegoferigo diegoferigo requested a review from xela-95 October 4, 2024 12:45
@diegoferigo diegoferigo self-assigned this Oct 4, 2024
@diegoferigo diegoferigo force-pushed the uniform_usage_of_joint_force_references branch from ab7e46d to 20f486c Compare October 4, 2024 12:59
@xela-95
Copy link
Member

xela-95 commented Oct 4, 2024

@flferretti @xela-95 please let me know if I missed something.

Thanks @diegoferigo ! This will for sure help to clarify the usage of this argument.

Just to be sure, have you also checked the use of joint_force_references in jaxsim.api.contact (like in

def collidable_point_dynamics(
model: js.model.JaxSimModel,
data: js.data.JaxSimModelData,
link_forces: jtp.MatrixLike | None = None,
joint_force_references: jtp.VectorLike | None = None,
) -> tuple[jtp.Matrix, dict[str, jtp.Array]]:
and
def collidable_point_forces(
model: js.model.JaxSimModel,
data: js.data.JaxSimModelData,
link_forces: jtp.MatrixLike | None = None,
joint_force_references: jtp.VectorLike | None = None,
) -> jtp.Matrix:
) and in the compute_contact_forces methods of the different contact models (like rigid and relaxed_rigid) that use such input arguments?

@diegoferigo
Copy link
Member Author

Just to be sure, have you also checked the use of joint_force_references in jaxsim.api.contact

I already checked them, let me know if you find mistakes :) I have a lot of changes pending, I might have missed something.

@diegoferigo diegoferigo force-pushed the uniform_usage_of_joint_force_references branch 2 times, most recently from b639c82 to 33ad625 Compare October 7, 2024 07:24
@diegoferigo
Copy link
Member Author

I just noticed that I missed to commit two calls in the Rigid and RelaxedRigid contact models. I force-pushed the changes.

@diegoferigo diegoferigo force-pushed the uniform_usage_of_joint_force_references branch from 33ad625 to 07b3ece Compare October 7, 2024 07:28
Copy link
Collaborator

@flferretti flferretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Diego, LGTM!

@diegoferigo diegoferigo merged commit 1bbf438 into main Oct 7, 2024
24 checks passed
@diegoferigo diegoferigo deleted the uniform_usage_of_joint_force_references branch October 7, 2024 08:01
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

Successfully merging this pull request may close these issues.

3 participants