Class to control a simulated duty cycle encoder.
More...
#include <frc/simulation/DutyCycleEncoderSim.h>
Class to control a simulated duty cycle encoder.
◆ DutyCycleEncoderSim() [1/2]
frc::sim::DutyCycleEncoderSim::DutyCycleEncoderSim |
( |
const DutyCycleEncoder & |
encoder | ) |
|
|
explicit |
◆ DutyCycleEncoderSim() [2/2]
frc::sim::DutyCycleEncoderSim::DutyCycleEncoderSim |
( |
int |
channel | ) |
|
|
explicit |
Constructs from a digital input channel.
- Parameters
-
channel | digital input channel |
◆ Get()
double frc::sim::DutyCycleEncoderSim::Get |
( |
| ) |
|
Get the position in turns.
- Returns
- The position.
◆ GetAbsolutePosition()
double frc::sim::DutyCycleEncoderSim::GetAbsolutePosition |
( |
| ) |
|
Get the absolute position.
- Returns
- The absolute position
◆ GetDistance()
double frc::sim::DutyCycleEncoderSim::GetDistance |
( |
| ) |
|
Get the distance.
- Returns
- The distance.
◆ GetDistancePerRotation()
double frc::sim::DutyCycleEncoderSim::GetDistancePerRotation |
( |
| ) |
|
Get the distance per rotation for this encoder.
- Returns
- The scale factor that will be used to convert rotation to useful units.
◆ IsConnected()
bool frc::sim::DutyCycleEncoderSim::IsConnected |
( |
| ) |
|
Get if the encoder is connected.
- Returns
- true if the encoder is connected.
◆ Set()
void frc::sim::DutyCycleEncoderSim::Set |
( |
units::turn_t |
turns | ) |
|
Set the position in turns.
- Parameters
-
◆ SetAbsolutePosition()
void frc::sim::DutyCycleEncoderSim::SetAbsolutePosition |
( |
double |
position | ) |
|
Set the absolute position.
- Parameters
-
position | The absolute position |
◆ SetConnected()
void frc::sim::DutyCycleEncoderSim::SetConnected |
( |
bool |
isConnected | ) |
|
Set if the encoder is connected.
- Parameters
-
isConnected | Whether or not the sensor is connected. |
◆ SetDistance()
void frc::sim::DutyCycleEncoderSim::SetDistance |
( |
double |
distance | ) |
|
Set the distance.
- Parameters
-
The documentation for this class was generated from the following file: