Skip to content

Commit

Permalink
Add function of getting body pose
Browse files Browse the repository at this point in the history
  • Loading branch information
xkiixkii committed Aug 14, 2024
1 parent fdc7777 commit bd879d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deformable_gym/helpers/mj_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ def remove_body(model: mujoco.MjModel, data: mujoco.MjData, name: str) -> None:
mujoco.mj_forward(model, data)


def get_body_pos(
def get_body_pose(
model: mujoco.MjModel, data: mujoco.MjModel, name: str
) -> NDArray:
) -> Pose:
names = get_body_names(model)
assert (
name in names
), f"No body named {name} in the model.\n Names available: {names}"

return data.body(name).xpos
return Pose(data.body(name).xpos, data.body(name).xquat)


def get_body_com(
Expand Down

0 comments on commit bd879d2

Please sign in to comment.