Table of Contents

Class CANrangeConfiguration

Namespace
CTRE.Phoenix6.Configs
Assembly
Phoenix6.Hardware.dll

Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front of the device.

This defines all configurations for the CANrange.
public class CANrangeConfiguration : IParentConfiguration, ISerializable, ICloneable
Inheritance
CANrangeConfiguration
Implements
Inherited Members

Fields

CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:
public CustomParamsConfigs CustomParams

Field Value

CustomParamsConfigs

FovParams

Configs that affect the ToF Field of View

Includes range and center configs

Parameter list:
public FovParamsConfigs FovParams

Field Value

FovParamsConfigs

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

bool

ProximityParams

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameter list:
public ProximityParamsConfigs ProximityParams

Field Value

ProximityParamsConfigs

ToFParams

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameter list:
public ToFParamsConfigs ToFParams

Field Value

ToFParamsConfigs

Methods

Clone()

Creates a copy of this configuration.

public CANrangeConfiguration Clone()

Returns

CANrangeConfiguration

Deserialize(string)

Take a string and deserialize it to this configuration

public StatusCode Deserialize(string to_deserialize)

Parameters

to_deserialize string

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

string

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 CANrangeConfiguration WithCustomParams(CustomParamsConfigs newCustomParams)

Parameters

newCustomParams CustomParamsConfigs

Parameter to modify

Returns

CANrangeConfiguration

Itself

WithFovParams(FovParamsConfigs)

Modifies this configuration's FovParams parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF Field of View

Includes range and center configs

Parameter list:
public CANrangeConfiguration WithFovParams(FovParamsConfigs newFovParams)

Parameters

newFovParams FovParamsConfigs

Parameter to modify

Returns

CANrangeConfiguration

Itself

WithProximityParams(ProximityParamsConfigs)

Modifies this configuration's ProximityParams parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameter list:
public CANrangeConfiguration WithProximityParams(ProximityParamsConfigs newProximityParams)

Parameters

newProximityParams ProximityParamsConfigs

Parameter to modify

Returns

CANrangeConfiguration

Itself

WithToFParams(ToFParamsConfigs)

Modifies this configuration's ToFParams parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameter list:
public CANrangeConfiguration WithToFParams(ToFParamsConfigs newToFParams)

Parameters

newToFParams ToFParamsConfigs

Parameter to modify

Returns

CANrangeConfiguration

Itself