C、C++:
Global Waypoint ManagementglobalWaypointManage
It is used to add, query, or update global waypoints.
Add global waypointsrm_add_global_waypoint()
- Method prototype:
C
int rm_add_global_waypoint(rm_robot_handle * handle,rm_waypoint_t waypoint)
Jump to rm_robot_handle and rm_waypoint_t for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
waypoint | Input | Add global waypoint parameters (the time for adding the waypoint is not required). |
- 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
// Add global waypoint p3
rm_waypoint_t waypoint;
strcpy(waypoint.point_name,"p3");
waypoint.joint[0] = 20;
waypoint.joint[1] = 30;
// The remaining joint angles are all 0
for (int i = 2; i < 6; ++i) {
waypoint.joint[i] = 0.0;
}
// Set position and orientation
waypoint.pose.position.x = 0.01;
waypoint.pose.position.y = 0.02;
waypoint.pose.position.z = 0.03;
waypoint.pose.euler.rx = 0.1;
waypoint.pose.euler.ry = 0.2;
waypoint.pose.euler.rz = 0.3;
strcpy(waypoint.work_frame, "World");
strcpy(waypoint.tool_frame, "Arm_Tip");
ret = rm_add_global_waypoint(robot_handle, waypoint);
Update global waypointsrm_update_global_waypoint()
- Method prototype:
C
int rm_update_global_waypoint(rm_robot_handle * handle,rm_waypoint_t waypoint)
Jump to rm_robot_handle and rm_waypoint_t for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
waypoint | Input | Update global waypoint parameters (the time for updating the waypoint is not required). |
- 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
// Update global waypoint p3
rm_waypoint_t waypoint;
strcpy(waypoint.point_name,"p3");
waypoint.joint[0] = 20;
waypoint.joint[1] = 30;
// The remaining joint angles are all 0
for (int i = 2; i < 6; ++i) {
waypoint.joint[i] = 0.0;
}
// Set position and orientation
waypoint.pose.position.x = 0.01;
waypoint.pose.position.y = 0.02;
waypoint.pose.position.z = 0.03;
waypoint.pose.euler.rx = 0.1;
waypoint.pose.euler.ry = 0.2;
waypoint.pose.euler.rz = 0.3;
strcpy(waypoint.work_frame, "World");
strcpy(waypoint.tool_frame, "Arm_Tip");
ret = rm_update_global_waypoint(robot_handle, waypoint);
Delete global waypointsrm_delete_global_waypoint()
- Method prototype:
C
int rm_delete_global_waypoint(rm_robot_handle * handle,const char * point_name)
Jump to rm_robot_handle and rm_waypoint_t for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
point_name | Input | Name of the global waypoint. |
- 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
// Delete global waypoint p3
rm_delete_global_waypoint(robot_handle, "p3");
Query given global waypointsrm_get_given_global_waypoint()
- Method prototype:
C
int rm_get_given_global_waypoint(rm_robot_handle * handle,const char * name,rm_waypoint_t * point)
Jump to rm_robot_handle and rm_waypoint_t for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
name | Input | Name of the given global waypoint. |
point | Output | Return the given global waypoint parameters. |
- 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
// Get parameters for global waypoint p3
rm_waypoint_t point;
ret = rm_get_given_global_waypoint(robot_handle, "p3", &point);
Query multiple global waypointsrm_get_global_waypoints_list()
- Method prototype:
C
int rm_get_global_waypoints_list(rm_robot_handle * handle,int page_num,int page_size,const char * vague_search,rm_waypoint_list_t * point_list)
Jump to rm_robot_handle and rm_waypoint_t for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
page_num | Input | Page number. |
page_size | Input | Page size. |
vague_search | Input | Keyword for vague search. |
point_list | Output | List of returned global waypoints. |
- 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 information of 10 global waypoints on the first page
rm_waypoint_list_t point_list;
int page_num = 1;
int page_size = 10;
const char *vague_search;
ret = rm_get_global_waypoints_list(robot_handle,page_num,page_size,vague_search,&point_list);
printf("get global waypoints list result : %d\n", ret);