Skip to content

Commit cdc6640

Browse files
jtigue-bdaiMayankm96kellyguo11
authored
Changes to quat_apply and quat_apply_inverse for speed (#2129)
# Description As per findings in #1711, `quat_apply` was found to be faster that `quat_rotate`. This PR: - adds `quat_apply_inverse` - changes all instances of `quat_rotate` and `quat_rotate_inverse` to their apply counterparts. Fixes #1711 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Screenshots | Per 1000 | cpu | cuda | |:----------|:-------:|:---------:| |**quat_apply:** | **217.91 us** | **47.07 us**| |einsum_quat_rotate: | 295.95 us | 127.62 us| |iter_quat_apply: | 679.10 us | 850.25 us| |iter_bmm_quat_rotate: | 829.62 us | 1.28 ms| |iter_einsum_quat_rotate: | 937.73 us | 1.46 ms| |**quat_apply_inverse:** | **212.20 us** | **48.43 us**| |einsum_quat_rotate_inverse: | 278.43 us | 114.25 us| |iter_quat_apply_inverse: | 681.85 us | 774.82 us| |iter_bmm_quat_rotate_inverse: | 863.27 us | 1.23 ms| |iter_einsum_quat_rotate_inverse: | 1.04 ms | 1.45 ms| ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: James Tigue <166445701+jtigue-bdai@users.noreply.github.com> Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: Kelly Guo <kellyg@nvidia.com> Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Co-authored-by: Kelly Guo <kellyg@nvidia.com>
1 parent 3b6d615 commit cdc6640

File tree

21 files changed

+420
-245
lines changed

21 files changed

+420
-245
lines changed

scripts/tutorials/05_controllers/run_osc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
from isaaclab.utils.math import (
5050
combine_frame_transforms,
5151
matrix_from_quat,
52+
quat_apply_inverse,
5253
quat_inv,
53-
quat_rotate_inverse,
5454
subtract_frame_transforms,
5555
)
5656

@@ -336,8 +336,8 @@ def update_states(
336336
ee_vel_w = robot.data.body_vel_w[:, ee_frame_idx, :] # Extract end-effector velocity in the world frame
337337
root_vel_w = robot.data.root_vel_w # Extract root velocity in the world frame
338338
relative_vel_w = ee_vel_w - root_vel_w # Compute the relative velocity in the world frame
339-
ee_lin_vel_b = quat_rotate_inverse(robot.data.root_quat_w, relative_vel_w[:, 0:3]) # From world to root frame
340-
ee_ang_vel_b = quat_rotate_inverse(robot.data.root_quat_w, relative_vel_w[:, 3:6])
339+
ee_lin_vel_b = quat_apply_inverse(robot.data.root_quat_w, relative_vel_w[:, 0:3]) # From world to root frame
340+
ee_ang_vel_b = quat_apply_inverse(robot.data.root_quat_w, relative_vel_w[:, 3:6])
341341
ee_vel_b = torch.cat([ee_lin_vel_b, ee_ang_vel_b], dim=-1)
342342

343343
# Calculate the contact force

source/isaaclab/config/extension.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.39.7"
4+
version = "0.40.0"
5+
56

67
# Description
78
title = "Isaac Lab framework for Robot Learning"

source/isaaclab/docs/CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Changelog
22
---------
33

4+
0.40.0 (2025-05-16)
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Added
8+
^^^^^
9+
10+
* Added deprecation warning for :meth:`~isaaclab.utils.math.quat_rotate` and
11+
:meth:`~isaaclab.utils.math.quat_rotate_inverse`
12+
13+
Changed
14+
^^^^^^^
15+
16+
* Changed all calls to :meth:`~isaaclab.utils.math.quat_rotate` and :meth:`~isaaclab.utils.math.quat_rotate_inverse` to
17+
:meth:`~isaaclab.utils.math.quat_apply` and :meth:`~isaaclab.utils.math.quat_apply_inverse` for speed.
18+
19+
420
0.39.7 (2025-05-19)
521
~~~~~~~~~~~~~~~~~~~
622

source/isaaclab/isaaclab/assets/articulation/articulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def write_root_com_pose_to_sim(self, root_pose: torch.Tensor, env_ids: Sequence[
391391
root_link_pos, root_link_quat = math_utils.combine_frame_transforms(
392392
root_pose[..., :3],
393393
root_pose[..., 3:7],
394-
math_utils.quat_rotate(math_utils.quat_inv(com_quat), -com_pos),
394+
math_utils.quat_apply(math_utils.quat_inv(com_quat), -com_pos),
395395
math_utils.quat_inv(com_quat),
396396
)
397397

@@ -465,7 +465,7 @@ def write_root_link_velocity_to_sim(self, root_velocity: torch.Tensor, env_ids:
465465
com_pos_b = self.data.com_pos_b[env_ids, 0, :]
466466
# transform given velocity to center of mass
467467
root_com_velocity[:, :3] += torch.linalg.cross(
468-
root_com_velocity[:, 3:], math_utils.quat_rotate(quat, com_pos_b), dim=-1
468+
root_com_velocity[:, 3:], math_utils.quat_apply(quat, com_pos_b), dim=-1
469469
)
470470
# write center of mass velocity to sim
471471
self.write_root_com_velocity_to_sim(root_velocity=root_com_velocity, env_ids=physx_env_ids)

source/isaaclab/isaaclab/assets/articulation/articulation_data.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def root_link_state_w(self):
395395

396396
# adjust linear velocity to link from center of mass
397397
velocity[:, :3] += torch.linalg.cross(
398-
velocity[:, 3:], math_utils.quat_rotate(pose[:, 3:7], -self.com_pos_b[:, 0, :]), dim=-1
398+
velocity[:, 3:], math_utils.quat_apply(pose[:, 3:7], -self.com_pos_b[:, 0, :]), dim=-1
399399
)
400400
# set the buffer data and timestamp
401401
self._root_link_state_w.data = torch.cat((pose, velocity), dim=-1)
@@ -463,7 +463,7 @@ def body_link_state_w(self):
463463

464464
# adjust linear velocity to link from center of mass
465465
velocity[..., :3] += torch.linalg.cross(
466-
velocity[..., 3:], math_utils.quat_rotate(pose[..., 3:7], -self.com_pos_b), dim=-1
466+
velocity[..., 3:], math_utils.quat_apply(pose[..., 3:7], -self.com_pos_b), dim=-1
467467
)
468468
# set the buffer data and timestamp
469469
self._body_link_state_w.data = torch.cat((pose, velocity), dim=-1)
@@ -529,7 +529,7 @@ def body_incoming_joint_wrench_b(self) -> torch.Tensor:
529529
@property
530530
def projected_gravity_b(self):
531531
"""Projection of the gravity direction on base frame. Shape is (num_instances, 3)."""
532-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.GRAVITY_VEC_W)
532+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.GRAVITY_VEC_W)
533533

534534
@property
535535
def heading_w(self):
@@ -624,7 +624,7 @@ def root_lin_vel_b(self) -> torch.Tensor:
624624
This quantity is the linear velocity of the articulation root's center of mass frame relative to the world
625625
with respect to the articulation root's actor frame.
626626
"""
627-
return math_utils.quat_rotate_inverse(self.root_quat_w, self.root_lin_vel_w)
627+
return math_utils.quat_apply_inverse(self.root_quat_w, self.root_lin_vel_w)
628628

629629
@property
630630
def root_ang_vel_b(self) -> torch.Tensor:
@@ -633,7 +633,7 @@ def root_ang_vel_b(self) -> torch.Tensor:
633633
This quantity is the angular velocity of the articulation root's center of mass frame relative to the world with
634634
respect to the articulation root's actor frame.
635635
"""
636-
return math_utils.quat_rotate_inverse(self.root_quat_w, self.root_ang_vel_w)
636+
return math_utils.quat_apply_inverse(self.root_quat_w, self.root_ang_vel_w)
637637

638638
##
639639
# Derived Root Link Frame Properties
@@ -696,7 +696,7 @@ def root_link_lin_vel_b(self) -> torch.Tensor:
696696
This quantity is the linear velocity of the actor frame of the root rigid body frame with respect to the
697697
rigid body's actor frame.
698698
"""
699-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_link_lin_vel_w)
699+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_link_lin_vel_w)
700700

701701
@property
702702
def root_link_ang_vel_b(self) -> torch.Tensor:
@@ -705,7 +705,7 @@ def root_link_ang_vel_b(self) -> torch.Tensor:
705705
This quantity is the angular velocity of the actor frame of the root rigid body frame with respect to the
706706
rigid body's actor frame.
707707
"""
708-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_link_ang_vel_w)
708+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_link_ang_vel_w)
709709

710710
##
711711
# Root Center of Mass state properties
@@ -771,7 +771,7 @@ def root_com_lin_vel_b(self) -> torch.Tensor:
771771
This quantity is the linear velocity of the root rigid body's center of mass frame with respect to the
772772
rigid body's actor frame.
773773
"""
774-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_com_lin_vel_w)
774+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_com_lin_vel_w)
775775

776776
@property
777777
def root_com_ang_vel_b(self) -> torch.Tensor:
@@ -780,7 +780,7 @@ def root_com_ang_vel_b(self) -> torch.Tensor:
780780
This quantity is the angular velocity of the root rigid body's center of mass frame with respect to the
781781
rigid body's actor frame.
782782
"""
783-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_com_ang_vel_w)
783+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_com_ang_vel_w)
784784

