Control Module
Capability overview
-
Chassis Control Interface: Supports chassis control mode switching, global position movement, relative position movement, and forward/backward velocity control, and provides virtual zero point setting, pose, odometry, and real-time motion status feedback.
-
Head control interface: Supports head pitch and yaw attitude control and attitude reset, and provides head attitude, joint state, and motor status feedback.
-
Robotic arm control interface: Supports dual-arm control mode configuration, joint position control and end-effector pose control for left and right robotic arms, and provides joint state and end-effector pose feedback.
-
Master arm control interface: When the robot is configured with master arm hardware and related services, it supports left and right master arm control mode configuration, joint position and end-effector pose control, and provides joint state, end-effector pose, and trigger input feedback.
-
Gripper control interface: Supports opening/closing position control for left and right grippers, and provides gripper position and joint state feedback.
-
Torso Lift Control Interface: Supports torso lift position control, and provides lift position and joint state feedback.
Robot Control Interface
set_manipulator_control_mode interface reference
| Field | Details |
|---|---|
| Function | set_manipulator_control_mode() |
| Signature | def set_manipulator_control_mode(manipulator_control_mode_param: ManipulatorControlModeParam, timeout) -> ExecutionResult |
| Description | Set the robot-arm control mode |
| Parameter | ManipulatorControlModeParam.mode: Robot-arm control mode. MANIPULATOR_END_POSE: End-effector pose control mode; this is the default when SDK mode is enabled. MANIPULATOR_JOINT_POSITIONS: Joint-position control mode. |
| Return Value | ExecutionResult |
| Notes | Setting the control mode separately for the left or right arm is not currently supported. Call this interface through robot_control. Do not switch control modes while the robot arms are moving, because doing so can cause an impact on the motors. |
Example:
robot.system.set_work_mode(
RobotModeParam(mode=RobotWorkMode.SDK)
)
robot.robot_control.set_manipulator_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_END_POSE
)
)get_manipulator_control_mode interface reference
| Field | Details |
|---|---|
| Function | get_manipulator_control_mode() |
| Signature | def get_manipulator_control_mode(timeout) -> ManipulatorControlModeParam |
| Description | Get the robot-arm control mode |
| Parameter | None |
| Return Value | ManipulatorControlModeParam |
| Notes | None |
Example:
mode = robot.robot_control.get_manipulator_control_mode()
print(mode)emergency_stop interface reference
| Field | Details |
|---|---|
| Function | emergency_stop() |
| Signature | None |
| Description | Stop robot motion in an emergency |
| Parameter | None |
| Return Value | ExecutionResult |
| Notes |
Example:
result = robot.robot_control.emergency_stop()
print(result.is_success)recover_emergency_stop interface reference
| Field | Details |
|---|---|
| Function | recover_emergency_stop() |
| Signature | None |
| Description | Recover from the emergency-stop state |
| Parameter | None |
| Return Value | ExecutionResult |
| Notes |
Example:
# Recovery
result = robot.robot_control.recover_emergency_stop()
print(result.is_success)homing interface reference
| Field | Details |
|---|---|
| Function | homing() |
| Signature | None |
| Description | Home the joints |
| Parameter | None |
| Return Value | ExecutionResult |
| Notes |
Example:
# Homing
result = robot.robot_control.homing()
print(result.is_success)Chassis Control Interface
Note: Please control the chassis in a relatively open area; otherwise, collisions may occur.
set_control_mode interface reference
| Field | Details |
|---|---|
| Function | set_control_mode() |
| Signature | def set_control_mode(manipulator_control_mode_param: ChassisControlModeParam, timeout) -> ExecutionResult |
| Description | Set the chassis control mode |
| Parameter | ChassisControlModeParam.mode: ChassisControlMode - Control mode |
| Return Value | ExecutionResult |
| Notes | Control modes: GLOBAL: Global absolute-position control relative to the map frame. RELATIVE: Relative-position control relative to the virtual zero point; recommended. VELOCITY: Direct velocity control. |
Example (refer to chassis_control.py in examples):
# Set to relative position control mode
robot.chassis.set_control_mode(
ChassisControlModeParam(mode=ChassisControlMode.RELATIVE)
)
robot.chassis.move_to_relative_position(
ChassisPosition(x=0.25, y=0.0, yaw=0.0)
)
# Set to absolute position control mode
robot.chassis.set_control_mode(
ChassisControlModeParam(mode=ChassisControlMode.GLOBAL)
)
robot.chassis.move_to_global_position(
ChassisPosition(
x=current_position.x + 0.25,
y=current_position.y,
yaw=current_position.yaw,
)
)get_control_mode interface reference
| Field | Details |
|---|---|
| Function | get_control_mode() |
| Signature | def get_control_mode(timeout) -> ChassisControlModeParam |
| Description | Get the current chassis control mode |
| Parameter | None |
| Return Value | ChassisControlModeParam |
| Notes |
Example:
mode = robot.chassis.get_control_mode()move_to_global_position interface reference
| Field | Details |
|---|---|
| Function | move_to_global_position() |
| Signature | def move_to_global_position(chassis_position: ChassisPosition, timeout) -> ExecutionResult |
| Description | Move to a global position after setting GLOBAL mode |
| Parameter | position: ChassisPosition - Target position (x, y, yaw) |
| Return Value | ExecutionResult |
| Notes | This interface uses the robot's built-in navigation mode. Before the first call, create and save a map. |
Example:
position = ChassisPosition(x=1.0, y=0.5, yaw=0.0)
result = robot.chassis.move_to_global_position(position)move_to_relative_position interface reference
| Field | Details |
|---|---|
| Function | move_to_relative_position() |
| Signature | def move_to_relative_position(chassis_position: ChassisPosition, timeout) -> ExecutionResult |
| Description | Move to a relative position after setting RELATIVE mode and a virtual zero point |
| Parameter | position: ChassisPosition - Target position (x, y, yaw) |
| Return Value | ExecutionResult |
| Notes | This interface uses the robot's built-in navigation mode. Before the first call, create and save a map. |
Example:
current_position = robot.chassis.get_global_position()
print(
f"Global position: x={current_position.x}, "
f"y={current_position.y}, yaw={current_position.yaw}"
)
robot.chassis.set_virtual_zero_point(current_position)
robot.chassis.set_control_mode(
ChassisControlModeParam(mode=ChassisControlMode.RELATIVE)
)
robot.chassis.move_to_relative_position(
ChassisPosition(x=0.25, y=0.0, yaw=0.0)
)set_velocity interface reference
| Field | Details |
|---|---|
| Function | set_velocity() |
| Signature | def set_velocity(chassis_velocity: ChassisVelocity, timeout) -> ExecutionResult |
| Description | Set velocity control after selecting VELOCITY mode. The Quanta One chassis supports linear velocity control only along the x-axis, for forward and backward motion. |
| Parameter | velocity: ChassisVelocity - Velocity (vel_x, vel_y, vel_yaw), in m/s and rad/s |
| Return Value | ExecutionResult |
| Notes | Parameter range: [-2.0, 2.0]. For safety, chassis velocity commands must be sent at a frequency greater than 10 Hz for the robot to respond. The caller must control the transmission frequency. This interface cannot move the chassis while the robot is charging. |
Example:
# Set velocity: 0.25 m/s in the x direction, lasting for 2 seconds
for i in range(40):
cur_velocity = ChassisVelocity(
vel_x=0.25,
vel_y=0.0,
vel_yaw=0.0,
)
robot.chassis.set_velocity(cur_velocity)
time.sleep(0.05)
time.sleep(0.5)set_virtual_zero_point interface reference
| Field | Details |
|---|---|
| Function | set_virtual_zero_point() |
| Signature | def set_virtual_zero_point(chassis_position: ChassisPosition, timeout) -> ExecutionResult |
| Description | Set the virtual zero point used as the origin for relative motion |
| Parameter | position: ChassisPosition - Target position (x, y, yaw) |
| Return Value | ExecutionResult |
| Notes | None |
Example:
current_position = robot.chassis.get_global_position()
print(
f"Global position: x={current_position.x}, "
f"y={current_position.y}, yaw={current_position.yaw}"
)
robot.chassis.set_virtual_zero_point(current_position)get_virtual_zero_point interface reference
| Field | Details |
|---|---|
| Function | get_virtual_zero_point() |
| Signature | def get_virtual_zero_point(timeout) -> ChassisPosition |
| Description | Get the virtual zero point |
| Parameter | None |
| Return Value | ChassisPosition |
| Notes | None |
Example:
position = robot.chassis.get_virtual_zero_point()get_global_position interface reference
| Field | Details |
|---|---|
| Function | get_global_position() |
| Signature | def get_global_position(timeout) -> ChassisPosition |
| Description | Get the global position |
| Parameter | None |
| Return Value | ChassisPosition |
| Notes | Localization must be running before this interface is called |
Example:
current_position = robot.chassis.get_global_position()
print(
f"Global position: x={current_position.x}, "
f"y={current_position.y}, yaw={current_position.yaw}"
)get_relative_position interface reference
| Field | Details |
|---|---|
| Function | get_relative_position() |
| Signature | def get_relative_position(timeout) -> ChassisPosition |
| Description | Get the relative position |
| Parameter | None |
| Return Value | ChassisPosition |
| Notes |
Examples (organized by interface name):
current_position = robot.chassis.get_relative_position()
print(
f"Relative position: x={current_position.x}, "
f"y={current_position.y}, yaw={current_position.yaw}"
)get_odometry interface reference
| Field | Details |
|---|---|
| Function | get_odometry() |
| Signature | def get_odometry(timeout) -> nav_msgs_.Odometry |
| Description | Get odometry |
| Parameter | None |
| Return Value | Odometry |
| Notes | None |
Example:
current_odometry = robot.chassis.get_odometry()
print(current_odometry)get_odometry_stream interface reference
| Field | Details |
|---|---|
| Function | get_odometry_stream() |
| Signature | def get_odometry_stream(timeout) -> Iterator[nav_msgs_.Odometry] |
| Description | Get an odometry data stream |
| Parameter | None |
| Return Value | Odometry iterator |
| Notes | None |
Example:
stream = robot.chassis.get_odometry_stream()
for msg in stream:
print(msg)get_pose_stream interface reference
| Field | Details |
|---|---|
| Function | get_pose_stream() |
| Signature | def get_pose_stream(timeout) -> Iterator[geometry_msgs_.PoseStamped] |
| Description | Get a pose data stream |
| Parameter | None |
| Return Value | PoseStamped iterator |
| Notes | None |
Example:
stream = robot.chassis.get_pose_stream()
for msg in stream:
print(msg)Head control interface
set_pose interface reference
| Field | Details |
|---|---|
| Function | set_pose() |
| Signature | def set_pose(head_pose: HeadPose, timeout) -> ExecutionResult |
| Description | Set the head pose |
| Parameter | pose: HeadPose - Head pose (pitch, yaw) |
| Return Value | ExecutionResult |
| Notes | Parameter ranges: pitch: [-0.06, 0.9]; yaw: [-1.20, 1.20] |
Example:
robot.head.set_pose(HeadPose(yaw=0.0, pitch=0.0))get_pose interface reference
| Field | Details |
|---|---|
| Function | get_pose() |
| Signature | def get_pose(timeout) -> HeadPose |
| Description | Get the head pose |
| Parameter | None |
| Return Value | HeadPose |
| Notes | None |
Example:
head_state = robot.head.get_pose()
print(head_state)reset interface reference
| Field | Details |
|---|---|
| Function | reset() |
| Signature | def reset(timeout) -> ExecutionResult |
| Description | Reset the head pose to pitch=0.0 and yaw=0.0 |
| Parameter | None |
| Return Value | ExecutionResult |
| Notes | None |
Example:
robot.head.reset()get_joint_states_stream interface reference
| Field | Details |
|---|---|
| Function | get_joint_states_stream() |
| Signature | def get_joint_states_stream(timeout) -> Iterator[sensor_msgs_.JointState] |
| Description | Get a head joint-state data stream |
| Parameter | None |
| Return Value | JointState iterator |
| Notes | None |
Example:
stream = robot.head.get_joint_states_stream()
for msg in stream:
print(msg)Robotic arm control interface
set_joint_positions interface reference
| Field | Details |
|---|---|
| Function | set_joint_positions() |
| Signature | def set_joint_positions(joint_positions: JointPositions, timeout) -> ExecutionResult |
| Description | Control robot-arm joint positions. First set SDK work mode and MANIPULATOR_JOINT_POSITIONS control mode. |
| Parameter | positions: JointPositions - Six joint positions in radians |
| Return Value | ExecutionResult |
| Notes | Parameter limits: Joints are ordered from shoulder to wrist. For the left arm: left_arm_joint1: [-2.792, 2.792]; left_arm_joint2: [0.0, 3.44]; left_arm_joint3: [-3.14, 0.0]; left_arm_joint4: [-1.57, 1.57]; left_arm_joint5: [-1.4, 1.4]; left_arm_joint6: [-1.745, 1.745]. A large difference between the target and current positions may cause substantial vibration. Increment gradually from the current position to the target. |
Example:
robot.system.set_work_mode(
RobotModeParam(mode=RobotWorkMode.SDK)
)
robot.robot_control.set_manipulator_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_JOINT_POSITIONS
)
)
joint_state = robot.right_arm.get_joint_states()
target_positions = list(joint_state.position)
target_positions[5] += 0.01
result = robot.right_arm.set_joint_positions(
JointPositions(positions=target_positions)
)
print(result)set_end_pose interface reference
| Field | Details |
|---|---|
| Function | set_end_pose() |
| Signature | def set_end_pose(pose: geometry_msgs_.Pose, timeout) -> ExecutionResult |
| Description | Control the robot-arm end-effector pose. First set SDK work mode and MANIPULATOR_END_POSE control mode. |
| Parameter | pose: Pose - Target pose, including position and orientation |
| Return Value | ExecutionResult |
| Notes | Parameter limits: position.x: [-5.0, 5.0]; position.y: [-5.0, 5.0]; position.z: [-5.0, 5.0]; orientation.x: [-1, 1]; orientation.y: [-1, 1]; orientation.z: [-1, 1]; orientation.w: [-1, 1]. A large difference between the target and current poses may cause substantial vibration. Increment gradually from the current pose to the target. |
Example:
robot.system.set_work_mode(
RobotModeParam(mode=RobotWorkMode.SDK)
)
robot.robot_control.set_manipulator_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_END_POSE
)
)
pose = Pose()
pose.position = Point(x=0.0, y=0.0, z=0.0)
pose.orientation = Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)
pose.position.z += 0.03
robot.right_arm.set_end_pose(pose)
time.sleep(0.2)get_joint_states interface reference
| Field | Details |
|---|---|
| Function | get_joint_states() |
| Signature | def get_joint_states(timeout) -> sensor_msgs_.JointState |
| Description | Get robot-arm joint-state information |
| Parameter | None |
| Return Value | JointState |
| Notes | None |
Example:
joint_state = robot.left_arm.get_joint_states()
print(f"Joint name: {joint_state.name}")
print(f"Joint position: {joint_state.position}")
print(f"Joint velocity: {joint_state.velocity}")
print(f"Joint effort: {joint_state.effort}")get_end_pose interface reference
| Field | Details |
|---|---|
| Function | get_end_pose() |
| Signature | def get_end_pose(timeout) -> geometry_msgs_.PoseStamped |
| Description | Get the robot-arm end-effector pose |
| Parameter | None |
| Return Value | PoseStamped |
| Notes | The last line of the original example was missing a closing parenthesis; it has been added in the example below. |
Example:
cur_pose = robot.left_arm.get_end_pose()
print(f"current_position: {cur_pose}")get_joint_states_stream interface reference
| Field | Details |
|---|---|
| Function | get_joint_states_stream() |
| Signature | def get_joint_states_stream(timeout) -> Iterator[sensor_msgs_.JointState] |
| Description | Get a robot-arm joint-state stream |
| Parameter | None |
| Return Value | JointState iterator |
| Notes | None |
Example:
stream = robot.left_arm.get_joint_states_stream()
for msg in stream:
print(msg)get_end_pose_stream interface reference
| Field | Details |
|---|---|
| Function | get_end_pose_stream() |
| Signature | def get_end_pose_stream(timeout) -> Iterator[geometry_msgs_.PoseStamped] |
| Description | Get a robot-arm end-effector pose stream |
| Parameter | None |
| Return Value | PoseStamped iterator |
| Notes | None |
Example:
stream = robot.left_arm.get_end_pose_stream()
for msg in stream:
print(msg)Master arm control interface
Important note: The master arm interface is used to read and control devices on the master arm side. The SDK client entry points are robot.master_left_arm and robot.master_right_arm. Do not confuse them with the slave-arm objects robot.left_arm and robot.right_arm. Whether QUANTA X1 Pro can use master-arm write control depends on whether the master-arm hardware, master-arm service, and corresponding control-mode configuration are deployed on the robot. If the robot only supports reading from the master arms or the write-control topic is not configured, calling the write interface will return an error. The master arm control mode is set by the set_control_mode() interface provided by each of the left and right master arm objects. The parameter reuses ManipulatorControlModeParam and is not set via robot.robot_control.set_manipulator_control_mode().
set_control_mode interface reference
| Field | Details |
|---|---|
| Function | set_control_mode() |
| Signature | def set_control_mode(manipulator_control_mode_param: ManipulatorControlModeParam, timeout) -> ExecutionResult |
| Description | Set the master-arm control mode, which determines how subsequent master-arm write commands are interpreted |
| Parameter | mode: ManipulatorControlModeParam - Master-arm control mode |
| Return Value | ExecutionResult |
| Notes | Control modes: MANIPULATOR_END_POSE: Master-arm end-effector pose control; subsequent set_end_pose() calls are interpreted as target master-arm end-effector poses. MANIPULATOR_JOINT_POSITIONS: Master-arm joint-position control; subsequent set_joint_positions() calls are interpreted as target positions for the six master-arm joints. MANIPULATOR_GRAVITY_COMPENSATION: Master-arm gravity-compensation mode, which can be used for manual takeover. Do not switch control modes frequently while the master arm is moving. Both the left and right master-arm services provide this interface. Check the current mode before issuing write commands. |
Example:
from x2robot.sdk import (
ManipulatorControlMode,
ManipulatorControlModeParam,
)
robot.master_left_arm.set_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_END_POSE
)
)get_control_mode interface reference
| Field | Details |
|---|---|
| Function | get_control_mode() |
| Signature | def get_control_mode(timeout) -> ManipulatorControlModeParam |
| Description | Get the current master-arm control mode |
| Parameter | None |
| Return Value | ManipulatorControlModeParam |
| Notes | If the robot-side control chain is not in master-arm joint control mode or master-arm end-effector control mode, the interface may return an error. Before issuing master-arm write commands, call set_control_mode() to select the corresponding mode. |
Example:
mode = robot.master_left_arm.get_control_mode()
print(mode)set_joint_positions interface reference
| Field | Details |
|---|---|
| Function | set_joint_positions() |
| Signature | def set_joint_positions(joint_positions: JointPositions, timeout) -> ExecutionResult |
| Description | Set target positions for the master-arm joints. First call set_control_mode() on the master arm to select MANIPULATOR_JOINT_POSITIONS mode. |
| Parameter | positions: JointPositions - Positions of the six master-arm joints in radians. The joint order is master_left_arm_joint1 through master_left_arm_joint6 or master_right_arm_joint1 through master_right_arm_joint6. joint1: [-2.7925, 2.7925]; joint2: [0.0, 3.6652]; joint3: [-2.7925, 0.0]; joint4: [-1.5708, 1.5708]; joint5: [-1.5708, 1.5708]; joint6: [-1.9199, 1.9199]. |
| Return Value | ExecutionResult |
| Notes | The SDK checks the number of joints, verifies that all values are finite, and validates the joint limits. result.is_success=True means that the SDK Server accepted the command and published it to the robot-side control chain. It does not mean that the motion has completed or reached the target position. |
Example:
from x2robot.sdk import (
JointPositions,
ManipulatorControlMode,
ManipulatorControlModeParam,
)
master_arm = robot.master_left_arm
master_arm.set_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_JOINT_POSITIONS
)
)
joint_state = master_arm.get_joint_states()
target = list(joint_state.position)
target[0] += 0.01
result = master_arm.set_joint_positions(
JointPositions(positions=target)
)
print(result.is_success, result.error_message)set_end_pose interface reference
| Field | Details |
|---|---|
| Function | set_end_pose() |
| Signature | def set_end_pose(pose: geometry_msgs_.Pose, timeout) -> ExecutionResult |
| Description | Set the target master-arm end-effector pose. First call set_control_mode() on the master arm to select MANIPULATOR_END_POSE mode. |
| Parameter | pose: Pose - Target master-arm end-effector pose |
| Return Value | ExecutionResult |
| Notes | set_end_pose() sends an absolute master-arm end-effector pose command. The pose is interpreted according to the controller's internal convention for absolute master-arm poses. The SDK verifies that the position and quaternion contain valid values and that the quaternion norm is close to 1. result.is_success=True means only that the SDK Server accepted and published the command; it does not indicate that inverse kinematics succeeded, the controller reached the target, or the motion completed. |
Example:
from x2robot.geometry_msgs import Pose, Point, Quaternion
from x2robot.sdk import (
ManipulatorControlMode,
ManipulatorControlModeParam,
)
master_arm = robot.master_left_arm
master_arm.set_control_mode(
ManipulatorControlModeParam(
mode=ManipulatorControlMode.MANIPULATOR_END_POSE
)
)
current = master_arm.get_end_pose()
pose = Pose()
pose.position = Point(
x=current.pose.position.x,
y=current.pose.position.y,
z=current.pose.position.z + 0.002,
)
pose.orientation = Quaternion(
x=current.pose.orientation.x,
y=current.pose.orientation.y,
z=current.pose.orientation.z,
w=current.pose.orientation.w,
)
result = master_arm.set_end_pose(pose)
print(result.is_success, result.error_message)get_joint_states interface reference
| Field | Details |
|---|---|
| Function | get_joint_states() |
| Signature | def get_joint_states(timeout) -> sensor_msgs_.JointState |
| Description | Get master-arm joint-state information |
| Parameter | None |
| Return Value | JointState |
| Notes | None |
Example:
joint_state = robot.master_left_arm.get_joint_states()
print(f"Joint name: {joint_state.name}")
print(f"Joint position: {joint_state.position}")
print(f"Joint velocity: {joint_state.velocity}")
print(f"Joint effort: {joint_state.effort}")get_end_pose interface reference
| Field | Details |
|---|---|
| Function | get_end_pose() |
| Signature | def get_end_pose(timeout) -> geometry_msgs_.PoseStamped |
| Description | Get the master-arm end-effector pose |
| Parameter | None |
| Return Value | PoseStamped |
| Notes | None |
Example:
cur_pose = robot.master_left_arm.get_end_pose()
print(f"current_position: {cur_pose}")get_gripper_position interface reference
| Field | Details |
|---|---|
| Function | get_gripper_position() |
| Signature | def get_gripper_position(timeout) -> GripperPosition |
| Description | Get the master-arm trigger input value. On the master-arm side, this value represents the grasp input and not the actual physical position of the slave-arm gripper. |
| Parameter | None |
| Return Value | GripperPosition |
| Notes | The master-arm trigger input is normally in the range [0, 1]. The trigger is currently read-only; its position cannot be set through the SDK. |
Example:
trigger = robot.master_left_arm.get_gripper_position()
print(trigger.position)get_joint_states_stream interface reference
| Field | Details |
|---|---|
| Function | get_joint_states_stream() |
| Signature | def get_joint_states_stream(timeout) -> Iterator[sensor_msgs_.JointState] |
| Description | Get a master-arm joint-state stream |
| Parameter | None |
| Return Value | JointState iterator |
| Notes | None |
Example:
stream = robot.master_left_arm.get_joint_states_stream()
for msg in stream:
print(msg)get_end_pose_stream interface reference
| Field | Details |
|---|---|
| Function | get_end_pose_stream() |
| Signature | def get_end_pose_stream(timeout) -> Iterator[geometry_msgs_.PoseStamped] |
| Description | Get a master-arm end-effector pose stream |
| Parameter | None |
| Return Value | PoseStamped iterator |
| Notes | None |
Example:
stream = robot.master_left_arm.get_end_pose_stream()
for msg in stream:
print(msg)get_gripper_state_stream interface reference
| Field | Details |
|---|---|
| Function | get_gripper_state_stream() |
| Signature | def get_gripper_state_stream(timeout) -> Iterator[GripperPosition] |
| Description | Get a master-arm trigger input stream |
| Parameter | None |
| Return Value | GripperPosition iterator |
| Notes | The master arm also retains the compatibility interface get_gripper_joint_states_stream() for reading joint-state streams associated with the master-arm gripper or trigger. For new development, use get_gripper_state_stream() to read trigger input values. |
Example:
stream = robot.master_left_arm.get_gripper_state_stream()
for msg in stream:
print(msg.position)Gripper control interface
set_position interface reference
| Field | Details |
|---|---|
| Function | set_position() |
| Signature | def set_position(gripper_position: GripperPosition, timeout) -> ExecutionResult |
| Description | Set the gripper position as a motor rotation value in radians. First select SDK work mode. |
| Parameter | position: GripperPosition |
| Return Value | ExecutionResult |
| Notes | position ranges in radians: H gripper [0.0, 4.5]; G gripper [0.0, 1.89]. |
Example:
robot.system.set_work_mode(
RobotModeParam(mode=RobotWorkMode.SDK)
)
robot.right_gripper.set_position(
GripperPosition(position=0.5)
)
sleep(0.05)
position = robot.right_gripper.get_position()
print(position)get_position interface reference
| Field | Details |
|---|---|
| Function | get_position() |
| Signature | def get_position(timeout) -> GripperPosition |
| Description | Get the gripper position |
| Parameter | None |
| Return Value | GripperPosition |
| Notes | None |
Example:
position = robot.left_gripper.get_position()
print(position)get_joint_states_stream interface reference
| Field | Details |
|---|---|
| Function | get_joint_states_stream() |
| Signature | def get_joint_states_stream(timeout) -> Iterator[sensor_msgs_.JointState] |
| Description | Get a gripper joint-state stream |
| Parameter | None |
| Return Value | JointState |
| Notes | None |
Example:
stream = robot.left_gripper.get_joint_states_stream()
for msg in stream:
print(msg)Torso Control Interface
set_lift_position interface reference
| Field | Details |
|---|---|
| Function | set_lift_position() |
| Signature | def set_lift_position(lift_position: LiftPosition, timeout) -> ExecutionResult |
| Description | Set the torso lift position. First select SDK work mode. |
| Parameter | position: LiftPosition |
| Return Value | ExecutionResult |
| Notes | position range: [0.0, 0.78] |
Example:
cur_position = robot.lift.get_lift_position()
print(f"current_position: {cur_position}")
lift_position = LiftPosition(
position=cur_position.position + 0.2
)
robot.lift.set_lift_position(lift_position)get_lift_position interface reference
| Field | Details |
|---|---|
| Function | get_lift_position() |
| Signature | def get_lift_position(timeout) -> LiftPosition |
| Description | Get the torso lift position |
| Parameter | None |
| Return Value | LiftPosition |
| Notes | None |
Example:
position = robot.lift.get_lift_position()get_joint_states_stream interface reference
| Field | Details |
|---|---|
| Function | get_joint_states_stream() |
| Signature | def get_joint_states_stream(timeout) -> Iterator[sensor_msgs_.JointState] |
| Description | Get a torso joint-state stream |
| Parameter | None |
| Return Value | JointState |
| Notes | None |
Example:
stream = robot.lift.get_joint_states_stream()
for msg in stream:
print(msg)