RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::Motor Class Referenceabstract

Something that turns a voltage into motion: a V5 motor, a motor group, a simulated motor, a power-takeoff port, or a test mock. More...

#include <Motor.hpp>

Inheritance diagram for rz::Motor:
rz::MotorDevice rz::MotorGroup rz::SimulationMotor

Public Member Functions

 Motor ()=default
 Motor (const Motor &)=delete
Motor & operator= (const Motor &)=delete
 Motor (Motor &&)=delete
Motor & operator= (Motor &&)=delete
virtual ~Motor ()=default
virtual void setVoltage (Voltage voltage)=0
 Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward.
virtual bool connected () const =0

Detailed Description

Something that turns a voltage into motion: a V5 motor, a motor group, a simulated motor, a power-takeoff port, or a test mock.

Feedback is deliberately not part of this interface. Anything that needs it takes a Sensor<T>&, which can be a motor's built-in encoder or an external sensor.

Constructor & Destructor Documentation

◆ Motor() [1/3]

rz::Motor::Motor ( )
default

◆ Motor() [2/3]

rz::Motor::Motor ( const Motor & )
delete

◆ Motor() [3/3]

rz::Motor::Motor ( Motor && )
delete

◆ ~Motor()

virtual rz::Motor::~Motor ( )
virtualdefault

Member Function Documentation

◆ connected()

virtual bool rz::Motor::connected ( ) const
nodiscardpure virtual

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Motor & rz::Motor::operator= ( Motor && )
delete

◆ setVoltage()

virtual void rz::Motor::setVoltage ( Voltage voltage)
pure virtual

Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward.

Implemented in rz::MotorDevice, rz::MotorGroup, and rz::SimulationMotor.


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