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

A drivetrain with a left and a right side, each driven as one motor (usually a MotorGroup). More...

#include <SkidSteerChassis.hpp>

Classes

struct  WheelVoltages
 One tick's command: a voltage for each side. Positive drives forward. More...
class  Lease
 The exclusive right to drive the chassis, held by whatever is driving it right now. More...

Public Member Functions

 SkidSteerChassis (Motor &left, Motor &right)
 SkidSteerChassis (const SkidSteerChassis &)=delete
SkidSteerChassis & operator= (const SkidSteerChassis &)=delete
Lease take ()
 Takes the exclusive right to drive.

Detailed Description

A drivetrain with a left and a right side, each driven as one motor (usually a MotorGroup).

Motions take the chassis as an argument and drive it through a Lease:

Task<> creep(SkidSteerChassis& chassis) {
    SkidSteerChassis::Lease drive = chassis.take();
    for (;;) {
        drive.apply({.left = au::volts(3.0), .right = au::volts(3.0)});  // write first, then wait
        co_await estimatorsUpdated();
    }
}

Constructor & Destructor Documentation

◆ SkidSteerChassis() [1/2]

rz::SkidSteerChassis::SkidSteerChassis ( Motor & left,
Motor & right )
inline

◆ SkidSteerChassis() [2/2]

rz::SkidSteerChassis::SkidSteerChassis ( const SkidSteerChassis & )
delete

Member Function Documentation

◆ operator=()

SkidSteerChassis & rz::SkidSteerChassis::operator= ( const SkidSteerChassis & )
delete

◆ take()

Lease rz::SkidSteerChassis::take ( )
nodiscard

Takes the exclusive right to drive.

Exceptions
std::logic_errorif something else is driving it: two motions at once is a bug.

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