Go to Post When motors stall, bad things happen. - Rob Stehlik [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 15-01-2005, 23:34
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
2005 Autonomous Scripting Manual

OK, sorry I took so long. Its been a couple of hectic days. Anywho, here are all of the default commands available in Kevin Watson's code. I plan on playing around with the disabled ones (i.e. the way points and the like) and hopefully posting code to run it.

--------------------------------------------------------------------------

CMD_SHOW_STATE; no parameters
Prints back the on-board clock time, x and y coordinates in mm, and the heading in milliradians

CMD_VELOCITY; parm_1: velocity in mm/sec
Uses the PID algorithm and encoders on the wheels to keep the motors driving at the commanded velocity

CMD_WAIT; parm_1: time to wait in milliseconds
Waits for the specified time until executing the next command on the list. Very useful after setting the velocity. (i.e. set velocity 1000mm/sec, drive for 5000 milliseconds = 5 meters).

CMD_WAIT_UNTIL; parm_1: time to wait until in milliseconds
Waits until the specified milliseconds into the match until executing the next line. Useful to delay your code so your alliance can get out of the way first.

CMD_DRIVE; parm_1: distance to drive in mm
Uses the PID code and encoders to drive the robot forward the specified distance.

CMD_TURN; parm_1: distance to turn in milliradians, parm_2: tolerance to be within goal heading in milliradians
Uses the gyro along with the PID algorithm to turn the robot the specified distance. The tolerance is the buffer as to how close it needs to be before deciding it has succeeded.

CMD_WAIT_FOR_BUMP; no parameters
Waits for a switch to be hit before continuing on to the next command.

CMD_STOP; no parameters
Stops the robot.

CMD_GYRO_BIAS; no parameters
Tells the gyro code to use the next 8 loops or so to set its bias. Usually the first line of code to be called since you want to be stationary when setting the bias.

CMD_KEEP_HEADING; parm_1: time to hold heading in milliseconds. parm_2: tolerance in milliradians
Tells to robot to keep its heading (direction) using the Gyro and the PID code to within the specified tolerance for the specified time.

CMD_JUMP; parm_1: command to jump to
Jumps to the specified command in the command list. Usefull for creating loops.

--------------------------------------------------------------------------

That's all that is complete in Kevin's code. I will try to get CMD_SET_HEADING and CMD_SET_POS done soon as they should be useful. I hope this helps anyone that needs it.

-Tony K
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year

Last edited by Anthony Kesich : 16-01-2005 at 01:24. Reason: Forgot CMD_JUMP
  #2   Spotlight this post!  
Unread 16-01-2005, 05:12
jparkteach's Avatar
jparkteach jparkteach is offline
Registered User
FRC #2070 (Ridgefield Robotics)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2001
Location: New York City, NY
Posts: 63
jparkteach is a splendid one to beholdjparkteach is a splendid one to beholdjparkteach is a splendid one to beholdjparkteach is a splendid one to beholdjparkteach is a splendid one to beholdjparkteach is a splendid one to behold
Send a message via AIM to jparkteach
Re: Autonomous Scripting Manual

Is this code compatible with joystick operation of the robot? I mean, after the robot excutes the command sequence in autonomous, will it respond to the joysticks on the OI? I'm asking because I noticed the Default routine is gone and I can't find where the mappings of the pwms and joystick inputs.
  #3   Spotlight this post!  
Unread 16-01-2005, 10:16
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,906
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: Autonomous Scripting Manual

Quote:
Originally Posted by jparkteach
Is this code compatible with joystick operation of the robot? I mean, after the robot excutes the command sequence in autonomous, will it respond to the joysticks on the OI? I'm asking because I noticed the Default routine is gone and I can't find where the mappings of the pwms and joystick inputs.
That function has been removed, but could easily be added back in. There is plenty of space left and by calling either autonomous or the Default_Routine they won't be in conflict.
The programmers have to combine the functions they want from the various capabilities FIRST, Kevin, and company are providing.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-01-2005 at 09:36. Reason: Noticed a typo and it bothered me
  #4   Spotlight this post!  
Unread 17-01-2005, 09:34
Anton's Avatar
Anton Anton is offline
Anton Povzner
#1581 (Element)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Israel
Posts: 51
Anton can only hope to improve
Re: Autonomous Scripting Manual

The code forom Kevin's site doesn't contain some files from rhe default code from the http://www.ifirobotics.com/rc.shtml site (user_camera.c, for example).
Will it be alright if I'll just add these to Kevin's code?
By the way, is that the right place to download the code from, or was I supposed to take it from somewhere else?

Last edited by Anton : 17-01-2005 at 09:38.
  #5   Spotlight this post!  
Unread 17-01-2005, 09:39
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,906
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: Autonomous Scripting Manual

Quote:
Originally Posted by Anton
The code forom Kevin's site doesn't contain some files from rhe default code from the http://www.ifirobotics.com/rc.shtml site (user_camera.c, for example).
will it be alright if I'll just add these to Kevin's code?
You can integrate the code you need into Kevin's code. You have to be particularly careful though when two sets of code want to use the same resources, such as controlling the serial ports or using timers or interrupts.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #6   Spotlight this post!  
Unread 17-01-2005, 09:43
nehalita's Avatar
nehalita nehalita is offline
Robots are friends
AKA: tagger fanatic
FRC #1345 (Platinum Dragons); FRC# 97 (RoboRuminants)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Ft. Laud, FL
Posts: 870
nehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond repute
Send a message via AIM to nehalita Send a message via MSN to nehalita Send a message via Yahoo to nehalita
Question Re: Autonomous Scripting Manual

Quote:
Originally Posted by Mark McLeod
You can integrate the code you need into Kevin's code. You have to be particularly careful though when two sets of code want to use the same resources, such as controlling the serial ports or using timers or interrupts.
has anyone already integrated the two codes together? if so, did you run into any problems? there were a few threads about integrating code together but i wasn't sure if they were talking about the same thing (i'm a newbie...). i want to integrate them but i have no idea where to start....
__________________
"Relativity applies to physics, not ethics." Thank you Einstein
MIT '10

Proud Member of H.I.L.
The PLATINUM DRAGONS are on FIRE!
  #7   Spotlight this post!  
Unread 17-01-2005, 09:46
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Autonomous Scripting Manual

Quote:
Originally Posted by nehalita
has anyone already integrated the two codes together? if so, did you run into any problems? there were a few threads about integrating code together but i wasn't sure if they were talking about the same thing (i'm a newbie...). i want to integrate them but i have no idea where to start....
First decide what functions you want in you code, then look at the different versions of the code, cut n paste. I hope you are into it enough that you can when you copy files or parts of them you include whatever variables and files they need. If you know C, just start playing around and you will figure it out, thats where to start. And if you run into any problems you can always post.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #8   Spotlight this post!  
Unread 17-01-2005, 10:02
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: Autonomous Scripting Manual

FIRST and Kevin Watson have provided us with great driver programs this year. By that I mean, they have wrote c files that will do things that are usually tedious to code for, such as sampling a gyro, or counting quadrature encoder ticks, and made them available to us. Now what you need to do, as Bharat said, is figure out what your robot needs, write those things down in a list. Then look at all the drivers given to us (gyro.c , encoder.c , pid.c , camera.c --and their headers!). So now that you understand what functions are in these programs, you can add what you need to your default code workspace (provided from IFI.. the one with no PID or camera support), and set your user_routines.c, or whatever file you are using to control the bot to include your newly added driver c files. When this is done, it will be easy to call any function from any of the drivers, and you will understand the code more because you helped create your robots workspace, instead of just changing values in the default code.

If you dont understand this, think of it as inlcuding an API in your win32 coding, and then calling functions from it.

[EDIT] Dont forget to configure your drivers, by modifying the header (.h) files (respective to that .c file, of course) If you look in the headers, there will be multiple #define statements, where you must change values that are specific to your robot and sensors, such as wheel diameter, output RPM, and gyro scale factor [/EDIT]

Last edited by Tom Bottiglieri : 17-01-2005 at 10:06.
  #9   Spotlight this post!  
Unread 17-01-2005, 11:40
Anton's Avatar
Anton Anton is offline
Anton Povzner
#1581 (Element)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Israel
Posts: 51
Anton can only hope to improve
Re: Autonomous Scripting Manual

Quote:
Originally Posted by Tom Bottiglieri
(provided from IFI.. the one with no PID or camera support),
I don't really understand it- why the one with no camera/PID control?
also, if i can't use the code with the camera and PID support, how can i use the camera at all?
I'm sure it's a stupid question, but it's my first year in the FIRST competition(my first year of studying robotics at all, too) and it's my first year of using C too, so I'm not really good at it.
  #10   Spotlight this post!  
Unread 17-01-2005, 13:30
JMac JMac is offline
Registered User
AKA: Jen
#0042
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: New Hamshire
Posts: 7
JMac is on a distinguished road
Re: Autonomous Scripting Manual

If I understand correctly, you want to use the code that doesn't specify for the camera or PID routine in the User_routine, and add the code or function calls that include either the camera or the PID, or both if you wanted to. I think this is so that you understand the code better... Also, keep in mind that they just pulled the camera code off the innovation first site, so it's probably got bugs. I think if you try to understand what each piece of the code and the functions do, and put it in the regular default user code, you'll be more successful at making it work.
  #11   Spotlight this post!  
Unread 17-01-2005, 14:13
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
Re: Autonomous Scripting Manual

Quote:
Originally Posted by JMac
has anyone already integrated the two codes together? if so, did you run into any problems? there were a few threads about integrating code together but i wasn't sure if they were talking about the same thing (i'm a newbie...). i want to integrate them but i have no idea where to start....
I have posted a version in the white papers section. It does not really work, but it has all of the relevant files and is a starting point. I included some discussion of the conflict which occurs in the readme file. I am working on a functional version, but, I am making no headway with the serial driver. Anyone who really knows how to program the serial drivers want to take a look?
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist

  #12   Spotlight this post!  
Unread 17-01-2005, 19:27
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: Autonomous Scripting Manual

So what about integrating the camera into the script? (By way of new commands.) I've come up with 2 seperate APIs to do this (Both fairly thin), so I'm curious as to how others are thinking of doing it.
  #13   Spotlight this post!  
Unread 17-01-2005, 19:58
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: Autonomous Scripting Manual

Quote:
Originally Posted by Astronouth7303
So what about integrating the camera into the script? (By way of new commands.) I've come up with 2 seperate APIs to do this (Both fairly thin), so I'm curious as to how others are thinking of doing it.
I might have been able to answer you, if i was using the scripting option. The options you are given with it are very narrow. I know that you can write your own code to be available for scripts, but I dont see the point of the extra work.

Can someone prove me wrong?
  #14   Spotlight this post!  
Unread 18-01-2005, 00:55
ten3brousone's Avatar
ten3brousone ten3brousone is offline
Kurayami o Samayou
None #1160
Team Role: Programmer
 
Join Date: Dec 2004
Location: San Marino
Posts: 32
ten3brousone is an unknown quantity at this point
Re: Autonomous Scripting Manual

mm..to be able to use the autonomous scripting commands, a gyro, encoder(the gear teeth counter no?), and a PID(dunno what this is), are needed are they not?
  #15   Spotlight this post!  
Unread 18-01-2005, 07:21
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: Autonomous Scripting Manual

Quote:
Originally Posted by ten3brousone
mm..to be able to use the autonomous scripting commands, a gyro, encoder(the gear teeth counter no?), and a PID(dunno what this is), are needed are they not?
A gyro and some kind of quadrature setup is needed. A PID loop is a code thing and provided.
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
2005 Manual dez250 General Forum 51 17-01-2005 21:06
**FIRST EMAIL**/Important 2005 Competition Manual Information Sscamatt FIRST E-Mail Blast Archive 1 06-01-2005 18:50
Autonomous to Manual control? Lint_Ninja Programming 5 16-02-2004 21:48


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

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