mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 02:51:35 +08:00
Added home position switch on GPS position - gives a more reliable home position setup
This commit is contained in:
@@ -1092,9 +1092,9 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
&& global_position.global_valid) {
|
&& global_position.global_valid) {
|
||||||
|
|
||||||
/* copy position data to uORB home message, store it locally as well */
|
/* copy position data to uORB home message, store it locally as well */
|
||||||
home.lat = global_position.lat;
|
home.lat = gps_position.lat / (double)1e7;
|
||||||
home.lon = global_position.lon;
|
home.lon = gps_position.lon / (double)1e7;
|
||||||
home.alt = global_position.alt;
|
home.alt = gps_position.alt;
|
||||||
|
|
||||||
warnx("home: lat = %.7f, lon = %.7f, alt = %.4f ", home.lat, home.lon, (double)home.alt);
|
warnx("home: lat = %.7f, lon = %.7f, alt = %.4f ", home.lat, home.lon, (double)home.alt);
|
||||||
mavlink_log_info(mavlink_fd, "[cmd] home: %.7f, %.7f, %.4f", home.lat, home.lon, (double)home.alt);
|
mavlink_log_info(mavlink_fd, "[cmd] home: %.7f, %.7f, %.4f", home.lat, home.lon, (double)home.alt);
|
||||||
|
|||||||
Reference in New Issue
Block a user