785785
@property
786786
def body_pos_w(self) -> torch.Tensor:

source/isaaclab/isaaclab/assets/rigid_object/rigid_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def write_root_com_pose_to_sim(self, root_pose: torch.Tensor, env_ids: Sequence[
259259
root_link_pos, root_link_quat = math_utils.combine_frame_transforms(
260260
root_pose[..., :3],
261261
root_pose[..., 3:7],
262-
math_utils.quat_rotate(math_utils.quat_inv(com_quat), -com_pos),
262+
math_utils.quat_apply(math_utils.quat_inv(com_quat), -com_pos),
263263
math_utils.quat_inv(com_quat),
264264
)
265265

@@ -333,7 +333,7 @@ def write_root_link_velocity_to_sim(self, root_velocity: torch.Tensor, env_ids:
333333
com_pos_b = self.data.com_pos_b[local_env_ids, 0, :]
334334
# transform given velocity to center of mass
335335
root_com_velocity[:, :3] += torch.linalg.cross(
336-
root_com_velocity[:, 3:], math_utils.quat_rotate(quat, com_pos_b), dim=-1
336+
root_com_velocity[:, 3:], math_utils.quat_apply(quat, com_pos_b), dim=-1
337337
)
338338
# write center of mass velocity to sim
339339
self.write_root_com_velocity_to_sim(root_velocity=root_com_velocity, env_ids=env_ids)

source/isaaclab/isaaclab/assets/rigid_object/rigid_object_data.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def root_link_state_w(self):
142142

143143
# adjust linear velocity to link from center of mass
144144
velocity[:, :3] += torch.linalg.cross(
145-
velocity[:, 3:], math_utils.quat_rotate(pose[:, 3:7], -self.com_pos_b[:, 0, :]), dim=-1
145+
velocity[:, 3:], math_utils.quat_apply(pose[:, 3:7], -self.com_pos_b[:, 0, :]), dim=-1
146146
)
147147
# set the buffer data and timestamp
148148
self._root_link_state_w.data = torch.cat((pose, velocity), dim=-1)
@@ -218,7 +218,7 @@ def body_acc_w(self):
218218
@property
219219
def projected_gravity_b(self):
220220
"""Projection of the gravity direction on base frame. Shape is (num_instances, 3)."""
221-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.GRAVITY_VEC_W)
221+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.GRAVITY_VEC_W)
222222

223223
@property
224224
def heading_w(self):
@@ -282,7 +282,7 @@ def root_lin_vel_b(self) -> torch.Tensor:
282282
This quantity is the linear velocity of the root rigid body's center of mass frame with respect to the
283283
rigid body's actor frame.
284284
"""
285-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_lin_vel_w)
285+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_lin_vel_w)
286286

287287
@property
288288
def root_ang_vel_b(self) -> torch.Tensor:
@@ -291,7 +291,7 @@ def root_ang_vel_b(self) -> torch.Tensor:
291291
This quantity is the angular velocity of the root rigid body's center of mass frame with respect to the
292292
rigid body's actor frame.
293293
"""
294-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_ang_vel_w)
294+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_ang_vel_w)
295295

