|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Making Debugging Easier
I've had several ideas to make debugging easier on us programmers or even just checking out the robot between matches.
Currently we have an autonomous selector switch on our robot. I inserted a special 'debug mode' that we can put any autonomous sequence in and test it and when we run out of time and cant reload code, its not a big deal. Stemming off that, I was wondering what other ideas or solutions fellow programmers have had? My next change to our code once the 'No Work' period is ended for our team (Nationals) is going to use a toggle switch on our OI to enable or disable printfs for pots and encoders. Those two are by far the two most used printfs on our team, so I hope to make it easier for us programmers to work. Also, has any team used the Dashboard to read pot or encoder values? That was going to be another project on the horizon which I believe is exempt from the 'No Work' period because its not actual work on the robot. Currently we use the dashboard to trim joysticks, although we did use it to monitor pwms before we got our robot to test code. A few ideas in the works for later this year or next year are: Three Pots that can plug into the OI and be used to tweak PID gains rapidly. Utilizing the leds on the OI we have to enable us to deadband joysticks sans dashboard Mini Dashboard viewer instead of a laptop (possibly pocketpc or the like) Wireless programmer for use in those few hours programmers actually get the robot right before shipping it away. ??? These are all ideas which we have YET to get working but please add what programming easter eggs you have put into the code to make your life easier. EDIT: Dashbord Config of pots and encoders in although since only 4 digits, I have a call that looks somethin like this for encoders: Code:
User_ByteX = (int) abs( (int) Get_Encoder_Counts(LEFT)) % 1000; Last edited by dm0ney : 28-03-2005 at 01:39. |
|
#2
|
||||
|
||||
|
Re: Making Debugging Easier
Quote:
|
|
#3
|
||||
|
||||
|
Re: Making Debugging Easier
Something that won our team an award from last year was a "debug box". It doubled as our arm control mechanism, but it had a big red button on it that said debug. When you were in debug mode you could hit a combination of 4 keys (or more) to change the way the robot operated. The changes would then be stored in the flash (?) memory so next time the controller booted, it would use the saved changes. The idea was to preprogram as much as you can to not need to recompile the program to do mundane changes.
A list of features was - Enabling and Disabling the Right or Left motors - Inverting the polarity on the Right or Left motors (this was useful for motor replacement) - Changing the operator drive mode from one stick, two stick, or ultra topic secret mode - Selecting which autonomous program to run - Motor dampening - Enabling and disabling specific debug statements - Having one test autonomous program that you could hot script and save This year we were planning on getting an rj-45 jack and hooking it into the digital ins/outs and then having a project box with LCDs on it as well as a keypad. The project box would then be able to hot plug into the robot and the LCDs would make a menu of sorts to replicate the same function as described before. They could have also been used to display output variables and such. |
|
#4
|
|||||
|
|||||
|
Re: Making Debugging Easier
Most of the pins on the programming port aren't used. I made a pair of "breakout" connectors that steal pins 7, 8, and 9 from the programming cable and provide remote control of the robot reset and program buttons. The RC end has a "pwm" cable connector for the remote switch pins, and the computer end has a two-way rocker switch with red=RESET and green=PROG sides (though a pair of momentary switches would work too).
Without this, the programmer has two options: either get up from the computer and kneel down by the robot to press PROG every time, or shout "Please press program!" and wait for someone to comply. When the robot was on our practice field, connected by a 25-foot cable, on the other side of the alliance station wall from the programmer, the remote switches were very handy. |
|
#5
|
||||
|
||||
|
Re: Making Debugging Easier
Quote:
I'm definitely going to look into doing a breakout connector like the one shown. I actually wrote an implementation of some code that I can drop in at a later date today to allow the printfs to become obsolete and use the dashboard instead... I suppose its on to creating a dashboard prog to run on a pocketpc, palm, or somethin else. "If mechanical can have their labeled blocks of wood for tap and drill sets, electrical can have their helping hands to solder, us programmers can DEFINITELY have all that and more. " ~D. Mishra ![]() |
|
#6
|
||||
|
||||
|
Re: Making Debugging Easier
Quote:
|
|
#7
|
||||
|
||||
|
[quote=Alan Anderson]Most of the pins on the programming port aren't used. I made a pair of "breakout" connectors that steal pins 7, 8, and 9 from the programming cable and provide remote control of the robot reset and program buttons. The RC end has a "pwm" cable connector for the remote switch pins, and the computer end has a two-way rocker switch with red=RESET and green=PROG sides (though a pair of momentary switches would work too). QUOTE]
Can you provide a picture of the words above? Can you point to any IFI documentation that details the programming port? |
|
#8
|
|||
|
|||
|
Re: Making Debugging Easier
[quote=marccenter]
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: Making Debugging Easier
We used primarily printf()'s (again) for debugging. (though we had some issues with overlap.)
We took the 8 most significant bits off the pots on our arm and put those in the user bytes. That was very nice, since it seemed the pots were always loosing alignment. (And we were using a 'model' control for it.) I also opened up PWMs 13-16 for debugging. So I could use CCP2_OUT (or whatever ), etc. for digital outs and pwm13-16 to see values on the dashboard. |
|
#10
|
|||||
|
|||||
|
Re: Making Debugging Easier
Our software read one of the otherwise unused joystick wheel inputs (yes, we used the old reliable black joysticks for the driver this year) and used its value to select among a set of User_Byte outputs to be viewed by a dashboard program. With the wheel at one end of its travel, it sent (the low 16 bits of) the three encoder wheel values. At the other end, it sent arm potentiometer feedback. Intermediate positions gave internal state information for the arm and drivebase control routines.
A separate "debug mode" switch selected between all of that and the regular "drive mode" dashboard data, which was basically monitoring the autonomous mode selection, the vision tetra detection, and a few feedback bits such as air compressor status. |
|
#11
|
||||
|
||||
|
Re: Making Debugging Easier
Quote:
|
|
#12
|
|||||
|
|||||
|
On a similar thing, has anyone tried something so that you can change constants w/o downloading code again? I'm thinking that's going to be my summer project.
|
|
#13
|
|||
|
|||
|
Re: Making Debugging Easier
Quote:
Last edited by seanwitte : 07-04-2005 at 15:05. |
|
#14
|
|||
|
|||
|
Re: Making Debugging Easier
Program port pinout is at http://www.ifirobotics.com/docs/program-port-4-7-05.pdf .. pins 9, 4, 6, and 1 are free, I love the IFI support forums
![]() |
|
#15
|
|||||
|
|||||
|
Re: Making Debugging Easier
I always figured it was just standard RS-232 (which it appears to be), though minus a few status lines (fairly common).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Making your robot drive easier | ufa_mike | Control System | 32 | 28-04-2004 21:35 |
| Wiring Diagram for making a Joystick | Nick Fury | Control System | 0 | 10-02-2004 23:10 |
| Team Communication - Making it easier | Balbinot | Website Design/Showcase | 3 | 10-02-2004 13:50 |
| What's easier? Last year or this year? | archiver | 2001 | 2 | 23-06-2002 23:33 |
| FIRST, BattleBots & Marketing of Robotics | Mike Soukup | General Forum | 12 | 12-12-2001 18:46 |