Robotic Arm APIs
ArmFactory
Section titled “ArmFactory”The ArmFactory class provides the following methods for creating robotic arm instances.
-
Create a robotic arm instance by specifying the type and name.
-
Method:
create_arm(vendor_type: str, name: str, params: dict[str, str]) -> ArmInterface -
Parameters:
Parameter Description vendor_typeThe manufacturer or type of the robotic arm.
nameThe instance identifier for the arm (e.g.,
"left_arm","right_arm").paramsAdditional robotic arm parameters, such as IP address, port number, etc.
{'ip':'192.168.1.10', # TCP IP address'port':'5000', # TCP port number'udp_ip':'192.168.1.100', # UDP IP address'udp_port':'6000', # UDP port number'udp_cycle':'20', # UDP cycle (period = udp_cycle * 5 ms)} -
Return value:
An
ArmInterfaceinstance if creation succeeds, otherwiseNone.
-
-
Create a robotic arm instance using an ArmFactoryParam object.
-
Method:
create_arm(param: ArmFactoryParam) -> ArmInterface -
Parameters:
ParameterDescription paramRobotic arm configuration parameters. For details, please refer to ArmFactoryParam. -
Return value:
An
ArmInterfaceinstance if creation succeeds, otherwiseNone.
-
-
Create a robotic arm instance from a configuration file.
-
Method:
create_arm_from_config(config_path: str) -> ArmInterface -
Parameter:
Parameter Description config_pathPath to the configuration file. The configuration file must be a JSON file.
{"arm_type":"xxx", # Robotic arm vendor"arm_name":"left_arm", # Robotic arm name"ip": "192.168.1.18", # TCP IP address"port": "8080", # TCP port number"udp_ip": "192.168.1.102", # UDP IP address"udp_port": "8089", # UDP port number"udp_cycle": "1", # UDP cycle (period = udp_cycle * 5 ms)"enable_gripper": "false" # Enable gripper} -
Return value:
An
ArmInterfaceinstance if creation succeeds, otherwiseNone.
-
ArmFactoryParam
Section titled “ArmFactoryParam”The ArmFactoryParam class is used to describe the parameters required for creating a robotic arm. It can be initialized either through the default constructor or by passing a dictionary.
Attributes
Section titled “Attributes”All attributes of the ArmFactoryParam class are read-write.
| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
arm_type | str | Robotic arm vendor (e.g., "realman") |
arm_name | str | Robotic arm name (e.g., "left_arm") |
ip | str | TCP IP address |
udp_ip | str | UDP IP address |
port | int | TCP port number |
udp_port | int | UDP port number |
udp_cycle | int | UDP cycle (period = udp_cycle * 5 ms) |
Constructor with Parameters
Section titled “Constructor with Parameters”-
Method:
__init__(self, arg0: dict[str, str]) -> None -
Parameter:
Parameter Description arg0A dictionary containing all necessary parameters for creating the robotic arm. It must include the keys shown in the example below.
The constructor will raise aRuntimeErrorif any required key is missing or its format is invalid.{'arm_type':'xxx', # Robotic arm vendor'arm_name':'left_arm', # Robotic arm name'ip':'192.168.1.10', # TCP IP address'port':'5000', # TCP port number'udp_ip': '192.168.1.100', # UDP IP address'udp_port':'6000', # UDP port number'udp_cycle':'20', # UDP cycle (period = udp_cycle * 5 ms)'enable_gripper': 'false' # Enable gripper}
ArmInterface
Section titled “ArmInterface”The ArmInterface class provides a series of public methods for controlling the robotic arm, including motion, grasping, and status queries. Ensure a robotic arm instance has been created before using these methods.
Attributes
Section titled “Attributes”| Attribute (Read-Only) | Data Type | Description |
|---|---|---|
name | str | The name of the robotic arm instance. |
Connect to the Robotic Arm
Section titled “Connect to the Robotic Arm”-
Method:
connect(self) -> alphabot.core.AbcErrorCode -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Disconnect from the Robotic Arm
Section titled “Disconnect from the Robotic Arm”-
Method:
disconnect(self) -> None -
Return value:
None.
Joint Motion
Section titled “Joint Motion”-
Method:
move_joint_position(self,joints: list[float],v: int,r: int,trajectory_connect: int,block: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription jointsTarget joint positions, in degrees. vPercentage of the maximum joint linear velocity and acceleration used for planning. Valid range: 0-100. rTrajectory blending radius. Default value is 0. trajectory_connectTrajectory connection flag. Accepts 0 or 1.
-0: Plan and execute the trajectory immediately. Do not connect to the next trajectory.
-1: Plan the current trajectory together with the next one, but do not execute immediately. Note: In blocking mode, the method returns immediately even after the trajectory is successfully sent.blockBlocking mode flag. Accepts 0 or 1.
-0: Non-blocking mode. The method returns immediately after successfully sending the motion command to the controller.
-1: Blocking mode. The method waits until the arm completes the motion or an error occurs before returning. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Cartesian Linear Motion
Section titled “Cartesian Linear Motion”-
Method:
move_cartesian_linear(self,pose: alphabot.core.Pose,v: int,r: int,trajectory_connect: int,block: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription poseTarget pose. For details, please refer to Pose. vPercentage of the maximum joint linear velocity and acceleration used for planning. Valid range: 0-100. rTrajectory blending radius. Default value is 0. trajectory_connectTrajectory connection flag. Accepts 0 or 1.
-0: Plan and execute the trajectory immediately. Do not connect to the next trajectory.
-1: Plan the current trajectory together with the next one, but do not execute immediately. Note: In blocking mode, the method returns immediately even after the trajectory is successfully sent.blockBlocking mode flag. Accepts 0 or 1.
-0: Non-blocking mode. The method returns immediately after successfully sending the motion command to the controller.
-1: Blocking mode. The method waits until the arm completes the motion or an error occurs before returning. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Move to Target Pose in Joint Space
Section titled “Move to Target Pose in Joint Space”In joint space, a motion trajectory is planned to move the robotic arm to the specified target pose.
-
Method:
move_joint_pose(self,pose: alphabot.core.Pose,v: int,r: int,trajectory_connect: int,block: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription poseTarget pose. For details, please refer to Pose. vPercentage of the maximum joint angular velocity and joint angular acceleration used for planning. Valid range: 0-100. rTrajectory blending radius. Default value is 0. trajectory_connectTrajectory connection flag. Accepts 0 or 1.
-0: Plan and execute the trajectory immediately. Do not connect to the next trajectory.
-1: Plan the current trajectory together with the next one, but do not execute immediately. Note: In blocking mode, the method returns immediately even after the trajectory is successfully sent.blockBlocking mode flag. Accepts 0 or 1.
-0: Non-blocking mode. The method returns immediately after successfully sending the motion command to the controller.
-1: Blocking mode. The method waits until the arm completes the motion or an error occurs before returning. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Angle Pass-through
Section titled “Angle Pass-through”Joint angles are sent to the robotic arm via CAN FD (Controller Area Network Flexible Data-rate), bypassing trajectory planning by the controller. If the method is called correctly, the robotic arm executes the motion immediately.
-
Method:
move_joint_position_canfd(self,joints: list[float],follow: bool,trajectory_mode: int = 0,radio: int = 0) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription jointsTarget joint positions, in degrees. followFollow mode flag. Accepts TrueorFalse.
-True: High-follow mode.
-False: Low-follow mode.
Note: High-follow mode requires a pass-through cycle of 10ms or less.trajectory_modeUsed in high-follow mode. Accepts 0, 1, or 2.
-0: Full pass-through mode.
-1: Curve-fitting mode.
-2: Filtering mode.radio- In curve-fitting mode: radiois the smoothing coefficient, range 0-100.
- In filtering mode:radiois the filter parameter, range 0-1000. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Pose Pass-through
Section titled “Pose Pass-through”The target pose is sent to the robotic arm via CAN FD (Controller Area Network Flexible Data-rate), bypassing trajectory planning by the controller.
When the target pose is received by the arm controller, the controller first attempts inverse kinematics calculation. If the inverse kinematics solution succeeds and the calculated joint angles do not differ significantly from the current joint positions, the angles are sent directly to the joints for execution, skipping additional trajectory planning.
This feature is suitable for scenarios that require periodic pose adjustments, such as visual servoing applications.
-
Method:
move_cartesian_pose_canfd(self,pose: alphabot.core.Pose,follow: bool,trajectory_mode: int = 0,radio: int = 0) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription poseTarget pose. followFollow mode flag. Accepts TrueorFalse.
-True: High-follow mode.
-False: Low-follow mode.
Note: High-follow mode requires a pass-through cycle of 10ms or less.trajectory_modeUsed in high-follow mode. Accepts 0, 1, or 2.
-0: Full pass-through mode.
-1: Curve-fitting mode.
-2: Filtering mode.radio- In curve-fitting mode: radiois the smoothing coefficient, range 0-100.
- In filtering mode:radiois the filter parameter, range 0-1000. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Joint Space Following Motion
Section titled “Joint Space Following Motion”Joint space following motion refers to real-time trajectory planning in joint space to achieve dynamic following of target joint positions.
-
Method:
move_joint_follow(self, joints: list[float]) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription jointsTarget joint positions. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Cartesian Space Following Motion
Section titled “Cartesian Space Following Motion”Cartesian space following motion refers to real-time trajectory planning in Cartesian space to achieve dynamic following of the target pose.
-
Method:
move_pose_follow(self, pose: alphabot.core.Pose) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription poseTarget pose. For details, please refer to Pose. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Register Robotic Arm State Callback Function
Section titled “Register Robotic Arm State Callback Function”-
Method:
realtime_arm_state_call_back(self, callback: typing.Callable) -> None -
Parameter:
ParameterDescription callbackThe callback function is called whenever a robotic arm state update is received. The callback function receives a parameter of type ArmRealtimeState. -
Return value:
None.
Slow Stop
Section titled “Slow Stop”The robotic arm decelerates and stops smoothly along the currently executing trajectory.
-
Method:
set_arm_slow_stop(self) -> alphabot.core.AbcErrorCode -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Emergency Stop
Section titled “Emergency Stop”The robotic arm stops immediately at the maximum joint speed along the currently executing trajectory. This operation is an irreversible abort; motion cannot be resumed from the interruption point.
-
Method:
set_arm_stop(self) -> alphabot.core.AbcErrorCode -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
The robotic arm pauses execution along the currently running trajectory. This operation is a recoverable interruption; motion can be resumed from the point of interruption.
-
Method:
set_arm_pause(self) -> alphabot.core.AbcErrorCode -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Resume
Section titled “Resume”After being paused, the robotic arm resumes execution from the interruption point and continues the unfinished motion task.
-
Method:
set_arm_continue(self) -> alphabot.core.AbcErrorCode -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set End-Effector Ecosystem Protocol Mode
Section titled “Set End-Effector Ecosystem Protocol Mode”-
Method:
set_plus_mode(self, mode: int) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription modeThe end-effector ecosystem protocol mode.
-0: Disable protocol.
-9600: Enable protocol (baud rate 9600).
-115200: Enable protocol (baud rate 115200).
-256000: Enable protocol (baud rate 256000).
-460800: Enable protocol (baud rate 460800). -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Release Gripper
Section titled “Release Gripper”The gripper moves to its fully open position at the specified speed.
-
Method:
set_gripper_release(self,speed: int,block: bool,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription speedGripper release speed. Valid range: 1-1000 (dimensionless). blockBlocking mode flag.
-True: Blocking mode. Waits for the controller to confirm the gripper has reached the position.
-False: Non-blocking mode. Does not wait for the gripper-in-position feedback.timeoutTimeout behavior depends on the blocking mode.
- Blocking mode: Maximum waiting time for the gripper to reach the target position, in seconds.
- Non-blocking mode: If set to 0, the method returns immediately after sending the command; otherwise, it returns after receiving the successful setting command. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Force-Controlled Grasp
Section titled “Force-Controlled Grasp”The gripper grasps at the specified speed and force. Grasping stops automatically when the gripping force exceeds the configured force threshold.
-
Method:
set_gripper_pick(self,speed: int,force: int,block: bool,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription speedGripper closing speed. Valid range: 1-1000 (dimensionless). forceForce-control threshold. Valid range: 50-1000 (dimensionless). blockBlocking mode flag.
-True: Blocking mode. Waits for the controller to confirm the gripper has reached the position.
-False: Non-blocking mode. Does not wait for the gripper-in-position feedback.timeoutTimeout behavior depends on the blocking mode.
- Blocking mode: Maximum waiting time for the gripper to reach the target position, in seconds.
- Non-blocking mode: If set to 0, the method returns immediately after sending the command; otherwise, it returns after receiving the successful setting command. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Continuous Force-Controlled Grasp
Section titled “Continuous Force-Controlled Grasp”-
Method:
set_gripper_pick_on(self,speed: int,force: int,block: bool,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription speedGripper closing speed. Valid range: 1-1000 (dimensionless). forceForce-control threshold. Valid range: 50-1000 (dimensionless). blockBlocking mode flag.
-True: Blocking mode. Waits for the controller to confirm the gripper has reached the position.
-False: Non-blocking mode. Does not wait for the gripper-in-position feedback.timeoutTimeout behavior depends on the blocking mode.
- Blocking mode: Maximum waiting time for the gripper to reach the target position, in seconds.
- Non-blocking mode: If set to 0, the method returns immediately after sending the command; otherwise, it returns after receiving the successful setting command. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Gripper Aperture Position
Section titled “Set Gripper Aperture Position”After the gripper reaches the target position, the following behavior applies:
-
If the current aperture is smaller than the target, the gripper opens to the target position at the default speed.
-
If the current aperture is larger than the target, the gripper closes towards the target position at the specified speed and torque limit. The gripper stops when either the torque threshold is exceeded or the target position is reached.
-
Method:
set_gripper_position(self,position: int,block: bool,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription positionTarget gripper aperture position. Valid range: 1-1000 (dimensionless). blockBlocking mode flag.
-true: Blocking mode. Waits for the controller to confirm the gripper has reached the position.
-false: Non-blocking mode. Does not wait for the gripper-in-position feedback.timeoutTimeout behavior depends on the blocking mode.
- Blocking mode: Maximum waiting time for the gripper to reach the target position, in seconds.
- Non-blocking mode: If set to 0, the method returns immediately after sending the command; otherwise, it returns after receiving the successful setting command. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Get Gripper Status
Section titled “Get Gripper Status”-
Method:
get_gripper_state(self) -> tuple[alphabot.core.AbcErrorCode, GripperState] -
Return value:
A tuple containing two elements.
Element Type Description AbcErrorCodeAbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.GripperStateThe current gripper status. For details, please refer to GripperState.
Set Target Gesture Sequence Number of the Dexterous Hand
Section titled “Set Target Gesture Sequence Number of the Dexterous Hand”-
Method:
set_hand_posture(self,posture_num: int,block: bool,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription posture_numGesture sequence number pre-stored in the dexterous hand, range: 1-40. block- Trueindicates blocking mode, which waits until the dexterous hand motion completes before returning.
-Falseindicates non-blocking mode, which returns immediately after the command is sent.timeoutTimeout value in blocking mode, in seconds. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Each DOF Angle of the Dexterous Hand
Section titled “Set Each DOF Angle of the Dexterous Hand”The dexterous hand has 6 degrees of freedom (DOF), numbered 1–6 as follows:
1: Little finger, 2: Ring finger, 3: Middle finger, 4: Index finger, 5: Thumb flexion, 6: Thumb rotation.
-
Method:
set_hand_angle(self,hand_angle: list[int]) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription hand_angleArray of finger angles. The array length is 6. The angle range is 0–1000. Additionally, -1indicates that no action will be performed for this degree of freedom, and the current state will be maintained. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Angle Following Control for the Dexterous Hand
Section titled “Set Angle Following Control for the Dexterous Hand”The dexterous hand has 6 degrees of freedom (DOF), numbered 1–6 as follows:
1: Little finger, 2: Ring finger, 3: Middle finger, 4: Index finger, 5: Thumb flexion, 6: Thumb rotation.
-
Method:
set_hand_follow_angle(self,hand_angle: list[int],block: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription hand_angleArray of finger angles. The array length is 6. The angle range is defined by the dexterous hand manufacturer (e.g., for INSPIRE-ROBOTS, the range is 0–2000). blockTimeout value before returning, in milliseconds. A value of 0means non-blocking mode. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Position Following Control for the Dexterous Hand
Section titled “Set Position Following Control for the Dexterous Hand”The dexterous hand has 6 degrees of freedom (DOF), numbered 1–6 as follows:
1: Little finger, 2: Ring finger, 3: Middle finger, 4: Index finger, 5: Thumb flexion, 6: Thumb rotation.
-
Method:
set_hand_follow_pos(self,hand_pos: list[int],block: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription hand_angleArray of finger positions. The array length is 6. The position range is defined by the dexterous hand manufacturer (e.g., for INSPIRE-ROBOTS, the range is 0–1000). blockTimeout value before returning, in milliseconds. A value of 0means non-blocking mode. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Speed of the Dexterous Hand
Section titled “Set Speed of the Dexterous Hand”-
Method:
set_hand_speed(self, speed: int) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription speedFinger speed. Valid range: 1–1000. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Set Force Threshold of the Dexterous Hand
Section titled “Set Force Threshold of the Dexterous Hand”-
Method:
set_hand_force(self, hand_force: int) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription hand_forceFinger force. Valid range: 1–1000. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Get Current Joint Angles
Section titled “Get Current Joint Angles”-
Method:
get_joint_degree(self) -> tuple[alphabot.core.AbcErrorCode, list[float]] -
Return value:
A tuple containing two elements.
Element Type Description AbcErrorCodeAbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.list[float]Current joint angles.
Compute Forward Kinematics
Section titled “Compute Forward Kinematics”-
Method:
forward_kinematics(self,joints: list[float]) -> tuple[alphabot.core.AbcErrorCode, alphabot.core.Pose] -
Parameter:
ParameterDescription jointsJoint angles. -
Return value:
A tuple containing two elements.
Element Type Description AbcErrorCodeAbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.PosePose computed by forward kinematics. For details, please refer to Pose.
Compute Inverse Kinematics
Section titled “Compute Inverse Kinematics”-
Method:
inverse_kinematics(self,pose: alphabot.core.Pose,ref_joints: list[float],mode: int = 0) -> tuple[alphabot.core.AbcErrorCode, list[float]] -
Parameters:
ParameterDescription poseThe target pose. For details, please refer to Pose. ref_jointsReference joint angles. modeSolution mode. Accepts 0 or 1. Default is 0.
-0: Single-step solution.
-1: Iterative search solution. -
Return value:
A tuple containing two elements.
Element Type Description AbcErrorCode AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.list[float]Joint angles computed by inverse kinematics.
Configure Modbus RTU Mode
Section titled “Configure Modbus RTU Mode”After the robotic arm is started, you must first call the following method to configure Modbus RTU mode before performing any operation on the communication port. Otherwise, an error will be returned.
The robotic arm persists the Modbus configuration. After a reboot, the arm automatically restores the mode that was configured before power-off.
-
Method:
set_modbus_mode(self,port: int,baudrate: int,timeout: int) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription portSpecifies the communication port. Valid values: 0, 1, or 2.
-0: Controller RS485 port as RTU master.
-1: End interface board RS485 port as RTU master.
-2: Controller RS485 port as RTU slave.baudrateBaud rate, supporting three common baud rates, namely 9600, 115200, and 460800. timeoutTimeout period, in 100 ms.
For all read and write commands to the Modbus device, if no response data is returned within the specified timeout period, a timeout error will be returned.
The timeout period cannot be set to 0; if set to 0, the robotic arm will take it as 1 for configuration. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Close Modbus RTU Mode
Section titled “Close Modbus RTU Mode”-
Method:
close_modbus_mode(self, port: int) -> alphabot.core.AbcErrorCode -
Parameter:
ParameterDescription portSpecifies the communication port. Valid values: 0, 1, or 2.
-0: Controller RS485 port as RTU master.
-1: End interface board RS485 port as RTU master.
-2: Controller RS485 port as RTU slave. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Write multiple registers
Section titled “Write multiple registers”-
Method:
write_registers(self,params: PeripheralReadWriteParams,values: list[int]) -> alphabot.core.AbcErrorCode -
Parameters:
ParameterDescription paramsParameter structure writing multiple registers. For details, please refer to PeripheralReadWriteParams.valuesAn array of data to be written to the registers, where each value is a 16-bit unsigned integer in the range 0-65535. -
Return value:
AbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Get Error Information
Section titled “Get Error Information”-
Method:
get_error_flag(self) -> tuple[alphabot.core.AbcErrorCode, tuple[list[int], list[int]]] -
Return value:
A tuple containing two elements.
Element Type Description AbcErrorCodeAbcErrorCode.SUCCESSindicates success. For other error codes, please refer to AbcErrorCode。tuple[list[int], list[int]]list[int] Joint error codes. list[int] Joint brake status.
-1: Brake is engaged (not released).
-0: Brake is released.
ArmForceSensor
Section titled “ArmForceSensor”The ArmForceSensor class represents force sensor data of the robotic arm.
| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
force | list[float] | Current raw force sensor data, in units of 0.001 N or 0.001 N·m. |
zero_force | list[float] | Current external force data measured by the force sensor system, in units of 0.001 N or 0.001 N·m. |
coordinate | int | Coordinate frame of the external force data. - 0: Sensor coordinate frame.- 1: Current working coordinate frame.- 2: Current tool coordinate frame. |
ArmRealtimeState
Section titled “ArmRealtimeState”The ArmRealtimeState class represents the real-time state of the robotic arm.
| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
name | str | Robotic arm name |
timestamp | typing.Any | Timestamp |
joint_status | JointState | Joint states |
force_sensor | ArmForceSensor | Force sensor status |
arm_current_status | ArmCurrentStatus | Robotic arm status |
gripper_state | GripperState | Gripper status |
ee_pose | Pose | End-effector pose |
JointState
Section titled “JointState”| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
joint_position | list[float] | Current joint angles, in degrees (°). |
joint_speed | list[float] | Current joint speeds, in RPM (revolutions per minute). |
joint_current | list[float] | Current joint current, in milliamperes (mA). |
joint_temperature | list[float] | Current joint temperature, in degrees Celsius (°C). |
joint_voltage | list[float] | Current joint voltage, in volts (V). |
joint_err_code | list[int] | Current joint error codes. |
joint_en_flag | list[bool] | Current joint enable flags. - True: Enabled.- False: Disabled. |
GripperState
Section titled “GripperState”| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
status | int | Gripper status. - 0: Offline.- 1: Online.- -1: Online but disabled. |
error | int | Gripper error information. - Lower 8 bits: Internal gripper error codes. - Bits 5—7: Reserved. - Bit 4: Internal communication error. - Bit 3: Driver error. - Bit 2: Overcurrent. - Bit 1: Overtemperature. - Bit 0: Locked-rotor. |
mode | int | Current operating mode. - 1: Gripper fully open and idle.- 2: Gripper fully closed and idle.- 3: Gripper stopped and idle.- 4: Gripper is closing.- 5: Gripper is opening.- 6: Gripper stopped by force-controlled during closing. |
current_force | int | Current force, in grams (g). |
temperature | int | Current temperature, in degrees Celsius (°C). |
actpos | int | Gripper aperture, range 0-1000. - 0: Gripper fully closed.- 1000: Gripper fully open. |
PeripheralReadWriteParams
Section titled “PeripheralReadWriteParams”The PeripheralReadWriteParams class is used to configure Modbus communication parameters between the controller and peripheral devices.
| Attribute (Read-Write) | Data Type | Description |
|---|---|---|
port | int | Communication port. - 0: Controller RS485 port- 1: End-effector interface board RS485 port- 3: Controller Modbus TCP device |
address | int | Starting data address |
device | int | Peripheral device address |
num | int | Number of data items |