|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
Re: Inserting Naviagation code into Default code?
Thanks a lot!!!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |