Robotic Arm APIs
The robotic arm APIs are implemented by the following classes. You can find the corresponding header files in the c++\include\drivers\arm directory to access the complete set of APIs.
| Header File | Class Name | Description |
|---|---|---|
arm_factory.h | ArmFactory | A factory class for creating robotic arm instances of different types. |
arm_interface.h | ArmInterface | The base interface class defining common APIs for robotic arm control. All vendor-specific drivers should inherit from this class. |
Create a Robotic Arm Instance
Section titled “Create a Robotic Arm Instance”There are three ways to create a robotic arm instance.
-
Create a robotic arm instance by specifying the type and name.
-
Method:
static std::shared_ptr<ArmInterface> create_arm(const std::string& arm_type,const std::string& name,const std::unordered_map<std::string, std::string>& params); -
Parameters:
ParameterTypeDescription arm_typeInput The manufacturer or type of the robotic arm. nameInput The instance identifier for the arm (e.g., "left_arm","right_arm").paramsInput A key-value map for additional configuration parameters (e.g., {{"ip", "192.168.1.18"}, {"port", "8080"}}). -
Return Value:
Returns a shared pointer to an object of a class derived from
ArmInterfaceif the instance is created successfully; otherwise, returnsnullptr.
-
-
Create a robotic arm instance by arm parameters.
-
Method:
static std::shared_ptr<ArmInterface> create_arm(const ArmFactoryParam& param) -
Parameter:
ParameterTypeDescription paramInput Parameters related to the robotic arm. For details, please refer to ArmFactoryParam. -
Return Value:
Returns a shared pointer to an object of a class derived from
ArmInterfaceif the instance is created successfully; otherwise, returnsnullptr.
-
-
Create a robotic arm instance from a configuration file.
-
Method:
static std::shared_ptr<ArmInterface> create_arm_from_config(const std::string& config_path) -
Parameters:
Parameter Type Description config_pathInput
Path 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:
Returns a shared pointer to an object of a class derived from
ArmInterfaceif the instance is created successfully; otherwise, returnsnullptr.
-
Connect to the Robotic Arm
Section titled “Connect to the Robotic Arm”After creating a robotic arm instance, you can establish a connection to the robotic arm using the following method.
-
Method:
AbcErrorCode connect() -
Return Value:
AbcErrorCode::SUCCESSindicates that the connection was established successfully. For other error codes, please refer to AbcErrorCode.
Disconnect from the Robotic Arm
Section titled “Disconnect from the Robotic Arm”You can disconnect from the robotic arm using the following method.
-
Method:
AbcErrorCode disconnect() -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Control Robotic Arm Trajectories
Section titled “Control Robotic Arm Trajectories”Robotic arm trajectory control includes motion control and pass-through control.
- Motion Control: This includes joint motion, Cartesian linear motion, and Cartesian space motion.
- Pass-through Control: This involves angle pass-through and pose pass-through.
Joint Motion
Section titled “Joint Motion”In joint space, a motion trajectory is planned to drive each joint of the robotic arm to the specified target joint positions.
-
Method:
AbcErrorCode move_joint_position(const std::vector<AbcType>& joints,int v,int r,int trajectory_connect,int block) -
Parameters:
ParameterTypeDescription jointsInput Target joint positions, in degrees. For details, please refer to AbcType. vInput Percentage of the maximum joint linear velocity and acceleration used for planning. Valid range: 0–100. rInput Trajectory blending radius. Default value is 0. trajectory_connectInput Trajectory 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.blockInput Blocking 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”In Cartesian space, a linear motion trajectory is planned to move the robotic arm along a straight line to the specified target pose.
-
Method:
AbcErrorCode move_cartesian_linear(const AbcPose& pose,int v,int r,int trajectory_connect,int block) -
Parameters:
ParameterTypeDescription poseInput Target pose. For details, please refer to AbcPose. vInput Percentage of the maximum joint linear velocity and acceleration used for planning. Valid range: 0–100. rInput Trajectory blending radius. Default value is 0. trajectory_connectInput Trajectory 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.blockInput Blocking 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:
AbcErrorCode move_joint_pose(const AbcPose& pose,int v,int r,int trajectory_connect,int block) -
Parameters:
ParameterTypeDescription poseInput Target pose. For details, please refer to AbcPose. vInput Percentage of the maximum joint angular velocity and joint angular acceleration used for planning. Valid range: 0–100. rInput Trajectory blending radius. Default value is 0. trajectory_connectInput Trajectory 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.blockInput Blocking 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:
AbcErrorCode move_joint_position_canfd(const std::vector<AbcType>& joints,bool follow,int trajectory_mode = 0,int radio = 0) -
Parameters:
ParameterTypeDescription jointsInput Target joint positions, in degrees. For details, please refer to AbcType. followInput Follow 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_modeInput (optional) Used in high-follow mode. Accepts 0, 1, or 2.
-0: Full pass-through mode.
-1: Curve-fitting mode.
-2: Filtering mode.radioInput (optional) - 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.
Angle Pass-through with Collision Avoidance
Section titled “Angle Pass-through with Collision Avoidance”This method extends move_joint_position_canfd() by adding collision avoidance functionality. If the robotic arm is at risk of colliding with the robot body, the motion will not be executed.
-
Method:
AbcErrorCode move_joint_position_canfd_collision_avoid(const std::vector<AbcType>& arm_joints,const std::vector<AbcType>& torso_head_joints,bool follow,int trajectory_mode = 0,int radio = 0) -
Parameters:
ParameterTypeDescription arm_jointsInput Target joint positions for the robotic arm, in degrees. For details, please refer to AbcType. torso_head_jointsInput Joint angles for the torso and head, in degrees. followInput Follow 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_modeInput (optional) Used in high-follow mode. Accepts 0, 1, or 2.
-0: Full pass-through mode.
-1: Curve-fitting mode.
-2: Filtering mode.radioInput (optional) - 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:
AbcErrorCode move_cartesian_pose_canfd(const AbcPose& pose,bool follow,int trajectory_mode = 0,int radio = 0) -
Parameters:
ParameterTypeDescription poseInput Target pose. For details, please refer to AbcPose. followInput Follow 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_modeInput (optional) Used in high-follow mode. Accepts 0, 1, or 2.
-0: Full pass-through mode.
-1: Curve-fitting mode.
-2: Filtering mode.radioInput (optional) - 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:
AbcErrorCode move_joint_follow(std::vector<AbcType>& joints) -
Parameter:
ParameterTypeDescription jointsInput Target joint positions. For details, please refer to AbcType. -
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:
AbcErrorCode move_pose_follow(const AbcPose& pose) -
Parameter:
ParameterTypeDescription poseInput Target pose. For details, please refer to AbcPose. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Get Current Joint Angles
Section titled “Get Current Joint Angles”-
Method:
AbcErrorCode get_joint_degree(std::vector<AbcType>& joints) -
Parameter:
ParameterTypeDescription jointsOutput Current joint angles. For details, please refer to AbcType. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Algorithms
Section titled “Algorithms”This SDK provides a set of algorithm-related APIs for the robotic arm, including forward kinematics and inverse kinematics.
Compute Forward Kinematics
Section titled “Compute Forward Kinematics”-
Method:
AbcErrorCode forward_kinematics(const std::vector<AbcType>& joints,AbcPose& pose) -
Parameters:
ParameterTypeDescription jointsInput Joint angles. For details, please refer to AbcType. poseOutput Pose computed by forward kinematics. For details, please refer to AbcPose. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Compute Inverse Kinematics
Section titled “Compute Inverse Kinematics”-
Method:
AbcErrorCode inverse_kinematics(const AbcPose& pose,const std::vector<AbcType>& ref_joints,std::vector<AbcType>& joints,int mode = 0) -
Parameters:
ParameterTypeDescription poseInput The target pose. For details, please refer to AbcPose. ref_jointsInput Reference joint angles. For details, please refer to AbcType. jointsOutput Joint angles computed by inverse kinematics. For details, please refer to AbcType. modeInput (optional) Solution mode. Accepts 0 or 1. Default is 0.
-0: Single-step solution.
-1: Iterative search solution. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Control Robotic Arm Motion
Section titled “Control Robotic Arm Motion”This SDK supports basic motion control operations for the robotic arm, including slow stop, emergency stop, pause, and resume.
Slow Stop
Section titled “Slow Stop”The robotic arm decelerates and stops smoothly along the currently executing trajectory.
-
Method:
AbcErrorCode set_arm_slow_stop() -
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:
AbcErrorCode set_arm_stop() -
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:
AbcErrorCode set_arm_pause() -
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:
AbcErrorCode set_arm_continue() -
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:
AbcErrorCode set_plus_mode(int mode) -
Parameter:
ParameterTypeDescription modeInput The 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.
Control the Gripper
Section titled “Control the Gripper”Release Gripper
Section titled “Release Gripper”The gripper moves to its fully open position at the specified speed.
-
Method:
AbcErrorCode set_gripper_release(int speed, bool block, int timeout) -
Parameters:
ParameterTypeDescription speedInput Gripper release speed. Valid range: 1–1000 (dimensionless). blockInput Blocking 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.timeoutInput Timeout 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:
AbcErrorCode set_gripper_pick(int speed, int force, bool block, int timeout) -
Parameters:
ParameterTypeDescription speedInput Gripper closing speed. Valid range: 1–1000 (dimensionless). forceInput Force-control threshold. Valid range: 50–1000 (dimensionless). blockInput Blocking 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.timeoutInput Timeout 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”The gripper performs continuous force-controlled grasping, maintaining the gripping force at the specified level during operation.
-
Method:
AbcErrorCode set_gripper_pick_on(int speed, int force, bool block, int timeout) -
Parameters:
ParameterTypeDescription speedInput Gripper closing speed. Valid range: 1–1000 (dimensionless). forceInput Force-control threshold. Valid range: 50–1000 (dimensionless). blockInput Blocking 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.timeoutInput Timeout 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:
AbcErrorCode set_gripper_position(int position, bool block, int timeout) -
Parameters:
ParameterTypeDescription positionInput Target gripper aperture position. Valid range: 1–1000 (dimensionless). blockInput Blocking 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.timeoutInput Timeout 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:
AbcErrorCode get_gripper_state(AbcGripperState* state) -
Parameter:
ParameterTypeDescription stateOutput The current gripper status. For details, please refer to AbcGripperState. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Control Five-Fingered Dexterous Hand
Section titled “Control Five-Fingered Dexterous Hand”Set Target Gesture Sequence Number of the Dexterous Hand
Section titled “Set Target Gesture Sequence Number of the Dexterous Hand”-
Method:
AbcErrorCode set_hand_posture(int posture_num, bool block,int timeout) -
Parameters:
ParameterTypeDescription posture_numInput Gesture sequence number pre-stored in the dexterous hand, range: 1-40. blockInput - 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.timeoutInput Timeout 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:
AbcErrorCode set_hand_angle(const std::vector<int>& hand_angle) -
Parameter:
ParameterTypeDescription hand_angleInput Array 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:
AbcErrorCode set_hand_follow_angle(const std::vector<int>& hand_angle,int block) -
Parameters:
ParameterTypeDescription hand_angleInput Array 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). blockInput Timeout 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:
AbcErrorCode set_hand_follow_pos(const std::vector<int>& hand_pos,int block) -
Parameters:
ParameterTypeDescription hand_angleInput Array 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). blockInput Timeout 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:
AbcErrorCode set_hand_speed(int speed) -
Parameter:
ParameterTypeDescription speedInput Finger 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:
AbcErrorCode set_hand_force(int hand_force) -
Parameter:
ParameterTypeDescription hand_forceInput Finger force. Valid range: 1–1000. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Configure Modbus
Section titled “Configure Modbus”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:
AbcErrorCode set_modbus_mode(int port, int baudrate, int timeout) -
Parameters:
ParameterTypeDescription portInput Specifies 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.baudrateInput Baud rate, supporting three common baud rates, namely 9600, 115200, and 460800. timeoutInput Timeout 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:
AbcErrorCode close_modbus_mode(int port) -
Parameter:
ParameterTypeDescription portInput Specifies 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:
AbcErrorCode write_registers(const PeripheralReadWriteParams& params,const std::vector<uint8_t>& data) -
Parameters:
ParameterTypeDescription paramsInput Parameter structure writing multiple registers. This method can write up to 10 registers once, that is, the value of the nummember must not exceed 10. For details, please refer to PeripheralReadWriteParams.dataInput Data array to write to register. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Configure UDP Active Reporting
Section titled “Configure UDP Active Reporting”This SDK provides an interface for active reporting of robotic arm status.
Within the same local area network (LAN), by configuring UDP active reporting and registering a robotic arm status callback function, the application can receive periodic robotic arm status data at a specified interval (default: 5 ms).
Set UDP Active Reporting Configuration
Section titled “Set UDP Active Reporting Configuration”-
Method:
AbcErrorCode realtime_arm_state_set_configuration(const RealtimePushConfig& config) -
Parameter:
ParameterTypeDescription configInput UDP configuration. For details, please refer to RealtimePushConfig. -
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:
void realtime_arm_state_call_back(AbcArmRealtimeStateCallback realtime_callback) -
Parameter:
ParameterTypeDescription realtime_callbackInput AbcArmRealtimeStateCallbackis a function pointer type. For details, please refer to AbcArmRealtimeStateCallback. The callback function is called whenever a robotic arm state update is received. -
Return Value:
None (void).
Get Error Information
Section titled “Get Error Information”-
Method:
AbcErrorCode get_error_flag(std::vector<uint16_t>& err_flag,std::vector<uint16_t>& brake_state) -
Parameters:
ParameterTypeDescription err_flagOutput Joint error codes. brake_stateOutput Joint brake status.
-1: Brake is engaged (not released).
-0: Brake is released. -
Return Value:
AbcErrorCode::SUCCESSindicates success. For other error codes, please refer to AbcErrorCode.
Get Robotic Arm Name
Section titled “Get Robotic Arm Name”-
Method:
std::string get_name() const -
Return Value:
The name of the robotic arm instance.