WPILibC++ 2023.4.3-108-ge5452e3
frc::NidecBrushless Class Reference

Nidec Brushless Motor. More...

#include <frc/motorcontrol/NidecBrushless.h>

Inheritance diagram for frc::NidecBrushless:
frc::MotorController frc::MotorSafety wpi::Sendable wpi::SendableHelper< NidecBrushless >

Public Member Functions

 NidecBrushless (int pwmChannel, int dioChannel)
 Constructor. More...
 
 ~NidecBrushless () override=default
 
 NidecBrushless (NidecBrushless &&)=default
 
NidecBrushlessoperator= (NidecBrushless &&)=default
 
void Set (double speed) override
 Set the PWM value. More...
 
double Get () const override
 Get the recently set value of the PWM. More...
 
void SetInverted (bool isInverted) override
 Common interface for inverting direction of a motor controller. More...
 
bool GetInverted () const override
 Common interface for returning the inversion state of a motor controller. More...
 
void Disable () override
 Disable the motor. More...
 
void Enable ()
 Re-enable the motor after Disable() has been called. More...
 
void StopMotor () override
 
std::string GetDescription () const override
 The return value from this method is printed out when an error occurs. More...
 
int GetChannel () const
 Gets the channel number associated with the object. More...
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from frc::MotorController
virtual ~MotorController ()=default
 
virtual void Set (double speed)=0
 Common interface for setting the speed of a motor controller. More...
 
virtual void SetVoltage (units::volt_t output)
 Sets the voltage output of the MotorController. More...
 
virtual double Get () const =0
 Common interface for getting the current set speed of a motor controller. More...
 
virtual void SetInverted (bool isInverted)=0
 Common interface for inverting direction of a motor controller. More...
 
virtual bool GetInverted () const =0
 Common interface for returning the inversion state of a motor controller. More...
 
virtual void Disable ()=0
 Common interface for disabling a motor. More...
 
virtual void StopMotor ()=0
 Common interface to stop the motor until Set is called again. More...
 
- Public Member Functions inherited from frc::MotorSafety
 MotorSafety ()
 
virtual ~MotorSafety ()
 
 MotorSafety (MotorSafety &&rhs)
 
MotorSafetyoperator= (MotorSafety &&rhs)
 
void Feed ()
 Feed the motor safety object. More...
 
void SetExpiration (units::second_t expirationTime)
 Set the expiration time for the corresponding motor safety object. More...
 
units::second_t GetExpiration () const
 Retrieve the timeout value for the corresponding motor safety object. More...
 
bool IsAlive () const
 Determine if the motor is still operating or has timed out. More...
 
void SetSafetyEnabled (bool enabled)
 Enable/disable motor safety for this device. More...
 
bool IsSafetyEnabled () const
 Return the state of the motor safety enabled flag. More...
 
void Check ()
 Check if this motor has exceeded its timeout. More...
 
virtual void StopMotor ()=0
 
virtual std::string GetDescription () const =0
 The return value from this method is printed out when an error occurs. More...
 
- Public Member Functions inherited from wpi::Sendable
virtual ~Sendable ()=default
 
virtual void InitSendable (SendableBuilder &builder)=0
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::SendableHelper< NidecBrushless >
 SendableHelper (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
SendableHelperoperator= (SendableHelper &&rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::MotorSafety
static void CheckMotors ()
 Check the motors to see if any have timed out. More...
 
- Protected Member Functions inherited from wpi::SendableHelper< NidecBrushless >
 SendableHelper ()=default
 
 ~SendableHelper ()
 

Detailed Description

Nidec Brushless Motor.

Constructor & Destructor Documentation

◆ NidecBrushless() [1/2]

frc::NidecBrushless::NidecBrushless ( int  pwmChannel,
int  dioChannel 
)

Constructor.

Parameters
pwmChannelThe PWM channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-19 are on the MXP port.
dioChannelThe DIO channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-25 are on the MXP port.

◆ ~NidecBrushless()

frc::NidecBrushless::~NidecBrushless ( )
overridedefault

◆ NidecBrushless() [2/2]

frc::NidecBrushless::NidecBrushless ( NidecBrushless &&  )
default

Member Function Documentation

◆ Disable()

void frc::NidecBrushless::Disable ( )
overridevirtual

Disable the motor.

The Enable() function must be called to re-enable the motor.

Implements frc::MotorController.

◆ Enable()

void frc::NidecBrushless::Enable ( )

Re-enable the motor after Disable() has been called.

The Set() function must be called to set a new motor speed.

◆ Get()

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

Get the recently set value of the PWM.

Returns
The most recently set value for the PWM between -1.0 and 1.0.

Implements frc::MotorController.

◆ GetChannel()

int frc::NidecBrushless::GetChannel ( ) const

Gets the channel number associated with the object.

Returns
The channel number.

◆ GetDescription()

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

The return value from this method is printed out when an error occurs.

This method must not throw!

Implements frc::MotorSafety.

◆ GetInverted()

bool frc::NidecBrushless::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.

◆ InitSendable()

void frc::NidecBrushless::InitSendable ( wpi::SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ operator=()

NidecBrushless & frc::NidecBrushless::operator= ( NidecBrushless &&  )
default

◆ Set()

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

Set the PWM value.

The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the FPGA.

Parameters
speedThe speed value between -1.0 and 1.0 to set.

Implements frc::MotorController.

◆ SetInverted()

void frc::NidecBrushless::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::NidecBrushless::StopMotor ( )
overridevirtual

Implements frc::MotorSafety.


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