Skip to content

Support passing a subset of links to be parametrized#489

Merged
flferretti merged 2 commits intomainfrom
selective_parametrization
Dec 10, 2025
Merged

Support passing a subset of links to be parametrized#489
flferretti merged 2 commits intomainfrom
selective_parametrization

Conversation

@flferretti
Copy link
Copy Markdown
Collaborator

@flferretti flferretti commented Nov 20, 2025

This PR adds an option to pass a list of link names to be parametrized.


📚 Documentation preview 📚: https://jaxsim--489.org.readthedocs.build//489/

@flferretti flferretti self-assigned this Nov 20, 2025
@flferretti flferretti requested a review from xela-95 as a code owner November 20, 2025 11:51
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark

Details
Benchmark suite Current: 355a24f Previous: c28e89a Ratio
tests/test_benchmark.py::test_forward_dynamics_aba[1] 318.88952272923103 iter/sec (stddev: 0.00000881419415675742) 385.94492720843766 iter/sec (stddev: 0.000009463978323506126) 1.21
tests/test_benchmark.py::test_forward_dynamics_aba[128] 25.70189294541085 iter/sec (stddev: 0.00014085274338628969) 29.216966653272625 iter/sec (stddev: 0.00011455086573428671) 1.14
tests/test_benchmark.py::test_free_floating_bias_forces[1] 296.26609246293384 iter/sec (stddev: 0.000009641233679849826) 361.396251061539 iter/sec (stddev: 0.00000910574964681653) 1.22
tests/test_benchmark.py::test_free_floating_bias_forces[128] 14.480184562652923 iter/sec (stddev: 0.00029059351075443567) 16.218942194940492 iter/sec (stddev: 0.00025096534945186314) 1.12
tests/test_benchmark.py::test_forward_kinematics[1] 359.97890925034045 iter/sec (stddev: 0.00013749890859643307) 452.4863643105723 iter/sec (stddev: 0.000008022285629396292) 1.26
tests/test_benchmark.py::test_forward_kinematics[128] 27.78353191883734 iter/sec (stddev: 0.00016762687202368128) 31.765642438814933 iter/sec (stddev: 0.0002088457881717258) 1.14
tests/test_benchmark.py::test_free_floating_mass_matrix[1] 152.09098968180743 iter/sec (stddev: 0.000011568439380294813) 181.58130216807277 iter/sec (stddev: 0.00005072371260792714) 1.19
tests/test_benchmark.py::test_free_floating_mass_matrix[128] 150.6167545107286 iter/sec (stddev: 0.000020577516668760828) 175.24079377087364 iter/sec (stddev: 0.000018760096947039575) 1.16
tests/test_benchmark.py::test_free_floating_jacobian[1] 412.74717360374643 iter/sec (stddev: 0.000013339400380460952) 525.7508803201982 iter/sec (stddev: 0.000006377672924636457) 1.27
tests/test_benchmark.py::test_free_floating_jacobian[128] 416.7109098865311 iter/sec (stddev: 0.00001555238860130101) 534.2483568468638 iter/sec (stddev: 0.000006942445781767468) 1.28
tests/test_benchmark.py::test_free_floating_jacobian_derivative[1] 339.36480009132964 iter/sec (stddev: 0.000008095092469758106) 410.0473494948492 iter/sec (stddev: 0.000012243950755069747) 1.21
tests/test_benchmark.py::test_free_floating_jacobian_derivative[128] 301.7141143666997 iter/sec (stddev: 0.000010777767880170669) 302.58988317111164 iter/sec (stddev: 0.000015109621352982298) 1.00
tests/test_benchmark.py::test_soft_contact_model[1] 289.27130341357196 iter/sec (stddev: 0.000020441598771593122) 349.9366267743607 iter/sec (stddev: 0.00000947480013200776) 1.21
tests/test_benchmark.py::test_soft_contact_model[128] 26.453680032584813 iter/sec (stddev: 0.00011950706639665959) 29.951416599383442 iter/sec (stddev: 0.0001405258247109449) 1.13
tests/test_benchmark.py::test_rigid_contact_model[1] 47.231999032610915 iter/sec (stddev: 0.00001533864012681784) 40.276241063183 iter/sec (stddev: 0.000024302278784552764) 0.85
tests/test_benchmark.py::test_rigid_contact_model[128] 0.7090389904165447 iter/sec (stddev: 0.0006043201432614013) 0.7258859819172665 iter/sec (stddev: 0.0003607214923404956) 1.02
tests/test_benchmark.py::test_relaxed_rigid_contact_model[1] 98.46679524042534 iter/sec (stddev: 0.0001367375336615683) 74.75017951811331 iter/sec (stddev: 0.00003167479964364776) 0.76
tests/test_benchmark.py::test_relaxed_rigid_contact_model[128] 5.062449046710641 iter/sec (stddev: 0.00043058181042121346) 6.400062476314604 iter/sec (stddev: 0.00024891629896200675) 1.26
tests/test_benchmark.py::test_simulation_step[1] 87.00010734361041 iter/sec (stddev: 0.000019942825638196642) 69.29459728383536 iter/sec (stddev: 0.00002754549281911007) 0.80
tests/test_benchmark.py::test_simulation_step[128] 4.46579648516512 iter/sec (stddev: 0.0003432565400875039) 5.39599749835251 iter/sec (stddev: 0.000279412049524645) 1.21
tests/test_benchmark.py::test_update_hw_parameters[1] 98.60297174278689 iter/sec (stddev: 0.00009958183623359776)
tests/test_benchmark.py::test_update_hw_parameters[128] 102.2539593145928 iter/sec (stddev: 0.00010710914208225535)
tests/test_benchmark.py::test_export_updated_model[1] 3.4977661982522186 iter/sec (stddev: 0.005294066254392871)
tests/test_benchmark.py::test_export_updated_model[128] 0.01887312516012782 iter/sec (stddev: 0.4411767271396804)

This comment was automatically generated by workflow using github-action-benchmark.

@flferretti flferretti force-pushed the selective_parametrization branch from 9b56ac5 to 43d20a5 Compare November 20, 2025 14:20
integrator: IntegratorType | None = None,
gravity: jtp.FloatLike = jaxsim.math.STANDARD_GRAVITY,
constraints: jaxsim.rbda.kinematic_constraints.ConstraintMap | None = None,
parametrized_links: tuple[str, ...] | None = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new parameter is not used inside this function. Are we missing to pass it somewhere here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes sorry, I added this line with the intention of moving the instantiation of hardware link metadata in the build method rather than inside the build_from_model_description. If you agree I can add a commit for that in this PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I opened an issue at https://github.com/ami-iit/element_differentiable_simulators_for_codesign/issues/30. We will address this in the future as it requires deeper investigation. I'll leave this discussion unresolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect thanks!

@flferretti flferretti force-pushed the selective_parametrization branch from 08ff4fb to 43d20a5 Compare December 9, 2025 16:55
@flferretti flferretti force-pushed the selective_parametrization branch from 43d20a5 to 355a24f Compare December 9, 2025 16:58
@flferretti
Copy link
Copy Markdown
Collaborator Author

@xela-95 this should be good to go. I restarted one failing job, but the failure was due to robot_descriptions

@flferretti flferretti merged commit 9893904 into main Dec 10, 2025
43 of 45 checks passed
@flferretti flferretti deleted the selective_parametrization branch December 10, 2025 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.

2 participants