Gyroscope
Last updated
Last updated
YAGSL supports a wide variety of Gyroscopes in an effort to best help teams of all budgets, while we do recommend the NavX or Pigeon2 and officially support and have tested them, we do try to support others with varying degrees of success.
YAGSL creates wrappers over all supported Gyroscope types to uniformly fetch and set data that is needed for a Swerve Drive to operate, this wrapper is called SwerveIMU
. All Gyroscope's can be fetched from the SwerveDrive
object via the SwerveDriveConfiguration
object which is generated from the swervedrive.json
file given. For a user program to fetch the raw gyroscope object all you must do is as follows while casting the object to the right type, in our case this will be a NavX AHRS
class.
These gyroscopes have been thoroughly tested and are used by many FRC teams. Generally speaking these will give you the best performance and reliability as well as help from the community at large.
Only CTRE devices currently support the canbus
option, if your device is using the roboRIO canbus
you must use the value of null
or "rio"
for supported CTRE devices. If you are using a CANivore, and the device is on the CANivore bus, the name must match the CANivore name.
In swervedrive.json
you specify the gyroscope with the
If your robot spins out of control without any controller input you probably need to invert your IMU here.
pigeon
CAN; does not support CANivore.
pigeon2
CAN; supports CANivore
canandgyro
CAN; does not support CANivore.
navx
, navx_spi
roboRIO MXP SPI
navx_i2c
I2C port on the roboRIO MXP. Not recommended!
navx_usb
Serial over USB Cable to roboRIO (not recommended)
navx_mxp_serial
Serial over roboRIO MXP
adis16448
roboRIO MXP
adis16470
roboRIO SPI port
adxrs450
roboRIO SPI port.
Analog Gyro
analog
AnalogInput