RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::TurnController Class Reference

Turns a skid-steer robot in place to face a heading, with a PID on the heading error. More...

#include <TurnController.hpp>

Classes

struct  Config

Public Member Functions

 TurnController (Sensor< Rotation > &heading, Config config)
Task to (SkidSteerChassis &chassis, Rotation target)
 Turns in place to face target, the short way round. Finishes once settled.

Detailed Description

Turns a skid-steer robot in place to face a heading, with a PID on the heading error.

Construct one per robot with its tuning, and pass the chassis to each turn:

TurnController turn{odometry.heading(), {.pid = {...}, .settle = {.tolerance = au::degrees(1.0), ...}}};
co_await turn.to(chassis, Rotation{au::degrees(90.0)});
co_await anyOf(turn.to(chassis, Rotation{}), sleepFor(au::seconds(1.0)));  // with a timeout

Constructor & Destructor Documentation

◆ TurnController()

rz::TurnController::TurnController ( Sensor< Rotation > & heading,
Config config )
inline
Parameters
headingCounterclockwise positive, e.g. odometry.heading() or an InertialSensor.

Member Function Documentation

◆ to()

Task rz::TurnController::to ( SkidSteerChassis & chassis,
Rotation target )
nodiscard

Turns in place to face target, the short way round. Finishes once settled.


The documentation for this class was generated from the following file: