Class CANcoderConfiguration
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.
This defines all configurations for the CANcoder.public class CANcoderConfiguration : IParentConfiguration, ISerializable, ICloneable
- Inheritance
-
CANcoderConfiguration
- Implements
- Inherited Members
Fields
CustomParams
Custom Params.
Custom paramaters that have no real impact on controller. Parameter list:public CustomParamsConfigs CustomParams
Field Value
FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.
This flag addresses a corner case where the device may have firmware with newer configs that didn't exist when this version of the API was built. If this occurs and this flag is true, unsupported new configs will be factory defaulted to avoid unexpected behavior. This is also the behavior in Phoenix 5, so this flag is defaulted to true to match.public bool FutureProofConfigs
Field Value
MagnetSensor
Configs that affect the magnet sensor and how to interpret it.
Includes sensor direction, the sensor discontinuity point, and the magnet offset. Parameter list:public MagnetSensorConfigs MagnetSensor
Field Value
Methods
Clone()
Creates a copy of this configuration.
public CANcoderConfiguration Clone()
Returns
Deserialize(string)
Take a string and deserialize it to this configuration
public StatusCode Deserialize(string to_deserialize)
Parameters
to_deserializestring
Returns
- StatusCode
Return code of the deserialize method
Serialize()
Get the serialized form of this configuration
public string Serialize()
Returns
- string
Serialized form of this config group
ToString()
Provides the string representation of this object
public override string ToString()
Returns
WithCustomParams(CustomParamsConfigs)
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.
Custom Params. Custom paramaters that have no real impact on controller. Parameter list:public CANcoderConfiguration WithCustomParams(CustomParamsConfigs newCustomParams)
Parameters
newCustomParamsCustomParamsConfigsParameter to modify
Returns
- CANcoderConfiguration
Itself
WithMagnetSensor(MagnetSensorConfigs)
Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easier to use config API.
Configs that affect the magnet sensor and how to interpret it. Includes sensor direction, the sensor discontinuity point, and the magnet offset. Parameter list:public CANcoderConfiguration WithMagnetSensor(MagnetSensorConfigs newMagnetSensor)
Parameters
newMagnetSensorMagnetSensorConfigsParameter to modify
Returns
- CANcoderConfiguration
Itself