Skip to content

Commit 14b87ce

Browse files
Ruben GrandiacursoragentGuirec-Maloiselnvtw
authored
[Kamino] Implement joint friction (#3966)
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com>
1 parent 23bbd7b commit 14b87ce

54 files changed

Lines changed: 3117 additions & 708 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Coulomb joint friction support to SolverKamino.

docs/solvers/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ constraints, with opt-in unified compliant ALM and a deprecated legacy AVBD path
313313
- |no|
314314
- |yes|
315315
- |no|
316-
- |no|
316+
- |yes|
317317
* - :attr:`~newton.Model.joint_limit_lower` / :attr:`~newton.Model.joint_limit_upper`
318318
- |yes|
319319
- |yes| :sup:`2`

newton/_src/solvers/kamino/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ A more stable `BETA 2` version is planned for release during the summer of 2026.
1919
It currently supports:
2020
- Constrained rigid multi-body systems with arbitrary joint topologies (i.e. a kinematic tree is not assumed)
2121
- A large set of common and advanced bilateral joint constraints
22-
- Unilateral joint-limit and contact constraints with spatial friction and restitutive impacts
22+
- Unilateral joint-limit, and contact constraints with spatial friction and restitutive impacts
23+
- Joint Coulomb friction
2324
- Fully configurable constraint stabilization that can be specified per constraint subset
2425
- Hard joint-limit and contact constraints enforced via an advanced Proximal-ADMM forward dynamics solver
2526

newton/_src/solvers/kamino/_src/core/bodies.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,13 @@ class RigidBodiesData:
262262

263263
w_j_i: wp.array[wp.spatial_vectorf] | None = None
264264
"""
265-
Joint constraint wrench applied to each body (in world coordinates).
265+
Bilateral joint constraint wrench applied to each body (in world coordinates) [N, N·m].
266+
Shape of ``(num_bodies,)``.
267+
"""
268+
269+
w_f_i: wp.array[wp.spatial_vectorf] | None = None
270+
"""
271+
Joint friction wrench applied to each body (in world coordinates) [N, N·m].
266272
Shape of ``(num_bodies,)``.
267273
"""
268274

@@ -291,6 +297,7 @@ def clear_all_wrenches(self):
291297
self.w_i.zero_()
292298
self.w_a_i.zero_()
293299
self.w_j_i.zero_()
300+
self.w_f_i.zero_()
294301
self.w_l_i.zero_()
295302
self.w_c_i.zero_()
296303
self.w_e_i.zero_()
@@ -300,6 +307,7 @@ def clear_constraint_wrenches(self):
300307
Clears all constraint wrenches, setting them to zeros.
301308
"""
302309
self.w_j_i.zero_()
310+
self.w_f_i.zero_()
303311
self.w_l_i.zero_()
304312
self.w_c_i.zero_()
305313

@@ -403,6 +411,7 @@ def _update_body_wrenches(
403411
# Inputs
404412
state_bodies_w_a_i_in: wp.array[wp.spatial_vectorf],
405413
state_bodies_w_j_i_in: wp.array[wp.spatial_vectorf],
414+
state_bodies_w_f_i_in: wp.array[wp.spatial_vectorf],
406415
state_bodies_w_l_i_in: wp.array[wp.spatial_vectorf],
407416
state_bodies_w_c_i_in: wp.array[wp.spatial_vectorf],
408417
state_bodies_w_e_i_in: wp.array[wp.spatial_vectorf],
@@ -415,12 +424,13 @@ def _update_body_wrenches(
415424
# Retrieve the model data
416425
w_a_i = state_bodies_w_a_i_in[bid]
417426
w_j_i = state_bodies_w_j_i_in[bid]
427+
w_f_i = state_bodies_w_f_i_in[bid]
418428
w_l_i = state_bodies_w_l_i_in[bid]
419429
w_c_i = state_bodies_w_c_i_in[bid]
420430
w_e_i = state_bodies_w_e_i_in[bid]
421431

422432
# Compute the total wrench applied to the body
423-
w_i = w_a_i + w_j_i + w_l_i + w_c_i + w_e_i
433+
w_i = w_a_i + w_j_i + w_f_i + w_l_i + w_c_i + w_e_i
424434

425435
# Store results in the output arrays
426436
state_bodies_w_i_out[bid] = w_i
@@ -571,6 +581,7 @@ def update_body_wrenches(model: RigidBodiesModel, data: RigidBodiesData):
571581
# Inputs:
572582
data.w_a_i,
573583
data.w_j_i,
584+
data.w_f_i,
574585
data.w_l_i,
575586
data.w_c_i,
576587
data.w_e_i,

newton/_src/solvers/kamino/_src/core/builder.py

Lines changed: 88 additions & 26 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)