![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
V5 Smart Motor. Its built-in encoder is exposed as sensors on the same snapshot. More...
#include <MotorDevice.hpp>
Classes | |
| struct | Config |
Public Types | |
| enum class | Cartridge { Red , Green , Blue } |
Public Member Functions | |
| MotorDevice (std::uint8_t port) | |
| MotorDevice (std::uint8_t port, Config config) | |
| void | setVoltage (Voltage voltage) override |
| Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward. | |
| bool | connected () const override |
| Sensor< Angle > & | encoder () noexcept |
| Output shaft angle (after the cartridge). | |
| Sensor< AngularVelocity > & | velocity () noexcept |
| Output shaft velocity as estimated by the motor. | |
| Public Member Functions inherited from rz::Device | |
| std::uint8_t | port () const noexcept |
| bool | deviceConnected () const noexcept |
| Whether this tick's read succeeded. | |
| std::uint32_t | deviceEpoch () const noexcept |
| Increments on every (re)connection. | |
| Public Member Functions inherited from rz::Component | |
| Component (const Component &)=delete | |
| Component & | operator= (const Component &)=delete |
| Component (Component &&)=delete | |
| Component & | operator= (Component &&)=delete |
| virtual | ~Component () |
| std::string_view | name () const noexcept |
| Used in log and error messages. | |
| Public Member Functions inherited from rz::Motor | |
| Motor ()=default | |
| Motor (const Motor &)=delete | |
| Motor & | operator= (const Motor &)=delete |
| Motor (Motor &&)=delete | |
| Motor & | operator= (Motor &&)=delete |
| virtual | ~Motor ()=default |
Additional Inherited Members | |
| Static Public Member Functions inherited from rz::Device | |
| static void | validatePorts () |
| Throws std::runtime_error if two devices are constructed on the same port. | |
| Static Public Member Functions inherited from rz::Component | |
| static Task | runAll () |
| Runs the loop of every component constructed so far, in construction order, until cancelled. rz::robot runs it; tests without rz::robot run it alongside their script. | |
| Protected Member Functions inherited from rz::Device | |
| Device (std::uint8_t port, std::string_view kind) | |
| ~Device () override | |
| Protected Member Functions inherited from rz::Component | |
| Component (std::string_view name) | |
V5 Smart Motor. Its built-in encoder is exposed as sensors on the same snapshot.
|
strong |
|
inlineexplicit |
| rz::MotorDevice::MotorDevice | ( | std::uint8_t | port, |
| Config | config ) |
|
inlinenodiscardoverridevirtual |
Implements rz::Motor.
Output shaft angle (after the cartridge).
|
overridevirtual |
Commands a voltage, clamped to the motor's range. Positive drives the mechanism forward.
Implements rz::Motor.
|
inlinenodiscardnoexcept |
Output shaft velocity as estimated by the motor.