isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.31k stars 951 forks source link

[Proposal] Change Imu accelerations to physx.tensor.api instead of finite difference #1294

Open jtigue-bdai opened 1 month ago

jtigue-bdai commented 1 month ago

Proposal

Investigate the use of physx.tensor.api for body acceleration calculations in IMU sensor using Using Isaac Sim 4.2. Previous versions of the accelerations had some bugs with regard to accuracy.

Motivation

Currently the IMU sensor utilizes a finite difference model for acceleration. This produces significant noise when in contact/noisy-velocity and is dependent on sample rate.

Alternatives

Leave current implementation.

Additional context

In order to provide the accelerations in the correct frame they will need to be moved to the link frame because they are provided at the center of mass (COM) frame. Code to do this is shown below: NOTE: currently the physx API generates errors when using small masses, will switch back to it once fixed

# obtain the acceleration of the link COM
lin_acc_w, ang_acc_w = self._view.get_accelerations()[env_ids].split([3, 3], dim=-1)
# # if an offset is present or the COM does not agree with the link origin, the linear acceleration has to
# # be transformed taking the angular velocity and acceleration into account
lin_acc_w += torch.cross(ang_acc_w, math_utils.quat_rotate(quat_w, self._offset_pos_b[env_ids] - self._com_pos_b[env_ids]), dim=-1) + torch.cross(
    ang_vel_w, torch.cross(ang_vel_w, math_utils.quat_rotate(quat_w, self._offset_pos_b[env_ids] - self._com_pos_b[env_ids]), dim=-1), dim=-1
)

Checklist

Acceptance Criteria

Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.

jtigue-bdai commented 1 month ago