REVLib - C++
rev::spark::MAXMotionConfig Class Reference

#include <MAXMotionConfig.h>

Inherits rev::spark::BaseConfig.

Public Types

enum  MAXMotionPositionMode : uint32_t { kMAXMotionTrapezoidal = 0 }
 

Public Member Functions

 MAXMotionConfig ()=default
 
 ~MAXMotionConfig () override=default
 
 MAXMotionConfig (const MAXMotionConfig &)=delete
 
MAXMotionConfigoperator= (const MAXMotionConfig &)=delete
 
 MAXMotionConfig (MAXMotionConfig &&) noexcept=delete
 
MAXMotionConfigoperator= (MAXMotionConfig &&) noexcept=delete
 
MAXMotionConfigApply (MAXMotionConfig &config)
 
MAXMotionConfigMaxVelocity (double maxVelocity, ClosedLoopSlot slot=kSlot0)
 
MAXMotionConfigMaxAcceleration (double maxAcceleration, ClosedLoopSlot slot=kSlot0)
 
MAXMotionConfigAllowedClosedLoopError (double allowedError, ClosedLoopSlot slot=kSlot0)
 
MAXMotionConfigPositionMode (MAXMotionPositionMode mode, ClosedLoopSlot slot=kSlot0)
 
- Public Member Functions inherited from rev::spark::BaseConfig
virtual ~BaseConfig ()=default
 
virtual std::string Flatten ()
 

Additional Inherited Members

- Protected Types inherited from rev::spark::BaseConfig
using SparkConfig_t = std::variant< int32_t, uint32_t, float, bool >
 
- Protected Member Functions inherited from rev::spark::BaseConfig
 BaseConfig ()=default
 
 BaseConfig (const BaseConfig &)=delete
 
BaseConfigoperator= (const BaseConfig &)=delete
 
 BaseConfig (BaseConfig &&) noexcept=delete
 
BaseConfigoperator= (BaseConfig &&) noexcept=delete
 
template<typename ConfigType >
void PutParameter (uint8_t parameterId, ConfigType value)
 
std::optional< SparkConfig_tGetParameter (uint8_t parameterId)
 
std::optional< SparkConfig_tGetParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void RemoveParameter (uint8_t parameterId)
 
void RemoveParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void Apply (BaseConfig &config)
 

Member Enumeration Documentation

◆ MAXMotionPositionMode

Enumerator
kMAXMotionTrapezoidal 

Constructor & Destructor Documentation

◆ MAXMotionConfig() [1/3]

rev::spark::MAXMotionConfig::MAXMotionConfig ( )
default

◆ ~MAXMotionConfig()

rev::spark::MAXMotionConfig::~MAXMotionConfig ( )
overridedefault

◆ MAXMotionConfig() [2/3]

rev::spark::MAXMotionConfig::MAXMotionConfig ( const MAXMotionConfig )
delete

◆ MAXMotionConfig() [3/3]

rev::spark::MAXMotionConfig::MAXMotionConfig ( MAXMotionConfig &&  )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

MAXMotionConfig & rev::spark::MAXMotionConfig::operator= ( const MAXMotionConfig )
delete

◆ operator=() [2/2]

MAXMotionConfig & rev::spark::MAXMotionConfig::operator= ( MAXMotionConfig &&  )
deletenoexcept

◆ Apply()

MAXMotionConfig & MAXMotionConfig::Apply ( MAXMotionConfig config)

Applies settings from another MAXMotionConfig to this one.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe MAXMotionConfig to copy settings from
Returns
The updated MAXMotionConfig for method chaining

◆ MaxVelocity()

MAXMotionConfig & MAXMotionConfig::MaxVelocity ( double  maxVelocity,
ClosedLoopSlot  slot = kSlot0 
)

Set the maximum velocity for the MAXMotion mode of the controller for a specific closed loop slot. This is the cruising velocity of the profile. Natively, the units are in RPM but will be affected by the velocity conversion factor.

Parameters
maxVelocityThe maximum velocity with the velocity conversion factor applied
slotThe closed loop slot to set the values for
Returns
The modified MAXMotionConfig object for method chaining

◆ MaxAcceleration()

MAXMotionConfig & MAXMotionConfig::MaxAcceleration ( double  maxAcceleration,
ClosedLoopSlot  slot = kSlot0 
)

Set the maximum acceleration for the MAXMotion mode of the controller for a specific closed loop slot. This is the rate at which the velocity will increase until the max velocity is reached. Natively, the units are in RPM per second but will be affected by the velocity conversion factor.

Parameters
maxAccelerationThe maximum acceleration with the velocity conversion factor applied
slotThe closed loop slot to set the values for
Returns
The modified MAXMotionConfig object for method chaining

◆ AllowedClosedLoopError()

MAXMotionConfig & MAXMotionConfig::AllowedClosedLoopError ( double  allowedError,
ClosedLoopSlot  slot = kSlot0 
)

Set the allowed closed loop error for the MAXMotion mode of the controller for a specific PID slot. This value is how much deviation from the setpoint is tolerated and is useful in preventing oscillation around the setpoint. Natively, the units are in rotations but will be affected by the position conversion factor.

Parameters
allowedErrorThe allowed error with the position conversion factor applied
slotThe closed loop slot to set the values for
Returns
The modified MAXMotionConfig object for method chaining

◆ PositionMode()

MAXMotionConfig & MAXMotionConfig::PositionMode ( MAXMotionPositionMode  mode,
ClosedLoopSlot  slot = kSlot0 
)

Set the MAXMotion position control mode of the controller for a specific closed loop slot.

Parameters
modeThe MAXmotion position mode
slotThe closed loop slot to set the values for
Returns
The modified MAXMotionConfig object for method chaining

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