pid settings
parent
09310a745f
commit
a91c1a4932
|
@ -4,14 +4,21 @@
|
|||
|
||||
#include "Constants.h"
|
||||
#include "rev/CANSparkMax.h"
|
||||
#include "units/base.h"
|
||||
|
||||
#include "cowlib/SwerveModule.h"
|
||||
|
||||
using namespace SwerveConstants;
|
||||
using namespace units::constants;
|
||||
|
||||
using MotorType = rev::CANSparkMax::MotorType;
|
||||
|
||||
SwerveModule::SwerveModule(int driveMotorId, int steerMotorId, int encoderId)
|
||||
SwerveModule::SwerveModule(int driveMotorId, int steerMotorId, int encoderId,
|
||||
bool driveInverted)
|
||||
: driveMotor{driveMotorId, rev::CANSparkMax::MotorType::kBrushless},
|
||||
steerMotor{steerMotorId, rev::CANSparkMax::MotorType::kBrushless},
|
||||
encoder{encoderId}, pid{SwervePID::p, SwervePID::i, SwervePID::d} {}
|
||||
encoder{encoderId}, pid{SwervePID::p, SwervePID::i, SwervePID::d} {
|
||||
this->pid.EnableContinuousInput(-180, 180);
|
||||
|
||||
this->driveMotor.SetInverted(driveInverted);
|
||||
}
|
||||
|
|
|
@ -16,5 +16,6 @@ private:
|
|||
frc::PIDController pid;
|
||||
|
||||
public:
|
||||
SwerveModule(int driveMotorId, int steerMotorId, int encoderId);
|
||||
SwerveModule(int driveMotorId, int steerMotorId, int encoderId,
|
||||
bool driveInverted);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue