|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: I2C Andymark Gyro Constructor
We have used an ITG-3200 based sensor. This is not the exact AM-2134 model you are describing, but it uses the same chipset for gyro measurements.
It was a non-trivial exercise to get angle information out of this sensor to our robot Java code. We ended up using a background thread that kept reading and accumulating values from the sensor. The ITG-3200 sensor provides deg/sec measurements that you have to integrate (accumulate) over time if you want to get degrees. We have some Java source code available for the ITG-3200 using an I2C chip out at github that you are welcome to look at, use, modify or experiment with: https://github.com/frc868/lib-robot/...o/ITG3200.java We have not used the ITG-3200 sensor for the past couple of seasons. We switched a BNO059 sensor from Adafruit that does the accumulation onboard. We have not decided what we will use this year yet. Here is a link to that sensor https://www.adafruit.com/products/2472 WARNING: Neither of these sensors are directly supported in the standard robot libraries. It takes a considerable amount of time to connect custom I2C circuits to the roboRIO and read through the data sheets and then create the Java code to make use of them. It's a great and often painful experience for both kids and mentors. If you do not have a Java and electronics expert on your team, you might be better off in looking for a Gyro that is already supported. Good luck. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|