Go to Post Physics is not a religion. - Jack Jones [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 28-01-2004, 13:48
actorindp actorindp is offline
Registered User
#0270
 
Join Date: Jan 2004
Location: Long Island, New York
Posts: 11
actorindp is on a distinguished road
Inserting Naviagation code into Default code?

Hey everyone... please bare with me.

I was approached (ambushed) by my robotics team to see if i could program this year.

I have no idea what i'm doing, to be frank. Yet I'm catching on quickly, and I have a quick question.

I have the default code on my bot. I have the navigation code.
How do I merge the two together, so i have my default code and once I switch to autonomous mode, It starts running that navigation code?

Thanks..

Please help the n00b

Nick, a lost soul who was kidnapped by his robotics team in hopes of a success.
  #2   Spotlight this post!  
Unread 28-01-2004, 17:07
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Inserting Naviagation code into Default code?

There is an excellent Powerpoint presentation on many aspects of programming the new controllers at:
http://www.usfirst.org/robotics/C_help.htm

It includes a section describing where you insert autonomous code. You should be able to simply copy the code you have and insert it into the autonomous section of user_routines_fast.c.
  #3   Spotlight this post!  
Unread 28-01-2004, 18:07
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Inserting Naviagation code into Default code?

If you have the "navigate" package for the IR sensors, you're almost good to go - both this code and the default code are based off the same template. Essentially what you'll need to do is take all of the manual control code from the default code (all of which is in user_routines.c), and merge it into the navigate code. Also, you'll have to change user_routines_fast.c in the navigate code so that it will only navigate when the robot is in autonomous mode. Functions to look at are as follows:

user_routines.c
void User_Initialization() - make sure everything is set up like it needs to be (assigning IO pins, et cetera)
void Process_Data_From_Master_uP() - add stuff from default to navigate
void Default_Routine() - this entire function needs to be copied from default to navigate

user_routines_fast.c
void Process_Data_From_Local_IO() - move the call to Navigate() into the while loop and if statement in User_Autonomous_Code()
void User_Autonomous_Code() - any other autonomous mode stuff can go here, along with the call to Navigate()

that should be just about it, if i've forgotten or not noticed anything, feel free to tell me.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #4   Spotlight this post!  
Unread 28-01-2004, 18:12
actorindp actorindp is offline
Registered User
#0270
 
Join Date: Jan 2004
Location: Long Island, New York
Posts: 11
actorindp is on a distinguished road
Re: Inserting Naviagation code into Default code?

Thanks a lot!!!
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
default code and the actual robot tml240 Programming 15 24-01-2004 11:31
How long does it take you to load the default code? vegasmcse Robotics Education and Curriculum 10 03-11-2003 21:41
2003 PBasic default code from Innovation First ttedrow Programming 0 06-01-2003 11:18
default code archiver 2001 2 23-06-2002 22:53
Rookie Programmer has question about the default code DanL Programming 3 26-01-2002 19:59


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

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