3#include "frc/MotorSafety.h"
4#include "frc/motorcontrol/MotorController.h"
5#include "wpi/sendable/Sendable.h"
6#include "wpi/sendable/SendableHelper.h"
7#include "wpi/sendable/SendableBuilder.h"
8#include "CANVenomApi.h"
22class CANVenom :
public MotorSafety,
public MotorController,
public wpi::Sendable,
public wpi::SendableHelper<CANVenom> {
271 virtual void Set(
double command)
override;
279 virtual double Get()
const override;
297 virtual void SetInverted(
bool isInverted)
override;
318 virtual void Disable()
override;
338 virtual void PIDWrite(
double output);
345 virtual void InitSendable (wpi::SendableBuilder &builder)
override;
726 double GetKF()
const;
744 double GetKP()
const;
753 double GetKI()
const;
762 double GetKD()
const;
887 void SetPID(
double kP,
double kI,
double kD,
double kF,
double b);
895 void SetKF(
double kF);
911 void SetKP(
double kP);
919 void SetKI(
double kI);
927 void SetKD(
double kD);
1012 CANVenom_t *m_canVenomHandle;
Definition: CANVenom.h:22
void ResetPosition()
Definition: CANVenom.cpp:118
virtual std::string GetDescription() const override
Definition: CANVenom.cpp:25
double GetPosition() const
Definition: CANVenom.cpp:203
void AddMotionProfilePoint(double time, double speed, double position)
Definition: CANVenom.cpp:131
CANVenom & operator=(const CANVenom &)=delete
FaultFlag GetActiveFaults() const
Definition: CANVenom.cpp:263
double GetKD() const
Definition: CANVenom.cpp:227
virtual void Disable() override
Definition: CANVenom.cpp:62
void Follow(CANVenom &leadVenom)
Definition: CANVenom.cpp:45
double GetAuxVoltage() const
Definition: CANVenom.cpp:195
virtual void InitSendable(wpi::SendableBuilder &builder) override
Definition: CANVenom.cpp:87
ControlMode GetActiveControlMode() const
Definition: CANVenom.cpp:255
uint16_t GetCurrentMotionProfilePoint() const
Definition: CANVenom.cpp:155
double GetBusVoltage() const
Definition: CANVenom.cpp:175
void SetB(double b)
Definition: CANVenom.cpp:283
FaultFlag GetLatchedFaults() const
Definition: CANVenom.cpp:267
void ClearLatchedFaults()
Definition: CANVenom.cpp:271
CANVenom(uint8_t motorID)
Definition: CANVenom.cpp:7
double GetOutputVoltage() const
Definition: CANVenom.cpp:179
double GetKI() const
Definition: CANVenom.cpp:223
void SetMaxJerk(double limit)
Definition: CANVenom.cpp:315
BrakeCoastMode GetBrakeCoastMode() const
Definition: CANVenom.cpp:259
MotionProfileState
Definition: CANVenom.h:157
@ kInit
Definition: CANVenom.h:161
@ kErrBufferUnderflow
Definition: CANVenom.h:183
@ kDone
Definition: CANVenom.h:210
@ kErrBufferCleared
Definition: CANVenom.h:174
@ kErrBufferInvalid
Definition: CANVenom.h:203
@ kRunning
Definition: CANVenom.h:167
void CompleteMotionProfilePath(double time, double position)
Definition: CANVenom.cpp:135
void SetPosition(double newPosition)
Definition: CANVenom.cpp:122
void SetPID(double kP, double kI, double kD, double kF, double b)
Definition: CANVenom.cpp:275
uint32_t GetFirmwareVersion() const
Definition: CANVenom.cpp:143
virtual void Set(double command) override
Definition: CANVenom.cpp:30
void SetKD(double kD)
Definition: CANVenom.cpp:295
double GetOutputCurrent() const
Definition: CANVenom.cpp:187
double GetMotionProfilePositionTarget() const
Definition: CANVenom.cpp:159
void ClearMotionProfilePoints()
Definition: CANVenom.cpp:126
bool GetRevLimitSwitchActive() const
Definition: CANVenom.cpp:79
void ExecutePath()
Definition: CANVenom.cpp:139
double GetKF() const
Definition: CANVenom.cpp:211
double GetMaxSpeed() const
Definition: CANVenom.cpp:239
bool GetFwdLimitSwitchActive() const
Definition: CANVenom.cpp:75
bool GetMotionProfileIsValid() const
Definition: CANVenom.cpp:167
FaultFlag
Definition: CANVenom.h:94
@ kBadMode
Definition: CANVenom.h:131
@ kHighTemperature
Definition: CANVenom.h:120
@ kNoLeaderHeartbeat
Definition: CANVenom.h:109
@ kNone
Definition: CANVenom.h:98
@ kDuplicateID
Definition: CANVenom.h:137
@ kNoHeartbeat
Definition: CANVenom.h:104
@ kForwardLimit
Definition: CANVenom.h:142
@ kHighCurrent
Definition: CANVenom.h:125
@ kReset
Definition: CANVenom.h:153
@ kReverseLimit
Definition: CANVenom.h:147
@ kBadLeaderID
Definition: CANVenom.h:115
double GetMaxAcceleration() const
Definition: CANVenom.cpp:243
virtual void StopMotor() override
Definition: CANVenom.cpp:21
double GetMinPILimit() const
Definition: CANVenom.cpp:231
void SetMinPILimit(double limit)
Definition: CANVenom.cpp:299
double GetSpeed() const
Definition: CANVenom.cpp:199
void SetControlMode(ControlMode controlMode)
Definition: CANVenom.cpp:319
void SetBrakeCoastMode(BrakeCoastMode brakeCoastMode)
Definition: CANVenom.cpp:323
CANVenom(CANVenom &&)=default
MotionProfileState GetMotionProfileState() const
Definition: CANVenom.cpp:171
CANVenom & operator=(CANVenom &&)=default
double GetB() const
Definition: CANVenom.cpp:215
void EnableLimitSwitches(bool fwdLimitSwitchEnabled, bool revLimitSwitchEnabled)
Definition: CANVenom.cpp:83
uint32_t GetSerialNumber() const
Definition: CANVenom.cpp:147
virtual void SetInverted(bool isInverted) override
Definition: CANVenom.cpp:54
void SetMaxSpeed(double limit)
Definition: CANVenom.cpp:307
uint16_t GetNumAvaliableMotionProfilePoints() const
Definition: CANVenom.cpp:151
double GetMotionProfileSpeedTarget() const
Definition: CANVenom.cpp:163
void SetKP(double kP)
Definition: CANVenom.cpp:287
void Enable()
Definition: CANVenom.cpp:66
BrakeCoastMode
Definition: CANVenom.h:80
@ kBrake
Definition: CANVenom.h:91
@ kCoast
Definition: CANVenom.h:85
void IdentifyMotor()
Definition: CANVenom.cpp:114
virtual double Get() const override
Definition: CANVenom.cpp:49
ControlMode GetControlMode() const
Definition: CANVenom.cpp:251
virtual ~CANVenom()
Definition: CANVenom.cpp:16
void SetMaxPILimit(double limit)
Definition: CANVenom.cpp:303
double GetPIDTarget() const
Definition: CANVenom.cpp:207
CANVenom(const CANVenom &)=delete
double GetDutyCycle() const
Definition: CANVenom.cpp:183
void SetKI(double kI)
Definition: CANVenom.cpp:291
void SetKF(double kF)
Definition: CANVenom.cpp:279
double GetMaxJerk() const
Definition: CANVenom.cpp:247
double GetMaxPILimit() const
Definition: CANVenom.cpp:235
double GetTemperature() const
Definition: CANVenom.cpp:191
void SetMaxAcceleration(double limit)
Definition: CANVenom.cpp:311
virtual void PIDWrite(double output)
Definition: CANVenom.cpp:70
virtual bool GetInverted() const override
Definition: CANVenom.cpp:58
double GetKP() const
Definition: CANVenom.cpp:219
ControlMode
Definition: CANVenom.h:24
@ kPositionControl
Definition: CANVenom.h:48
@ kDisabled
Definition: CANVenom.h:28
@ kCurrentControl
Definition: CANVenom.h:38
@ kSpeedControl
Definition: CANVenom.h:43
@ kVoltageControl
Definition: CANVenom.h:77
@ kProportional
Definition: CANVenom.h:33
@ kFollowTheLeader
Definition: CANVenom.h:71
@ kMotionProfile
Definition: CANVenom.h:57
void SetCommand(ControlMode mode, double command)
Definition: CANVenom.cpp:35
Definition: CANVenom.h:10