Skip to content

Global Waypoint Management globalWaypointManage

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:
ParameterTypeDescription
handleInputRobotic arm handle.
waypointInputAdd global waypoint parameters (the time for adding the waypoint is not required).
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe 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:
ParameterTypeDescription
handleInputRobotic arm handle.
waypointInputUpdate global waypoint parameters (the time for updating the waypoint is not required).
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe 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:
ParameterTypeDescription
handleInputRobotic arm handle.
point_nameInputName of the global waypoint.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe 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:
ParameterTypeDescription
handleInputRobotic arm handle.
nameInputName of the given global waypoint.
pointOutputReturn the given global waypoint parameters.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe 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:
ParameterTypeDescription
handleInputRobotic arm handle.
page_numInputPage number.
page_sizeInputPage size.
vague_searchInputKeyword for vague search.
point_listOutputList of returned global waypoints.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe 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);