Skip to content

Allow to override joint friction coefficients during parsing #443

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Jun 5, 2025

This pull request introduces new configuration options for joint dynamics and updates the parser to utilize these options. The most important changes include adding environment variables for static and viscous friction coefficients and modifying the parser to use these variables as defaults.

Configuration Enhancements:

  • Added two new environment variables: JAXSIM_JOINT_FRICTION_STATIC and JAXSIM_JOINT_FRICTION_VISCOUS, which allow overriding the static and viscous friction coefficients for all joints. Both default to 0.0. (docs/guide/configuration.rst, docs/guide/configuration.rstR50-R64)

Parser Updates:

  • Updated the extract_model_data function in parser.py to use JAXSIM_JOINT_FRICTION_STATIC and JAXSIM_JOINT_FRICTION_VISCOUS as default values for static and viscous friction coefficients when joint dynamics data is unavailable. (src/jaxsim/parsers/rod/parser.py, src/jaxsim/parsers/rod/parser.pyL255-R262)

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

@flferretti flferretti self-assigned this Jun 5, 2025
Copy link

@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

Benchmark suite Current: 09dbc77 Previous: 8d5c896 Ratio
tests/test_benchmark.py::test_forward_dynamics_aba[1] 33.732495725184535 iter/sec (stddev: 0.00019560899131016585) 33.99270710150131 iter/sec (stddev: 0.00009160345295732999) 1.01
tests/test_benchmark.py::test_forward_dynamics_aba[128] 15.746604675985465 iter/sec (stddev: 0.00043086011544949483) 15.450388973393041 iter/sec (stddev: 0.00039276707628969594) 0.98
tests/test_benchmark.py::test_free_floating_bias_forces[1] 27.300939408323607 iter/sec (stddev: 0.00017956622791729214) 28.072185819254948 iter/sec (stddev: 0.0001405275314719085) 1.03
tests/test_benchmark.py::test_free_floating_bias_forces[128] 11.348017004996896 iter/sec (stddev: 0.0007912682552996057) 10.661461909768686 iter/sec (stddev: 0.0003774590436268307) 0.94
tests/test_benchmark.py::test_forward_kinematics[1] 78.30887709655238 iter/sec (stddev: 0.00007557007499027129) 80.47867539657375 iter/sec (stddev: 0.0008406595365800215) 1.03
tests/test_benchmark.py::test_forward_kinematics[128] 24.36412968846077 iter/sec (stddev: 0.000733411705460884) 22.963981536068786 iter/sec (stddev: 0.00018004443135162003) 0.94
tests/test_benchmark.py::test_free_floating_mass_matrix[1] 40.51344369489465 iter/sec (stddev: 0.0004243451253223576) 41.68963883859595 iter/sec (stddev: 0.00016661815474607527) 1.03
tests/test_benchmark.py::test_free_floating_mass_matrix[128] 40.261883507735895 iter/sec (stddev: 0.00022866348995515085) 41.30544074968093 iter/sec (stddev: 0.00006869051943032785) 1.03
tests/test_benchmark.py::test_free_floating_jacobian[1] 52.457663628527584 iter/sec (stddev: 0.0007515706831323388) 54.710482035025365 iter/sec (stddev: 0.0000771513049637593) 1.04
tests/test_benchmark.py::test_free_floating_jacobian[128] 53.09159022965794 iter/sec (stddev: 0.00019970672192801519) 54.13600959838642 iter/sec (stddev: 0.0002066391631624143) 1.02
tests/test_benchmark.py::test_free_floating_jacobian_derivative[1] 31.317773074090745 iter/sec (stddev: 0.00020957412302644173) 32.31611675089207 iter/sec (stddev: 0.0004465427329110755) 1.03
tests/test_benchmark.py::test_free_floating_jacobian_derivative[128] 32.147702892446766 iter/sec (stddev: 0.00011626252227472205) 32.8020875749547 iter/sec (stddev: 0.00027199927237599305) 1.02
tests/test_benchmark.py::test_soft_contact_model[1] 29.687001824040674 iter/sec (stddev: 0.0002212059113671745) 30.416550779490947 iter/sec (stddev: 0.00009594224392172117) 1.02
tests/test_benchmark.py::test_soft_contact_model[128] 14.223696422478216 iter/sec (stddev: 0.0003876691004434678) 14.145201786398033 iter/sec (stddev: 0.0005232496065842119) 0.99
tests/test_benchmark.py::test_rigid_contact_model[1] 6.2382537646669745 iter/sec (stddev: 0.0008298066596855063) 6.438860629793804 iter/sec (stddev: 0.00028284443651919447) 1.03
tests/test_benchmark.py::test_rigid_contact_model[128] 0.8462676675800964 iter/sec (stddev: 0.0008152134258916299) 0.8450260471582455 iter/sec (stddev: 0.0007584783160614406) 1.00
tests/test_benchmark.py::test_relaxed_rigid_contact_model[1] 5.757986514462311 iter/sec (stddev: 0.0005390561642124177) 5.901695040090421 iter/sec (stddev: 0.0008691354003239028) 1.02
tests/test_benchmark.py::test_relaxed_rigid_contact_model[128] 3.3496305818642527 iter/sec (stddev: 0.0027458221108738324) 3.3393481643233303 iter/sec (stddev: 0.0005133033064496388) 1.00
tests/test_benchmark.py::test_simulation_step[1] 4.6661891262854915 iter/sec (stddev: 0.0039160542655659585) 4.792670117574774 iter/sec (stddev: 0.00041546735946859745) 1.03
tests/test_benchmark.py::test_simulation_step[128] 2.6434717793362177 iter/sec (stddev: 0.0006156978249948536) 2.6082535675050296 iter/sec (stddev: 0.0013605955461495007) 0.99

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

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.

1 participant