Fixed APO bug in current waypoint update.

This commit is contained in:
James Goppert 2011-10-27 17:23:08 -04:00
parent fc12113167
commit 9192143c44
4 changed files with 6 additions and 5 deletions

3
.gitignore vendored
View File

@ -16,4 +16,5 @@ build
/Tools/ArdupilotMegaPlanner/bin/APM Planner.app /Tools/ArdupilotMegaPlanner/bin/APM Planner.app
/Tools/ArdupilotMegaPlanner/obj /Tools/ArdupilotMegaPlanner/obj
/Tools/ArdupilotMegaPlanner/resedit/bin /Tools/ArdupilotMegaPlanner/resedit/bin
/Tools/ArdupilotMegaPlanner/resedit/obj /Tools/ArdupilotMegaPlanner/resedit/obj
tags

View File

@ -11,6 +11,7 @@
// vehicle options // vehicle options
static const apo::vehicle_t vehicle = apo::VEHICLE_CAR; static const apo::vehicle_t vehicle = apo::VEHICLE_CAR;
//static const apo::halMode_t halMode = apo::MODE_HIL_CNTL;
static const apo::halMode_t halMode = apo::MODE_LIVE; static const apo::halMode_t halMode = apo::MODE_LIVE;
static const apo::board_t board = apo::BOARD_ARDUPILOTMEGA_1280; static const apo::board_t board = apo::BOARD_ARDUPILOTMEGA_1280;
static const uint8_t heartBeatTimeout = 3; static const uint8_t heartBeatTimeout = 3;

View File

@ -80,18 +80,17 @@ AP_Autopilot::AP_Autopilot(AP_Navigator * navigator, AP_Guide * guide,
} else if (hal->getMode() == MODE_HIL_CNTL) { // hil } else if (hal->getMode() == MODE_HIL_CNTL) { // hil
hal->hil->sendMessage(MAVLINK_MSG_ID_HEARTBEAT); hal->hil->sendMessage(MAVLINK_MSG_ID_HEARTBEAT);
hal->hil->receive(); hal->hil->receive();
Serial.println("HIL Receive Called");
if (_navigator->getTimeStamp() != 0) { if (_navigator->getTimeStamp() != 0) {
// give hil a chance to send some packets // give hil a chance to send some packets
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
hal->debug->println_P(PSTR("reading initial hil packets")); hal->debug->println_P(PSTR("reading initial hil packets"));
hal->gcs->sendText(SEVERITY_LOW, hal->gcs->sendText(SEVERITY_LOW, PSTR("reading initial hil packets"));
PSTR("reading initial hil packets"));
delay(1000); delay(1000);
} }
break; break;
} }
hal->debug->println_P(PSTR("waiting for hil packet")); hal->debug->println_P(PSTR("waiting for hil packet"));
hal->gcs->sendText(SEVERITY_LOW, PSTR("waiting for hil packets"));
} }
delay(500); delay(500);
} }

View File

@ -128,7 +128,7 @@ void MavlinkGuide::nextCommand() {
_nextCommandCalls = 0; _nextCommandCalls = 0;
} }
_cmdIndex = getNextIndex(); setCurrentIndex(getNextIndex());
//Serial.print("cmd : "); Serial.println(int(_cmdIndex)); //Serial.print("cmd : "); Serial.println(int(_cmdIndex));
//Serial.print("cmd prev : "); Serial.println(int(getPreviousIndex())); //Serial.print("cmd prev : "); Serial.println(int(getPreviousIndex()));
//Serial.print("cmd num : "); Serial.println(int(getNumberOfCommands())); //Serial.print("cmd num : "); Serial.println(int(getNumberOfCommands()));