11#include "frc/MotorSafety.h"
12#include "frc/motorcontrol/MotorController.h"
13#include "wpi/sendable/Sendable.h"
14#include "wpi/sendable/SendableBuilder.h"
15#include "wpi/sendable/SendableHelper.h"
16#include <hal/SimDevice.h>
33 public frc::MotorController,
34 public frc::MotorSafety,
36 public wpi::SendableHelper<TalonFX>
51 std::string m_description;
53 hal::SimDevice m_simMotor;
54 hal::SimDouble m_simSupplyVoltage;
55 hal::SimDouble m_simDutyCycle;
56 hal::SimDouble m_simMotorVoltage;
57 hal::SimDouble m_simTorqueCurrent;
58 hal::SimDouble m_simSupplyCurrent;
60 hal::SimDevice m_simForwardLimit;
61 hal::SimBoolean m_simForwardLimitValue;
63 hal::SimDevice m_simReverseLimit;
64 hal::SimBoolean m_simReverseLimitValue;
66 hal::SimDevice m_simRotor;
67 hal::SimDouble m_simRotorPos;
68 hal::SimDouble m_simRotorRawPos;
69 hal::SimDouble m_simRotorVel;
71 int32_t m_simPeriodicUid{-1};
72 std::vector<int32_t> m_simValueChangedUids;
74 static void OnValueChanged(
const char* name,
void *param, HAL_SimValueHandle handle,
75 HAL_Bool readonly,
const struct HAL_Value* value);
76 static void OnPeriodic(
void* param);
97 TalonFX(
int deviceId, std::string canbus =
"");
105 void Set(
double speed)
override;
117 double Get()
const override;
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:28
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:37
std::string GetDescription() const override
ctre::phoenix::StatusCode SetControlPrivate(controls::ControlRequest &request) override
void SetInverted(bool isInverted) override
Common interface for inverting direction of a motor controller.
void StopMotor() override
Common interface to stop motor movement until Set is called again.
void Disable() override
Common interface for disabling a motor controller.
void InitSendable(wpi::SendableBuilder &builder) override
TalonFX(int deviceId, std::string canbus="")
Constructs a new Talon FX motor controller object.
void SetVoltage(units::volt_t volts) override
Common interface for seting the direct voltage output of a motor controller.
bool GetInverted() const override
Common interface for returning the inversion state of a motor controller.
void Set(double speed) 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.
Class description for the Talon FX integrated motor controller that runs on associated Falcon motors.
Definition: CoreTalonFX.hpp:2367
StatusSignal< units::dimensionless::scalar_t > & GetDutyCycle()
The applied motor duty cycle.
Definition: ManualEvent.hpp:12