CTRE Phoenix 6 C++ 25.0.0-beta-4
|
Configs for Motion Magic®. More...
#include <ctre/phoenix6/configs/Configs.hpp>
Public Member Functions | |
constexpr | MotionMagicConfigs ()=default |
constexpr MotionMagicConfigs & | WithMotionMagicCruiseVelocity (units::angular_velocity::turns_per_second_t newMotionMagicCruiseVelocity) |
Modifies this configuration's MotionMagicCruiseVelocity parameter and returns itself for method-chaining and easier to use config API. | |
constexpr MotionMagicConfigs & | WithMotionMagicAcceleration (units::angular_acceleration::turns_per_second_squared_t newMotionMagicAcceleration) |
Modifies this configuration's MotionMagicAcceleration parameter and returns itself for method-chaining and easier to use config API. | |
constexpr MotionMagicConfigs & | WithMotionMagicJerk (units::angular_jerk::turns_per_second_cubed_t newMotionMagicJerk) |
Modifies this configuration's MotionMagicJerk parameter and returns itself for method-chaining and easier to use config API. | |
constexpr MotionMagicConfigs & | WithMotionMagicExpo_kV (ctre::unit::volts_per_turn_per_second_t newMotionMagicExpo_kV) |
Modifies this configuration's MotionMagicExpo_kV parameter and returns itself for method-chaining and easier to use config API. | |
constexpr MotionMagicConfigs & | WithMotionMagicExpo_kA (ctre::unit::volts_per_turn_per_second_squared_t newMotionMagicExpo_kA) |
Modifies this configuration's MotionMagicExpo_kA parameter and returns itself for method-chaining and easier to use config API. | |
std::string | ToString () const override |
std::string | Serialize () const override |
ctre::phoenix::StatusCode | Deserialize (const std::string &to_deserialize) override |
Public Attributes | |
units::angular_velocity::turns_per_second_t | MotionMagicCruiseVelocity = 0_tps |
This is the maximum velocity Motion Magic® based control modes are allowed to use. | |
units::angular_acceleration::turns_per_second_squared_t | MotionMagicAcceleration = 0_tr_per_s_sq |
This is the target acceleration Motion Magic® based control modes are allowed to use. | |
units::angular_jerk::turns_per_second_cubed_t | MotionMagicJerk = 0_tr_per_s_cu |
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. | |
ctre::unit::volts_per_turn_per_second_t | MotionMagicExpo_kV = 0.12_V / 1_tps |
This is the target kV used only by Motion Magic® Expo control modes. | |
ctre::unit::volts_per_turn_per_second_squared_t | MotionMagicExpo_kA = 0.1_V / 1_tr_per_s_sq |
This is the target kA used only by Motion Magic® Expo control modes. | |
Configs for Motion Magic®.
Includes Velocity, Acceleration, Jerk, and Expo parameters.
|
constexprdefault |
|
inlineoverridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineoverridevirtual |
Implements ctre::phoenix6::ISerializable.
|
inlineoverridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineconstexpr |
Modifies this configuration's MotionMagicAcceleration parameter and returns itself for method-chaining and easier to use config API.
This is the target acceleration Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config.
newMotionMagicAcceleration | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's MotionMagicCruiseVelocity parameter and returns itself for method-chaining and easier to use config API.
This is the maximum velocity Motion Magic® based control modes are allowed to use. Motion Magic® Velocity control modes do not use this config.
When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.
newMotionMagicCruiseVelocity | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's MotionMagicExpo_kA parameter and returns itself for method-chaining and easier to use config API.
This is the target kA used only by Motion Magic® Expo control modes. Unlike the kA slot gain, this is always in units of V/rps².
This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration.
newMotionMagicExpo_kA | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's MotionMagicExpo_kV parameter and returns itself for method-chaining and easier to use config API.
This is the target kV used only by Motion Magic® Expo control modes. Unlike the kV slot gain, this is always in units of V/rps.
This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity.
newMotionMagicExpo_kV | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's MotionMagicJerk parameter and returns itself for method-chaining and easier to use config API.
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config. This allows Motion Magic® to generate S-Curve profiles.
Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.
newMotionMagicJerk | Parameter to modify |
units::angular_acceleration::turns_per_second_squared_t ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicAcceleration = 0_tr_per_s_sq |
This is the target acceleration Motion Magic® based control modes are allowed to use.
Motion Magic® Expo control modes do not use this config.
units::angular_velocity::turns_per_second_t ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicCruiseVelocity = 0_tps |
This is the maximum velocity Motion Magic® based control modes are allowed to use.
Motion Magic® Velocity control modes do not use this config.
When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.
ctre::unit::volts_per_turn_per_second_squared_t ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicExpo_kA = 0.1_V / 1_tr_per_s_sq |
This is the target kA used only by Motion Magic® Expo control modes.
Unlike the kA slot gain, this is always in units of V/rps².
This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration.
ctre::unit::volts_per_turn_per_second_t ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicExpo_kV = 0.12_V / 1_tps |
This is the target kV used only by Motion Magic® Expo control modes.
Unlike the kV slot gain, this is always in units of V/rps.
This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity.
units::angular_jerk::turns_per_second_cubed_t ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicJerk = 0_tr_per_s_cu |
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use.
Motion Magic® Expo control modes do not use this config. This allows Motion Magic® to generate S-Curve profiles.
Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.