296296
@property
297297
def root_link_pos_w(self) -> torch.Tensor:
@@ -350,7 +350,7 @@ def root_link_lin_vel_b(self) -> torch.Tensor:
350350
This quantity is the linear velocity of the actor frame of the root rigid body frame with respect to the
351351
rigid body's actor frame.
352352
"""
353-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_link_lin_vel_w)
353+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_link_lin_vel_w)
354354

355355
@property
356356
def root_link_ang_vel_b(self) -> torch.Tensor:
@@ -359,7 +359,7 @@ def root_link_ang_vel_b(self) -> torch.Tensor:
359359
This quantity is the angular velocity of the actor frame of the root rigid body frame with respect to the
360360
rigid body's actor frame.
361361
"""
362-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_link_ang_vel_w)
362+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_link_ang_vel_w)
363363

364364
@property
365365
def root_com_pos_w(self) -> torch.Tensor:
@@ -420,7 +420,7 @@ def root_com_lin_vel_b(self) -> torch.Tensor:
420420
This quantity is the linear velocity of the root rigid body's center of mass frame with respect to the
421421
rigid body's actor frame.
422422
"""
423-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_com_lin_vel_w)
423+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_com_lin_vel_w)
424424

425425
@property
426426
def root_com_ang_vel_b(self) -> torch.Tensor:
@@ -429,7 +429,7 @@ def root_com_ang_vel_b(self) -> torch.Tensor:
429429
This quantity is the angular velocity of the root rigid body's center of mass frame with respect to the
430430
rigid body's actor frame.
431431
"""
432-
return math_utils.quat_rotate_inverse(self.root_link_quat_w, self.root_com_ang_vel_w)
432+
return math_utils.quat_apply_inverse(self.root_link_quat_w, self.root_com_ang_vel_w)
433433

