Go to Post I don't know how much of a safety factor chain manufacturers build into these ratings. I've got empirical evidence to demonstrate that it's not 5, however. - Tristan Lall [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 31-01-2004, 15:36
Paradox1350's Avatar
Paradox1350 Paradox1350 is offline
FORMER Captain now Jealous Onlooker
None #1350 (Rambot)
 
Join Date: Jan 2004
Location: Rhode Island
Posts: 80
Paradox1350 is on a distinguished road
Newbie Autonomous Question(s)

I'm from a rookie team and we are having some coding issues. We have one member on our team that can code just about anything, but he can only come about one day a week. Meanwhile, we are trying to accomplish things on our own. Everyone else that is working on coding began learning C about, oh, last week. Meaning we're all clueless. Really, really, seriously clueless.

We are trying to get the autonomous mode to work. The problem is we have no clue where to begin. We don't even know where to find the source code that is supposed to be on the FIRST site, or so we've been told.

Basically, we need a STEP BY STEP guide on how to begin our autonomous programming. We need to know how to initialize an autonomous mode, how to set it up to follow sensors, and how to set up a programmed list of directions (i.e. "Move forward 10 feet, turn 30 degrees, etc.")

Any help would be GREATLY appreciated.
  #2   Spotlight this post!  
Unread 31-01-2004, 16:21
AlphaOmega870 AlphaOmega870 is offline
Registered User
AKA: Mike
#0870 (Southold RICE)
Team Role: Programmer
 
Join Date: Oct 2002
Location: Southold, NY
Posts: 18
AlphaOmega870 is an unknown quantity at this point
Send a message via AIM to AlphaOmega870
Re: Newbie Autonomous Question(s)

the default code can be found at www.innovationfirst.com
also, the place for putting default code is found in the user_routines_fast.c file.

Last edited by AlphaOmega870 : 31-01-2004 at 16:22. Reason: addition
  #3   Spotlight this post!  
Unread 31-01-2004, 16:23
Jeremy_Mc's Avatar
Jeremy_Mc Jeremy_Mc is offline
GitHubber
no team
Team Role: Mentor
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Orlando, FL
Posts: 496
Jeremy_Mc will become famous soon enoughJeremy_Mc will become famous soon enough
Re: Newbie Autonomous Question(s)

Quote:
Originally Posted by Paradox1350
I'm from a rookie team and we are having some coding issues. We have one member on our team that can code just about anything, but he can only come about one day a week. Meanwhile, we are trying to accomplish things on our own. Everyone else that is working on coding began learning C about, oh, last week. Meaning we're all clueless. Really, really, seriously clueless.

We are trying to get the autonomous mode to work. The problem is we have no clue where to begin. We don't even know where to find the source code that is supposed to be on the FIRST site, or so we've been told.

Basically, we need a STEP BY STEP guide on how to begin our autonomous programming. We need to know how to initialize an autonomous mode, how to set it up to follow sensors, and how to set up a programmed list of directions (i.e. "Move forward 10 feet, turn 30 degrees, etc.")

Any help would be GREATLY appreciated.
www.innovationfirst.com
Click on "FIRST Robotics" then on "Documents" at the top. The source is on that page.

Look in ChiefDelphi's white papers for help on getting started...there are 3-4 papers on just that.

If you need more help, PM me and I'll be glad to help.
__________________
GitHub - Collaborate on code, documentation, etc. - http://github.com
  #4   Spotlight this post!  
Unread 31-01-2004, 21:11
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Newbie Autonomous Question(s)

Quote:
Originally Posted by Paradox1350
how to set up a programmed list of directions (i.e. "Move forward 10 feet, turn 30 degrees, etc.")
Well, I'll show you some code so you can get a start on it. The other stuff should be pretty similar, or at least require a similar level of thinking -- so once you understand what's going on here, you should be well on your way.

First, let's say you want a function 'void Turn_Robot (int angle)' to turn the robot by some specified angle 'angle.' How do you do this? Well, without encoders or gyros, the answer is pray! But you'll have to settle for a simple counter. E.g.,

