Autoware.Auto
|
|
The purpose of this base class is to encapsulate common functionality of a controller.
This common functionality is then intended to ease the implementation of specific controller algorithms.
compute_command_impl(State)
must be implemented. This defines the control behavior of the controller under nominal trajectory following conditions.
check_new_trajectory(Trajectory)
can be overridden to allow the user to define whether a trajectory is accepted or rejected. Some examples can include checking if the provided trajectory meets certain assumptions required for the control algorithm to work, such as a specified sampling rate.
handle_new_trajectory(Trajectory)
can be overridden to allow the user to update book-keeping, such as for an algorithm-specific representation of the trajectory.
Some input validation is baked into the design. compute_command
will throw an exception if the state is not in the same frame as the trajectory. It is the user's responsibility to ensure that the inputs are compatible.
A number of basic behaviors are intended to be implemented by the base controller class so that algorithm implementers need not worry about the implementation. In addition, this will ensure that all controllers implementing this interface exhibit the same behavior during edge cases.
The following behaviors are implemented:
When a trajectory is not present, or otherwise unavailable, the vehicle should come to a smooth stop.
Control commands that will bring the vehicle to a smooth stop will be generated in lieu of an algorithm computing the commands under the following conditions:
On each call to compute_command(State)
, the reference index with respect to the trajectory is updated. The reference index is the last point the given state is past (or equal to).
compute_command(State)
set_trajectory(Trajectory)
variantsDifferent algorithms work on spatial or temporal references. As such, an API for both tracking the current state in both the time and space sense is provided.