Go to Post We also had a couple of student leaders emerge from this offseason Rumble, which can do nothing but help the team in the upcoming FRC season. - JesseK [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 11-02-2005, 17:41
black mage black mage is offline
Registered User
#1302 (Team Lionheart)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Sparta
Posts: 6
black mage is an unknown quantity at this point
Send a message via AIM to black mage
programming codewords

I'm lost. A first time programmer and our team doesn't know where our sheet of the codewords is. Also, I can't find anyone who has it. If anybody has the paper and can put it into a reply would be great.

Last edited by black mage : 11-02-2005 at 18:03.
  #2   Spotlight this post!  
Unread 11-02-2005, 18:02
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: programming codewords

Quote:
Originally Posted by black mage
I'm lost. A first time program and our team doesn't know where our sheet of the codewords is. Also, I can't find anyone who has it. If anybody has the paper and can put it into a reply would be great.
You mean you don't know how to program. I don't quite understand your question. If you need help with overall programming in general, feel free to contact via aim(teknobramha).
__________________
-= 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
  #3   Spotlight this post!  
Unread 12-02-2005, 09:45
black mage black mage is offline
Registered User
#1302 (Team Lionheart)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Sparta
Posts: 6
black mage is an unknown quantity at this point
Send a message via AIM to black mage
Re: programming codewords

What I'm trying to say is the sheet with the programming codewords
(you know, the turn left turn right end things) is lost in our group. I'm trying to see if anyone out there has it on their computer and can send it over.
  #4   Spotlight this post!  
Unread 12-02-2005, 10:25
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: programming codewords

Quote:
Originally Posted by black mage
What I'm trying to say is the sheet with the programming codewords
(you know, the turn left turn right end things) is lost in our group. I'm trying to see if anyone out there has it on their computer and can send it over.
If I am not mistaken, this is what you're looking for. This is directly from the navigation code released on 1-8-05. Make sure you're using a gyro and encoders.
Code:
   /**********************/
  /* Command Dictionary */
 /**********************/
 
 /*
 The command dictionary is a list of commands that can be put in a 
 sequence to make it easy to program the autonomous motion of the robot.
 Each command has a define statement and a function prototype associated
 with it.  The define value is used in the command list to identify
 the commands.  The function is defined in robot.c  
 
 If you want to add your own commands, create a define with a new number
 and list the function prototype here.  Then go to robot.c to write
 your code.
 
 Each command has 0 to 3 parameters.  Just fill in zeros for unused 
 parameters in the command list. 
 */
 
 /* The NULL command is used to end the command list.  You must
    have a NULL command as the last command in your command list
    so that the command processor knows when to stop. */  
 #define NULL				  0
 
 /* CMD_SHOW_STATE will display the current position and heading
    of the robot to the programming host.  It is useful for debugging
    your driving. It takes no parameters */
 #define CMD_SHOW_STATE		1
 int cmd_show_state(void);
 
 /* CMD_VELOCITY takes one parameter, the velocity in mm/sec.  The 
    robot will remain at this velocity until you give it a CMD_STOP. */
 #define CMD_VELOCITY		  2
 int cmd_velocity(void);
 
 /* CMD_WAIT takes one parameter, the time to wait in milliseconds.  It
    will not let the next command start until that much time has elapsed.
    You might want to use it after a CMD_VELOCITY or CMD_DRIVE to let
    them finish before going on. */
 #define CMD_WAIT			  3
 int cmd_wait(void);
 
 /* CMD_WAIT_UNTIL takes one parameter, the time from the start of the
    match.  The robot will not go on to the next command until that
    much time has elapsed.  This might be useful if you want your robot
    to sit still until 5 seconds into the match (to let the other robots
    get out of the way???). */
 #define CMD_WAIT_UNTIL		4
 int cmd_wait_until(void);
 
 /* CMD_DRIVE takes one parameter, a distance in mm.  The robot will
    drive straight that distance and try to maintain the position. */
 #define CMD_DRIVE			 5
 int cmd_drive(void);
 
 /* CMD_TURN takes two parameters, an angle to turn through and a
    tolerance, both in milliradians.  */
 #define CMD_TURN			  6
 int cmd_turn (void);
 
 /* CMD_GOTO_WAYPOINT is not yet implemented (maybe when we get trig
    functions ;-) */
 #define CMD_GOTO_WAYPOINT	 7
 int cmd_goto_waypoint(void);
 
 /* CMD_SET_POS is not yet implemented (maybe when we get trig
    functions ;-) */
 #define CMD_SET_POS		   8
 int cmd_set_pos(void);
 
 /* CMD_SET_HEADING is not yet implemented (maybe when we get trig
    functions ;-) */
 #define CMD_SET_HEADING	   9
 int cmd_set_heading(void);
 
 /* CMD_WAIT_FOR_BUMP takes no parameters.  It will wait until it sees
    a signal from the bump sensor or the trigger to continue to the next 
    command.  This is useful for debugging by waiting between commands
    until you hit the bump sensor, or the trigger.  It is also useful 
    for driving until you hit something.  */
 #define CMD_WAIT_FOR_BUMP	 10
 int cmd_wait_for_bump(void);
 
 /* CMD_STOP takes no parameters. It just stops driving.  */
 #define CMD_STOP			  11
 int cmd_stop(void);
 
 /* CMD_JUMP takes one parameter a command list position.  It is used
    to jump around in the command list.  Note: the command list starts
    with command number 0.  This is C after all. */
 #define CMD_JUMP			  12
 int cmd_jump(void);
 
 /* CMD_GYRO_BIAS sets the gyro bias.  It takes no parameters.  Run this
    while stopped before using the gyro.  It should calibrate out any
    drift.  */
 #define CMD_GYRO_BIAS		 13
 int cmd_gyro_bias(void);
 
 /* CMD_KEEP_HEADING takes two parameters, a timeout and a tolerance.  It
    is a demonstration of the robot maintaining position and orientation.
    While this command is active, the robot will fight against any attempt
    to move it.  */
 #define CMD_KEEP_HEADING	  14
 int cmd_keep_heading(void);
__________________
-= 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
  #5   Spotlight this post!  
Unread 12-02-2005, 15:40
black mage black mage is offline
Registered User
#1302 (Team Lionheart)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Sparta
Posts: 6
black mage is an unknown quantity at this point
Send a message via AIM to black mage
Re: programming codewords

How do I put the keywords into the program? Would it be...

casepoint1:
CMD_VELOCITY: (whatever number I need)

or would it be in a different format?
Please!!!! I Need Help! But we don't have a teacher who knows programming who comes!
  #6   Spotlight this post!  
Unread 12-02-2005, 15:45
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: programming codewords

You would place them into an array and run a function that uses the array like so:
commands.h:
Code:
struct commands command_list[] = {
/*   Command			  parm 1	 parm 2   parm 3   */
{CMD_GYRO_BIAS,			   0,		0,	  0},
{CMD_WAIT_FOR_BUMP,		 100,		0,	  0},
{CMD_WAIT,				 1000,		0,	  0},
{CMD_TURN,	   -1571L,	  100,	  0},
{CMD_WAIT_FOR_BUMP,		 100,		0,	  0},
{CMD_WAIT,				 1000,		0,	  0},
{CMD_TURN,		1571,	  100,	  0},
{CMD_JUMP,					1,		0,	  0},
{NULL,						0,		0,	  0}
};
__________________
- from B B frank


Last edited by AIBob : 12-02-2005 at 15:54.
  #7   Spotlight this post!  
Unread 13-02-2005, 15:38
black mage black mage is offline
Registered User
#1302 (Team Lionheart)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Sparta
Posts: 6
black mage is an unknown quantity at this point
Send a message via AIM to black mage
Re: programming codewords

Do you know how to say that in lay man's terms?

And are their other codes that don't use the gyro and encoder?
Because I use the
casepoint1:
pwm01 = 240
pwm02 = 170
break;

format...
  #8   Spotlight this post!  
Unread 13-02-2005, 15:47
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: programming codewords

Quote:
Originally Posted by black mage
Do you know how to say that in lay man's terms?

And are their other codes that don't use the gyro and encoder?
Because I use the
casepoint1:
pwm01 = 240
pwm02 = 170
break;

format...
If you want to do a state machine (use your switch statement), then you can't use the scripting code which comes with the default code.
__________________

  #9   Spotlight this post!  
Unread 23-02-2005, 17:21
black mage black mage is offline
Registered User
#1302 (Team Lionheart)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Sparta
Posts: 6
black mage is an unknown quantity at this point
Send a message via AIM to black mage
Re: programming codewords

BRAIN!!!!!!!!! THE FLEXNARG DOES THAT MEAN?????




So... calm... down....
How would I put the wheel to go a certain distance? And can you show what it would look like.
  #10   Spotlight this post!  
Unread 23-02-2005, 21:21
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: programming codewords

I think you'll be better off if you IM me or something. My screenname is TeknoBramha or look at my profile for more info.
__________________
-= 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
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
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Organizing a programming team. scitobor 617 Programming 7 28-01-2005 19:18
Book on C programming - suggestions? wun Programming 18 14-01-2005 00:12
Programming and Electronics — Getting Started Sidney San Martín Technical Discussion 7 12-01-2005 15:25
Robot Programming Education phrontist Programming 11 03-05-2004 07:32


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

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