Skip to content

General Extended Joint Configuration expandControl

This interface is used for joint speed loop control, position loop control, and state acquisition of expansion joints.

State acquisition of expansion jointsrm_get_expand_state()

  • Method prototype:
C
int rm_get_expand_state(rm_robot_handle * handle,rm_expand_state_t * state)

Jump to rm_robot_handle and rm_expand_state_t for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
stateInputState structure of expansion joints.
  • Return value:

0 represents success. For other error codes, please refer to the API2 Error Codes.

  • Usage demo
C
// Query the state of expansion joints
rm_expand_state_t state;
int result = rm_get_expand_state(robot_handle, &state);

Speed loop control of expansion jointsrm_set_expand_speed()

  • Method prototype:
C
int rm_set_expand_speed(rm_robot_handle * handle,int speed)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
speedInputSpeed percentage, -100 to 100:
speed<0: Lifting mechanism moves down;
speed>0: Lifting mechanism moves up;
speed=0: Lifting mechanism stops moving;
  • Return value:

0 represents success. For other error codes, please refer to the API2 Error Codes.

  • Usage demo
C
int speed = 50;
ret = rm_set_expand_speed(robot_handle,speed);

Position loop control of expansion jointsrm_set_expand_pos()

  • Method prototype:
C
int rm_set_expand_pos(rm_robot_handle * handle,int speed,int pos,int block)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
speedInputSpeed percentage, 1 to 100.
posInputExpansion joint angle, in °.
blockInputBlocking settings:
multi-thread mode: 0: non-blocking mode, immediately return after sending commands; 1: blocking mode, return after the robotic arm reaches the target position or the planning fails.
Single-thread mode: 0: non-blocking mode; other values: blocking mode, and timeout period setting according to the movement time, in s.
  • Return value:

0 represents success. For other error codes, please refer to the API2 Error Codes.

  • Usage demo
C
// By default, the current thread mode is multi-threading, with the system operating at 20% speed and blocking until it reaches the 200 mm position
int ret;
int target = 200;
int speed = 20;
int block = 1;
ret = rm_set_expand_pos(robot_handle,speed,target,block);