14#include <wpi/commands2/SubsystemBase.hpp>
15#include <wpi/math/controller/ArmFeedforward.hpp>
16#include <wpi/math/controller/ElevatorFeedforward.hpp>
17#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
18#include <wpi/math/system/DCMotor.hpp>
19#include <wpi/math/trajectory/ExponentialProfile.hpp>
20#include <wpi/math/trajectory/TrapezoidProfile.hpp>
21#include <wpi/units/acceleration.hpp>
22#include <wpi/units/angle.hpp>
23#include <wpi/units/angular_acceleration.hpp>
24#include <wpi/units/angular_jerk.hpp>
25#include <wpi/units/angular_velocity.hpp>
26#include <wpi/units/current.hpp>
27#include <wpi/units/force.hpp>
28#include <wpi/units/length.hpp>
29#include <wpi/units/mass.hpp>
30#include <wpi/units/moment_of_inertia.hpp>
31#include <wpi/units/temperature.hpp>
32#include <wpi/units/time.hpp>
33#include <wpi/units/velocity.hpp>
34#include <wpi/units/voltage.hpp>
43class SmartMotorController;
49class SmartMotorControllerTelemetryConfig;
56 wpi::units::meters, wpi::units::inverse<wpi::units::cubed<wpi::units::seconds>>>>;
88 double kP,
double kI,
double kD,
101 const wpi::math::ArmFeedforward& ff,
112 const wpi::math::ElevatorFeedforward& ff,
123 const wpi::math::SimpleMotorFeedforward<wpi::units::turns>& ff,
136 wpi::units::turns_per_second_t maxVelocity,
137 wpi::units::turns_per_second_squared_t maxAcceleration);
147 wpi::units::meters_per_second_t maxVelocity,
148 wpi::units::meters_per_second_squared_t maxAcceleration);
161 wpi::units::turns_per_second_squared_t maxAcceleration,
162 wpi::units::angular_jerk::turns_per_second_cubed_t maxJerk);
185 wpi::units::volt_t maxInput);
200 wpi::math::DCMotor motor,
201 wpi::units::kilogram_square_meter_t moi);
217 wpi::math::DCMotor motor,
218 wpi::units::kilogram_t mass,
219 wpi::units::meter_t drumRadius);
230 wpi::units::volt_t maxVolts, wpi::units::turns_per_second_t maxVelocity,
231 wpi::units::turns_per_second_squared_t maxAcceleration);
240 wpi::math::ExponentialProfile<wpi::units::turns, wpi::units::volts>::Constraints constraints);
254 wpi::units::volt_t maxInput);
381 wpi::units::turn_t upper);
396 wpi::units::meter_t upper);
626 wpi::units::turn_t discontinuityPoint);
639 wpi::units::turn_t max);
739 const wpi::math::ArmFeedforward& ff,
750 const wpi::math::ElevatorFeedforward& ff,
761 const wpi::math::SimpleMotorFeedforward<wpi::units::turns>& ff,
774 double kP,
double kI,
double kD,
798 wpi::units::turns_per_second_t maxVelocity,
799 wpi::units::turns_per_second_squared_t maxAcceleration);
809 wpi::units::meters_per_second_t maxVelocity,
810 wpi::units::meters_per_second_squared_t maxAcceleration);
819 wpi::math::ExponentialProfile<wpi::units::turns, wpi::units::volts>::Constraints constraints);
909 std::vector<SmartMotorController*> followers);
974 std::optional<wpi::math::ArmFeedforward>
armFF;
976 std::optional<wpi::math::SimpleMotorFeedforward<wpi::units::turns>>
simpleFF;
977 std::optional<math::LQRConfig>
lqr;
1081 wpi::units::turn_t current)
const;
1140 std::shared_ptr<telemetry::SmartMotorControllerTelemetryConfig>
1147 wpi::units::kilogram_square_meter_t
GetMOI()
const;
1190 std::optional<wpi::math::ExponentialProfile<wpi::units::turns, wpi::units::volts>>
1193 std::optional<wpi::math::ExponentialProfile<wpi::units::meters, wpi::units::volts>>
1230 wpi::units::turns_per_second_t mechanismVelocity)
const;
1239 wpi::units::turns_per_second_squared_t mechanismAcceleration)
const;
1248 wpi::units::angular_jerk::turns_per_second_cubed_t mechanismJerk)
const;
1273 wpi::units::meters_per_second_squared_t acceleration)
const;
1294 wpi::units::newton_t feedforwardForce)
const;
1305 wpi::units::newton_t feedforwardForce)
const;
1308 static constexpr int kNumSlots = 4;
1312 bool m_slotHasFeedback[kNumSlots]{
false,
false,
false,
false};
1316 enum class BasicOptions {
1317 VendorControlRequest,
1319 ClosedLoopMaxVoltage,
1338 LooselyCoupledFollowers,
1339 VoltageCompensation,
1340 FeedbackSynchronizationThreshold,
1341 ClosedLoopTolerance,
1342 ClosedLoopControlPeriod,
1343 ResetPreviousConfig,
1345 enum class ExternalEncoderOptions {
1348 UseExternalFeedback,
1350 ExternalEncoderInverted,
1352 static std::string_view ToString(BasicOptions opt);
1353 static std::string_view ToString(ExternalEncoderOptions opt);
1354 mutable std::set<BasicOptions> m_basicOptions;
1355 mutable std::set<ExternalEncoderOptions> m_externalEncoderOptions;
1358 double ForceToRotorTorque(wpi::units::newton_t feedforwardForce)
const;
1360 void RequireCircumference(
const std::string& action)
const;
1362 bool HasClosedLoopController()
const;
1365 struct SimGainsOverride {
1366 std::optional<double> kP, kI, kD;
1367 std::optional<math::LQRConfig> lqr;
1368 std::optional<wpi::math::ArmFeedforward> armFF;
1369 std::optional<wpi::math::ElevatorFeedforward> elevatorFF;
1370 std::optional<wpi::math::SimpleMotorFeedforward<wpi::units::turns>> simpleFF;
1372 SimGainsOverride m_simGains[kNumSlots];
1375 std::optional<wpi::math::TrapezoidProfile<wpi::units::turns>> m_trapProfile;
1376 std::optional<wpi::math::TrapezoidProfile<wpi::units::meters>> m_linearTrapProfile;
1377 std::optional<wpi::math::ExponentialProfile<wpi::units::turns, wpi::units::volts>> m_expoProfile;
1378 std::optional<wpi::math::ExponentialProfile<wpi::units::meters, wpi::units::volts>>
1379 m_linearExpoProfile;
1380 bool m_velocityTrapProfile{
false};
1382 std::optional<wpi::units::turns_per_second_t> m_trapMaxVelTurns;
1383 std::optional<wpi::units::turns_per_second_squared_t> m_trapMaxAccTurns;
1384 std::optional<wpi::units::meters_per_second_t> m_trapMaxVelLinear;
1385 std::optional<wpi::units::meters_per_second_squared_t> m_trapMaxAccLinear;
1387 std::optional<double> m_expoMotionMagicKV;
1388 std::optional<double> m_expoMotionMagicKA;
1389 std::optional<wpi::units::volt_t> m_expoMaxInput;
1392 std::optional<wpi::units::turn_t> m_mechLowerLimit;
1393 std::optional<wpi::units::turn_t> m_mechUpperLimit;
1394 std::optional<wpi::units::ampere_t> m_statorCurrentLimit;
1395 std::optional<wpi::units::ampere_t> m_supplyCurrentLimit;
1396 std::optional<wpi::units::celsius_t> m_temperatureCutoff;
1397 std::optional<wpi::units::volt_t> m_closedLoopMaxVoltage;
1398 std::optional<wpi::units::volt_t> m_voltageCompensation;
1399 std::optional<wpi::units::turn_t> m_feedbackSynchronizationThreshold;
1400 std::optional<wpi::units::turn_t> m_closedLoopTolerance;
1401 bool m_resetPreviousConfig{
true};
1402 std::optional<wpi::units::turn_t> m_continuousWrappingMin;
1403 std::optional<wpi::units::turn_t> m_continuousWrappingMax;
1407 std::optional<MotorMode> m_zeroPower;
1408 std::optional<wpi::units::second_t> m_closedLoopPeriod;
1409 std::optional<wpi::units::second_t> m_openLoopRampRate;
1410 std::optional<wpi::units::second_t> m_closedLoopRampRate;
1413 std::optional<bool> m_motorInverted;
1414 std::optional<bool> m_encoderInverted;
1417 std::optional<gearing::MechanismGearing> m_motorGearing;
1418 std::optional<wpi::units::meter_t> m_mechanismCircumference;
1419 bool m_linearClosedLoopController{
false};
1422 std::optional<std::any> m_externalEncoder;
1423 bool m_useExternalFeedback{
true};
1424 std::optional<bool> m_externalEncoderInverted;
1425 std::optional<double> m_externalEncoderConversionFactor;
1426 std::optional<wpi::units::turn_t> m_externalEncoderZeroOffset;
1427 std::optional<gearing::MechanismGearing> m_externalEncoderGearing;
1428 std::optional<wpi::units::turn_t> m_externalEncoderDiscontinuityPoint;
1431 std::optional<std::string> m_telemetryName;
1432 std::optional<TelemetryVerbosity> m_verbosity;
1434 std::shared_ptr<telemetry::SmartMotorControllerTelemetryConfig> m_telemetryConfig;
1436 wpi::cmd::SubsystemBase* m_subsystem{
nullptr};
1437 std::optional<wpi::math::DCMotor> m_simMotor;
1438 wpi::units::kilogram_square_meter_t m_moi{0.02_kg_sq_m};
1439 std::optional<wpi::units::second_t> m_simulationPeriod;
1440 std::optional<wpi::units::turn_t> m_startingPosition;
1441 std::optional<wpi::units::meter_t> m_startingPositionDistance;
1444 std::optional<wpi::units::turn_t> m_simStartingPosition;
1445 std::optional<wpi::math::TrapezoidProfile<wpi::units::turns>> m_simTrapProfile;
1446 std::optional<wpi::math::TrapezoidProfile<wpi::units::meters>> m_simLinearTrapProfile;
1447 std::optional<wpi::math::ExponentialProfile<wpi::units::turns, wpi::units::volts>>
1450 std::optional<std::any> m_vendorConfig;
1451 std::optional<std::any> m_vendorControlRequest;
1454 std::vector<std::pair<std::any, bool>> m_followers;
1455 std::vector<SmartMotorController*> m_looseFollowers;
Definition MechanismGearing.hpp:19
Definition LQRConfig.hpp:27
Definition SmartMotorControllerConfig.hpp:65
std::optional< bool > GetExternalEncoderInverted() const
SmartMotorControllerConfig & WithStartingPosition(wpi::units::meter_t startingDistance)
SmartMotorControllerConfig & WithTelemetry(const std::string &name, TelemetryVerbosity verbosity=TelemetryVerbosity::HIGH)
SmartMotorControllerConfig & WithSupplyCurrentLimit(wpi::units::ampere_t limit)
wpi::units::turn_t ConvertToMechanism(wpi::units::meter_t distance) const
std::optional< wpi::units::volt_t > GetExponentialProfileMaxInput() const
SmartMotorControllerConfig & WithTemperatureCutoff(wpi::units::celsius_t temperature)
wpi::units::turn_t GetContinuousWrappingSetpoint(wpi::units::turn_t setpoint, wpi::units::turn_t current) const
SmartMotorControllerConfig & WithTrapezoidProfile(wpi::units::turns_per_second_t maxVelocity, wpi::units::turns_per_second_squared_t maxAcceleration)
SmartMotorControllerConfig & WithMotorInverted(bool inverted)
std::optional< wpi::units::volt_t > GetVoltageCompensation() const
SmartMotorControllerConfig & WithZeroPower(MotorMode mode)
bool GetLinearClosedLoopControllerUse() const
std::optional< std::any > GetExternalEncoder() const
std::optional< wpi::units::turn_t > GetMechanismLowerLimit() const
SmartMotorControllerConfig & WithExternalEncoderGearing(double reductionRatio)
SmartMotorControllerConfig & WithExternalEncoderInverted(bool inverted)
std::optional< wpi::units::turn_t > GetContinuousWrapping() const
std::optional< wpi::math::SimpleMotorFeedforward< wpi::units::turns > > GetSimpleFeedforward(ClosedLoopControllerSlot slot) const
bool GetUseExternalFeedback() const
const std::vector< std::pair< std::any, bool > > & GetFollowers() const
SmartMotorControllerConfig & WithContinuousWrapping(wpi::units::turn_t min, wpi::units::turn_t max)
wpi::units::turns_per_second_t ConvertToMechanism(wpi::units::meters_per_second_t velocity) const
std::optional< wpi::units::turn_t > GetStartingPosition() const
SmartMotorControllerConfig & WithMOI(wpi::units::meter_t length, wpi::units::kilogram_t mass)
wpi::units::kilogram_square_meter_t GetMOI() const
wpi::units::ampere_t ConvertToCurrent(const wpi::math::DCMotor &motor, wpi::units::newton_t feedforwardForce) const
SmartMotorControllerConfig & WithClosedLoopControlPeriod(wpi::units::second_t period)
std::optional< wpi::units::meter_t > GetMeasurementLowerLimit() const
SmartMotorControllerConfig & WithClosedLoopRampRate(wpi::units::second_t rampRate)
double GetKi(ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0) const
std::optional< wpi::units::turns_per_second_squared_t > GetTrapMaxAccelTurns() const
SmartMotorControllerConfig & WithClosedLoopMode()
std::optional< wpi::units::turn_t > GetExternalEncoderDiscontinuityPoint() const
SmartMotorControllerConfig & WithExponentialProfile(wpi::units::volt_t maxVolts, wpi::math::DCMotor motor, wpi::units::kilogram_t mass, wpi::units::meter_t drumRadius)
SmartMotorControllerConfig & WithStartingPosition(wpi::units::degree_t startingAngle)
std::optional< int > GetStatorStallCurrentLimit() const
TelemetryVerbosity
Definition SmartMotorControllerConfig.hpp:72
wpi::units::meters_per_second_squared_t ConvertFromMechanism(wpi::units::turns_per_second_squared_t mechanismAcceleration) const
wpi::units::meters_per_second_t ConvertFromMechanism(wpi::units::turns_per_second_t mechanismVelocity) const
SmartMotorControllerConfig & WithSimFeedforward(const wpi::math::ArmFeedforward &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
SmartMotorControllerConfig & WithMotorGearing(const gearing::MechanismGearing &gearing)
double GetKp(ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0) const
std::optional< wpi::math::ArmFeedforward > GetArmFeedforward(ClosedLoopControllerSlot slot) const
SmartMotorControllerConfig & WithMechanismLimits(wpi::units::turn_t lower, wpi::units::turn_t upper)
bool HasExponentialProfile() const
PIDGains GetSlotGains(ClosedLoopControllerSlot slot) const
SmartMotorControllerConfig & WithSimStartingPosition(wpi::units::degree_t startingAngle)
std::optional< wpi::units::ampere_t > GetStatorCurrentLimit() const
wpi::units::meter_t ConvertFromMechanism(wpi::units::turn_t mechanismPosition) const
std::optional< wpi::units::turn_t > GetMechanismUpperLimit() const
SmartMotorControllerConfig & WithSubsystem(wpi::cmd::SubsystemBase *subsystem)
SmartMotorControllerConfig & WithCascadingElevatorStages(int stages)
SmartMotorControllerConfig & WithSimulationPeriod(wpi::units::second_t period)
SmartMotorControllerConfig & WithExternalEncoderGearing(const gearing::MechanismGearing &gearing)
void ResetValidationCheck() const
SmartMotorControllerConfig & WithSimTrapezoidProfile(wpi::units::turns_per_second_t maxVelocity, wpi::units::turns_per_second_squared_t maxAcceleration)
SmartMotorControllerConfig Clone() const
SmartMotorControllerConfig & WithFeedforward(const wpi::math::ArmFeedforward &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
std::optional< wpi::units::ampere_t > GetSupplyCurrentLimit() const
bool HasSubsystem() const
std::optional< bool > GetMotorInverted() const
wpi::units::volt_t ConvertToVoltage(const wpi::math::DCMotor &motor, wpi::units::newton_t feedforwardForce) const
SmartMotorControllerConfig & WithFollowers(std::vector< std::pair< std::any, bool > > followers)
SmartMotorControllerConfig & WithExponentialProfile(double kV, double kA, wpi::units::volt_t maxInput)
std::optional< TelemetryVerbosity > GetVerbosity() const
ControlMode
Definition SmartMotorControllerConfig.hpp:68
SmartMotorControllerConfig & WithSimStartingPosition(wpi::units::meter_t startingDistance)
SmartMotorControllerConfig & WithSimFeedforward(const wpi::math::SimpleMotorFeedforward< wpi::units::turns > &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
std::optional< MotorMode > GetZeroPower() const
SmartMotorControllerConfig & WithLinearExponentialProfile(double kV, double kA, wpi::units::volt_t maxInput)
SmartMotorControllerConfig & WithVelocityTrapezoidProfile(wpi::units::meters_per_second_squared_t maxAcceleration, meters_per_second_cubed_t maxJerk)
std::optional< wpi::units::second_t > GetClosedLoopControlPeriod() const
std::optional< wpi::units::second_t > GetClosedLoopRampRate() const
SmartMotorControllerConfig & WithVendorControlRequest(std::any req)
SmartMotorControllerConfig & WithVoltageCompensation(wpi::units::volt_t voltage)
std::optional< wpi::units::meters_per_second_t > GetTrapMaxVelocityLinear() const
SmartMotorControllerConfig & WithFeedback(double kP, double kI, double kD, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
SmartMotorControllerConfig & WithClosedLoopTolerance(wpi::units::meter_t tolerance)
SmartMotorControllerConfig & WithExternalEncoderZeroOffset(wpi::units::turn_t zeroOffset)
SmartMotorControllerConfig & WithExternalEncoderDiscontinuityPoint(wpi::units::turn_t discontinuityPoint)
SmartMotorControllerConfig & WithSimClosedLoopController(double kP, double kI, double kD, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
SmartMotorControllerConfig & WithFeedbackSynchronizationThreshold(wpi::units::turn_t threshold)
bool HasTrapezoidProfile() const
SmartMotorControllerConfig & WithVendorConfig(std::any cfg)
SmartMotorControllerConfig & WithFeedforward(const wpi::math::ElevatorFeedforward &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
std::shared_ptr< telemetry::SmartMotorControllerTelemetryConfig > GetSmartControllerTelemetryConfig() const
const std::optional< gearing::MechanismGearing > & GetMotorGearing() const
SmartMotorControllerConfig & WithStatorCurrentLimit(wpi::units::ampere_t limit)
std::optional< double > GetExternalEncoderConversionFactor() const
std::optional< wpi::math::DCMotor > GetSimMotor() const
bool GetResetPreviousConfig() const
ControlMode GetMotorControllerMode() const
std::optional< wpi::math::TrapezoidProfile< wpi::units::meters > > GetLinearTrapezoidProfile() const
SmartMotorControllerConfig & WithOpenLoopRampRate(wpi::units::second_t rampRate)
std::optional< std::any > GetVendorConfig() const
SmartMotorControllerConfig & WithMOI(wpi::units::kilogram_square_meter_t moi)
SmartMotorControllerConfig & WithExponentialProfile(wpi::units::volt_t maxVolts, wpi::math::DCMotor motor, wpi::units::kilogram_square_meter_t moi)
wpi::cmd::SubsystemBase * GetSubsystem() const
std::optional< wpi::units::volt_t > GetClosedLoopControllerMaximumVoltage() const
SmartMotorControllerConfig & WithMotorGearing(double reductionRatio)
std::optional< wpi::units::meters_per_second_squared_t > GetTrapMaxAccelLinear() const
SmartMotorControllerConfig & WithMechanismCircumference(wpi::units::meter_t gearPitch, int teeth)
SmartMotorControllerConfig & WithResetPreviousConfig(bool reset)
SmartMotorControllerConfig & WithTelemetry(TelemetryVerbosity verbosity)
SmartMotorControllerConfig & WithMechanismRadius(wpi::units::meter_t radius)
std::optional< std::string > GetTelemetryName() const
std::optional< wpi::math::TrapezoidProfile< wpi::units::turns > > GetTrapezoidProfile() const
SmartMotorControllerConfig & WithMechanismCircumference(wpi::units::meter_t circumference)
meters_per_second_cubed_t ConvertFromMechanism(wpi::units::angular_jerk::turns_per_second_cubed_t mechanismJerk) const
std::optional< wpi::units::turns_per_second_t > GetTrapMaxVelocityTurns() const
SmartMotorControllerConfig & WithMechanismDiameter(wpi::units::meter_t diameter)
SmartMotorControllerConfig & WithExponentialProfile(wpi::units::volt_t maxVolts, wpi::units::turns_per_second_t maxVelocity, wpi::units::turns_per_second_squared_t maxAcceleration)
wpi::units::angular_jerk::turns_per_second_cubed_t ConvertToMechanism(meters_per_second_cubed_t jerk) const
SmartMotorControllerConfig & WithSimExponentialProfile(wpi::math::ExponentialProfile< wpi::units::turns, wpi::units::volts >::Constraints constraints)
SmartMotorControllerConfig & WithExternalEncoder(std::any encoder)
SmartMotorControllerConfig & WithExponentialProfile(wpi::math::ExponentialProfile< wpi::units::turns, wpi::units::volts >::Constraints constraints)
SmartMotorControllerConfig & WithLinearTrapezoidProfile(wpi::units::meters_per_second_t maxVelocity, wpi::units::meters_per_second_squared_t maxAcceleration)
std::optional< std::any > GetVendorControlRequest() const
bool GetVelocityTrapezoidalProfileInUse() const
std::optional< wpi::units::meter_t > GetMeasurementUpperLimit() const
std::optional< math::LQRConfig > GetLQR(ClosedLoopControllerSlot slot) const
std::optional< wpi::units::turn_t > GetClosedLoopTolerance() const
SmartMotorControllerConfig & WithLooselyCoupledFollowers(std::vector< SmartMotorController * > followers)
std::optional< int > GetSupplyStallCurrentLimit() const
std::optional< wpi::units::celsius_t > GetTemperatureCutoff() const
SmartMotorControllerConfig & WithSimClosedLoopController(const math::LQRConfig &lqrConfig, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
ClosedLoopControllerSlot
Definition SmartMotorControllerConfig.hpp:74
SmartMotorControllerConfig & WithClosedLoopTolerance(wpi::units::turn_t tolerance)
SmartMotorControllerConfig & WithLQR(const math::LQRConfig &lqrConfig, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
std::optional< wpi::math::ElevatorFeedforward > GetElevatorFeedforward(ClosedLoopControllerSlot slot) const
void ValidateBasicOptions() const
std::optional< wpi::math::ExponentialProfile< wpi::units::turns, wpi::units::volts > > GetExponentialProfile() const
SmartMotorControllerConfig & WithOpenLoopMode()
SmartMotorControllerConfig & WithSimMotor(wpi::math::DCMotor motor)
const std::vector< SmartMotorController * > & GetLooselyCoupledFollowers() const
SmartMotorControllerConfig & WithLinearClosedLoopController(bool linear)
wpi::units::turns_per_second_squared_t ConvertToMechanism(wpi::units::meters_per_second_squared_t acceleration) const
SmartMotorControllerConfig & WithEncoderInverted(bool inverted)
SmartMotorControllerConfig & WithVelocityTrapezoidProfile(wpi::units::turns_per_second_squared_t maxAcceleration, wpi::units::angular_jerk::turns_per_second_cubed_t maxJerk)
SmartMotorControllerConfig & WithMeasurementLimits(wpi::units::meter_t lower, wpi::units::meter_t upper)
SmartMotorControllerConfig & WithUseExternalFeedbackEncoder(bool use)
SmartMotorControllerConfig & WithSimTrapezoidProfile(wpi::units::meters_per_second_t maxVelocity, wpi::units::meters_per_second_squared_t maxAcceleration)
std::optional< wpi::math::ExponentialProfile< wpi::units::meters, wpi::units::volts > > GetLinearExponentialProfile() const
const std::optional< gearing::MechanismGearing > & GetExternalEncoderGearing() const
void ValidateExternalEncoderOptions() const
std::optional< wpi::units::turn_t > GetFeedbackSynchronizationThreshold() const
std::optional< wpi::units::meter_t > GetMechanismCircumference() const
wpi::units::second_t GetSimulationPeriod() const
std::optional< wpi::units::turn_t > GetExternalEncoderZeroOffset() const
std::optional< bool > GetEncoderInverted() const
bool HasLinearExponentialProfile() const
SmartMotorControllerConfig & WithExternalEncoderConversionFactor(double factor)
std::optional< wpi::units::turn_t > GetContinuousWrappingMin() const
MotorMode
Definition SmartMotorControllerConfig.hpp:70
std::optional< double > GetExponentialProfileKA() const
std::optional< double > GetExponentialProfileKV() const
SmartMotorControllerConfig & WithExternalEncoderZeroOffset(wpi::units::meter_t zeroOffset)
SmartMotorControllerConfig & WithSimFeedforward(const wpi::math::ElevatorFeedforward &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
SmartMotorControllerConfig & WithClosedLoopMaxVoltage(wpi::units::volt_t maxVoltage)
SmartMotorControllerConfig & WithFeedforward(const wpi::math::SimpleMotorFeedforward< wpi::units::turns > &ff, ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0)
double GetKd(ClosedLoopControllerSlot slot=ClosedLoopControllerSlot::SLOT_0) const
std::optional< wpi::units::second_t > GetOpenLoopRampRate() const
SmartMotorControllerConfig & WithTelemetry(const std::string &name, telemetry::SmartMotorControllerTelemetryConfig telemetryConfig)
Definition SmartMotorControllerTelemetryConfig.hpp:63
Definition SimSensorConfig.hpp:15
wpi::units::unit_t< wpi::units::compound_unit< wpi::units::meters, wpi::units::inverse< wpi::units::cubed< wpi::units::seconds > > > > meters_per_second_cubed_t
Definition SmartMotorControllerConfig.hpp:56
Definition SwerveDrive.hpp:864
Definition SmartMotorControllerConfig.hpp:971
double kP
Definition SmartMotorControllerConfig.hpp:972
double kD
Definition SmartMotorControllerConfig.hpp:972
double kS
Definition SmartMotorControllerConfig.hpp:973
std::optional< wpi::math::ElevatorFeedforward > elevatorFF
Definition SmartMotorControllerConfig.hpp:975
double kV
Definition SmartMotorControllerConfig.hpp:973
std::optional< math::LQRConfig > lqr
Definition SmartMotorControllerConfig.hpp:977
std::optional< wpi::math::ArmFeedforward > armFF
Definition SmartMotorControllerConfig.hpp:974
double kI
Definition SmartMotorControllerConfig.hpp:972
std::optional< wpi::math::SimpleMotorFeedforward< wpi::units::turns > > simpleFF
Definition SmartMotorControllerConfig.hpp:976
double kG
Definition SmartMotorControllerConfig.hpp:973
double kA
Definition SmartMotorControllerConfig.hpp:973