View Single Post
  #6   Spotlight this post!  
Unread 07-02-2015, 19:31
duane's Avatar
duane duane is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Vacaville
Posts: 98
duane is an unknown quantity at this point
Send a message via AIM to duane
Re: Trouble with ADXRS453 Gyro

Thank you for sharing the code for the gyro. A couple of comments:

You used a Task and Timers rather than a notifier. Seems like a notifier could make the code easier, but there are also two timers which indeed complicate a bit. Are two timers needed? I'd have to read closer to work it out.

The floating point values are floats instead of doubles. Any particular reason? I'm used to thinking of doubles as being just fine for most uses. WPI Lib seems to use doubles everywhere.

The float values are being updated from a task and read from the robot loop. I think a mutex is needed to protect the values being read. Keep in mind that this year, we really do have multiple processors which means we should pay attention to atomic operations. I don't think a double or float is atomic.

This should be great for us to get going with the gyros.

I'll be happy to contribute to any changes we make.

...Duane
ps Gotta luv github!
__________________
Duane Murphy
Mentor - Software
Vanden Vikings FIRST Team 701
http://www.vandenrobotics.com