![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Drives a skid-steer robot straight for a distance, with a PID on the distance and another holding the heading it started at. More...
#include <DriveController.hpp>
Classes | |
| struct | Config |
Public Member Functions | |
| DriveController (Sensor< Length > &travelled, Sensor< Rotation > &heading, Config config) | |
| Task | distance (SkidSteerChassis &chassis, Length distance) |
| Drives distance straight ahead (backward if negative) from where the robot is. Finishes once settled. | |
Drives a skid-steer robot straight for a distance, with a PID on the distance and another holding the heading it started at.
Construct one per robot with its tuning, and pass the chassis to each drive:
DriveController drive{odometry.distance(), odometry.heading(), {...}};
co_await drive.distance(chassis, au::inches(24.0));
co_await anyOf(drive.distance(chassis, au::inches(-12.0)), sleepFor(au::seconds(1.0))); // with a timeout
|
inline |
| travelled | How far the robot has driven forward, e.g. odometry.distance() or a TrackingWheel. |
| heading | Counterclockwise positive, e.g. odometry.heading() or an InertialSensor. |
|
nodiscard |
Drives distance straight ahead (backward if negative) from where the robot is. Finishes once settled.