Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 1.97 KB

device-configuration.md

File metadata and controls

14 lines (8 loc) · 1.97 KB

Device Configuration

Device Configuration

All devices in a swerve drive come down to a basic set of fields. The device configuration is used to store and create those devices during parsing with a 1:1 mapping to DeviceJson.

Fields

NameUnitsRequiredDescription
typeEncoder type
IMU type
Motor type
YThe device type which is used for creation of the Swerve type.
idIntegerYThe ID of the device on the CANBus, or the pin ID on the roboRIO for certain devices.
canbusStringNThe canbus to instantiate the device on. Only works on devices compatible with alternate CAN buses.

When the type is sparkmax_brushed this defines the encoder attached to the motor which is required for drive motors, angle motors should also use them if there is no attached absolute encoder. The valid values in this case are greyhill_63r256, srx_mag_encoder, throughbore, throughbore_dataport, greyhill_63r256_dataport, srx_mag_encoder_dataport.
DO NOT SET THIS IF THE ATTACHED ENCODER IS AN ABSOLUTE ENCODER

Useful tips

  1. Optimize your IMU if it isn't as accurate as you hope, NavX's have this nice guide here
  2. Read the code! If you can't understand something all of the code is documented and easy to read.