Skip to content

Commit 35f72f1

Browse files
nimrod-gileadicopybara-github
authored andcommitted
Fix a crash in dm_control Python viewer during perturbations.
The action enum used to be an integer with the old Python bindings, but now it's an enum the NONE action evaluates as true. PiperOrigin-RevId: 586990491 Change-Id: I0b366c2c87c9d6bae1f7c8c0aaeec619aa434704
1 parent c2959e6 commit 35f72f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dm_control/viewer/renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def start_move(self, action, grab_pos):
254254

255255
def tick_move(self, viewport_offset):
256256
"""Transforms object's location/rotation by the specified amount."""
257-
if self._action:
257+
if self._action and self._action != mujoco.mjtMouse.mjMOUSE_NONE:
258258
mujoco.mjv_movePerturb(self._model.ptr, self._data.ptr, self._action,
259259
viewport_offset[0], viewport_offset[1],
260260
self._scene.ptr, self._perturb.ptr)

0 commit comments

Comments
 (0)