Go to Post And that's part of the game... The field is never reset! Muhahaha! - nighterfighter [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-04-2004, 09:02
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
What Features Should the Default Code REALLY include?

As promised here: http://www.chiefdelphi.com/forums/sh...778#post258778 I am starting a new thread to discuss what features the Default Code should really include.


Here is my list of good practice routines that I think IFI should include in future default codes:
  1. I have just been enabled
  2. I have just been disabled
  3. I have just entered autonomous mode
  4. I have just exited autonomous mode
  5. A timer and associated functions (reset, set to time, start, suspend, etc.)
  6. A future task scheduler: Pass it a pointer to a function that gets run at time T
  7. A step by step auton shell with examples of switches based on position of arms, orientation/position of robot, time, watch dog timers, etc
  8. Dual Wheel Encoders and associated functions (reset, CG position calculation, virtual compass, etc.)
  9. Support Smart motor controls (read Barello's comments on positive feedback of motor velocity to compensate for back EMF of motors, hysteresis, etc.)
  10. Support for PID control loops
  11. I have more, but not right now...
I don't expect the folks at IFI to fill in the details of these functions, but I think that it would be a good thing to have shell functions in place that gets called at the right times so that we can get a jump start on programming our robots.

Please add your own thoughts and comments on this topic.

Joe J.
  #2   Spotlight this post!  
Unread 27-04-2004, 09:24
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,188
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

I think:
1)a function that will simplify opening, starting, and stoping timers would be good. Even though i got the timers to work, it would be simpler to just be able to say "Start Counting" Than have to open up the timer the way it is now.
2)An easy function that will assign different In/Out pins to a binary set, where you set which pins hold which unit in the binary value. This will also return that binary value to an int variable.
3)An easy way to measure encoders, and possibly a rotation counting variable to go along with it. (ex. LeftWheelRotation = GetEncoderData(LeftDrive) )

Thats all for now
4)
  #3   Spotlight this post!  
Unread 27-04-2004, 10:50
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: What Features Should the Default Code REALLY include?

Maybe this is too specific to me, but i'd like a copy of the code with all the absolutely unnecesary stuff removed. This includes

1. those premade functions in user_routines.c
2. any preset control assignments and limits like p1_y to pwm01 or whatever
3. printf
4. im not sure about this one because it may be done all in hardware, but the built in 100th and 1000th of a second timers that can be referenced.

Essentially just leave only code that is neccesary to make the robot FIRST legal (enable and disable, autonomous, etc) and code required to easily read inputs and set outputs
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #4   Spotlight this post!  
Unread 27-04-2004, 11:02
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

It sounds like there are some polar views on this topic. There are some teams out there who are at the level where remapping buttons on the joystick to different relays on the RC is difficult. And there are some teams who can setup up interrupt driven encoders to feedback PID-control loops, without breaking a sweat.

I don't think an overly complex default program will benefit the former team, nor will it encourage the learning involved in getting to the same level as the latter team.

I think all the code to do these complex functions should be MADE OPENLY AVAILABLE, similar to how the default IR code was made available this year. But I don't feel that a default program that supports all these functions should be rolled out to every IFI controller when they're shipped out.

It would be nice to have all the code snippets that have accrued on chiefdelphi.com and in various code repositories rolled onto a CD which is included in the kit =)
  #5   Spotlight this post!  
Unread 27-04-2004, 11:10
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
what is #ifdef for?

It seems to me that IFI could pretty easily set up some simple #ifdef statements to allow for these functions to be used or not based on whatever the team in question wants.

Seriously, why go to all the bother of C if we are not going to use one of the major features of the language? We have all paid the price of having to know how and when to use the cast operation, the least IFI could do for us is reward us with some cool features.

But I digress... ...more importantly, some of the features (like "I've just been enabled", "I've just been disabled", "I just entered autonomous mode", etc.) are just plain good coding practice. IFI should include these types of function calls in the default code just to help train the population of FIRST users. (imho).

Joe J.
  #6   Spotlight this post!  
Unread 27-04-2004, 11:26
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: What Features Should the Default Code REALLY include?

Quote:
5.A timer and associated functions (reset, set to time, start, suspend, etc.)
I'd like to see a built in interupt causing clock. With a user configurable frequency, but with a reasonable default, for instance 60Hz.

The clock would make measuring sensor changes over time much easier and almost intuitive.

(60Hz was chosen because it makes gyro calculations easier)
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #7   Spotlight this post!  
Unread 27-04-2004, 12:02
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: What Features Should the Default Code REALLY include?

what Iwant to see:
  • Integrated EDU/RC default code
  • Corrected Main.c
  • a header for all lib functions (see compiler code). (optional)
  • Easier template use
  • printf that doesn't freak if you don't init first (or documentation on the error)
Anything else?
  #8   Spotlight this post!  
Unread 27-04-2004, 14:03
dlavery's Avatar
dlavery dlavery is offline
Curmudgeon
FRC #0116 (Epsilon Delta)
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Herndon, VA
Posts: 3,176
dlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

Quote:
Originally Posted by SlimBoJones
I think all the code to do these complex functions should be MADE OPENLY AVAILABLE, similar to how the default IR code was made available this year. ... It would be nice to have all the code snippets that have accrued on chiefdelphi.com and in various code repositories rolled onto a CD which is included in the kit =)
Not to hijack the thread, but let me go off on a tangent for a minute. I think that the core of the idea mentioned above is great. We need to establish an environment where teams are able to grab modules of software to perform advanced functions for their robots. Rookie and veteran teams could share both algorithms and specific code segments. Teams can help each other with their software designs in much the same way that we currently share hardware designs. But to do this, rather than include a CD in the kit, it would be preferable to have an on-line library of open source software that can be continuously updated and expanded as more teams make use of the resource. Think along the lines of a SorceForge.net library for IFI-FIRST software to go along with the openFIRST project already in place.

