Skip to content

Commit

Permalink
Inverts SE-2 keyboard device actions (Z, X) for yaw command (isaac-si…
Browse files Browse the repository at this point in the history
…m#1030)

# Description

This MR swaps the keyboard command (X, Z) for yaw in the `Se2Keyboard` class
to have the following mapping:
- Z - positive yaw
- X - negative yaw

It also corrects the docstring of the `Se2Keyboard` class.

Fixes isaac-sim#1029

_Note:_ I double checked the `Se3Keyboard` class and the implementation
there is correct.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## 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
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have run all the tests with `./isaaclab.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
  • Loading branch information
riccardorancan authored Sep 25, 2024
1 parent 18a208e commit cb4dd54
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Se2Keyboard(DeviceBase):
====================== ========================= ========================
Move along x-axis Numpad 8 / Arrow Up Numpad 2 / Arrow Down
Move along y-axis Numpad 4 / Arrow Right Numpad 6 / Arrow Left
Rotate along z-axis Numpad 7 / X Numpad 9 / Y
Rotate along z-axis Numpad 7 / Z Numpad 9 / X
====================== ========================= ========================
.. seealso::
Expand Down Expand Up @@ -82,8 +82,8 @@ def __str__(self) -> str:
msg += "\tMove backward (along x-axis): Numpad 2 / Arrow Down\n"
msg += "\tMove right (along y-axis): Numpad 4 / Arrow Right\n"
msg += "\tMove left (along y-axis): Numpad 6 / Arrow Left\n"
msg += "\tYaw positively (along z-axis): Numpad 7 / X\n"
msg += "\tYaw negatively (along z-axis): Numpad 9 / Y"
msg += "\tYaw positively (along z-axis): Numpad 7 / Z\n"
msg += "\tYaw negatively (along z-axis): Numpad 9 / X"
return msg

"""
Expand Down Expand Up @@ -160,8 +160,8 @@ def _create_key_bindings(self):
"RIGHT": np.asarray([0.0, -1.0, 0.0]) * self.v_y_sensitivity,
# yaw command (positive)
"NUMPAD_7": np.asarray([0.0, 0.0, 1.0]) * self.omega_z_sensitivity,
"X": np.asarray([0.0, 0.0, 1.0]) * self.omega_z_sensitivity,
"Z": np.asarray([0.0, 0.0, 1.0]) * self.omega_z_sensitivity,
# yaw command (negative)
"NUMPAD_9": np.asarray([0.0, 0.0, -1.0]) * self.omega_z_sensitivity,
"Z": np.asarray([0.0, 0.0, -1.0]) * self.omega_z_sensitivity,
"X": np.asarray([0.0, 0.0, -1.0]) * self.omega_z_sensitivity,
}

0 comments on commit cb4dd54

Please sign in to comment.