Code:
/*
      Hopefully you can follow this.  I'll try to comment liberally (something that's rather hard for me ;)

      In your auto mode routine, you might say something like:
      if (!FinishedTurn) Turn_Robot (radian measure);
      else  {/* put other code here */}

      Note that you'll need a global variable FinishedTurn, initialized to false (0), and a handfull of defines.
*/
void Turn_Robot (int angle)
{
     // static means that we only set it to 0 the first time, and when it is
     // called again, it is persistant, meaning it won't lose its old value
     static unsigned int counter = 0;

     // we are going to count up from 0.  On the left side of the equation, we
     // have a unit of cycles, so we have to find out how to convert radians
     // to cycles.  This is done by an *emprically found constant*
     // CYCLES_PER_RADIAN (dependent on voltage, so beware).
     if (counter++ > abs(angle) * CYCLES_PER_RADIAN)
     {		// Robot has finished turning, ergo ...
        // we're done, so nicely set counter back to 0 for next time
        // set left and right drive to neutral, and set flag FinishedTurn to true
        counter = 0;
        LEFT_DRIVE = 127;
        RIGHT_DRIVE = 127;
        FinishedTurn = 1;
     }
     else {
        // We aren't done turning.  We have to set up some convention for
        // angle (turning PI/4 radians doens't mean anything without a
        // coordinate system, afterall!)  Ergo,
        if (angle > 0)
        {	// Positive angle means turn left
            LEFT_DRIVE = LTURN_SPD_LDRIVE;
            RIGHT_DRIVE = LTURN_SPD_RDRIVE;
        }
        else {	// Negative angle means turn right
            LEFT_DRIVE = RTURN_SPD_LDRIVE;
            RIGHT_DRIVE = pwm04 = RTURN_SPD_RDRIVE;
        }
        FinishedTurn = 0;  // NOTE: set this back to false; else, when called
                                 // after successful move, it will still be true!
     }
}
A similar Move_Robot function should be easy (the turn is slightly more complicated, so that's why I included this one for you). Now, how to find out all those constants? Well, that's the fun part (by the way, I put in their radians as the default, but you can set it up to any unit you feel like).

Okay, set the constant CYCLES_PER_RADIAN to some value, any value (I'd guess what you think, from judging how fast the robot can turn). Don't do anything in your code, but call the function Turn_Robot (angle), with some angle you feel like turning. If the robot doesn't turn enough, increase the constant by a variable amount, depending on how much is left to turn. If the robot turns too much, decrease the constant. (You might want to put tape on the floor marking off a 45 deg angle, or some such sort that is easily determined, so you can quickly tell what to do.)

Oh, and I haven't tested this code, so beware (I'm frequently wrong ) As Knuth said, Beware, I've only proven the above code correct, I haven't tested it.
  #5   Spotlight this post!  
Unread 31-01-2004, 23:14
[53] opticruzer [53] opticruzer is offline
Registered User
#0053
Team Role: Programmer
 
Join Date: Jan 2004
Location: Bowie, Maryland
Posts: 9
[53] opticruzer is an unknown quantity at this point
Send a message via AIM to [53] opticruzer
Re: Newbie Autonomous Question(s)

well if u download the source codes from the sites listed above, they come ready to work. make sure u wire up the beacon right. to start try to see if ur senors pick up the beacon by using the tracking code. if the works then use teh navigate code. oh make sure that u use two of the same type servos or it wont work right. we had to fix this in the code to. this should get u started. make sure u hit the trigger when using the navigate code or it wont start.
  #6   Spotlight this post!  
Unread 01-02-2004, 00:23
shsdragon shsdragon is offline
Registered User
#1345
Team Role: Programmer
 
Join Date: Jan 2004
Location: Florida
Posts: 8
shsdragon is on a distinguished road
Send a message via AIM to shsdragon Send a message via Yahoo to shsdragon
rokkie needs help

k i am from a first year team from fl and basically we have alot of problems with programming some kid told me bout encoders and buildin a cirui would be the best way to go if any one can help me plz help
  #7   Spotlight this post!  
Unread 01-02-2004, 02:57
emusteve's Avatar
emusteve emusteve is offline
Registered User
AKA: Steve Martin
#0470 (Alpha Omega)
 
Join Date: Jan 2004
Location: Ypsilanti
Posts: 66
emusteve is just really niceemusteve is just really niceemusteve is just really niceemusteve is just really nice
Unhappy Re: Newbie Autonomous Question(s)

Don't feel too bad...We're clueless too! And to make things worse, they never sent us the CDROM that was supposed to come with the new Edubot Controller, so we didn't even have the CBot compiler until I borrowed a copy from another team! If you find that step-by-step let us know!
  #8   Spotlight this post!  
Unread 01-02-2004, 03:05
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: rokkie needs help

Quote:
Originally Posted by shsdragon
k i am from a first year team from fl and basically we have alot of problems with programming some kid told me bout encoders and buildin a cirui would be the best way to go if any one can help me plz help
if you need help, the best method is to try and figure something out, and when you get stuck on a particular thing, ask a specific question. we can't really show you the entire process (message boards aren't very good for that), but we can definitely try to answer specific questions or provide advice on specific topics.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #9   Spotlight this post!  
Unread 01-02-2004, 11:05
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,588
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: Newbie Autonomous Question(s)

