-
Notifications
You must be signed in to change notification settings - Fork 17.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ArduPlane: add REP-147 Global Position Control
Signed-off-by: Ryan Friedman <[email protected]>
- Loading branch information
Showing
3 changed files
with
51 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
external control library for plane | ||
*/ | ||
|
||
|
||
#include "AP_ExternalControl_Plane.h" | ||
#if AP_EXTERNAL_CONTROL_ENABLED | ||
|
||
#include "Plane.h" | ||
|
||
/* | ||
Sets the target global position for a loiter point. | ||
*/ | ||
bool AP_ExternalControl_Plane::set_global_position(const Location& loc) | ||
{ | ||
|
||
// set_target_location already checks if plane is ready for external control. | ||
// It doesn't check if flying or armed, just that it's in guided mode. | ||
return plane.set_target_location(loc); | ||
// return plane.is_taking_off(); | ||
} | ||
|
||
#endif // AP_EXTERNAL_CONTROL_ENABLED |
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,21 @@ | ||
|
||
/* | ||
external control library for plane | ||
*/ | ||
#pragma once | ||
|
||
#include <AP_ExternalControl/AP_ExternalControl.h> | ||
|
||
#if AP_EXTERNAL_CONTROL_ENABLED | ||
|
||
#include <AP_Common/Location.h> | ||
|
||
class AP_ExternalControl_Plane : public AP_ExternalControl { | ||
public: | ||
/* | ||
Sets the target global position for a loiter point. | ||
*/ | ||
bool set_global_position(const Location& loc) override WARN_IF_UNUSED; | ||
}; | ||
|
||
#endif // AP_EXTERNAL_CONTROL_ENABLED |
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