forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "mode.h" | ||
#include "Plane.h" | ||
#include <GCS_MAVLink/GCS.h> | ||
|
||
/* | ||
mode AutoLand parameters | ||
*/ | ||
const AP_Param::GroupInfo ModeAutoLand::var_info[] = { | ||
// @Param: WP_ALT | ||
// @DisplayName: Final approach WP altitude | ||
// @Description: This is the target altitude for final approach waypoint | ||
// @Range: 0 200 | ||
// @Increment: 1 | ||
// @Units: m | ||
// @User: Standard | ||
AP_GROUPINFO("WP_ALT", 1, ModeAutoLand, final_wp_alt, 55), | ||
|
||
// @Param: DIST | ||
// @DisplayName: Final approach WP distance | ||
// @Description: This is the distance from Home that the final approach waypoint is set. The waypoint point will be in the opposite direction of takeoff (the direction the plane is facing when the plane sets its takeoff heading) | ||
// @Range: 0 700 | ||
// @Increment: 1 | ||
// @Units: m | ||
// @User: Standard | ||
AP_GROUPINFO("WP_DIST", 2, ModeAutoLand, final_wp_dist, 400), | ||
|
||
AP_GROUPEND | ||
}; | ||
|
||
ModeAutoLand::ModeAutoLand() : | ||
Mode() | ||
{ | ||
AP_Param::setup_object_defaults(this, var_info); | ||
} | ||
|
||
bool ModeAutoLand::_enter() | ||
{ | ||
// upon enter we setup a final wp and land wp based on home and takeoff_dir | ||
const Location &home = ahrs.get_home(); | ||
plane.set_target_altitude_current(); | ||
plane.next_WP_loc.offset_bearing(bearing_cd, home.alt*0.01f + final_wp_alt); | ||
plane.prev_WP_loc = plane.current_loc; | ||
plane.nav_controller->update_waypoint(plane.prev_WP_loc, plane.next_WP_loc); | ||
return true; | ||
} | ||
|
||
void ModeAutoLand::update() | ||
{ | ||
plane.calc_nav_roll(); | ||
plane.update_fbwb_speed_height(); | ||
} | ||
|
||
void ModeAutoLand::navigate() | ||
{ | ||
|
||
} |