Skip to content

Commit

Permalink
Refactor Inertial class to include methods for setting mass, inertia,…
Browse files Browse the repository at this point in the history
… and origin
  • Loading branch information
Giulero committed Jun 12, 2024
1 parent 0e21593 commit 82ac977
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/adam/model/abc_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ def zero() -> "Inertial":
origin=Pose(xyz=[0.0, 0.0, 0.0], rpy=[0.0, 0.0, 0.0]),
)

def set_mass(self, mass: npt.ArrayLike) -> "Inertial":
"""Set the mass of the inertial object"""
self.mass = mass

def set_inertia(self, inertia: Inertia) -> "Inertial":
"""Set the inertia of the inertial object"""
self.inertia = inertia

def set_origin(self, origin: Pose) -> "Inertial":
"""Set the origin of the inertial object"""
self.origin = origin


@dataclasses.dataclass
class Link(abc.ABC):
Expand Down

0 comments on commit 82ac977

Please sign in to comment.