Skip to content

Commit

Permalink
Fix computations
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Dec 1, 2023
1 parent 37eb24f commit 7644a2b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
5 changes: 1 addition & 4 deletions src/adam/casadi/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,14 @@ def forward_dynamics(
self,
base_transform: Union[cs.SX, cs.DM],
joint_positions: Union[cs.SX, cs.DM],
base_velocity: Union[cs.SX, cs.DM],
joint_velocities: Union[cs.SX, cs.DM],
joint_torques: Union[cs.SX, cs.DM],
) -> Union[cs.SX, cs.DM]:
"""Returns the base acceleration and joint accelerations
"""Returns base and joints accelerations of the floating-base dynamics equation
Args:
base_transform (Union[cs.SX, cs.DM]): The homogenous transform from base to world frame
joint_positions (Union[cs.SX, cs.DM]): The joints position
base_velocity (Union[cs.SX, cs.DM]): The base velocity in mixed representation
joint_velocities (Union[cs.SX, cs.DM]): The joints velocity
joint_torques (Union[cs.SX, cs.DM]): The joints torque
Expand All @@ -436,7 +434,6 @@ def forward_dynamics(
return self.rbdalgos.aba(
base_transform,
joint_positions,
base_velocity,
joint_velocities,
joint_torques,
self.g,
Expand Down
5 changes: 1 addition & 4 deletions src/adam/jax/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,14 @@ def forward_dynamics(
self,
base_transform: jnp.array,
joint_positions: jnp.array,
base_velocity: jnp.array,
joint_velocities: jnp.array,
joint_torques: jnp.array,
) -> jnp.array:
"""Returns the forward dynamics equation
"""Returns base and joints accelerations of the floating-base dynamics equation
Args:
base_transform (jnp.array): The homogenous transform from base to world frame
joint_positions (jnp.array): The joints position
base_velocity (jnp.array): The base velocity in mixed representation
joint_velocities (jnp.array): The joints velocity
joint_torques (jnp.array): The joints torques
Expand All @@ -264,7 +262,6 @@ def forward_dynamics(
return self.rbdalgos.aba(
base_transform,
joint_positions,
base_velocity,
joint_velocities,
joint_torques,
self.g,
Expand Down
6 changes: 1 addition & 5 deletions src/adam/numpy/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,14 @@ def forward_dynamics(
self,
base_transform: np.ndarray,
joint_positions: np.ndarray,
base_velocity: np.ndarray,
joint_velocities: np.ndarray,
joint_torques: np.ndarray,
) -> np.ndarray:
"""Returns the forward dynamics of the floating-base dynamics equation,
using a reduced RNEA (no acceleration and external forces)
"""Returns base and joints accelerations of the floating-base dynamics equation
Args:
base_transform (np.ndarray): The homogenous transform from base to world frame
joint_positions (np.ndarray): The joints position
base_velocity (np.ndarray): The base velocity in mixed representation
joint_velocities (np.ndarray): The joint velocities
joint_torques (np.ndarray): The joint torques
Expand All @@ -270,7 +267,6 @@ def forward_dynamics(
return self.rbdalgos.aba(
base_transform,
joint_positions,
base_velocity.reshape(6, 1),
joint_velocities,
joint_torques,
self.g,
Expand Down
5 changes: 1 addition & 4 deletions src/adam/pytorch/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,14 @@ def forward_dynamic(
self,
base_transform: torch.Tensor,
joint_positions: torch.Tensor,
base_velocity: torch.Tensor,
joint_velocities: torch.Tensor,
joint_torques: torch.Tensor,
) -> torch.Tensor:
"""Returns the forward dynamics of the floating-base system
"""Returns base and joints accelerations of the floating-base dynamics equation
Args:
base_transform (torch.tensor): The homogenous transform from base to world frame
joint_positions (torch.tensor): The joints positions
base_velocity (torch.tensor): The base velocity in mixed representation
joint_velocities (torch.tensor): The joints velocities
joint_torques (torch.tensor): The joints torques
Expand All @@ -275,7 +273,6 @@ def forward_dynamic(
return self.rbdalgos.aba(
base_transform,
joint_positions,
base_velocity.reshape(6, 1),
joint_velocities,
joint_torques,
self.g,
Expand Down

0 comments on commit 7644a2b

Please sign in to comment.