RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
DriveController.hpp
1#pragma once
2#include "RaidZeroLib/api/Chassis/SkidSteerChassis.hpp"
3#include "RaidZeroLib/api/Control/Pid.hpp"
4#include "RaidZeroLib/api/Control/Settled.hpp"
5#include "RaidZeroLib/api/Geometry/Rotation.hpp"
6#include "RaidZeroLib/api/Hardware/Sensor.hpp"
7#include "RaidZeroLib/api/Runtime/Task.hpp"
8#include "RaidZeroLib/api/Units/Units.hpp"
9
10namespace rz {
11
23 public:
33
37 : travelled(travelled), heading(heading), config(config) {}
38
42
43 private:
44 Sensor<Length>& travelled;
45 Sensor<Rotation>& heading;
46 Config config;
47};
48
49} // namespace rz
DriveController(Sensor< Length > &travelled, Sensor< Rotation > &heading, Config config)
Definition DriveController.hpp:36
Task distance(SkidSteerChassis &chassis, Length distance)
Drives distance straight ahead (backward if negative) from where the robot is. Finishes once settled.
A reading from hardware, or computed from other sensors.
Definition Sensor.hpp:25
A drivetrain with a left and a right side, each driven as one motor (usually a MotorGroup).
Definition SkidSteerChassis.hpp:22
corral::Task< T > Task
Lazy: nothing runs until it is co_awaited.
Definition Task.hpp:17
au::QuantityD< au::Volts > Voltage
Definition Units.hpp:15
au::QuantityD< au::Meters > Length
Definition Units.hpp:9
Definition DriverControl.hpp:11
Definition DriveController.hpp:24
Pid< Angle, Voltage >::Config headingPid
Keeps the robot pointing the way it started. Zero gains drive without correcting the heading.
Definition DriveController.hpp:29
Settled< Length >::Config settle
When the drive is done, e.g. within 1 cm for 100 ms.
Definition DriveController.hpp:27
Voltage maxVoltage
The most voltage used for driving forward; the heading correction comes on top.
Definition DriveController.hpp:31
Pid< Length, Voltage >::Config distancePid
Definition DriveController.hpp:25
Definition Pid.hpp:29
Definition Settled.hpp:16