CTRE Phoenix 6 C++ 24.3.0
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

MotionMagicConfigsWithMotionMagicCruiseVelocity (double newMotionMagicCruiseVelocity)
 Modifies this configuration's MotionMagicCruiseVelocity parameter and returns itself for method-chaining and easier to use config API. More...
 
MotionMagicConfigsWithMotionMagicAcceleration (double newMotionMagicAcceleration)
 Modifies this configuration's MotionMagicAcceleration parameter and returns itself for method-chaining and easier to use config API. More...
 
MotionMagicConfigsWithMotionMagicJerk (double newMotionMagicJerk)
 Modifies this configuration's MotionMagicJerk parameter and returns itself for method-chaining and easier to use config API. More...
 
MotionMagicConfigsWithMotionMagicExpo_kV (double newMotionMagicExpo_kV)
 Modifies this configuration's MotionMagicExpo_kV parameter and returns itself for method-chaining and easier to use config API. More...
 
MotionMagicConfigsWithMotionMagicExpo_kA (double newMotionMagicExpo_kA)
 Modifies this configuration's MotionMagicExpo_kA parameter and returns itself for method-chaining and easier to use config API. More...
 
std::string ToString () const override
 
std::string Serialize () const override
 
ctre::phoenix::StatusCode Deserialize (const std::string &to_deserialize) override
 
virtual std::string ToString () const =0
 
virtual ctre::phoenix::StatusCode Deserialize (const std::string &string)=0
 
virtual std::string Serialize () const =0
 

Public Attributes

double MotionMagicCruiseVelocity = 0
 This is the maximum velocity Motion Magic® based control modes are allowed to use. More...
 
double MotionMagicAcceleration = 0
 This is the target acceleration Motion Magic® based control modes are allowed to use. More...
 
double MotionMagicJerk = 0
 This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. More...
 
double MotionMagicExpo_kV = 0
 This is the target kV used only by Motion Magic® Expo control modes, in units of V/rps. More...
 
double MotionMagicExpo_kA = 0
 This is the target kA used only by Motion Magic® Expo control modes, in units of V/rps². More...
 

Detailed Description

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

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()

MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicAcceleration ( double  newMotionMagicAcceleration)
inline

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()

MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicCruiseVelocity ( double  newMotionMagicCruiseVelocity)
inline

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: rps
Parameters
newMotionMagicCruiseVelocityParameter to modify
Returns
Itself

◆ WithMotionMagicExpo_kA()

MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicExpo_kA ( double  newMotionMagicExpo_kA)
inline

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, 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. A kA of 0 will be promoted to a reasonable default of 0.1.

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

◆ WithMotionMagicExpo_kV()

MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicExpo_kV ( double  newMotionMagicExpo_kV)
inline

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, 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. A kV of 0 will be promoted to a reasonable default of 0.12.

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

◆ WithMotionMagicJerk()

MotionMagicConfigs & ctre::phoenix6::configs::MotionMagicConfigs::WithMotionMagicJerk ( double  newMotionMagicJerk)
inline

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® support of S-Curves. 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

double ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicAcceleration = 0

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

double ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicCruiseVelocity = 0

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: rps

◆ MotionMagicExpo_kA

double ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicExpo_kA = 0

This is the target kA used only by Motion Magic® Expo control modes, 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. A kA of 0 will be promoted to a reasonable default of 0.1.

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

◆ MotionMagicExpo_kV

double ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicExpo_kV = 0

This is the target kV used only by Motion Magic® Expo control modes, 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. A kV of 0 will be promoted to a reasonable default of 0.12.

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

◆ MotionMagicJerk

double ctre::phoenix6::configs::MotionMagicConfigs::MotionMagicJerk = 0

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® support of S-Curves. 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: