Skip to content

Commit

Permalink
Add reference sources and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Sep 13, 2024
1 parent a09bc0d commit 6c47479
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/jaxsim/rbda/contacts/relaxed_rigid.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,62 +21,62 @@
class RelaxedRigidContactsParams(ContactsParams):
"""Parameters of the relaxed rigid contacts model."""

# Time constant
# Time constant.
time_constant: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.01, dtype=float)
)

# Adimensional damping coefficient
# Adimensional damping coefficient.
damping_coefficient: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(1.0, dtype=float)
)

# Minimum impedance
# Minimum impedance.
d_min: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.9, dtype=float)
)

# Maximum impedance
# Maximum impedance.
d_max: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.95, dtype=float)
)

# Width
# Width.
width: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.0001, dtype=float)
)

# Midpoint
# Midpoint.
midpoint: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.1, dtype=float)
)

# Power exponent
# Power exponent.
power: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(1.0, dtype=float)
)

# Stiffness
# Stiffness.
stiffness: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.0, dtype=float)
)

# Damping
# Damping.
damping: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.0, dtype=float)
)

# Friction coefficient
# Friction coefficient.
mu: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(0.5, dtype=float)
)

# Maximum number of iterations
# Maximum number of iterations.
max_iterations: jtp.Int = dataclasses.field(
default_factory=lambda: jnp.array(50, dtype=int)
)

# Solver Tolerance
# Solver tolerance.
tolerance: jtp.Float = dataclasses.field(
default_factory=lambda: jnp.array(1e-6, dtype=float)
)
Expand Down Expand Up @@ -172,7 +172,15 @@ def valid(self, model: js.model.JaxSimModel) -> bool:

@jax_dataclasses.pytree_dataclass
class RelaxedRigidContacts(ContactModel):
"""Rigid contacts model."""
"""
Relaxed rigid contacts model.
Notes:
This model is based on the following paper:
https://ieeexplore.ieee.org/document/5979814
and the code is based on the following implementation:
https://github.com/google/brax/blob/main/brax/generalized/constraint.py
"""

parameters: RelaxedRigidContactsParams = dataclasses.field(
default_factory=RelaxedRigidContactsParams
Expand Down

0 comments on commit 6c47479

Please sign in to comment.