Skip to content

Commit 4509f81

Browse files
committed
fix: mode for async joint control and move_home
1 parent 65758b2 commit 4509f81

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • extensions/rcs_xarm7/src/rcs_xarm7

extensions/rcs_xarm7/src/rcs_xarm7/hw.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ def move_home(self) -> None:
7575
np.ndarray[tuple[typing.Literal[7]], np.dtype[np.float64]],
7676
common.robots_meta_config(common.RobotType.XArm7).q_home,
7777
)
78-
self.set_joint_position(home)
78+
# self.set_joint_position(home)
79+
self._xarm.set_mode(0)
80+
self._xarm.set_state(0)
81+
self._xarm.set_servo_angle(angle=home, is_radian=True, wait=True)
7982

8083
def reset(self) -> None:
8184
pass
@@ -89,6 +92,9 @@ def set_cartesian_position(self, pose: common.Pose) -> None:
8992
self._xarm.set_position(x_mm, y_mm, z_mm, roll, pitch, yaw, is_radian=True, wait=not self._config.async_control)
9093

9194
def set_joint_position(self, q: np.ndarray[tuple[typing.Literal[7]], np.dtype[np.float64]]) -> None: # type: ignore
95+
if self._config.async_control:
96+
self._xarm.set_mode(6)
97+
self._xarm.set_state(0)
9298
self._xarm.set_servo_angle(angle=q, is_radian=True, wait=not self._config.async_control)
9399

94100
def close(self):

0 commit comments

Comments
 (0)