Manual

The TurtleBot 4 Navigator uses cardinal directions to set the orientation of the robot relative to
the map. You can use actual integers or floating points if you need a more precise direction.
class TurtleBot4Directions(IntEnum):
NORTH = 0
NORTH_WEST = 45
WEST = 90
SOUTH_WEST = 135
SOUTH = 180
SOUTH_EAST = 225
EAST = 270
NORTH_EAST = 315
Note
These cardinal directions are relative to the map, not the actual magnetic north pole. Driving
north is equivalent to driving upwards on the map, west is driving left, and so on.
Wait for Nav2
Once the initial position has been set, the Nav2 stack will place the robot at that position on the
map and begin localizing. We want to wait for Nav2 to be ready before we start sending
navigation goals.
navigator.waitUntilNav2Active()
Note
This call will block until Nav2 is ready. Make sure you have launched nav bringup in a separate
terminal.
Set the goal pose
Now we can create a geometry_msgs/PoseStamped message. The getPoseStamped method
makes it easy for us. All we have to do is pass in a list describing the x and y position that we
want to drive to on the map, and the direction that we want the robot to be facing when it
reaches that point.
goal_pose = navigator.getPoseStamped([13.0, 5.0], TurtleBot4Directions.EAST)
Undock the robot and go to the goal pose
We are ready to drive to the goal pose. We start by undocking the robot so that it does not
attempt to drive through the dock, and then send the goal pose. As the robot drives to the goal
pose, we will be receiving feedback from the action. This feedback includes the estimated time
of arrival.