Device Configuration
Last updated
Last updated
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
.
type
Y
The device type which is used for creation of the Swerve type.
id
Integer
Y
The ID of the device on the CANBus, or the pin ID on the roboRIO for certain devices.
canbus
String
N
The 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
Optimize your IMU if it isn't as accurate as you hope, NavX's have this nice guide here
Read the code! If you can't understand something all of the code is documented and easy to read.