![]() |
Autonomous Mode
I have been coding our autonomous mode, but it seems that everytime I switch into autonomous mode it kills the camera. I was wondering if anyone could tell me if this code would keep the camera from running during autonomous mode.
Code:
void User_Autonomous_Code(void) |
Re: Autonomous Mode
Hello.
For the camera to track, you need to copy the camera tracking stuff (ie. Camera_Handler and Servo_Track) from Process_Data_From_Master_uP to User_Autonomous_Code. PM me if you need more details. Good luck, Sam |
Re: Autonomous Mode
hi! I put servo_track(), and camera_handler() in the autonomous code
Code:
while (autonomous_mode) /* DO NOT CHANGE! */p.s. why does the autonomous mode need to be a large while loop? isn't it checked every cycle of the main function? so wouldn't it be easier to leave the up_master_data stuff out and just run autonomous from main.c |
Re: Autonomous Mode
There are a lot of while statements in that code that don't look at all right to me. For example,
Code:
while (PAN_SERVO > 130) And then try changing those while statments into if statements, which is what it looks like they really ought to be. |
Re: Autonomous Mode
just a hint. Try to stay away from while loops as previously mentioned. They mess with your code because othe essential functions are not able to be called when your code is in a while loop.
|
Re: Autonomous Mode
Ifs and Elses are the key in FRC. :cool:
|
Re: Autonomous Mode
Don't forget to copy over all the includes at the top of user_routines dealing with the camera. IE tracking.h. You can just copy all the includes from user_routines to user_routines_fast if you wish.
|
Re: Autonomous Mode
don't forget the switch statement, which can be more useful or better for use in autonomous.
|
Re: Autonomous Mode
Quote:
Most of our routines end up looking something like: Code:
switch (auto_state) { |
Re: Autonomous Mode
Yeah, definately don't do loops in autonomous. The while loop in the default code provides the repeat. Just use if-elses to get one thing done before the next happens. That eliminates the possiblility of running into an error becuase the code takes too long to execute and fills the buffer. That would stop the bot cold for the entire match. (Beleive me, I've done it:)
|
Re: Autonomous Mode
Could someone please explain how to "switch" into autonomous mode without using a dongle. I want to test my autonomous code but haven't had time to make a dongle yet. :D Thanks
|
Re: Autonomous Mode
Quote:
|
Re: Autonomous Mode
Thanks.
|
Re: Autonomous Mode
Quote:
If everyone on your team is deathly afraid of soldering, you can buy a dongle from AndyMark. |
Re: Autonomous Mode
Quote:
1. Make dongle. 2. Use dongle. Seriously, you really, really, should have a dongle with a disable switch handy when you test autonomous mode. 1 trip to Radio Shack and a half hour with a soldering iron is all it takes. |
| All times are GMT -5. The time now is 20:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi