phoenix6.hardware.canrange

Module Contents

class phoenix6.hardware.canrange.CANrange(device_id: int, canbus: phoenix6.canbus.CANBus)

Bases: phoenix6.hardware.core.core_canrange.CoreCANrange

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

Constructs a new CANrange object.

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

  • canbus (CANBus) – The CAN bus this device is on

classmethod none() Self

Constructs a stubbed-out CANrange, where all status signals, controls, configs, etc. perform no action and immediately return OK. This can be used to silence error messages for devices that have been completely removed from the robot.

Returns:

Stubbed-out CANrange

Return type:

CANrange

close()