If we can establish something like that (and yes, some of us are already talking with FIRST about the idea of an officially-supported open source project, so stay tuned!) then we could see a significant number of function modules becoming available to all teams. The teams could then pick and choose what they need based on their particular robot designs.

To get this effort started, it would be wonderful to have an initial set of modules to populate the library that would be useful to just about every team. So now back to Joe's original question, with a slight twist. If IFI-FIRST provided default code that cleanly supported the ability to drop in library module calls, what types of functions would we want to have? Joe's list of "good practices" makes a lot of sense - I would accept all these in the "we gotta have 'em" class. Modules to support common sensing functions (IR detect, time-of-flight IR, sonar, contact sensing, photo detectors, shaft encoders, capaciflective proximity sensing, etc.) similar to the IR code from Kevin Watson would be useful. But what else?

-dave

p.s. perhaps even more important, in addition to thinking about what modules you would like to see, start thinking about what modules you could CONTRIBUTE!
__________________
"I know what you're thinking, punk," hissed Wordy Harry to his new editor, "you're thinking, 'Did he use six superfluous adjectives or only five?' - and to tell the truth, I forgot myself in all this excitement; but being as this is English, the most powerful language in the world, whose subtle nuances will blow your head clean off, you've got to ask yourself one question: 'Do I feel loquacious?' - well do you, punk?"
- Stuart Vasepuru, 2006 Bulwer-Lytton Fiction Contest



My OTHER CAR is still on Mars!!!
  #9   Spotlight this post!  
Unread 27-04-2004, 14:05
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: What Features Should the Default Code REALLY include?

Quote:
Originally Posted by SlimBoJones
It sounds like there are some polar views on this topic. There are some teams out there who are at the level where remapping buttons on the joystick to different relays on the RC is difficult. And there are some teams who can setup up interrupt driven encoders to feedback PID-control loops, without breaking a sweat.

I don't think an overly complex default program will benefit the former team, nor will it encourage the learning involved in getting to the same level as the latter team.

I think all the code to do these complex functions should be MADE OPENLY AVAILABLE, similar to how the default IR code was made available this year. But I don't feel that a default program that supports all these functions should be rolled out to every IFI controller when they're shipped out.

It would be nice to have all the code snippets that have accrued on chiefdelphi.com and in various code repositories rolled onto a CD which is included in the kit =)
I agree, no point of putting in all these unnecesary functions into the main code when often a significant part is uneeded.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #10   Spotlight this post!  
Unread 27-04-2004, 14:36
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,907
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

Obvious library functions include most of the programming topic threads like math libraries, common switch usage, less common sensor specialities like the gyro neutral position and accumulation, PID functions for hitting specific positions or velocities, a collection of autonomous styles, multiple action queue handling, high/low pass filters, the list goes on.

One thing teams can look at is their code from this year and functions or code snippets that can be turned into functions to be shared with other teams. One of the things you notice especially on these forums is the wide variety of programming techniques. Some people write the shortest, fastest code possible, others emphasize clarity and teaching of first year students. With a wide variety of solutions available to chose from new programmers could begin with what is easiest to understand and progress to more complex or efficient methods in later years.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 28-04-2004 at 12:43. Reason: I never realized I type with an accent, "vide" instead of "wide." I wonder whose accent it is?
  #11   Spotlight this post!  
Unread 27-04-2004, 14:47
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

Quote:
Originally Posted by dlavery
We need to establish an environment where teams are able to grab modules of software to perform advanced functions for their robots. Rookie and veteran teams could share both algorithms and specific code segments. Teams can help each other with their software designs in much the same way that we currently share hardware designs. But to do this, rather than include a CD in the kit, it would be preferable to have an on-line library of open source software that can be continuously updated and expanded as more teams make use of the resource.
Something along the lines of this:http://nrg.chaosnet.org/repository/ ?
  #12   Spotlight this post!  
Unread 27-04-2004, 14:53
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: What Features Should the Default Code REALLY include?

Off-topic, sorry guys:
If an open source repository is made, It would be nice if each function had its own thread in a message board forum. This way you could get specific help if you don't understand something.
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #13   Spotlight this post!  
Unread 27-04-2004, 16:28
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: What Features Should the Default Code REALLY include?

Wow, im surprised i never thought of that before, Mike. Good idea. A code repository should be CDs next feature (though i dont know about every last function having its own thread, but yeah, every code snippet)
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #14   Spotlight this post!  
Unread 27-04-2004, 18:12
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: What Features Should the Default Code REALLY include?

Excellent discussion going on in this thread.

Features I would like to see in the default program:

non-linear transfer functions for joystick controls - who hasn't heard a team complain their robot controls are too sensitive/too jerky?
  #15   Spotlight this post!  
Unread 27-04-2004, 18:59
Guest
 
Posts: n/a
Re: What Features Should the Default Code REALLY include?

Quote:
Originally Posted by Joe Ross
Something along the lines of this:http://nrg.chaosnet.org/repository/ ?
I added a "Comment" feature to the Repository some time ago. If you have questions, just click on the code snippet and then click Post a Comment.

The problem is too many people wanting code, and not enough people contributing code

Last edited by SilverStar : 27-04-2004 at 19:05.
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
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Strange IR sensor movement with default tracker code wun Programming 5 19-03-2004 10:51
Bringing in Navigate.zip into the Default code alexrobotics Programming 1 24-02-2004 21:42
Is default code already loaded? quickie25 Electrical 8 19-02-2004 22:51
default code and the actual robot tml240 Programming 15 24-01-2004 11:31


All times are GMT -5. The time now is 13:18.

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