Skip to content

Commit

Permalink
Save time_step and reduced joint positions as float
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 24, 2025
1 parent 478660b commit 7aff901
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/jaxsim/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class JaxSimModel(JaxsimDataclass):

model_name: Static[str]

time_step: jtp.FloatLike = dataclasses.field(
default_factory=lambda: jnp.array(0.001, dtype=float),
time_step: float = dataclasses.field(
default=0.001,
)

terrain: Static[jaxsim.terrain.Terrain] = dataclasses.field(
Expand Down Expand Up @@ -222,7 +222,7 @@ def build(
time_step = (
time_step
if time_step is not None
else JaxSimModel.__dataclass_fields__["time_step"].default_factory()
else JaxSimModel.__dataclass_fields__["time_step"].default
)

# Create the default contact model.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_model_creation_and_reduction(
locked_joint_positions=dict(
zip(
model_full.joint_names(),
data_full.joint_positions,
data_full.joint_positions.tolist(),
strict=True,
)
),
Expand Down

0 comments on commit 7aff901

Please sign in to comment.