WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
wpi::xrp::XRPMotor Class Reference

XRPMotor. More...

#include <wpi/xrp/XRPMotor.hpp>

Inheritance diagram for wpi::xrp::XRPMotor:
wpi::MotorController wpi::MotorSafety

Public Member Functions

 XRPMotor (int deviceNum)
 Constructs an XRPMotor.
void SetThrottle (double throttle) override
 Sets the throttle of the motor controller.
double GetThrottle () const override
 Gets the throttle of the motor controller.
void SetInverted (bool isInverted) override
 Sets the inversion state of the motor controller.
bool GetInverted () const override
 Gets the inversion state of the motor controller.
void Disable () override
 Disables the motor controller.
void StopMotor () override
 Called to stop the motor when the timeout expires.
std::string GetDescription () const override
 Returns a description to print when an error occurs.
Public Member Functions inherited from wpi::MotorController
virtual ~MotorController ()=default
virtual void SetVoltage (wpi::units::volt_t voltage)
 Sets the voltage output of the motor controller.
Public Member Functions inherited from wpi::MotorSafety
 MotorSafety ()
virtual ~MotorSafety ()
 MotorSafety (MotorSafety &&rhs)
MotorSafetyoperator= (MotorSafety &&rhs)
void Feed ()
 Feed the motor safety object.
void SetExpiration (wpi::units::second_t expirationTime)
 Set the expiration time for the corresponding motor safety object.
wpi::units::second_t GetExpiration () const
 Retrieve the timeout value for the corresponding motor safety object.
bool IsAlive () const
 Determine if the motor is still operating or has timed out.
void SetSafetyEnabled (bool enabled)
 Enable/disable motor safety for this device.
bool IsSafetyEnabled () const
 Return the state of the motor safety enabled flag.
void Check ()
 Check if this motor has exceeded its timeout.

Additional Inherited Members

Static Public Member Functions inherited from wpi::MotorSafety
static void CheckMotors ()
 Check the motors to see if any have timed out.

Detailed Description

XRPMotor.

A SimDevice based motor controller representing the motors on an XRP robot

Constructor & Destructor Documentation

◆ XRPMotor()

wpi::xrp::XRPMotor::XRPMotor ( int deviceNum)
explicit

Constructs an XRPMotor.

Parameters
deviceNumthe motor channel

Member Function Documentation

◆ Disable()

void wpi::xrp::XRPMotor::Disable ( )
overridevirtual

Disables the motor controller.

Implements wpi::MotorController.

◆ GetDescription()

std::string wpi::xrp::XRPMotor::GetDescription ( ) const
overridevirtual

Returns a description to print when an error occurs.

Returns
Description to print when an error occurs.

Implements wpi::MotorSafety.

◆ GetInverted()

bool wpi::xrp::XRPMotor::GetInverted ( ) const
overridevirtual

Gets the inversion state of the motor controller.

Returns
The inversion state.

Implements wpi::MotorController.

◆ GetThrottle()

double wpi::xrp::XRPMotor::GetThrottle ( ) const
overridevirtual

Gets the throttle of the motor controller.

Returns
The throttle where -1 represents full reverse and 1 represents full forward.

Implements wpi::MotorController.

◆ SetInverted()

void wpi::xrp::XRPMotor::SetInverted ( bool isInverted)
overridevirtual

Sets the inversion state of the motor controller.

Parameters
isInvertedThe inversion state.

Implements wpi::MotorController.

◆ SetThrottle()

void wpi::xrp::XRPMotor::SetThrottle ( double throttle)
overridevirtual

Sets the throttle of the motor controller.

Parameters
throttleThe throttle where -1 indicates full reverse and 1 indicates full forward.

Implements wpi::MotorController.

◆ StopMotor()

void wpi::xrp::XRPMotor::StopMotor ( )
overridevirtual

Called to stop the motor when the timeout expires.

Implements wpi::MotorSafety.


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