FIRST Choice SENSOR BOARD (ACCELEROMETER & GYRO)

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.

Thanks in advance!

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.

Sorry, I should have been more clear - we are using 4 CIMS and 4 miniCIMS. The original post has been edited to specify this.

*What motor controllers are you using?

We are using 8 Talon SR motor controllers. Original post edited.

Have you looked at the tutorial?

http://files.andymark.com/ADI_FRC_GyroAccel_Board_LV_2016.pdf

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.

OK:

  • mecanum drivetrain

  • no encoders

  • using TalonSR

  • want to use gyro to drive straight

Does this help?

Here is another thread with a lot of the same questions/answers.

http://www.chiefdelphi.com/forums/showthread.php?&p=1531890

Ask if you need more.