http://www.rec.ri.cmu.edu/education/...tent/index.htm has a lot of tutorials that are very helpful, such as running a motor for 1 second, and another one called making a timed turn.
  #10   Spotlight this post!  
Unread 12-02-2004, 19:47
ZuniHigh ZuniHigh is offline
Registered User
#1428
 
Join Date: Jan 2004
Location: Zuni, NM
Posts: 3
ZuniHigh is an unknown quantity at this point
Unhappy Re: Newbie Autonomous Question(s)

I'm following the instructions in the 2004 introduction to programming guide, but when i followed their instructions to insert the code b/w the "Getdata" and "Putdata", but when i pressed the make button, it did not compile. What is wrong?
  #11   Spotlight this post!  
Unread 12-02-2004, 22:36
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,588
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: Newbie Autonomous Question(s)

Quote:
Originally Posted by ZuniHigh
I'm following the instructions in the 2004 introduction to programming guide, but when i followed their instructions to insert the code b/w the "Getdata" and "Putdata", but when i pressed the make button, it did not compile. What is wrong?
Saying that it didn't compile without giving us any error messages is not helpful at all. You should also show us the exact modifcations that you did.
  #12   Spotlight this post!  
Unread 13-02-2004, 00:41
LBK Rules's Avatar
LBK Rules LBK Rules is offline
1467 '06 Alumni
AKA: Anthony Rinaldi
no team (HSRO)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Henrico, VA
Posts: 438
LBK Rules will become famous soon enoughLBK Rules will become famous soon enough
Re: Newbie Autonomous Question(s)

Our robot will not follow a line of tape. (The banners are calibrated correctly.)

Let me explain our setup:
pwm01 = Left Drive Wheel
pwm02 = Right Drive Wheel

rc_digi_in01 = Left Banner (WHITE Sig.)
rc_digi_in02 = Right Banner (WHITE Sig.)

