mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 03:00:35 +08:00
Geo lib: Do not hardcode assumptions about process name.
This commit is contained in:
+6
-16
@@ -86,12 +86,7 @@ __EXPORT uint64_t map_projection_timestamp(const struct map_projection_reference
|
||||
__EXPORT int map_projection_global_init(double lat_0, double lon_0,
|
||||
uint64_t timestamp) //lat_0, lon_0 are expected to be in correct format: -> 47.1234567 and not 471234567
|
||||
{
|
||||
if (strcmp("commander", getprogname()) == 0) {
|
||||
return map_projection_init_timestamped(&mp_ref, lat_0, lon_0, timestamp);
|
||||
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return map_projection_init_timestamped(&mp_ref, lat_0, lon_0, timestamp);
|
||||
}
|
||||
|
||||
__EXPORT int map_projection_init_timestamped(struct map_projection_reference_s *ref, double lat_0, double lon_0,
|
||||
@@ -217,19 +212,14 @@ __EXPORT int map_projection_global_getref(double *lat_0, double *lon_0)
|
||||
}
|
||||
__EXPORT int globallocalconverter_init(double lat_0, double lon_0, float alt_0, uint64_t timestamp)
|
||||
{
|
||||
if (strcmp("commander", getprogname()) == 0) {
|
||||
gl_ref.alt = alt_0;
|
||||
gl_ref.alt = alt_0;
|
||||
|
||||
if (!map_projection_global_init(lat_0, lon_0, timestamp)) {
|
||||
gl_ref.init_done = true;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
gl_ref.init_done = false;
|
||||
return -1;
|
||||
}
|
||||
if (!map_projection_global_init(lat_0, lon_0, timestamp)) {
|
||||
gl_ref.init_done = true;
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
gl_ref.init_done = false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user