C、C++:
General Extended Joint ConfigurationexpandControl
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
state | Input | State structure of expansion joints. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- 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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
speed | Input | Speed percentage, -100 to 100: speed<0: Lifting mechanism moves down; speed>0: Lifting mechanism moves up; speed=0: Lifting mechanism stops moving; |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- 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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
speed | Input | Speed percentage, 1 to 100. |
pos | Input | Expansion joint angle, in °. |
block | Input | Blocking 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:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
-4 | int | The current in-position equipment verification fails, indicating the current in-position equipment is not a dexterous hand. |
-5 | int | The single-thread mode does not receive a return value after the timeout, indicating that the timeout period may be improper. |
- 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);