mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-18 02:53:52 +08:00
Rover: send home position when home is set or get-home msg received
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user