[CRUSH-code] some programming progress
Bill Bennett
bill at wizardofaz.net
Wed Nov 23 11:02:13 MST 2005
Hi coders
Some of the work done lately is coming together nicely. Jason worked on the autonomous mode selection code. This allows programming multiple autonomous routines and choosing which one is active via OI controls. It's pretty slick. I've integrated it into the main code base for Adil2, which I want to serve as the code base for 2006 competition programming. To use this, you first must choose some input device that won't be confused with other operations. We used the "hat" on the white joystick. This is an analog input that has only 5 values, corresponding to left, right, up, down, and center (off). Since we had not yet attached the hat to any other behavior, we used it for this. It's all pretty easy to change if we decide we want the hat for something else. Here's how it works:
1.. click hat left - enter autonmous mode set mode
2.. hold hat down while moving the joystick up and down in Y, allows choosing autonmous modes 0-15. There is feedback about which one is selected on the PC screen, but also on the OI if you have no PC hooked up to the tether. Click the "select" button on the OI below the digit display until you get a display that starts with U, then the number after the U is the selected autonomous mode. If we decide we need more than 16 autonomous modes, we could use X and Y to set the left and right digit, so you could have modes 0-255, which would show on the digit display as 00-FF.
3.. click hat right - exit autonomous mode set mode - the selected autonomous mode is stored in EEPROM so it is saved for later even if the bot is turned off.
4.. click hat up - runs the selected autonmous mode
Nice work Jason.
These controls are all disabled if in a "real game" to avoid accidental use in a game. This is determined by examining bits coming in from the field control system on the OI competition port.
Garret, Mark, and Jeremy have been working on a sample autonomous mode, mainly as practice. It drives a square. At least that's the intent, we haven't actually let it drive yet. The first version of this used timing to drive the sides of the square, and also used timinig to control how long was spent turning at the corners. We've now added the gyro code to the inputs that can be used in autonomous routines, so the corners can be turned based on angle of rotation rather than time. Should produce a much squarer circle.
I have done a bunch of reorganizing of the modules, not done yet, but intended to make files smaller and more devoted to particular functions. The names now are more representative of what's inside. This is especially true of header files. For example, all the mapping from names to ports is done in crushPortMapping.h. I think this will help make the code more understandable.
Another task I'd like to get going in parallel is the camera. I've been reading about this, and next meeting I will work with students to start to get the camera set up and working again.
Fun stuff.
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wizardofaz.whsites.net/pipermail/crush-code/attachments/20051123/32360dee/attachment.htm
More information about the CRUSH-code
mailing list