WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
frc::XRPMotor Class Reference

XRPMotor. More...

#include <frc/xrp/XRPMotor.h>

Inheritance diagram for frc::XRPMotor:
frc::MotorController frc::MotorSafety

Public Member Functions

 XRPMotor (int deviceNum)
 Constructs an XRPMotor.
 
void Set (double value) override
 Common interface for setting the speed of a motor controller.
 
double Get () const override
 Common interface for getting the current set speed of a motor controller.
 
void SetInverted (bool isInverted) override
 Common interface for inverting direction of a motor controller.
 
bool GetInverted () const override
 Common interface for returning the inversion state of a motor controller.
 
void Disable () override
 Common interface for disabling a motor.
 
void StopMotor () override
 Common interface to stop the motor until Set is called again.
 
std::string GetDescription () const override
 Returns a description to print when an error occurs.
 
- Public Member Functions inherited from frc::MotorController
virtual ~MotorController ()=default
 
virtual void SetVoltage (units::volt_t output)
 Sets the voltage output of the MotorController.
 
- Public Member Functions inherited from frc::MotorSafety
 MotorSafety ()
 
virtual ~MotorSafety ()
 
 MotorSafety (MotorSafety &&rhs)
 
MotorSafetyoperator= (MotorSafety &&rhs)
 
void Feed ()
 Feed the motor safety object.
 
void SetExpiration (units::second_t expirationTime)
 Set the expiration time for the corresponding motor safety object.
 
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 frc::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()

frc::XRPMotor::XRPMotor ( int deviceNum)
explicit

Constructs an XRPMotor.

Parameters
deviceNumthe motor channel

Member Function Documentation

◆ Disable()

void frc::XRPMotor::Disable ( )
overridevirtual

Common interface for disabling a motor.

Implements frc::MotorController.

◆ Get()

double frc::XRPMotor::Get ( ) const
overridevirtual

Common interface for getting the current set speed of a motor controller.

Returns
The current set speed. Value is between -1.0 and 1.0.

Implements frc::MotorController.

◆ GetDescription()

std::string frc::XRPMotor::GetDescription ( ) const
overridevirtual

Returns a description to print when an error occurs.

Returns
Description to print when an error occurs.

Implements frc::MotorSafety.

◆ GetInverted()

bool frc::XRPMotor::GetInverted ( ) const
overridevirtual

Common interface for returning the inversion state of a motor controller.

Returns
isInverted The state of inversion, true is inverted.

Implements frc::MotorController.

◆ Set()

void frc::XRPMotor::Set ( double speed)
overridevirtual

Common interface for setting the speed of a motor controller.

Parameters
speedThe speed to set. Value should be between -1.0 and 1.0.

Implements frc::MotorController.

◆ SetInverted()

void frc::XRPMotor::SetInverted ( bool isInverted)
overridevirtual

Common interface for inverting direction of a motor controller.

Parameters
isInvertedThe state of inversion, true is inverted.

Implements frc::MotorController.

◆ StopMotor()

void frc::XRPMotor::StopMotor ( )
overridevirtual

Common interface to stop the motor until Set is called again.

Implements frc::MotorController.


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