libPlayingWithFusion
2020.02.24
Playing With Fusion driver library for FRC roboRIO
|
3 #include "frc/MotorSafety.h"
4 #include "frc/SpeedController.h"
5 #include "frc/smartdashboard/SendableBase.h"
6 #include "frc/smartdashboard/SendableBuilder.h"
7 #include "CANVenomApi.h"
21 class CANVenom :
public MotorSafety,
public SpeedController,
public SendableBase {
257 virtual void GetDescription(wpi::raw_ostream& desc)
const override;
270 virtual void Set(
double command)
override;
278 virtual double Get()
const override;
296 virtual void SetInverted(
bool isInverted)
override;
317 virtual void Disable()
override;
337 virtual void PIDWrite(
double output)
override;
725 double GetKF()
const;
743 double GetKP()
const;
752 double GetKI()
const;
761 double GetKD()
const;
886 void SetPID(
double kP,
double kI,
double kD,
double kF,
double b);
894 void SetKF(
double kF);
910 void SetKP(
double kP);
918 void SetKI(
double kI);
926 void SetKD(
double kD);
1011 CANVenom_t *m_canVenomHandle;
double GetOutputVoltage() const
Definition: CANVenom.cpp:179
void SetPID(double kP, double kI, double kD, double kF, double b)
Definition: CANVenom.cpp:275
Definition: CANVenom.h:119
uint32_t GetFirmwareVersion() const
Definition: CANVenom.cpp:143
FaultFlag GetLatchedFaults() const
Definition: CANVenom.cpp:267
double GetMaxAcceleration() const
Definition: CANVenom.cpp:243
void SetMaxPILimit(double limit)
Definition: CANVenom.cpp:303
double GetPosition() const
Definition: CANVenom.cpp:203
virtual void SetInverted(bool isInverted) override
Definition: CANVenom.cpp:54
Definition: CANVenom.h:70
Definition: CANVenom.h:76
void SetMaxJerk(double limit)
Definition: CANVenom.cpp:315
void SetPosition(double newPosition)
Definition: CANVenom.cpp:122
Definition: CANVenom.h:97
void EnableLimitSwitches(bool fwdLimitSwitchEnabled, bool revLimitSwitchEnabled)
Definition: CANVenom.cpp:83
virtual void Set(double command) override
Definition: CANVenom.cpp:30
double GetSpeed() const
Definition: CANVenom.cpp:199
void ExecutePath()
Definition: CANVenom.cpp:139
Definition: CANVenom.h:47
Definition: CANVenom.h:114
bool GetRevLimitSwitchActive() const
Definition: CANVenom.cpp:79
double GetMaxPILimit() const
Definition: CANVenom.cpp:235
double GetMaxSpeed() const
Definition: CANVenom.cpp:239
double GetBusVoltage() const
Definition: CANVenom.cpp:175
void ResetPosition()
Definition: CANVenom.cpp:118
virtual void InitSendable(SendableBuilder &builder)
Definition: CANVenom.cpp:87
BrakeCoastMode
Definition: CANVenom.h:79
void SetMinPILimit(double limit)
Definition: CANVenom.cpp:299
Definition: CANVenom.h:84
void SetControlMode(ControlMode controlMode)
Definition: CANVenom.cpp:319
uint16_t GetCurrentMotionProfilePoint() const
Definition: CANVenom.cpp:155
virtual bool GetInverted() const override
Definition: CANVenom.cpp:58
Definition: CANVenom.h:130
CANVenom(uint8_t motorID)
Definition: CANVenom.cpp:7
BrakeCoastMode GetBrakeCoastMode() const
Definition: CANVenom.cpp:259
MotionProfileState GetMotionProfileState() const
Definition: CANVenom.cpp:171
Definition: CANVenom.h:90
double GetTemperature() const
Definition: CANVenom.cpp:191
double GetMaxJerk() const
Definition: CANVenom.cpp:247
void SetKD(double kD)
Definition: CANVenom.cpp:295
Definition: CANVenom.h:202
void SetBrakeCoastMode(BrakeCoastMode brakeCoastMode)
Definition: CANVenom.cpp:323
void SetCommand(ControlMode mode, double command)
Definition: CANVenom.cpp:35
Definition: CANVenom.h:42
void IdentifyMotor()
Definition: CANVenom.cpp:114
double GetKP() const
Definition: CANVenom.cpp:219
bool GetMotionProfileIsValid() const
Definition: CANVenom.cpp:167
void SetMaxSpeed(double limit)
Definition: CANVenom.cpp:307
void SetKI(double kI)
Definition: CANVenom.cpp:291
double GetPIDTarget() const
Definition: CANVenom.cpp:207
FaultFlag
Definition: CANVenom.h:93
FaultFlag GetActiveFaults() const
Definition: CANVenom.cpp:263
double GetKI() const
Definition: CANVenom.cpp:223
double GetMinPILimit() const
Definition: CANVenom.cpp:231
Definition: CANVenom.h:32
Definition: CANVenom.h:108
Definition: CANVenom.h:21
void Follow(CANVenom &leadVenom)
Definition: CANVenom.cpp:45
double GetAuxVoltage() const
Definition: CANVenom.cpp:195
Definition: CANVenom.h:56
double GetKF() const
Definition: CANVenom.cpp:211
virtual ~CANVenom()
Definition: CANVenom.cpp:16
double GetOutputCurrent() const
Definition: CANVenom.cpp:187
void ClearLatchedFaults()
Definition: CANVenom.cpp:271
Definition: CANVenom.h:173
virtual void Disable() override
Definition: CANVenom.cpp:62
ControlMode
Definition: CANVenom.h:23
MotionProfileState
Definition: CANVenom.h:156
double GetMotionProfilePositionTarget() const
Definition: CANVenom.cpp:159
Definition: CANVenom.h:141
Definition: CANVenom.h:124
Definition: CANVenom.h:103
ControlMode GetControlMode() const
Definition: CANVenom.cpp:251
bool GetFwdLimitSwitchActive() const
Definition: CANVenom.cpp:75
Definition: CANVenom.h:37
virtual void GetDescription(wpi::raw_ostream &desc) const override
Definition: CANVenom.cpp:25
virtual void StopMotor() override
Definition: CANVenom.cpp:21
virtual void PIDWrite(double output) override
Definition: CANVenom.cpp:70
void SetMaxAcceleration(double limit)
Definition: CANVenom.cpp:311
Definition: CANVenom.h:146
double GetB() const
Definition: CANVenom.cpp:215
Definition: CANVenom.h:182
double GetKD() const
Definition: CANVenom.cpp:227
void SetB(double b)
Definition: CANVenom.cpp:283
void SetKF(double kF)
Definition: CANVenom.cpp:279
void AddMotionProfilePoint(double time, double speed, double position)
Definition: CANVenom.cpp:131
void Enable()
Definition: CANVenom.cpp:66
void ClearMotionProfilePoints()
Definition: CANVenom.cpp:126
Definition: CANVenom.h:136
Definition: CANVenom.h:160
Definition: CANVenom.h:166
Definition: CANVenom.h:27
ControlMode GetActiveControlMode() const
Definition: CANVenom.cpp:255
Definition: CANVenom.h:152
void SetKP(double kP)
Definition: CANVenom.cpp:287
double GetMotionProfileSpeedTarget() const
Definition: CANVenom.cpp:163
virtual double Get() const override
Definition: CANVenom.cpp:49
double GetDutyCycle() const
Definition: CANVenom.cpp:183
uint32_t GetSerialNumber() const
Definition: CANVenom.cpp:147
uint16_t GetNumAvaliableMotionProfilePoints() const
Definition: CANVenom.cpp:151
Definition: CANVenom.h:209
void CompleteMotionProfilePath(double time, double position)
Definition: CANVenom.cpp:135