Skip to content

Commit

Permalink
Fix typo in CoM position docstrings across multiple computation class…
Browse files Browse the repository at this point in the history
…es and format with black
  • Loading branch information
Giulero committed Jan 8, 2025
1 parent b3b1a3d commit ed11080
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/adam/casadi/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def jacobian_dot_fun(self, frame: str) -> cs.Function:
)

def CoM_position_fun(self) -> cs.Function:
"""Returns the CoM positon
"""Returns the CoM position
Returns:
CoM (casADi function): The CoM position
Expand Down Expand Up @@ -464,7 +464,7 @@ def gravity_term(self, base_transform: cs.SX, joint_positions: cs.SX) -> cs.SX:
).array

def CoM_position(self, base_transform: cs.SX, joint_positions: cs.SX) -> cs.SX:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (cs.SX): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/core/rbd_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def jacobian_dot(
def CoM_position(
self, base_transform: npt.ArrayLike, joint_positions: npt.ArrayLike
) -> npt.ArrayLike:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (T): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/jax/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def gravity_term(
def CoM_position(
self, base_transform: jnp.array, joint_positions: jnp.array
) -> jnp.array:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (jnp.array): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/numpy/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def jacobian_dot(
def CoM_position(
self, base_transform: np.ndarray, joint_positions: np.ndarray
) -> np.ndarray:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (np.ndarray): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/parametric/casadi/computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def jacobian_dot_fun(self, frame: str) -> cs.Function:
)

def CoM_position_fun(self) -> cs.Function:
"""Returns the CoM positon
"""Returns the CoM position
Returns:
com (casADi function): The CoM position
Expand Down
2 changes: 1 addition & 1 deletion src/adam/parametric/jax/computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def CoM_position(
length_multiplier: jnp.array,
densities: jnp.array,
) -> jnp.array:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (jnp.array): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/parametric/numpy/computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def CoM_position(
length_multiplier: np.ndarray,
densities: np.ndarray,
) -> np.ndarray:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (np.ndarray): The homogenous transform from base to world frame
Expand Down
2 changes: 1 addition & 1 deletion src/adam/parametric/pytorch/computations_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def CoM_position(
length_multiplier: torch.Tensor,
densities: torch.Tensor,
) -> torch.Tensor:
"""Returns the CoM positon
"""Returns the CoM position
Args:
base_transform (torch.tensor): The homogenous transform from base to world frame
Expand Down
4 changes: 1 addition & 3 deletions tests/test_casadi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def test_CoM_jacobian(setup_test):
adam_kin_dyn.CoM_jacobian_fun()(state.H, state.joints_pos)
)
assert adam_com_jacobian - idyn_com_jacobian == pytest.approx(0.0, abs=1e-5)
adam_com_jacobian = cs.DM(
adam_kin_dyn.CoM_jacobian(state.H, state.joints_pos)
)
adam_com_jacobian = cs.DM(adam_kin_dyn.CoM_jacobian(state.H, state.joints_pos))
assert adam_com_jacobian - idyn_com_jacobian == pytest.approx(0.0, abs=1e-5)


Expand Down
1 change: 1 addition & 0 deletions tests/test_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_CoM_pos(setup_test):
adam_com = adam_kin_dyn.CoM_position(state.H, state.joints_pos)
assert adam_com - idyn_com == pytest.approx(0.0, abs=1e-5)


def test_CoM_jacobian(setup_test):
adam_kin_dyn, robot_cfg, state = setup_test
idyn_com_jacobian = robot_cfg.idyn_function_values.CoM_jacobian
Expand Down
1 change: 1 addition & 0 deletions tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_CoM_jacobian(setup_test):
adam_com_jacobian = adam_kin_dyn.CoM_jacobian(state.H, state.joints_pos)
assert adam_com_jacobian - idyn_com_jacobian == pytest.approx(0.0, abs=1e-5)


def test_total_mass(setup_test):
adam_kin_dyn, robot_cfg, state = setup_test
idyn_total_mass = robot_cfg.idyn_function_values.total_mass
Expand Down

0 comments on commit ed11080

Please sign in to comment.