434434
@property
435435
def body_pos_w(self) -> torch.Tensor:

source/isaaclab/isaaclab/assets/rigid_object_collection/rigid_object_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def write_object_com_pose_to_sim(
368368
object_link_pos, object_link_quat = math_utils.combine_frame_transforms(
369369
object_pose[..., :3],
370370
object_pose[..., 3:7],
371-
math_utils.quat_rotate(math_utils.quat_inv(com_quat), -com_pos),
371+
math_utils.quat_apply(math_utils.quat_inv(com_quat), -com_pos),
372372
math_utils.quat_inv(com_quat),
373373
)
374374

@@ -465,7 +465,7 @@ def write_object_link_velocity_to_sim(
465465
com_pos_b = self.data.com_pos_b[local_env_ids][:, local_object_ids, :]
466466
# transform given velocity to center of mass
467467
object_com_velocity[..., :3] += torch.linalg.cross(
468-
object_com_velocity[..., 3:], math_utils.quat_rotate(quat, com_pos_b), dim=-1
468+
object_com_velocity[..., 3:], math_utils.quat_apply(quat, com_pos_b), dim=-1
469469
)
470470
# write center of mass velocity to sim
471471
self.write_object_com_velocity_to_sim(

source/isaaclab/isaaclab/assets/rigid_object_collection/rigid_object_collection_data.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def object_link_state_w(self):
150150

151151
# adjust linear velocity to link from center of mass
152152
velocity[..., :3] += torch.linalg.cross(
153-
velocity[..., 3:], math_utils.quat_rotate(pose[..., 3:7], -self.com_pos_b[..., :]), dim=-1
153+
velocity[..., 3:], math_utils.quat_apply(pose[..., 3:7], -self.com_pos_b[..., :]), dim=-1
154154
)
155155

156156
# set the buffer data and timestamp
@@ -198,7 +198,7 @@ def object_acc_w(self):
198198
@property
199199
def projected_gravity_b(self):
200200
"""Projection of the gravity direction on base frame. Shape is (num_instances, num_objects, 3)."""
201-
return math_utils.quat_rotate_inverse(self.object_link_quat_w, self.GRAVITY_VEC_W)
201+
return math_utils.quat_apply_inverse(self.object_link_quat_w, self.GRAVITY_VEC_W)
202202

203203
@property
204204
def heading_w(self):
@@ -262,7 +262,7 @@ def object_lin_vel_b(self) -> torch.Tensor:
262262
This quantity is the linear velocity of the rigid bodies' center of mass frame with respect to the
263263
rigid body's actor frame.
264264
"""
265-
return math_utils.quat_rotate_inverse(self.object_quat_w, self.object_lin_vel_w)
265+
return math_utils.quat_apply_inverse(self.object_quat_w, self.object_lin_vel_w)
266266

267267
@property
268268
def object_ang_vel_b(self) -> torch.Tensor:
@@ -271,7 +271,7 @@ def object_ang_vel_b(self) -> torch.Tensor:
271271
This quantity is the angular velocity of the rigid bodies' center of mass frame with respect to the
272272
rigid body's actor frame.
273273
"""
274-
return math_utils.quat_rotate_inverse(self.object_quat_w, self.object_ang_vel_w)
274+
return math_utils.quat_apply_inverse(self.object_quat_w, self.object_ang_vel_w)
275275

276276
@property
277277
def object_lin_acc_w(self) -> torch.Tensor:
@@ -345,7 +345,7 @@ def object_link_lin_vel_b(self) -> torch.Tensor:
345345
This quantity is the linear velocity of the actor frame of the root rigid body frame with respect to the
346346
rigid body's actor frame.
347347
"""
348-
return math_utils.quat_rotate_inverse(self.object_link_quat_w, self.object_link_lin_vel_w)
348+
return math_utils.quat_apply_inverse(self.object_link_quat_w, self.object_link_lin_vel_w)
349349

350350
@property
351351
def object_link_ang_vel_b(self) -> torch.Tensor:
@@ -354,7 +354,7 @@ def object_link_ang_vel_b(self) -> torch.Tensor:
354354
This quantity is the angular velocity of the actor frame of the root rigid body frame with respect to the
355355
rigid body's actor frame.
356356
"""
357-
return math_utils.quat_rotate_inverse(self.object_link_quat_w, self.object_link_ang_vel_w)
357+
return math_utils.quat_apply_inverse(self.object_link_quat_w, self.object_link_ang_vel_w)
358358

359359
@property
360360
def object_com_pos_w(self) -> torch.Tensor:
@@ -415,7 +415,7 @@ def object_com_lin_vel_b(self) -> torch.Tensor:
415415
This quantity is the linear velocity of the center of mass frame of the root rigid body frame with respect to the
416416
rigid body's actor frame.
417417
"""
418-
return math_utils.quat_rotate_inverse(self.object_link_quat_w, self.object_com_lin_vel_w)
418+
return math_utils.quat_apply_inverse(self.object_link_quat_w, self.object_com_lin_vel_w)
419419

420420
@property
421421
def object_com_ang_vel_b(self) -> torch.Tensor:
@@ -424,7 +424,7 @@ def object_com_ang_vel_b(self) -> torch.Tensor:
424424
This quantity is the angular velocity of the center of mass frame of the root rigid body frame with respect to the
425425
rigid body's actor frame.
426426
"""
427-
return math_utils.quat_rotate_inverse(self.object_link_quat_w, self.object_com_ang_vel_w)
427+
return math_utils.quat_apply_inverse(self.object_link_quat_w, self.object_com_ang_vel_w)
428428

429429
@property
430430
def com_pos_b(self) -> torch.Tensor:

source/isaaclab/isaaclab/envs/mdp/actions/task_space_actions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,13 +622,13 @@ def _compute_ee_velocity(self):
622622
relative_vel_w = self._ee_vel_w - self._asset.data.root_vel_w
623623

624624
# Convert ee velocities from world to root frame
625-
self._ee_vel_b[:, 0:3] = math_utils.quat_rotate_inverse(self._asset.data.root_quat_w, relative_vel_w[:, 0:3])
626-
self._ee_vel_b[:, 3:6] = math_utils.quat_rotate_inverse(self._asset.data.root_quat_w, relative_vel_w[:, 3:6])
625+
self._ee_vel_b[:, 0:3] = math_utils.quat_apply_inverse(self._asset.data.root_quat_w, relative_vel_w[:, 0:3])
626+
self._ee_vel_b[:, 3:6] = math_utils.quat_apply_inverse(self._asset.data.root_quat_w, relative_vel_w[:, 3:6])
627627

628628
# Account for the offset
629629
if self.cfg.body_offset is not None:
630630
# Compute offset vector in root frame
631-
r_offset_b = math_utils.quat_rotate(self._ee_pose_b_no_offset[:, 3:7], self._offset_pos)
631+
r_offset_b = math_utils.quat_apply(self._ee_pose_b_no_offset[:, 3:7], self._offset_pos)
632632
# Adjust the linear velocity to account for the offset
633633
self._ee_vel_b[:, :3] += torch.cross(self._ee_vel_b[:, 3:], r_offset_b, dim=-1)
634634
# Angular velocity is not affected by the offset
@@ -640,7 +640,7 @@ def _compute_ee_force(self):
640640
self._contact_sensor.update(self._sim_dt)
641641
self._ee_force_w[:] = self._contact_sensor.data.net_forces_w[:, 0, :] # type: ignore
642642
# Rotate forces and torques into root frame
643-
self._ee_force_b[:] = math_utils.quat_rotate_inverse(self._asset.data.root_quat_w, self._ee_force_w)
643+
self._ee_force_b[:] = math_utils.quat_apply_inverse(self._asset.data.root_quat_w, self._ee_force_w)
644644

645645
def _compute_joint_states(self):
646646
"""Computes the joint states for operational space control."""

0 commit comments

Comments
 (0)