Skip to content

Commit 2bce367

Browse files
committed
Hotfix: haptic actuation in simulation mode
Current version introduced a bug in haptic actuation mode when run without HIL.
1 parent 413b41b commit 2bce367

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/dm_robotics/panda/arm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ def __init__(self, robot_params: params.RobotParams, arm: robot_arm.RobotArm):
372372
robot_params: Dataclass containing robot parameters.
373373
arm: The MoMa arm to control.
374374
"""
375-
super().__init__(arm, None, robot_params.name)
375+
override = None
376+
if robot_params.actuation == consts.Actuation.HAPTIC:
377+
override = [(0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)]
378+
super().__init__(arm, override, robot_params.name)
376379
self._robot_params = robot_params
377380

378381
def after_compile(self, mjcf_model: mjcf.RootElement,

src/dm_robotics/panda/arm_constants.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,5 @@ class Actuation(enum.Enum):
5656
ACTUATION_LIMITS = {
5757
Actuation.CARTESIAN_VELOCITY: VELOCITY_LIMITS,
5858
Actuation.JOINT_VELOCITY: VELOCITY_LIMITS,
59-
Actuation.HAPTIC: {
60-
'min': (-1, -1, -1, -1, -1, -1, -1),
61-
'max': (1, 1, 1, 1, 1, 1, 1),
62-
},
59+
Actuation.HAPTIC: JOINT_LIMITS,
6360
}

src/dm_robotics/panda/hardware.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def set_control(self, physics: mjcf.Physics, command: np.ndarray) -> None:
6262
if self.actuation == arm_constants.Actuation.HAPTIC:
6363
self.controller.set_control(
6464
physics.bind(self._arm.joints).qfrc_constraint * .1)
65-
command = np.array(self.hardware.get_state().q, dtype=np.float32)
66-
super().set_control(physics, command)
6765

6866
def close(self):
6967
self.hardware.stop_controller()

0 commit comments

Comments
 (0)