![]() |
Example gyro code released.
I've written example gyro interface code and posted it here: http://kevin.org/frc. This code has been substantially revised since the version released earlier with the PID and scripting code. A substantial amount of documentation has also been written to support this code. As the programming interface has changed, this code will not work with the current version of robot.c. An updated version of robot.c will be released soon.
Here's the readme.txt: Code:
The source code in gyro.c/.h contains a driver and supporting |
Re: Example gyro code released.
:yikes:
Thanks a lot! That's all I can say! :yikes: |
Re: Example gyro code released.
Nice! good thing we already ordered our gyro :D
Once again thankyou for the great code :D |
Re: Example gyro code released.
How could I use this with the accelerometer?
Does anyone know the sample rate for it? |
Re: Example gyro code released.
Has anyone tried this code yet? I'd like to get a sense of how (if) it's working for teams.
-Kevin |
Re: Example gyro code released.
Quote:
First of all, thank you for your undying effort keeping this huge event on track. I just started this year as a programming mentor and do not know the ins and outs of what has happened over the last few years with the code. The programming student on the team is new, and he is a little anxious with everything. He first saw "C" just a few weeks ago and is feeling a little overwhelmed. I am guiding him through how to layout the functionality he needs to meet the required game rules and translate all of that into working code. In one of your previous posts, you stated you were working on a new robot.c (and I hope a new robot.h). Do you have any idea when we would see that? Having that will help immensely since my role is to help and not perform the actual work instead of the student doing it himself. Respectfully, Gary D. |
Re: Example gyro code released.
Kevin,
Is this the same as the edubot guro code you have on your site? |
Re: Example gyro code released.
Quote:
1) Because I now return angular units expressed in milliradians instead of degrees, line 198 needs to be changed from: heading = Gyro_Angle()*PI_MRAD/180L; to: heading = Get_Gyro_Angle(); 2) The programming interface was expanded and many functions were renamed. To fix this, I would just drop the new version of gyro.c/.h into your build directory and let the compiler find the deltas for you (there will only be a few). -Kevin |
Re: Example gyro code released.
Quote:
:-) Gary |
Re: Example gyro code released.
Quote:
-Kevin |
Re: Example gyro code released.
Quote:
-Kevin |
Re: Example gyro code released.
Kevin, the gyro code has worked fine for us. We are able to track heading, and stick to a heading. We arent using the scripting, for lack of need.
As soon as we get our encoders in, I will post how the PID works out. |
Re: Example gyro code released.
Quote:
-Kevin |
Re: Example gyro code released.
For now, we are using the BEI gyrochip provided in the 2003 kit. This is for testing purposes, seeing as they are illegal for robot use. We are getting gyro bias at startup, with the Calc_Gyro_Bias() function (we plan to poll it more, but we have only done basic tests, seeing how we are learning this as we go). Our gyro use code hasnt really been developed, since we are waiting for our encoder delivery, and we are planning to tackle the PID system all at once. But in our initial tests, we were seeing a bit of drift; The heading would waver about +- 17 milliradians every 8 seconds. (I dont believe we had the scale factor set the right way, seeing as one rotation was giving us a heading of about 10000 mRads.)
In order to keep costs down, I was hoping to use the provided accelerometer in place of a yaw gyro for the bot. Im guesing this would work with the gyro driver you wrote, but is there anything I need to change? (yanno.. something that I would probably never be able to figure out on my own.) As for the drift, we have explored 2 options. One was to mount the gyro to a piece of foam tape or rubber, hoping it would cut out motor/compressor vibrations. I think the gyro bias is being set incorrectly due to the vibrations, and since for now we are only polling for bias once, it may have ill effect on our code. Any tips? Thanks. |
Re: Example gyro code released.
Quote:
Quote:
Quote:
-Kevin |
| All times are GMT -5. The time now is 16:53. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi