This tutorial describes how to use the Next Token with a robot. This applies to both physical and simulated robots.
Prerequisites
- Create a new flow with two progress steps: Loading and Moving.

- Connect a robot to LGDXRobot Cloud.
Completing the Progress
- Create a new task using the flow just created. The waypoints can be any waypoints in the realm.

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

- 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>'}"

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

- 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>'}"

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