[fix] utm coord was not initialized in landing module for FW (#3445)
Doxygen / build (push) Has been cancelled

Also
- kill throttle after landing
- add module takoff/land to demo mission flight plan
This commit is contained in:
Gautier Hattenberger
2025-04-01 18:39:10 +02:00
committed by GitHub
parent 33ebce980a
commit 6f7342fdd8
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">
<flight_plan alt="260" ground_alt="185" lat0="43.46223" lon0="1.27289" max_dist_from_home="1500" name="Basic" security_height="25" qfu="180">
<flight_plan alt="260" ground_alt="185" lat0="43.46223" lon0="1.27289" max_dist_from_home="1500" name="Basic" security_height="25" qfu="0">
<header/>
<waypoints>
<waypoint name="HOME" x="0" y="0"/>
@@ -12,6 +12,7 @@
</waypoints>
<modules>
<module name="mission" type="fw"/>
<module name="nav" type="takeoff_and_landing"/>
</modules>
<exceptions/>
<blocks>
@@ -316,6 +316,7 @@ static bool nav_land_run(void)
break;
case NAV_LANDING_DONE:
default:
NavKillThrottle();
landing.status = NAV_LANDING_INIT;
return false;
}
@@ -346,7 +347,7 @@ bool nav_land_at_loc(float td_alt, float lat, float lon, float dir, float dist,
landing.td_id = 0;
landing.af_id = 0;
struct LlaCoor_f lla = { RadOfDeg(lat), RadOfDeg(lon), GetAltRef() + td_alt };
struct UtmCoor_f utm;
struct UtmCoor_f utm = {0};
utm_of_lla_f(&utm, &lla);
ENU_OF_UTM_DIFF(landing.td_pos, utm, *stateGetUtmOrigin_f());
landing.af_pos.x = landing.td_pos.x + dist * sinf(RadOfDeg(dir));