phoenix6.hardware.cancoder

Module Contents

class phoenix6.hardware.cancoder.CANcoder(device_id: int, canbus: phoenix6.canbus.CANBus)

Bases: phoenix6.hardware.core.core_cancoder.CoreCANcoder

Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.

Constructs a new CANcoder 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 CANcoder, 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 CANcoder

Return type:

CANcoder

close()