Skip to content

Commit

Permalink
fix drake unit inertia deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTedrake committed Aug 17, 2023
1 parent 0ef52e4 commit a37b43e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions underactuated/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ def AddShape(plant, shape, name, mass=1, mu=1, color=[0.5, 0.5, 0.9, 1.0]):
shape.width(), shape.depth(), shape.height()
)
elif isinstance(shape, Cylinder):
inertia = UnitInertia.SolidCylinder(shape.radius(), shape.length())
inertia = UnitInertia.SolidCylinder(
shape.radius(), shape.length(), [0, 0, 1]
)
elif isinstance(shape, Sphere):
inertia = UnitInertia.SolidSphere(shape.radius())
elif isinstance(shape, Capsule):
inertia = UnitInertia.SolidCapsule(
shape.radius(), shape.length(), [0, 0, 1]
)
else:
raise RunTimeError(
raise RuntimeError(
f"need to write the unit inertia for shapes of type {shape}"
)
body = plant.AddRigidBody(
Expand Down

0 comments on commit a37b43e

Please sign in to comment.