Skip to content

why is projected_gravity calculated from quat_rotate instead of quat_rotate_inverse? #168

@DeeDive

Description

@DeeDive

Hello authors,

I notice the code here, the base_lin_vel and base_ang_vel is calculated from quat_rotate_inverse; but the projected gravity is from quat_rotate;

base_ang_vel = quat_rotate_inverse(torso_rotation, ang_velocity) * self.ang_vel_scale projected_gravity = quat_rotate(torso_rotation, self.gravity_vec)

https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs/blob/4948d18d042ec4f26625b67ce09afaa4b9dcbcc3/omniisaacgymenvs/tasks/anymal.py#L153-L154

While in similar implementations like legged_gym,

self.base_ang_vel[:] = quat_rotate_inverse(self.base_quat, self.root_states[:, 10:13]) self.projected_gravity[:] = quat_rotate_inverse(self.base_quat, self.gravity_vec)

https://github.com/leggedrobotics/legged_gym/blob/20f7f92e89865084b958895d988513108b307e6c/legged_gym/envs/base/legged_robot.py#L120

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions