![]() |
Re: More automonous help:ending stuff
Try this. In user_routines_fast.c replace the User_Autonomous_Code function with the function below. It's not a state machine, but it incorporates elements that you probably understand better.
All: Please check this for bugs! Code:
void User_Autonomous_Code( void ) |
Re: More automonous help:ending stuff
OK, here's my take on what's been said, with some minor refinements and details. I took the original code, re-arranged a bit to put it into a state machine (and fix the problem where sensor readings could lock out the code that does the end game), then plopped it all into the User_Autonomous_Code function from the default FIRST code in user_routines_fast.c.
I also added in the loop counter in the right spot and used the constants to give the transitions at 12 and 14 seconds. Since autonomous mode just spins in the one function, there's no reason to mess with global (or static) variables. Code:
enumTo do that, just add a few more states to turn left and right a couple of times. Enjoy. |
Re: More automonous help:ending stuff
Quote:
And Tom, thanks for pointing out that 'static' is unneccesary since it all happens in one loop for 15 seconds. It's just a habit to use a static when I want to see what the value was at the end of the previous pass. Good luck, Barry! |
Re: More automonous help:ending stuff
Hey Hey Hey!
I have to hand it to ya, the code did good, but it was our robot who screwed up... I got a big tip that the line sensors power supply does NOT come from the PWM... it comes directly from the breaker. So the sensers don't have the juice to pick up anything... so useless. I found that out just before we left. Another thing is the arm which is now removed... is useless to the winch... so no code for that useless device. off topic but I noticed a lot of teams going for the 'fishingrod' style. I think our robot should have done that, less weight overall. So we play defence and offense. So our now automonous code is drive like hell with our power window motors (I hate them) and plow the goal to the other end...look for my reason on this in strategy. MY team and I reall yappreciate all the work you guys did. I wish I could have seen it in action, but if we switch back at least we can say were 'multi automonistic' Barry PS: I'm in the hilton business/comp. room. I've met one the official/judges (he didn't tell me) and the DIRECTOR of the whole deal. His wive is photocopying using all the complimentary stuff they have |
| All times are GMT -5. The time now is 22:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi