Go to Post I normally prefer my speed controllers to brake, rather then break. - Joe Ross [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 17-02-2005, 10:28
Moloch's Avatar
Moloch Moloch is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Michigan
Posts: 39
Moloch can only hope to improve
kevin watsons scripting . . .

I have kevins nav code, and I have my drive commands entered and those work just great. Now I just need some help with the autonomous scripting. I know that its supposed to be easy, and from what I have read, it seems as though it is very easy. But after looking through the code, and reading tons of things on scripting and coding, I still need some help. I need someone to give me some code that will get my scripting commands in the command.h file to start running in auton. I dont know how to start the auton to test it. I dont really know antything about auton at all. PLEASE help me get started on this! Time is running out, I only have 5 days left!
  #2   Spotlight this post!  
Unread 18-02-2005, 00:49
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: kevin watsons scripting . . .

All you need to do is put robot_control(); in user_routines_fast.c



Code:
  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {
        Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */

        /* Add your own autonomous code here. */

		robot_control(); //call automous mode

        Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
}


Quote:
Originally Posted by Moloch
I have kevins nav code, and I have my drive commands entered and those work just great. Now I just need some help with the autonomous scripting. I know that its supposed to be easy, and from what I have read, it seems as though it is very easy. But after looking through the code, and reading tons of things on scripting and coding, I still need some help. I need someone to give me some code that will get my scripting commands in the command.h file to start running in auton. I dont know how to start the auton to test it. I dont really know antything about auton at all. PLEASE help me get started on this! Time is running out, I only have 5 days left!
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #3   Spotlight this post!  
Unread 18-02-2005, 17:52
Fuzzypanda007 Fuzzypanda007 is offline
ferret's rawth
#0564 (Digital Impact)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Middle Island, NY
Posts: 1
Fuzzypanda007 is an unknown quantity at this point
Send a message via AIM to Fuzzypanda007 Send a message via Yahoo to Fuzzypanda007
Re: kevin watsons scripting . . .

It actually isn't really hard at all. I have been able to make a small code, but it hasn't worked for my bot yet :/ . Anyway, to use it, go to the top and under the part that says something like "declare all variables here" put "static unsigned int t;" Then, in the area mentioned by Chakorules that says "add your own autonomous code here" put this:
t++;
if (t < 95) //turn left for 2.5 seconds
{
pwm01 = 95; //left motor goes in reverse
pwm02 = 150; //right motor goes forward
}
else if (t < 285) //go straight for 5 seconds
{
pwm01 = 150;
pwm02 = 150;
}
else if (t < 380) //turn right for 2.5 seconds
{
pwm01 = 150;
pwm02 = 95;
}
else //stop after 10 seconds
{
pwm01 = 127;
pwm02 = 127;
}
I( am not sure if this will work 100%, considering this is my first year as a freshman, but if you put this part of the code in a loop, is really should work. well, i hope this helped. see you at the competition.
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
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
2005 Autonomous Scripting Manual Anthony Kesich Programming 31 17-02-2005 17:30
Kevin Watson's encoder code with RPM output MaxM Programming 2 05-02-2005 00:06
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38


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

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