Go to Post if your true love is building robots, this makes perfect sense - EddieMcD [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 21-02-2005, 21:47
Team620 Team620 is offline
Registered User
#0620 (Warbots)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2002
Location: Virginia
Posts: 3
Team620 is an unknown quantity at this point
Simple Autonomous Code

Im having trouble doing autonomous mode. My team and I have agreed to go with dead reckoning. I was wondering if anyone can help me with a simple code to make the motors drive for 1 second and stop i just need help getting started.
After I see a sample code for the motors then I can figure it out this would be appreciated thanks.
-Ryan
  #2   Spotlight this post!  
Unread 21-02-2005, 22:02
His Eminence's Avatar
His Eminence His Eminence is offline
Registered User
None #0408 (Roboticks)
Team Role: Webmaster
 
Join Date: Feb 2004
Location: Florida
Posts: 12
His Eminence is on a distinguished road
Re: Simple Autonomous Code

Set a simple counter that is incremented every time. Then use conditional statements (like an if statement) to do certain things within a set time. As for actually running the motors, you have to find out which PWM you are using. Then, do something like this:

pwm01=235;

assuming pwm01 is the PWM you are using on your robot.
__________________
Know.
  #3   Spotlight this post!  
Unread 21-02-2005, 22:10
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Re: Simple Autonomous Code

I don't have any example code, but you could use the fact that the code is executed once every 26.2 milliseconds and use some decrementing (or incrementing) counters and some if statements...

well, sort of an example, but definitely needs refinement
Code:
count = count + 1;
if (count = 15)
  {
  pwm01 = 180;
  pwm02 = 180;
  }
if (count = 45)
  {
  pwm01 = 255;
  pwm02 = 0;
  }
If I have the idea correct, as count reaches 15, the bot will go forward at a medium speed, then when it reaches 45, it will turn, one side full speed forward, one side full speed back. You get the idea? Just remember that every "count" is 1/38 of a second.

EDIT: got beaten to it... oh well I'll leave it there for the code
  #4   Spotlight this post!  
Unread 21-02-2005, 22:33
TMHStitans TMHStitans is offline
Robot Operator-2005
AKA: Eric
#1474 (Tewksbury Titans)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Tewksbury, Massachusetts
Posts: 6
TMHStitans has a little shameless behaviour in the past
Re: Simple Autonomous Code

You can find a very good, yet simple autonomous code on this innovation first link. It not only allows you to go forward, but you can turn in any direction. It is based on time as well so I think it would be perfect for what your looking for. You just have to change the timing, speed, and pwm settings. Its really very simple and useful. You can modify it anyway you like by simply inserting or deleting times, speeds, and directions. You can also use if statements to create switches on the robot wired to the digital inputs that will allow you to write several different autonomous modes. Consider it an improved version of dead reckoning. (dead reckoning++)?

http://www.ifirobotics.com/forum/viewtopic.php?t=75
  #5   Spotlight this post!  
Unread 21-02-2005, 23:14
Team620 Team620 is offline
Registered User
#0620 (Warbots)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2002
Location: Virginia
Posts: 3
Team620 is an unknown quantity at this point
Re: Simple Autonomous Code

thank you i think i can program autonomous now
-Ryan
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
Out of the Box Camera Code russell Programming 9 21-10-2009 05:28
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Simple Autonomous Mode Example deltacoder1020 Programming 5 08-03-2004 20:22


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

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