|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#6
|
|||
|
|||
|
Re: Do you write functions for your code?
I shouldn't be talking since our robot barely worked, but we used a select statement to switch between autonomous modes in user routines fast. This "in theory" will make our autonomous failsafe if the desired mode encounters a problem.
autoMode = DEAD_RECKON; switch (autoMode) { case DONOTHING: break; case DEAD_RECKON: /* Dead_Recockning */ // MyTimerInterrupt is calling Handle_DeadReckoning //rr_auto_mode_dead_reckoning(); // RR_LEFT_DRIVE_MOTOR = leftScaledSpeedCmd; // RR_RIGHT_DRIVE_MOTOR = rightScaledSpeedCmd; // RR_LEFT_DRIVE_MOTOR = 157; // RR_RIGHT_DRIVE_MOTOR = 175; if(RR_OPTICAL_SENSOR_1 == 1) autoMode = LINE_TRACKING; break; case KNOCK_BALL: // put something here break; case LINE_TRACKING: rr_auto_mode_line_tracking(); break; case DONOTHING: break; } ----- We're using a PID control loop also in our autonomous, taking in feedback from 2 encoders mounted on the left and right drive train. We ended up disabling a good portion of it since the encoders kept getting dislodged. Anyone else use a PID loop with success? Last edited by gl75 : 08-03-2004 at 21:35. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is your most prefered programming language? | Hailfire | Programming | 156 | 19-01-2005 21:42 |
| Interrupt timer, executing code asap? | SeanCassidy | Programming | 10 | 07-03-2004 01:47 |
| Inserting Naviagation code into Default code? | actorindp | Programming | 3 | 28-01-2004 18:12 |
| RC bootup sequence | Venkatesh | Programming | 17 | 18-11-2003 20:56 |
| Does your team use the Default code. | Jeff McCune | General Forum | 2 | 09-01-2003 14:46 |