CTRE Phoenix 6 C++ 25.0.0-beta-4
Loading...
Searching...
No Matches
ctre::phoenix6::configs::MotionMagicConfigs Class Reference

Configs for Motion Magic®. More...

#include <ctre/phoenix6/configs/Configs.hpp>

Inheritance diagram for ctre::phoenix6::configs::MotionMagicConfigs:
ctre::phoenix6::configs::ParentConfiguration ctre::phoenix6::ISerializable

Public Member Functions

constexpr MotionMagicConfigs ()=default
 
constexpr MotionMagicConfigsWithMotionMagicCruiseVelocity (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 MotionMagicConfigsWithMotionMagicAcceleration (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 MotionMagicConfigsWithMotionMagicJerk (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 MotionMagicConfigsWithMotionMagicExpo_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 MotionMagicConfigsWithMotionMagicExpo_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.
 

Detailed Description

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Constructor & Destructor Documentation

◆ MotionMagicConfigs()

constexpr ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicConfigs ( )
constexprdefault

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::MotionMagicConfigs::Deserialize ( const std::string & to_deserialize)
inlineoverridevirtual

◆ Serialize()

std::string ctre::phoenix6::configs::MotionMagicConfigs::Serialize ( ) const
inlineoverridevirtual

◆ ToString()

std::string ctre::phoenix6::configs::MotionMagicConfigs::ToString ( ) const
inlineoverridevirtual

◆ WithMotionMagicAcceleration()

constexpr MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicAcceleration ( units::angular_acceleration::turns_per_second_squared_t newMotionMagicAcceleration)
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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec²
Parameters
newMotionMagicAccelerationParameter to modify
Returns
Itself

◆ WithMotionMagicCruiseVelocity()

constexpr MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicCruiseVelocity ( units::angular_velocity::turns_per_second_t newMotionMagicCruiseVelocity)
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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec
Parameters
newMotionMagicCruiseVelocityParameter to modify
Returns
Itself

◆ WithMotionMagicExpo_kA()

constexpr MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicExpo_kA ( ctre::unit::volts_per_turn_per_second_squared_t newMotionMagicExpo_kA)
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.

  • Minimum Value: 1e-05
  • Maximum Value: 100
  • Default Value: 0.1
  • Units: V/rps²
Parameters
newMotionMagicExpo_kAParameter to modify
Returns
Itself

◆ WithMotionMagicExpo_kV()

constexpr MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicExpo_kV ( ctre::unit::volts_per_turn_per_second_t newMotionMagicExpo_kV)
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.

  • Minimum Value: 0.001
  • Maximum Value: 100
  • Default Value: 0.12
  • Units: V/rps
Parameters
newMotionMagicExpo_kVParameter to modify
Returns
Itself

◆ WithMotionMagicJerk()

constexpr MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicJerk ( units::angular_jerk::turns_per_second_cubed_t newMotionMagicJerk)
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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec³
Parameters
newMotionMagicJerkParameter to modify
Returns
Itself

Member Data Documentation

◆ MotionMagicAcceleration

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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec²

◆ MotionMagicCruiseVelocity

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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec

◆ MotionMagicExpo_kA

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.

  • Minimum Value: 1e-05
  • Maximum Value: 100
  • Default Value: 0.1
  • Units: V/rps²

◆ MotionMagicExpo_kV

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.

  • Minimum Value: 0.001
  • Maximum Value: 100
  • Default Value: 0.12
  • Units: V/rps

◆ MotionMagicJerk

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.

  • Minimum Value: 0
  • Maximum Value: 9999
  • Default Value: 0
  • Units: rot per sec³

The documentation for this class was generated from the following file: