in robogym/viewer/robot_control_viewer.py [0:0]
def _press_key_callback(self, window, key, scancode, mods):
"""
Key callback on press action.
"""
if key == glfw.KEY_X:
self.action = self._discretize(self.controller.move_z(Direction.NEG))
elif key == glfw.KEY_Z:
self.action = self._discretize(self.controller.move_z(Direction.POS))
elif key == glfw.KEY_V:
self.action = self._discretize(self.controller.move_gripper(Direction.NEG))
elif key == glfw.KEY_C:
self.action = self._discretize(self.controller.move_gripper(Direction.POS))
elif key == glfw.KEY_UP:
self.action = self._discretize(self.controller.move_x(Direction.NEG))
elif key == glfw.KEY_DOWN:
self.action = self._discretize(self.controller.move_x(Direction.POS))
elif key == glfw.KEY_LEFT:
self.action = self._discretize(self.controller.move_y(Direction.NEG))
elif key == glfw.KEY_RIGHT:
self.action = self._discretize(self.controller.move_y(Direction.POS))
elif key == glfw.KEY_Q:
self.action = self._discretize(self.controller.rotate_wrist(Direction.POS))
elif key == glfw.KEY_W:
self.action = self._discretize(self.controller.rotate_wrist(Direction.NEG))
elif key == glfw.KEY_Y:
self.action = self._discretize(self.controller.tilt_gripper(Direction.POS))
elif key == glfw.KEY_U:
self.action = self._discretize(self.controller.tilt_gripper(Direction.NEG))
else:
super().key_callback(window, key, scancode, glfw.PRESS, mods)