Our Autonomus Code:
PHP Code:
if (rc_dig_in01 == && rc_dig_in02 == 1
        {
            
pwm01 117;
            
pwm02 117;
        }
        
        if (
rc_dig_in02 == && rc_dig_in01 1
        {
            
pwm01 117;
            
pwm02 113;
        }
        
        if (
rc_dig_in02 && rc_dig_in01 == 1
        {
            
pwm01 113;
            
pwm02 117;
        }

        if (
rc_dig_in01 && rc_dig_in02 1
        {
            
pwm01 137;
            
pwm02 137;
        } 
Our pwm output is reversed since we are driving the robot backwards in autonomus mode. (The locations I stated above are in autonomus mode.)

The problem is our robot will not do anything if the sensors are not seeing the tape. It just stops.

We are clueless, and any help would be appreciated. (This is the first time I worked with any C[++] programming other than the old "Hello, World!" program. (If you see any bugs in our code, please respond! ))

LBK Rules; VB Programmer being suddenly forced to C by FIRST (or IFI, I don't know which). (BTW: I just got back from a meeting about an hour ago.)
__________________
Anthony Rinaldi
Team 1132: 2003
Team 1467: 2004 - 2006
  #13   Spotlight this post!  
Unread 13-02-2004, 08:51
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Newbie Autonomous Question(s)

Quote:
Originally Posted by LBK Rules
Our robot will not follow a line of tape. (The banners are calibrated correctly.)

Let me explain our setup:
pwm01 = Left Drive Wheel
pwm02 = Right Drive Wheel

rc_digi_in01 = Left Banner (WHITE Sig.)
rc_digi_in02 = Right Banner (WHITE Sig.)

Our Autonomus Code:
PHP Code:
if (rc_dig_in01 == && rc_dig_in02 == 1
        {
            
pwm01 117;
            
pwm02 117;
        }
 
        if (
rc_dig_in02 == && rc_dig_in01 1
        {
            
pwm01 117;
            
pwm02 113;
        }
 
        if (
rc_dig_in02 && rc_dig_in01 == 1
        {
            
pwm01 113;
            
pwm02 117;
        }
 
        if (
rc_dig_in01 && rc_dig_in02 1
        {
            
pwm01 137;
            
pwm02 137;
        } 
Our pwm output is reversed since we are driving the robot backwards in autonomus mode. (The locations I stated above are in autonomus mode.)

The problem is our robot will not do anything if the sensors are not seeing the tape. It just stops.

We are clueless, and any help would be appreciated. (This is the first time I worked with any C[++] programming other than the old "Hello, World!" program. (If you see any bugs in our code, please respond! ))

LBK Rules; VB Programmer being suddenly forced to C by FIRST (or IFI, I don't know which). (BTW: I just got back from a meeting about an hour ago.)
Couple of problems:
First, when you're going off the line, you correct yourself wrong. If your left sensor goes off the line, you drive the right side harder, meaning you actually go further left. That's an easy mistake to make.

Second, somebody correct me if I'm wrong, the pins are pull ups, meaning that they are normally 1, unless they recieve a signal, which makes them 0. So you need to switch the test for 0s and 1s.

Third, make the power that the motors are driven at a little higher. I'm not sure if your problem was that it wasn't moving, but the way it is now, it will either move really slow or not at all.


P.S. Being a newbie isn't bad. I'm on a newbie team too.
__________________


Last edited by Ryan M. : 13-02-2004 at 08:56.
  #14   Spotlight this post!  
Unread 13-02-2004, 09:07
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,588
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: Newbie Autonomous Question(s)

Quote:
Originally Posted by Texan
Second, somebody correct me if I'm wrong, the pins are pull ups, meaning that they are normally 1, unless they recieve a signal, which makes them 0. So you need to switch the test for 0s and 1s.
The banner sensors have two signal wires, one of which is Normally Open and one of which is Normally Closed. So, his code is correct (in that aspect), assuming it is wired correctly.
  #15   Spotlight this post!  
Unread 13-02-2004, 09:14
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Newbie Autonomous Question(s)

Quote:
Originally Posted by Joe Ross
The banner sensors have two signal wires, one of which is Normally Open and one of which is Normally Closed. So, his code is correct (in that aspect), assuming it is wired correctly.
Oh, yeah, forgot that. Well, make sure you have the correct wire attched.
__________________

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
A better autonomous method.. randomperson Programming 4 24-02-2004 18:02
Initializing autonomous mode Mr. Lim Programming 7 02-02-2004 07:26
variable? manodrum Programming 11 01-04-2003 17:20
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Kill Switch UCGL_Guy Programming 8 15-01-2003 17:39


All times are GMT -5. The time now is 00:03.

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