phoenix6.hardware.core.core_canrange

Module Contents

class phoenix6.hardware.core.core_canrange.CoreCANrange(device_id: int, canbus: str | phoenix6.canbus.CANBus = '')

Bases: phoenix6.hardware.parent_device.ParentDevice

Constructs a new CANrange object.

Parameters:
  • device_id (int) – ID of the device, as configured in Phoenix Tuner.

  • canbus (str | CANBus, optional) –

    Name of the CAN bus this device is on. Possible CAN bus strings are:

    • ”rio” for the native roboRIO CAN bus

    • CANivore name or serial number

    • SocketCAN interface (non-FRC Linux only)

    • ”*” for any CANivore seen by the program

    • empty string (default) to select the default for the system:

      • ”rio” on roboRIO

      • ”can0” on Linux

      • ”*” on Windows

property sim_state: phoenix6.sim.canrange_sim_state.CANrangeSimState

Get the simulation state for this device.

This function reuses an allocated simulation state object, so it is safe to call this function multiple times in a robot loop.

Returns:

Simulation state

Return type:

CANrangeSimState

get_version_major(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

App Major Version number.

  • Minimum Value: 0

  • Maximum Value: 255

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

VersionMajor Status Signal Object

Return type:

StatusSignal[int]

get_version_minor(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

App Minor Version number.

  • Minimum Value: 0

  • Maximum Value: 255

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

VersionMinor Status Signal Object

Return type:

StatusSignal[int]

get_version_bugfix(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

App Bugfix Version number.

  • Minimum Value: 0

  • Maximum Value: 255

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

VersionBugfix Status Signal Object

Return type:

StatusSignal[int]

get_version_build(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

App Build Version number.

  • Minimum Value: 0

  • Maximum Value: 255

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

VersionBuild Status Signal Object

Return type:

StatusSignal[int]

get_version(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

Full Version of firmware in device. The format is a four byte value.

  • Minimum Value: 0

  • Maximum Value: 4294967295

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Version Status Signal Object

Return type:

StatusSignal[int]

get_fault_field(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

Integer representing all fault flags reported by the device.

These are device specific and are not used directly in typical applications. Use the signal specific GetFault_*() methods instead.

  • Minimum Value: 0

  • Maximum Value: 4294967295

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

FaultField Status Signal Object

Return type:

StatusSignal[int]

get_sticky_fault_field(refresh: bool = True) phoenix6.status_signal.StatusSignal[int]

Integer representing all (persistent) sticky fault flags reported by the device.

These are device specific and are not used directly in typical applications. Use the signal specific GetStickyFault_*() methods instead.

  • Minimum Value: 0

  • Maximum Value: 4294967295

  • Default Value: 0

  • Units:

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

StickyFaultField Status Signal Object

Return type:

StatusSignal[int]

get_is_pro_licensed(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Whether the device is Phoenix Pro licensed.

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

IsProLicensed Status Signal Object

Return type:

StatusSignal[bool]

get_supply_voltage(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.volt]

Measured supply voltage to the CANrange.

  • Minimum Value: 4

  • Maximum Value: 16.75

  • Default Value: 4

  • Units: V

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

SupplyVoltage Status Signal Object

Return type:

StatusSignal[volt]

get_distance(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.meter]

Distance to the nearest object in the configured field of view of the CANrange.

  • Minimum Value: 0.0

  • Maximum Value: 65.535

  • Default Value: 0

  • Units: m

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Distance Status Signal Object

Return type:

StatusSignal[meter]

get_measurement_time(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.second]

Timestamp of the most recent measurements. This is not synchronized to any other clock source.

Users can use this to check when the measurements are updated.

  • Minimum Value: 0.0

  • Maximum Value: 65.535

  • Default Value: 0

  • Units: s

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

MeasurementTime Status Signal Object

Return type:

StatusSignal[second]

get_signal_strength(refresh: bool = True) phoenix6.status_signal.StatusSignal[float]

Approximate signal strength of the measurement. A higher value indicates a higher strength of signal.

A value of ~2500 is typical when detecting an object under short-range conditions.

  • Minimum Value: 0

  • Maximum Value: 65535

  • Default Value: 0

  • Units:

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

SignalStrength Status Signal Object

Return type:

StatusSignal[float]

get_is_detected(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Whether the CANrange detects an object using the configured proximity parameters.

  • Default Value: 0

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

IsDetected Status Signal Object

Return type:

StatusSignal[bool]

get_measurement_health(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.signals.spn_enums.MeasurementHealthValue]

Health of the distance measurement.

Default Rates:
  • CAN 2.0: 100.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

MeasurementHealth Status Signal Object

Return type:

StatusSignal[MeasurementHealthValue]

get_ambient_signal(refresh: bool = True) phoenix6.status_signal.StatusSignal[float]

The amount of ambient infrared light that the sensor is detecting. For ideal operation, this should be as low as possible.

Short-range mode reduces the influence of ambient infrared light.

  • Minimum Value: 0

  • Maximum Value: 65535

  • Default Value: 0

  • Units:

Default Rates:
  • CAN 2.0: 20.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

AmbientSignal Status Signal Object

Return type:

StatusSignal[float]

get_distance_std_dev(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.meter]

Standard Deviation of the distance measurement.

  • Minimum Value: 0.0

  • Maximum Value: 1.3107000000000002

  • Default Value: 0

  • Units: m

Default Rates:
  • CAN 2.0: 20.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

DistanceStdDev Status Signal Object

Return type:

StatusSignal[meter]

get_real_fov_center_x(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.degree]

The actual center of the FOV in the X direction. This takes into account the user-configured FOVCenterX and FOVRangeX.

  • Minimum Value: -16.0

  • Maximum Value: 15.875

  • Default Value: 0

  • Units: deg

Default Rates:
  • CAN 2.0: 4.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

RealFOVCenterX Status Signal Object

Return type:

StatusSignal[degree]

get_real_fov_center_y(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.degree]

The actual center of the FOV in the Y direction. This takes into account the user-configured FOVCenterY and FOVRangeY.

  • Minimum Value: -16.0

  • Maximum Value: 15.875

  • Default Value: 0

  • Units: deg

Default Rates:
  • CAN 2.0: 4.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

RealFOVCenterY Status Signal Object

Return type:

StatusSignal[degree]

get_real_fov_range_x(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.degree]

The actual range of the FOV in the X direction. This takes into account the user-configured FOVRangeX.

  • Minimum Value: 0.0

  • Maximum Value: 31.875

  • Default Value: 0

  • Units: deg

Default Rates:
  • CAN 2.0: 4.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

RealFOVRangeX Status Signal Object

Return type:

StatusSignal[degree]

get_real_fov_range_y(refresh: bool = True) phoenix6.status_signal.StatusSignal[phoenix6.units.degree]

The actual range of the FOV in the Y direction. This takes into account the user-configured FOVRangeY.

  • Minimum Value: 0.0

  • Maximum Value: 31.875

  • Default Value: 0

  • Units: deg

Default Rates:
  • CAN 2.0: 4.0 Hz

  • CAN FD: 100.0 Hz (TimeSynced with Pro)

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

RealFOVRangeY Status Signal Object

Return type:

StatusSignal[degree]

get_fault_hardware(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Hardware fault occurred

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Fault_Hardware Status Signal Object

Return type:

StatusSignal[bool]

get_sticky_fault_hardware(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Hardware fault occurred

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

StickyFault_Hardware Status Signal Object

Return type:

StatusSignal[bool]

get_fault_undervoltage(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Device supply voltage dropped to near brownout levels

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Fault_Undervoltage Status Signal Object

Return type:

StatusSignal[bool]

get_sticky_fault_undervoltage(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Device supply voltage dropped to near brownout levels

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

StickyFault_Undervoltage Status Signal Object

Return type:

StatusSignal[bool]

get_fault_boot_during_enable(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Device boot while detecting the enable signal

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Fault_BootDuringEnable Status Signal Object

Return type:

StatusSignal[bool]

get_sticky_fault_boot_during_enable(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

Device boot while detecting the enable signal

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

StickyFault_BootDuringEnable Status Signal Object

Return type:

StatusSignal[bool]

get_fault_unlicensed_feature_in_use(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

An unlicensed feature is in use, device may not behave as expected.

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

Fault_UnlicensedFeatureInUse Status Signal Object

Return type:

StatusSignal[bool]

get_sticky_fault_unlicensed_feature_in_use(refresh: bool = True) phoenix6.status_signal.StatusSignal[bool]

An unlicensed feature is in use, device may not behave as expected.

  • Default Value: False

Default Rates:
  • CAN: 4.0 Hz

This refreshes and returns a cached StatusSignal object.

Parameters:

refresh (bool) – Whether to refresh the StatusSignal before returning it; defaults to true

Returns:

StickyFault_UnlicensedFeatureInUse Status Signal Object

Return type:

StatusSignal[bool]

set_control(request: phoenix6.hardware.parent_device.SupportsSendRequest) phoenix6.status_signal.StatusCode
clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_signal.StatusCode

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_hardware(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_signal.StatusCode

Clear sticky fault: Hardware fault occurred

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_undervoltage(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_signal.StatusCode

Clear sticky fault: Device supply voltage dropped to near brownout levels

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_boot_during_enable(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_signal.StatusCode

Clear sticky fault: Device boot while detecting the enable signal

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_signal.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode