Class BaseQuadDrive

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class BaseQuadDrive : public fang::chassis::QuadDriveSubsystem

This provides control for a set of 4 ISpeedMotors It manages the initialization and update functionality as well.

This is often passed into a holonomic drive or tank drive to delegate managing the wheel speeds and updating each of the motors

This can be managed by a taproot command (can be registered).

Subclassed by fang::chassis::PowerQuadDrive, fang::chassis::UltraMk2BaseQuaddrive

Public Types

using Motor = motor::ISpeedMotor
using Motors = QuadCollection<std::unique_ptr<Motor>>

Public Functions

BaseQuadDrive(Drivers &drivers, std::unique_ptr<Motor> frontLeftMotor, std::unique_ptr<Motor> frontRightMotor, std::unique_ptr<Motor> rearLeftMotor, std::unique_ptr<Motor> rearRightMotor)
BaseQuadDrive(Drivers &drivers, Motors &&motors)

Motors should be passed explicitly with move semantics to prevent memory errors. If you are unfamiliar with r-value references, since they have no name, they pop into existence the moment they are stated then pop out. This means that we do not have to worry about motors continuing to hold unto. If motors must be a named variable, cast it to an r-value reference with std::move()

virtual void setTargetWheelSpeeds(const QuadRPM &wheelSpeeds) override
virtual void initialize() override
virtual void update() override
virtual void refresh() override
inline virtual ~BaseQuadDrive()