This tutorial describes how to use the Next Token with a robot. This applies to both physical and simulated robots.

Prerequisites

  1. Create a new flow with two progress steps: Loading and Moving.

Screenshot of creating a new flow

  1. Connect a robot to LGDXRobot Cloud.

Completing the Progress

  1. Create a new task using the flow just created. The waypoints can be any waypoints in the realm.

Screenshot of creating a new task

  1. The robot will not move because the current progress is Loading.
  2. Connect to the robot or web interface.
  3. In the terminal, run the following command to obtain the task ID and Next Token:
ros2 topic echo /agent/auto_task

Screenshot of obtaining the task ID and Next Token

  1. In another terminal, run the following command to complete the progress:
ros2 service call /auto_task_next lgdxrobot2_agent/srv/AutoTaskNext "{task_id: <task ID>, next_token: '<Next Token>'}"

Screenshot of completing the progress

  1. The robot will move to the next waypoint.

Aborting the Task

  1. Create a new task using the flow just created. The waypoints can be any waypoints in the realm.
  2. The robot will not move because the current progress is Loading.
  3. Connect to the robot or web interface.
  4. In the terminal, run the following command to obtain the task ID and Next Token:
ros2 topic echo /agent/auto_task

Screenshot of obtaining the task ID and Next Token

  1. In another terminal, run the following command to abort the task:
ros2 service call /auto_task_abort lgdxrobot2_agent/srv/AutoTaskAbort "{task_id: <task ID>, next_token: '<Next Token>'}"

Screenshot of aborting the task

  1. The task will be aborted, and an email notification will be sent.