12#include "frc/MotorSafety.h"
13#include "frc/motorcontrol/MotorController.h"
14#include "wpi/sendable/Sendable.h"
15#include "wpi/sendable/SendableBuilder.h"
16#include "wpi/sendable/SendableHelper.h"
17#include <hal/SimDevice.h>
34 public frc::MotorController,
35 public frc::MotorSafety,
37 public wpi::SendableHelper<TalonFX>
52 std::string m_description;
56 hal::SimDevice m_simMotor;
57 hal::SimDouble m_simSupplyVoltage;
58 hal::SimDouble m_simDutyCycle;
59 hal::SimDouble m_simMotorVoltage;
60 hal::SimDouble m_simTorqueCurrent;
61 hal::SimDouble m_simSupplyCurrent;
63 hal::SimDevice m_simForwardLimit;
64 hal::SimBoolean m_simForwardLimitValue;
66 hal::SimDevice m_simReverseLimit;
67 hal::SimBoolean m_simReverseLimitValue;
69 hal::SimDevice m_simRotor;
70 hal::SimDouble m_simRotorPos;
71 hal::SimDouble m_simRotorRawPos;
72 hal::SimDouble m_simRotorVel;
74 int32_t m_simPeriodicUid{-1};
75 std::vector<int32_t> m_simValueChangedUids;
77 static void OnValueChanged(
const char* name,
void *param, HAL_SimValueHandle handle,
78 HAL_Bool readonly,
const struct HAL_Value* value);
79 static void OnPeriodic(
void* param);
100 TalonFX(
int deviceId, std::string canbus =
"");
108 void Set(
double speed)
override;
120 double Get()
const override;
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:65
Request a specified motor duty cycle.
Definition: DutyCycleOut.hpp:28
Request neutral output of actuator.
Definition: NeutralOut.hpp:27
Request a specified voltage.
Definition: VoltageOut.hpp:29
Class description for the Talon FX integrated motor controller that runs on associated Falcon motors.
Definition: TalonFX.hpp:38
void Set(double speed) override
Common interface for setting the speed of a motor controller.
TalonFX(int deviceId, std::string canbus="")
Constructs a new Talon FX motor controller object.
void InitSendable(wpi::SendableBuilder &builder) override
void Disable() override
Common interface for disabling a motor controller.
ctre::phoenix::StatusCode SetControlPrivate(controls::ControlRequest &request) override
bool GetInverted() const override
Common interface for returning the inversion state of a motor controller.
void SetVoltage(units::volt_t volts) override
Common interface for seting the direct voltage output of a motor controller.
double Get() const override
Common interface for getting the current set speed of a motor controller.
void StopMotor() override
Common interface to stop motor movement until Set is called again.
void SetInverted(bool isInverted) override
Common interface for inverting direction of a motor controller.
std::string GetDescription() const override
Class description for the Talon FX integrated motor controller that runs on associated Falcon motors.
Definition: CoreTalonFX.hpp:1401
StatusSignalValue< units::dimensionless::scalar_t > & GetDutyCycle()
The applied motor duty cycle.
Definition: string_util.hpp:14