View Full Version : IR Navigate in Autonomous Mode
bhawkins
01-03-2004, 22:43
We are having an issue with the autonomous mode I am having some issues with the code and implementing it if I upload the tracker file modified to work with our bot the servos follow the beacon but I tried to merge everything into the default code the trackers don't move and the tracks don't move. Could someone who has implemented the navigate/tracker code into their default program please email it to webmaster@lhssfirst.dyndns.org. I can change the values for the pwm's for the servo and motors in the program.
We are using:
pwm 2 for extend
pwm 6 for elevate
pwm 9 and 10 for servo trackers
pwm 13 and 15 for track drive
Any help with any of the programming would be great. I tried to follow the other forums about implementing the code but really I need a working code to study and look at. This is how I learn the best. :) My strengths are in c++, vb and qbasic.
Also could someone explain how the included current sensors work and what equation is needed to come up with the number in the program. Thanks
Thank you
Brian Hawkins
Webmaster/Programmer
Lutheran South FIRST Robotics
http://lhssfirst.dyndns.org
Anthony Kesich
01-03-2004, 23:21
Also could someone explain how the included current sensors work and what equation is needed to come up with the number in the program.
Ok, i won't write your autonomous for you, but I will tell you this. The current sensors are used to tell if the bot got stuck up against a wall or not. basically, for that bot, printf statements were used for the current sensors to see where they were when running normally, and what they drew ehen hitting the wall (lets say 550 normal and 750 when up againt a wall because they're stalling out). The cpu then checks to see if the sensors are above 700 and if they are, the cpu then averages out the last ten values to make sure it is consistant and not just a spike. (These sensors will not give a stable reading, believe you me.) So for your bot, just use a print f statement to see the value when the bot drives normally and when you're stalling out the motors. Subtract something like 50 from the stall value and set that as your new current max.
if I upload the tracker file modified to work with our bot the servos follow the beacon but I tried to merge everything into the default code the trackers don't move and the tracks don't move.
what i did was i took kevin's code for ir tracking, made a second copy of all of it and put it in a different folder. I then just cahnged the user_routines.c and such to use our inputs and outputs. It is much easier than trying to take the default code and incorporate all of the interupts and the like. That should work for you.
I hope I've been of some help.
-Kesich
bhawkins
04-03-2004, 21:24
thanks i will work on that
KenWittlief
04-03-2004, 22:40
what do you mean about merging the tracker code into your user code?
in the default SW main.c calls the auton subroutine, and the code stays in that subroutine until auton mode ends - so maybe you unwittingly put your auton (tracker) code in a different place? that could be why its not running at all.
They tell us not to edit main.c, but it really helps if you study it, make a flowchart of it, and understand how it works and when it calls the different subroutines.
bhawkins
04-03-2004, 23:10
what do you mean about merging the tracker code into your user code?
in the default SW main.c calls the auton subroutine, and the code stays in that subroutine until auton mode ends - so maybe you unwittingly put your auton (tracker) code in a different place? that could be why its not running at all.
They tell us not to edit main.c, but it really helps if you study it, make a flowchart of it, and understand how it works and when it calls the different subroutines.
I am having problems merging the navigate code by kevin and the code from innovation first. I moved the the navigate.h and .c tracker.h and .c and reciever.h and .c and in user rutines fast I initialized them. also i copied the interupt handler low from the navigate to the end of the code that was already there. I also added Navigate(); where it says insert code here.
I read somewhere that i need to remove a line from the navigate code so that it will not wait for a push of a button. Could someone tell me what line needs to be removed, i know where it is but i really dont know what all has to be removed from it.
Thanks :)
Mark McLeod
05-03-2004, 08:08
I read somewhere that i need to remove a line from the navigate code so that it will not wait for a push of a button. Could someone tell me what line needs to be removed, i know where it is but i really dont know what all has to be removed from it.
Thanks :)
This thread discusses it25094
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.