Rover: send home position when home is set or get-home msg received

This commit is contained in:
Randy Mackay
2015-10-03 12:56:21 +09:00
parent 1dcf58bc20
commit 836fff2119
3 changed files with 6 additions and 0 deletions
+4
View File
@@ -1075,6 +1075,10 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
}
break;
case MAV_CMD_GET_HOME_POSITION:
send_home(rover.ahrs.get_home());
break;
case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES: {
if (is_equal(packet.param1,1.0f)) {
rover.gcs[chan-MAVLINK_COMM_0].send_autopilot_version(FIRMWARE_VERSION);
+1
View File
@@ -68,6 +68,7 @@ void Rover::init_home()
ahrs.set_home(gps.location());
home_is_set = true;
Log_Write_Home_And_Origin();
GCS_MAVLINK::send_home_all(gps.location());
// Save Home to EEPROM
mission.write_home_to_storage();
+1
View File
@@ -326,6 +326,7 @@ void Rover::do_set_home(const AP_Mission::Mission_Command& cmd)
ahrs.set_home(cmd.content.location);
home_is_set = true;
Log_Write_Home_And_Origin();
GCS_MAVLINK::send_home_all(cmd.content.location);
}
}