|
Valkyrie 2026
|
Public Member Functions | |
| PhoenixController (PhoenixControllerType controllerType, int canID, valor::NeutralMode neutralMode, bool inverted, std::string canbus="") | |
| PhoenixController (PhoenixControllerType controllerType=KRAKEN_X60_FOC) | |
| void | SetNeutralMode (valor::NeutralMode mode, bool saveImmediately=false) override |
| Set the neutral mode of the motor. | |
| void | PositionSetter (units::turn_t position, Output feedforward, int slot) override |
| Send the motor to a specific position. | |
| void | SetPosition (units::turn_t position, units::turns_per_second_t maxVelocity, units::turns_per_second_squared_t maxAcceleration, units::turns_per_second_cubed_t maxJerk, Output feedforward=0, int slot=0) |
| void | SpeedSetter (units::turns_per_second_t velocity, Output feedforward, int slot) override |
| Send the motor to a specific speed. | |
| void | UseTimesync (units::hertz_t controlFreq, bool saveImmediately=false) |
| void | SetPIDF (valor::PIDF<> pidf, int slot=0, bool saveImmediately=false) override |
| Change the PIDF values for the motor. | |
| void | SetPosition (units::turn_t position, Output feedforward=0, int slot=0) |
| Public Member Functions inherited from valor::CorePhoenixController | |
| CorePhoenixController (PhoenixControllerType controllerType, int canID, valor::NeutralMode neutralMode, bool inverted, std::string canbus="") | |
| CorePhoenixController (PhoenixControllerType controllerType) | |
| void | ApplyConfig () override |
| void | Reset () override |
| Resets the motor and any state. | |
| void | SetCurrentLimits (units::ampere_t statorCurrentLimit, units::ampere_t supplyCurrentLimit, units::ampere_t supplyCurrentThreshold, units::second_t supplyTimeThreshold, bool saveImmediately=false) |
| void | SetVoltageLimits (units::volt_t reverseLimit, units::volt_t forwardLimit, bool saveImmediately=false) |
| Signal< units::turn_t > | GetPosition () const override |
| Get the motors position. | |
| ctre::phoenix6::StatusSignal< units::turn_t > & | GetPositionSignal (bool refresh=true) |
| Signal< units::turns_per_second_t > | GetSpeed () const override |
| Get the motors speed. | |
| Signal< units::turns_per_second_squared_t > | GetAcceleration () const override |
| ctre::phoenix6::StatusSignal< units::turns_per_second_squared_t > & | GetAccelerationSignal (bool refresh=true) |
| Signal< units::ampere_t > | GetCurrent () const override |
| Get the motors output current. | |
| Signal< units::volt_t > | GetVoltage () const override |
| void | SetEncoderPosition (units::turn_t position) override |
| void | SetContinuousWrap (bool continuousWrap, bool saveImmediately=false) |
| void | PowerSetter (Output out) override |
| void | SetupFollower (int canID, bool followerInverted=false) override |
| If a motor is paired with another motor, setup that other motor as a follower. | |
| void | SetupReverseHardwareLimit (int canID, ctre::phoenix6::signals::ReverseLimitTypeValue type, units::turn_t autosetPosition=0_tr, bool saveImmediately=false) |
| void | SetupForwardHardwareLimit (int canID, ctre::phoenix6::signals::ForwardLimitTypeValue type, units::turn_t autosetPosition=0_tr, bool saveImmediately=false) |
| void | SetForwardLimit (units::turn_t forward, bool saveImmediately=false) override |
| Set the forward soft limit for the motor. | |
| void | SetReverseLimit (units::turn_t reverse, bool saveImmediately=false) override |
| Set the reverse soft limit for the motor. | |
| void | SetGearRatios (double _rotorToSensor, double _sensorToMech, bool saveImmediately=false) override |
| Set the gear ratios for the motor. | |
| ctre::phoenix6::signals::MagnetHealthValue | GetMagnetHealth () |
| units::turn_t | GetAbsoluteEncoderPosition () const override |
| void | SetupCANcoder (int deviceId, units::turn_t offset, bool clockwise, std::string canbus="", units::turn_t absoluteRange=1_tr, bool saveImmediately=false) |
| ctre::phoenix6::hardware::CANcoder * | GetCANcoder () |
| void | SetOpenLoopRamp (units::second_t time, bool saveImmediately=false) override |
| units::volt_t | CalculateAppliedVoltage () override |
| void | SetSimState (units::turn_t pos, units::turns_per_second_t vel, units::turns_per_second_squared_t accel) |
| void | LoggablePeriodic () override |
| Periodic callback for logging updates. | |
| virtual void | SetSimState (frc::sim::DCMotorSim &sim) |
| virtual void | SetSimState (frc::sim::FlywheelSim &sim) |
| virtual void | SetSimState (frc::sim::SingleJointedArmSim &sim) |
| Public Member Functions inherited from valor::BaseController | |
| BaseController (frc::DCMotor _motorSpec) | |
| Construct a new Valor Controller object. | |
| void | OnLoggingStart () override |
| Hook invoked when logging is started for this object. | |
| constexpr units::turns_per_second_t | GetMaxMechanismSpeed () |
| Get the mechanisms's maximum speed. | |
| constexpr double | GetGearRatio () const |
| constexpr void | SetVoltageCompensation (units::volt_t _voltageCompensation) |
| Setup the voltage compensation for the motor. | |
| constexpr units::volt_t | GetVoltageCompensation () const |
| void | SetPosition (units::turn_t position, Output feedforward=0, int slot=0) |
| void | SetSpeed (units::turns_per_second_t speed, Output feedforward=0, int slot=0) |
| void | SetPower (Output power) |
| void | SetLimits (units::turn_t reverse, units::turn_t forward, bool saveImmediately=false) |
| Set both soft limits for the motor. | |
| Public Member Functions inherited from valor::Loggable | |
| Loggable (std::string_view name) | |
| Construct a Loggable that registers a top-level table name. | |
| Loggable (std::shared_ptr< nt::NetworkTable > table) | |
| Construct a Loggable that uses an existing NetworkTable. | |
| Loggable ()=default | |
| Default construct an uninitialized Loggable. | |
| void | LogChild (std::string_view name, Loggable *child) |
| Register a child Loggable under a named subtree. | |
| void | LogChild (std::string_view name, wpi::Sendable *child) |
| Register a child Sendable under a named subtree. | |
| bool | WriteLog (std::string_view field, bool data) |
| double | WriteLog (std::string_view field, double data) |
| void | WriteLog (std::string_view field, const std::vector< double > &data) |
|
template<typename U> requires units::traits::is_unit_t_v<U> | |
| U | WriteLog (std::string_view field, U data) |
| void | WriteLog (std::string_view field, std::string_view data) |
|
template<typename E> requires std::is_enum_v<E> | |
| void | WriteLog (std::string_view field, E data) |
|
template<typename T> requires wpi::StructSerializable<T> && (!std::is_arithmetic_v<T>) | |
| void | WriteLog (std::string_view field, const T &data) |
|
template<typename T> requires wpi::StructSerializable<T> && (!std::is_arithmetic_v<T>) | |
| void | WriteLog (std::string_view field, const std::vector< T > &data) |
| bool | ReadLog (std::string_view field, bool defaultValue) |
| double | ReadLog (std::string_view field, double defaultValue) |
|
template<typename U> requires units::traits::is_unit_t_v<U> | |
| U | ReadLog (std::string_view field, U defaultValue) |
Additional Inherited Members | |
| Public Types inherited from valor::BaseController | |
| enum class | OperationalMode { NON_OPERATIONAL , TUNING , OPERATIONAL } |
| enum class | ControlMode { VOLTAGE , CURRENT , DUTY_CYCLE , SPEED , POSITION } |
| using | Output = std::variant<units::volt_t, units::ampere_t, units::scalar_t> |
| Static Public Member Functions inherited from valor::Loggable | |
| static constexpr Loggable & | GetRoot () |
| Public Attributes inherited from valor::BaseController | |
| frc::DCMotor | motorSpec |
| Protected Attributes inherited from valor::CorePhoenixController | |
| std::unique_ptr< CorePhoenixController > | followerMotor |
| std::unique_ptr< ctre::phoenix6::hardware::CANcoder > | cancoder |
| std::unique_ptr< ctre::phoenix6::configs::MagnetSensorConfigs > | cancoderConfig |
| ctre::phoenix6::configs::TalonFXConfiguration | config |
| ctre::phoenix6::controls::VoltageOut | voltageRequest {0_V} |
| ctre::phoenix6::controls::DutyCycleOut | dutyCycleRequest {0} |
| ctre::phoenix6::controls::TorqueCurrentFOC | currentRequest {0_A} |
| Protected Attributes inherited from valor::BaseController | |
| double | rotorToSensor |
| double | sensorToMech |
| units::volt_t | voltageCompensation |
| Static Protected Attributes inherited from valor::CorePhoenixController | |
| static constexpr units::ampere_t | STATOR_CURRENT_LIMIT = 40_A |
| static constexpr units::ampere_t | SUPPLY_CURRENT_LIMIT = 30_A |
| static constexpr units::ampere_t | SUPPLY_CURRENT_THRESHOLD = 30_A |
| static constexpr units::millisecond_t | SUPPLY_TIME_THRESHOLD = 1_s |
| static constexpr units::ampere_t | PEAK_TORQUE_CURRENT = 100_A |
| static constexpr units::turn_t | DEADBAND = 0.01_tr |
|
inlineoverridevirtual |
Send the motor to a specific position.
Will use the motor's native trapezoidal motion profile to get the motor to that position. Can be tuned using the velocity and acceleration components of valor::PIDF via setPIDF
To be defined by the implemented BaseController class
| position | The position to send the motor to |
| slot | The slot to use for PID gains |
Implements valor::BaseController.
|
inlineoverridevirtual |
Set the neutral mode of the motor.
| mode | The neutral mode of the motor |
| saveImmediately | Send the config change immediately to the motor controller |
Reimplemented from valor::CorePhoenixController.
|
inlineoverridevirtual |
Change the PIDF values for the motor.
valor::PIDF has some default values already set and tested, but if the system requires some changes, use this method to change those defaults.
| pidf | The new PIDF values to use for the system |
| slot | Set which slot of the motor to apply the PIDF. 0 if slots aren't compatible |
| saveImmediately | Send the config change immediately to the motor controller |
Implements valor::BaseController.
|
inlineoverridevirtual |
Send the motor to a specific speed.
Will use the motor's native trapezoidal motion profile to get the motor to that position. Can be tuned using the PIDF components of valor::PIDF via setPIDF
To be defined by the implemented BaseController class
| speed | The speed to set the motor to |
| slot | The slot to use for PID gains |
Implements valor::BaseController.