most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown
Dependencies: mbed MODSERIAL FATFileSystem
Revision 92:52a91656458a, committed 2019-05-13
- Comitter:
- joel_ssc
- Date:
- Mon May 13 19:25:26 2019 +0000
- Parent:
- 91:916ee0fea9ff
- Commit message:
- version for first flight test, timeouts not yet set correctly
Changed in this revision
PidController/PidController.cpp | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PidController/PidController.cpp Thu May 09 14:57:45 2019 +0000 +++ b/PidController/PidController.cpp Mon May 13 19:25:26 2019 +0000 @@ -21,9 +21,9 @@ // hack to get heading update correct // need to make sure this makes physical sense if (_headingFlag) { - if (_error >= 180){ + if (_error >= 180){ //technincally, this adjustment should continue until error is less than 180. _error = _error - 360.0; - }else if(_error <= -180){ + }else if(_error <= -180){ // likewise here, continue until error greater than -180 _error = _error + 360.0; } }
--- a/main.cpp Thu May 09 14:57:45 2019 +0000 +++ b/main.cpp Mon May 13 19:25:26 2019 +0000 @@ -426,7 +426,8 @@ if ( (tNow % 2000) == 0 ) { // 2 second intervals led3()=1; - sprintf(buf, "hit 2 second log interval in main loop current_state=%d tNow =%d imu.roll = %f not-unsampled \n\n\r", current_state, tNow, imu().getRoll()); + sprintf(buf, "main loop: current_state=%d tNow =%d imu.heading=%f headingLoop.heading= %f imu.roll = %f \n\n\r", + current_state, tNow,imu().getHeading(), headingLoop().getPosition(), imu().getRoll()); mbedLogger().appendDiagFile(buf,3); } if ((tNow % 3000) == 0) { @@ -454,15 +455,19 @@ } // end else { at **88** if(current_state == FB_EXIT) { log_loop=true; - log_function(); led2()=1; led4()=1; + log_function(); + led2()=1; + led4()=1; keeprunning=0; // and this will force exit to the main while() loop. // switch state to EOL_WAIT, spit out xbee messages, wait 60 seconds or so. if keyboard comes back, do not exit sprintf(buf, "INSIDE main loop: BUT now called to exit out of it via FB_EXIT\n\n\r"); mbedLogger().appendDiagFile(buf,3); } - if(tNow == 90000) { // don't wait forever -remove this for real operations!! - keeprunning=0; - } + if(tNow == 90000) { // don't wait forever -remove this for real operations!! + keeprunning=0; + sprintf(buf, "INSIDE main loop: Triggered FINAL timeout at 90 seconds\n\n\r"); + mbedLogger().appendDiagFile(buf,3); + } } // end if(read_ticker) { } // end while(keeprunning)