Skip to content

Commit

Permalink
Update setters for motor parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Oct 20, 2023
1 parent 94a4688 commit dbe3734
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jaxsim/high_level/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,9 +1518,9 @@ def set_motor_inertias(
dict(zip(self.physics_model._joint_motor_inertia, inertias))
)

logging.info("Setting attribute 'motor_inertias'")
logging.info("Setting attribute `motor_inertias`")

@functools.partial(oop.jax_tf.method_rw, static_argnames=["joint_names"])
@functools.partial(oop.jax_tf.method_rw, jit=False)
def set_motor_gear_ratios(
self, gear_ratios: jtp.Vector, joint_names: tuple[str, ...] = None
) -> None:
Expand All @@ -1530,7 +1530,7 @@ def set_motor_gear_ratios(
raise ValueError("Wrong arguments size", gear_ratios.size, len(joint_names))

# Check on gear ratios if motor_inertias are not zero
for idx, gr in gear_ratios:
for idx, gr in enumerate(gear_ratios):
if gr != 0 and self.motor_inertias()[idx] == 0:
raise ValueError(
f"Zero motor inertia with non-zero gear ratio found in position {idx}"
Expand All @@ -1540,7 +1540,7 @@ def set_motor_gear_ratios(
dict(zip(self.physics_model._joint_motor_gear_ratio, gear_ratios))
)

logging.info("Setting attribute 'motor_gear_ratios'")
logging.info("Setting attribute `motor_gear_ratios`")

@functools.partial(oop.jax_tf.method_rw, static_argnames=["joint_names"])
def set_motor_viscous_frictions(
Expand Down Expand Up @@ -1569,7 +1569,7 @@ def set_motor_viscous_frictions(
# )
# )

logging.info("Setting attribute 'motor_viscous_frictions'")
logging.info("Setting attribute `motor_viscous_frictions`")

@functools.partial(oop.jax_tf.method_ro, jit=False)
def motor_inertias(self) -> jtp.Vector:
Expand Down

0 comments on commit dbe3734

Please sign in to comment.