WPILibC++ 2027.0.0-alpha-4
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 SetDutyCycle (double value) override
 Sets the duty cycle of the motor controller.
double GetDutyCycle () const override
 Gets the duty cycle 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.

◆ GetDutyCycle()

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

Gets the duty cycle of the motor controller.

Returns
The duty cycle between -1 and 1 (sign indicates direction).

Implements wpi::MotorController.

◆ GetInverted()

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

Gets the inversion state of the motor controller.

Returns
The inversion state.

Implements wpi::MotorController.

◆ SetDutyCycle()

void wpi::xrp::XRPMotor::SetDutyCycle ( double dutyCycle)
overridevirtual

Sets the duty cycle of the motor controller.

Parameters
dutyCycleThe duty cycle between -1 and 1 (sign indicates direction).

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.

◆ 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: