Go to Post I can't think of a match where we didnt do the ritual. We always called it... "Deploying the code" - Briansmithtown [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 4 votes, 4.75 average. Display Modes
  #1   Spotlight this post!  
Unread 20-03-2007, 17:27
♥♣♠♪'s Avatar
♥♣♠♪ ♥♣♠♪ is offline
DemiOmniGod
FRC #1546 (Chaos Inc.)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Baldwin
Posts: 5
♥♣♠♪ will become famous soon enough
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by meatmanek View Post
Our team uses an 'abstraction layer' which consists of a bunch of global variables and two functions: abstractIn() and abstractOut().
The global variables are things like driveLeft, driveRight, joyL, joyR, etc.
Our abstraction code takes renaming it one step farther. Rather than using the 0-255 scale where 127 means stop, we shift it down 128 (signed char, rather than unsigned), and we also invert motors where it makes sense. (one side of the drivetrain, any appendages where the motor is 'backwards')

This helps make our code MUCH more readable and configurable, and makes algorithms a bit simpler.

Another trick we did this year was one big state machine for teleoperated mode. In the past, our robot has been nothing more than a glorified remote control car. This year, our robot knows what it's supposed to be doing, with a set of states for each objective, and so the drivers are freed to think more about the game, rather than the robot.
Our code did the abstractions, but to the point where we had #define unsign(x) ((x)-127-((x)==255))
We #defined all the pwms to things like pwmL, pwmR, pwmA, etc.
The worst was when we needed to use two motors to control the wheels on the left and right. pwmL is #defined as (pwm05=pwm06)
__________________
Programming && English !mix

Our website
  #2   Spotlight this post!  
Unread 20-03-2007, 22:11
Adamskiy's Avatar
Adamskiy Adamskiy is offline
Team Founder
AKA: Brandon Adams
FRC #1261 (RoboLions)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Suwanee, GA
Posts: 30
Adamskiy is on a distinguished road
Re: Programming tricks (and former trade secrets)

We did similar to the above quote of meatmanek, but scaled it from -100 to +100....lost some resolution, but it made calculations much more simple. And although we had a tank drive, we set the left thumbstick on our Xbox controller to the throttle, and the right thumbstick controlled steering. We did that after picking drivers, as one of them loves Halo and figured it would be more easy for him to control.

For our elevator, the motor that acted as the winch was a small CIM with a BaneBots gearhead/encoder on it, so we used the encoder to have set rack positions (high/med/low) that would be assigned to a single button on the Guitar Hero controller. We then had a limit switch at the bottom (load position) that would reset the encoder count to 0 to account for slight variations that would occur....obviously not the best method, but it was accurate to about an inch, so good enough since we lower the tube onto the rack to score.
__________________
Team 1261 - Motorola/Cognex/EMD Software & Peachtree Ridge High School
- 2005 Peachtree Regional Champions
(Thanks 281 and 801)
- 2006 Peachtree Regional Champions (Thanks 1414 and 1057)
- 2006 Peachtree Regional Delphi "Driving Tomorrow's Technology" Award
- 2006 Peachtree Regional Underwriters Laboratories Safety Award
- 2007 Peachtree Regional Innovation In Control Award
(Guitar Hero controller )
- 2007 Peachtree Regional Semi-Finalists (Thanks 1746 and 1057)
  #3   Spotlight this post!  
Unread 20-03-2007, 22:31
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Programming tricks (and former trade secrets)

I also wrote sscanf but haven't gotten a chance to use it yet. My stupid state machine based input code works well enough, so I haven't bothered to change the code to use sscanf yet.

It compiles, and it works when I test it on my linux box. Only has %c, %u, and %d at the moment, but it should be pretty easy for someone to add other stuff to it.

http://meatmanek.net/scanf.c
__________________
Real programmers use vim.
  #4   Spotlight this post!  
Unread 20-03-2007, 22:33
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Programming tricks (and former trade secrets)

I created this: http://www.falconir.com/products.php

After calibrating once at our home practice field, it was literally "set it and forget it". We did not have to recalibrate once at either of the two regionals! It even handled a dim target light on the practice field.

Then we changed our arms out and autonomous broke permanently
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #5   Spotlight this post!  
Unread 20-03-2007, 23:07
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by Eldarion View Post
After calibrating once at our home practice field, it was literally "set it and forget it". We did not have to recalibrate once at either of the two regionals! It even handled a dim target light on the practice field.
Whoaa, cool! I do wish that this was open-source, or at least a few more details were included on the website...but good job! I did consider briefly a PC with a webcam onboard--that would be much easier to deal with than a CMUcam...but I'm also starting to lose confidence in the camera module. The lens seems to distort the image horribly, and it's not a defect because it does it on 2 cameras. I don't know as if I'll ever use the CMUcam. Too complicated...

My little bit: stay SIMPLE! And make sure the basics are done first! Autonomous mode does no good if the arm control module doesn't work...I should know, I just got it done yesterday during our last build window before Waterloo. I know I can do much better next year.

JBot
__________________
Aren't signatures a bit outdated?
  #6   Spotlight this post!  
Unread 20-03-2007, 23:15
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by JBotAlan View Post
Whoaa, cool! I do wish that this was open-source, or at least a few more details were included on the website...but good job!
If you want to, you can download the manual from the website. It offers some insight into the basic algorithms involved (adaptive image segmentation is the main one). Another featue is that the system natively uses 320x240 images, and scales the centroids down by two for output purposes. I will probably put a little more detail on the main products page; thanks for the suggestion!

I did not make this open source as I have been working on the algorithms for the past 2 1/2 years, and would like to make a little bit of profit so that I can fund my other vision systems research. It is hard to continue researching with no funds available to test ideas with! Besides, it is written for an FPGA, an FPGA which is pretty much filled up by the code. (1 million logic cells, all in use! )

The OV7620 camera module itself is not a bad module for this kind of work. I have yet to see this distortion you speak of, and I have had the oppertunity to work with 6 different OV7620 modules. Out of curiosity, did you plug both of them (one at a time, of course ) into the same CMUCam board or different CMUCam boards when you noticed the distortion?
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #7   Spotlight this post!  
Unread 20-03-2007, 23:35
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by Eldarion View Post
If you want to, you can download the manual from the website. It offers some insight into the basic algorithms involved (adaptive image segmentation is the main one). Another featue is that the system natively uses 320x240 images, and scales the centroids down by two for output purposes. I will probably put a little more detail on the main products page; thanks for the suggestion!

I did not make this open source as I have been working on the algorithms for the past 2 1/2 years, and would like to make a little bit of profit so that I can fund my other vision systems research. It is hard to continue researching with no funds available to test ideas with! Besides, it is written for an FPGA, an FPGA which is pretty much filled up by the code. (1 million logic cells, all in use! )

The OV7620 camera module itself is not a bad module for this kind of work. I have yet to see this distortion you speak of, and I have had the oppertunity to work with 6 different OV7620 modules. Out of curiosity, did you plug both of them (one at a time, of course ) into the same CMUCam board or different CMUCam boards when you noticed the distortion?
I don't mean to be rude, but I took a look at the code you provide and I must say, it's terribly disorganized and disheveled. I find it hard to navigate and poorly commented, it took me and a friend several minutes to figure out what is apparently a timeout reset of the cameras. Your project looks promising, but I think you should polish it up quite a bit more before charging such a hefty sum for it. And I'm not certain but is that full blown development board depicted in your picture actually entirely necessary? Seems like you could design your own hardware to house the device and save some money in removal of unnecessary parts.

Again I don't mean to be rude, and if I'd made a mistake in my conclusions, please forgive me, your site is somewhat sparse on details, I'll happily stand corrected if I am wrong.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #8   Spotlight this post!  
Unread 20-03-2007, 23:55
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by Matt Krass View Post
I don't mean to be rude, but I took a look at the code you provide and I must say, it's terribly disorganized and disheveled. I find it hard to navigate and poorly commented, it took me and a friend several minutes to figure out what is apparently a timeout reset of the cameras. Your project looks promising, but I think you should polish it up quite a bit more before charging such a hefty sum for it. And I'm not certain but is that full blown development board depicted in your picture actually entirely necessary? Seems like you could design your own hardware to house the device and save some money in removal of unnecessary parts.

Again I don't mean to be rude, and if I'd made a mistake in my conclusions, please forgive me, your site is somewhat sparse on details, I'll happily stand corrected if I am wrong.
Very good points. I did just throw together the example code for a temporary example, as I do not have an RC with me right now and so I could not clean up and test the code. I will pull it until I can clean it up and test it.

Would someone be able to direct me to a place that can handle the manufacturing and assembly of circuit boards that can handle BGA devices in small runs? At this point, I have almost zero capital, so I cannot invest in a run of 2000 boards and hope to sell them later.

I kind of rushed this product out here to "test the waters" and see if there would be any interest in a system like this. The actual system itself is very mature and stable, I am having some difficulty with the peripheral stuff, like sample IFI drivers. If you click on the "Add to Cart" link, you will see that I am not actually offering this for sale to the general public yet. (I should probably make that more clear.) What I would like is for one or two teams to be willing to test this, make sure that the manual is clear and such, that I am not overpromising, etc. before making this generally available and investing in a new board design.

You were not rude; this is my first time attempting to bring something to market and as such it is a learning experience for me. I appreciate your criticism and feel free to poke as many holes in my logic above as necessary.

Maybe we could discuss this further via the PM system so as not to tie up this thread?

Thanks again.
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #9   Spotlight this post!  
Unread 20-03-2007, 23:13
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by Eldarion View Post
I created this: http://www.falconir.com/products.php

After calibrating once at our home practice field, it was literally "set it and forget it". We did not have to recalibrate once at either of the two regionals! It even handled a dim target light on the practice field.

Then we changed our arms out and autonomous broke permanently
Looks cool, but have you checked out your main open-source competition: the avrcam
__________________
http://www.mikesorrenti.com/
  #10   Spotlight this post!  
Unread 20-03-2007, 23:20
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Programming tricks (and former trade secrets)

Quote:
Originally Posted by Mike View Post
Looks cool, but have you checked out your main open-source competition: the avrcam
That's interesting, but I think it will be hard to beat the raw processing power of a dedicated FPGA. The FPGA allows me to use 320x240 resolution, over 6 times the resolution of the CMUCam or the avrcam. It does sacrifice speed a little bit, runnig at a little over 6 FPS, but I have found that to be more than adequate. The increased resolution allowed me to stably track the lights from the home zone, (and far beyond it, actually ).

It is hard to go up against an open-source project, though...
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Former FIRST student and mentor dies in a tragic rocket attack in Iraq today. Munkaboo General Forum 48 19-04-2005 12:21
Off-season competetions and former teams Venkatesh Off-Season Events 5 10-12-2004 17:23
Harry Potter and the Chamber of Secrets Ryan Dognaux Chit-Chat 33 01-12-2002 19:57
scouting tips and tricks Rick Scouting 1 08-01-2002 00:52


All times are GMT -5. The time now is 16:41.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi