Go to Post Remember: "It's not the strongest that survive, but the most adaptable to change" - Daniel_LaFleur [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 12-01-2005, 21:49
Edmund Edmund is offline
Programmer
#1346 (Trobotics)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Vancouver, BC
Posts: 5
Edmund is an unknown quantity at this point
New promised "scripts"

Having read through the code, I have encountered some problems. Me and my programming fellows tried and put the differend available scripts. (CMD_DRIVE) for example. However, we were getting many problems when compiling this with MPLAB.

Any example of using the scripting commands and where to place or modify them would be great. Also some insight in the "Commands.h" file. We want to know why there are 4 CMD_DRIVE calls and other multiple calls.

Thank you

-Edmund
__________________
Team 1346
General Motors Canada & David Thompson Secondary
Trobotics
- Programmer
  #2   Spotlight this post!  
Unread 13-01-2005, 01:38
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: New promised "scripts"

Scripting is still in the developmental stage, search Kevin Watson's (the scripting developers) posts.
__________________
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

  #3   Spotlight this post!  
Unread 13-01-2005, 01:40
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
Re: New promised "scripts"

The commands.h file is just a single variable. It is an array of a custon data type called commands. The commands data type has four values: an int called command which stores the command type, a long called param1 which stores the first argument for the function, and two more ints called param2 and param3 to hold more arguments if needed.

The robot.c file goes through this structure line by line and executes. For example the default code
Code:
{CMD_GYRO_BIAS,               0,        0,      0},
{CMD_WAIT_FOR_BUMP,         100,        0,      0},
{CMD_WAIT,                 1000,        0,      0},
{CMD_DRIVE,                1500,        0,      0},
{CMD_WAIT,                 4000,        0,      0},
{CMD_TURN,       		(-1500),       50,      0},
{CMD_WAIT,                 3000,        0,      0},
{CMD_DRIVE,                2400,        0,      0},
{CMD_WAIT,                 4000,        0,      0},
{CMD_TURN,        (PI_MRAD / 2),       50,      0},
{CMD_WAIT,                 4000,        0,      0},
{CMD_DRIVE,                2400,        0,      0},
{CMD_WAIT,                 4000,        0,      0},
{CMD_TURN,       (-1500),       50,      0},
{CMD_WAIT,                 1000,        0,      0},
{CMD_DRIVE,                   0,        0,      0},
{CMD_KEEP_HEADING,       240000,      100,      0},
{CMD_JUMP,                    1,        0,      0},
{NULL,                        0,        0,      0}
would execute something like this:

1) pause for a few loops to calibrate the gyro
2) wait for a sensor to be tripped or a button to be pushed
3) wait one second (1000 milliseconds) before executing the next command
4) drive forward 1.5 meters (1500 millimeters) and stop
5) turn clockwise (negative direction) 1.5 radians (just under 90 degrees) with a tolerance (error zone) or plus or minus 50 milliradians (.05 radians)
6) wait another 3 seconds (3000 milliseconds)
7) drive forward 2.4 meters
8) wait 4 seconds
9) turn pi/2 radians (90 degrees) counterclockwise with a tolerance of 50 milliradians
10) wait another 4 seconds
11) drive forward 2.4 meters
12) wait another 4 seconds
13) turn 1.5 radians counterclockwise with a tolerance of 50 milliradians
14) drive forward 0 millimeters. That is, stop.
15) maintain heading for 4 minutes (240000 milliseconds) with a tolerance of .1 radians. That is, if something tries to turn the robot, it will self correct to within .1 radians of where it was.
16) return to step 2 (It's called as 1 since arrays in C start with 0) and repeat.
17) the Null statement signals an end of file for the script interpreter. Eventhough it will never get ot stil line, it is still good practice to put it in.

The reason the numbers are so big in the parameters are, if you haven't guessed, every thing is in thousanths. This eliminates the need for decimal math and makes the program run faster. Most of it is really straight forward, requireing only one argument. It is good practice to fill the unused paramaters with a 0, even though it doesn't matter what you put in it.

The reason tolerances are needed is that the robot will rarely ever get back to where it thought it was, so if there was no tolerance, the robot would continue to twitch, thinking it was always off by a fraction of a radian.

Anyways, I hope I have cleared thing up a bit. If there is anything else you need, don't hesitate to ask.

-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 : 13-01-2005 at 10:51.
  #4   Spotlight this post!  
Unread 13-01-2005, 01:45
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: New promised "scripts"

Anthony, your grammer indicates that you are up past your bedtime, it is late, go to bed, and sail the silver seas of dreams.
__________________
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

  #5   Spotlight this post!  
Unread 13-01-2005, 02:34
Edmund Edmund is offline
Programmer
#1346 (Trobotics)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Vancouver, BC
Posts: 5
Edmund is an unknown quantity at this point
Re: New promised "scripts"

Wow! Everything is cleared up. Thanks.

One more thing. After modifying the functions and numbers in the structures, how do you add this WHOLE struct into the autonomous mode? What exactly do you type in there?

We tried some different calls but they seemed to not work: "commands" "commands command_list[]" "command_list[]"
(Remove the quotes of course)

Please and thank you in advance.

-Edmund
__________________
Team 1346
General Motors Canada & David Thompson Secondary
Trobotics
- Programmer
  #6   Spotlight this post!  
Unread 13-01-2005, 10:24
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: New promised "scripts"

I have a question regarding tolerance.

What exactly is it? Is that how far the robot can deviate from the turn it's making, meaning a lower value is more precise but a higher value requires less small movements to get "back on track"?
  #7   Spotlight this post!  
Unread 13-01-2005, 10:39
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: New promised "scripts"

Quote:
Originally Posted by Greg Marra
I have a question regarding tolerance.

What exactly is it? Is that how far the robot can deviate from the turn it's making, meaning a lower value is more precise but a higher value requires less small movements to get "back on track"?
Without looking at how they have implemented it in the code, I would expect that you are right.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #8   Spotlight this post!  
Unread 13-01-2005, 10:42
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: New promised "scripts"

The autonomous mode call is already there "robot_control();"
__________________
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

  #9   Spotlight this post!  
Unread 13-01-2005, 10:48
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
Re: New promised "scripts"

Quote:
Originally Posted by Greg Marra
I have a question regarding tolerance.

What exactly is it? Is that how far the robot can deviate from the turn it's making, meaning a lower value is more precise but a higher value requires less small movements to get "back on track"?
Exactly. A lower tolerance lets you be more precise, but it is going to take longer to get it correct. A higher tolerance is going to be a little less precise, but will execute the command faster. Your choice depends on what you really need. To you have a short time to get to a general area, or a little more time to get to a more specific area. Just as in most everything else, its all about trade offs.

And Edmund: You don't call the variable, you call the function robot_control(), as CJO said. This funcation interprets the script variable you put in commands.h and executes them on the robot.

-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
  #10   Spotlight this post!  
Unread 13-01-2005, 11: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: New promised "scripts"

The difficulty with this whole systme is that the current version of the camera control system relies on being where the robot_control() function is located. So, heres hoping the camera gets better.
__________________
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

  #11   Spotlight this post!  
Unread 13-01-2005, 15:47
Edmund Edmund is offline
Programmer
#1346 (Trobotics)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Vancouver, BC
Posts: 5
Edmund is an unknown quantity at this point
Re: New promised "scripts"

Quote:
Originally Posted by CJO
The difficulty with this whole systme is that the current version of the camera control system relies on being where the robot_control() function is located. So, heres hoping the camera gets better.
As I've read, couldn't you make the camera function in robot.h then put the function in commands.h , and call robot_control(); in autonomous mode?

Would this work?
__________________
Team 1346
General Motors Canada & David Thompson Secondary
Trobotics
- Programmer
  #12   Spotlight this post!  
Unread 13-01-2005, 15:56
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
Re: New promised "scripts"

Yes, you could make it run in robot.c. The problem is that you would need to add the camera drivers to the kickoff code, which might cause some problems. You would then have to write your own new functions in robot.c before you coudl call them in commands.h. Granted, it wouldnt be to hard, but it would still take some time and effort.

-Tony K

P.S. I will post a list of all of the robot commands and parameters some time soon.
__________________
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
  #13   Spotlight this post!  
Unread 13-01-2005, 17:52
viewtyjoe viewtyjoe is offline
Code Monkey
AKA: Nathaniel Davis
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: West Chester
Posts: 14
viewtyjoe is an unknown quantity at this point
Send a message via AIM to viewtyjoe
Re: New promised "scripts"

Viewing this system, I am frightened. This looks almost exactly like the system one of our programmers developed and tried to implement, but it was very unwieldy. If the use of this system requires the amount of sensor input I'm reading, are younger teams going to be able to implement it?
  #14   Spotlight this post!  
Unread 13-01-2005, 20:56
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: New promised "scripts"

The biggest problem with the comera is the serial drivers, however, never fear, Mr. Watson is hard at work, so, I am hoping that this is a porblem which can be overcome.
__________________
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

  #15   Spotlight this post!  
Unread 13-01-2005, 22:59
Eric Brummer Eric Brummer is offline
there's 95% ...
FRC #1097 (Jesuit Robotics S3E)
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Sacramento, California
Posts: 31
Eric Brummer will become famous soon enough
Send a message via AIM to Eric Brummer
Re: New promised "scripts"

Mr. Watson, you have some of the biggest critics and biggest admirers from our team. Thanks in advance for your hard work and good luck to all teams with these new concepts. I know our team is definitely looking into much broader fields...
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
Autonomous Commands Promised in Kickoff schenkin Programming 11 16-01-2005 08:58
CT Regional - Jess Promised She Wouldn't Delete This.... Lora Knepper Regional Competitions 3 06-03-2004 10:03
Chief Delphi 47 archiver 2001 5 24-06-2002 01:08
She's ALIVE!!! archiver 2000 19 23-06-2002 23:08


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

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