Skip to content

Commit

Permalink
Fixed APO bug in current waypoint update.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoppert committed Oct 27, 2011
1 parent fc12113 commit 9192143
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ build
/Tools/ArdupilotMegaPlanner/bin/APM Planner.app
/Tools/ArdupilotMegaPlanner/obj
/Tools/ArdupilotMegaPlanner/resedit/bin
/Tools/ArdupilotMegaPlanner/resedit/obj
/Tools/ArdupilotMegaPlanner/resedit/obj
tags
1 change: 1 addition & 0 deletions ArduRover/CarStampede.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

// vehicle options
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::board_t board = apo::BOARD_ARDUPILOTMEGA_1280;
static const uint8_t heartBeatTimeout = 3;
Expand Down
5 changes: 2 additions & 3 deletions libraries/APO/AP_Autopilot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,17 @@ AP_Autopilot::AP_Autopilot(AP_Navigator * navigator, AP_Guide * guide,
} else if (hal->getMode() == MODE_HIL_CNTL) { // hil
hal->hil->sendMessage(MAVLINK_MSG_ID_HEARTBEAT);
hal->hil->receive();
Serial.println("HIL Receive Called");
if (_navigator->getTimeStamp() != 0) {
// give hil a chance to send some packets
for (int i = 0; i < 5; i++) {
hal->debug->println_P(PSTR("reading initial hil packets"));
hal->gcs->sendText(SEVERITY_LOW,
PSTR("reading initial hil packets"));
hal->gcs->sendText(SEVERITY_LOW, PSTR("reading initial hil packets"));
delay(1000);
}
break;
}
hal->debug->println_P(PSTR("waiting for hil packet"));
hal->gcs->sendText(SEVERITY_LOW, PSTR("waiting for hil packets"));
}
delay(500);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/APO/AP_Guide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void MavlinkGuide::nextCommand() {
_nextCommandCalls = 0;
}

_cmdIndex = getNextIndex();
setCurrentIndex(getNextIndex());
//Serial.print("cmd : "); Serial.println(int(_cmdIndex));
//Serial.print("cmd prev : "); Serial.println(int(getPreviousIndex()));
//Serial.print("cmd num : "); Serial.println(int(getNumberOfCommands()));
Expand Down

0 comments on commit 9192143

Please sign in to comment.