mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
commander: Update after merge
This commit is contained in:
@@ -826,8 +826,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
int gps_sub = orb_subscribe(ORB_ID(vehicle_gps_position));
|
||||
struct vehicle_gps_position_s gps_position;
|
||||
memset(&gps_position, 0, sizeof(gps_position));
|
||||
gps_position.eph_m = FLT_MAX;
|
||||
gps_position.epv_m = FLT_MAX;
|
||||
gps_position.eph = FLT_MAX;
|
||||
gps_position.epv = FLT_MAX;
|
||||
|
||||
/* Subscribe to sensor topic */
|
||||
int sensor_sub = orb_subscribe(ORB_ID(sensor_combined));
|
||||
@@ -1261,8 +1261,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
|
||||
/* Initialize map projection if gps is valid */
|
||||
if (!map_projection_global_initialized()
|
||||
&& (gps_position.eph_m < eph_epv_threshold)
|
||||
&& (gps_position.epv_m < eph_epv_threshold)
|
||||
&& (gps_position.eph < eph_epv_threshold)
|
||||
&& (gps_position.epv < eph_epv_threshold)
|
||||
&& hrt_elapsed_time((hrt_abstime*)&gps_position.timestamp_position) < 1e6) {
|
||||
/* set reference for global coordinates <--> local coordiantes conversion and map_projection */
|
||||
globallocalconverter_init((double)gps_position.lat * 1.0e-7, (double)gps_position.lon * 1.0e-7, (float)gps_position.alt * 1.0e-3f, hrt_absolute_time());
|
||||
|
||||
Reference in New Issue
Block a user