-
Notifications
You must be signed in to change notification settings - Fork 229
Waypoint Following
The waypointFollower
controller steers the AutoRally platform between successive waypoints that are defined in the global coordinate frame used by the state estimator.
We provide an example waypoints file recorded in the simulation track. The waypointFollower
loads the provided waypoints
file by default, but can be changed in the launch file.
Launch the waypointFollower
to steer the AutoRally platform with the following procedure:
-
Run some method to control the platform (gamepad in simulation or transmitter in the real world)
-
Run the
stateEstimator
and ensure it has converged -
Drive the AutoRally platform to the start of the waypoints. For the provided
waypoints
file taken in simulation this location is the spawn location of the platform. -
If running on a physical AutoRally platform, make sure the platform is set to autonomous control and autonomous motion is enabled. If you are unsure what that means, refer to the AutoRally Operating Procedures
-
Launch the waypoint follower with the platform stationary
roslaunch autorally_control waypointFollower.launch
The waypointFollower
does not control the throttle. You can control the throttle manually, run the provided Constant Speed controller, or use your own controller.
On startup the waypointFollower
reads in the waypoints file as an ordered list, and steers toward the first waypoint in the list. When proximity conditions are satisfied for a waypoint, the controller moved on to the next waypoint in the list. The waypointFollower
loops back to the first waypoint once the proximity conditions for the last waypoint in the list are satisfied.
Launch parameters WaypointRadius
and HeadingP
can be tuned to change the reaction speed of the steering and how close you must get to a waypoint before switching to the next waypoint.
The waypoint follower automatically loops back to the first waypoint in the list after the last is reached. To produce the most reliable waypoint following behavior we recommended you set the first waypoint at the end of a straight and the last waypoint at the beginning of the same straight.
By default the waypoint recorder will overwrite the provided waypoints
file. This behavior can be changed in the waypoint recorder launch file. Remember to update the waypointFollower
launch file with your new waypoints file location before running.
Record your own set of waypoints (coordinates in the x-y plane) with the following process:
-
Run some method to control the platform (gamepad in simulation or transmitter in the real world)
-
Run the
stateEstimator
and ensure it has converged -
Start recording waypoints with the command:
roslaunch autorally_control recordWpts.launch
-
Drive the desired trajectory
-
Stop the
recordWpts
node once you have recorded the desired trajectory to stop waypoint recording.
The parameter WaypointDistance
controls the distance between recorded waypoints.