This is my first thread, so bear with me and let me know if I break any unspoken conventions.
We are a fairly inexperienced team, and just got the SENSOR BOARD (ACCELEROMETER & GYRO) from FIRST Choice (http://firstchoicebyandymark.com/fc16-000). Could we get some advice on connecting and using the sensor board to drive straight? Ideally we could easily disable this function while driving over terrain, getting in a pushing match, etc. We are programming in Java and have an 4-CIM 4-miniCim mechanum wheel drive which we are currently controlling using the RobotDrive class’s mecanumDrive_Cartesian method. We are using 8 Talon SR motor controllers with PWM Y-splitters. No comments on the choice of drive train please, just programming/wiring advice.
I know that you said you didn’t want any comments on drive train choice, but you are only allowed 6 CIMs on a robot. You’re going to have to go down to one motor per mecanum wheel or you won’t be legal.
In theory, what you want to do is: Determine a desired gyro angle, and adjust power to the wheels as you drive to keep you pointing in that direction. There may be functions in the libraries that do most of that for you.
Unfortunately that tutorial is for labview, which I have no experience with. We are using Java. I’ve been looking at the ADIS16448_IMU class at https://github.com/juchong/ADIS16448-RoboRIO-Driver/blob/master/Java/com/analog/adis16448/frc/ADIS16448_IMU.java , so I know how to get basic data from the sensor board. Given time I’m sure I could figure out some way to adjust motor output by comparing joystick input and sensor data. We’re very busy though, so if there’s a standard way of implementing this I’d be interested in knowing how it works.