2023-08-08 21:28:00 -03:00
|
|
|
/*
|
|
|
|
external control library for MAVLink, DDS and scripting
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AP_ExternalControl_config.h"
|
|
|
|
|
|
|
|
#if AP_EXTERNAL_CONTROL_ENABLED
|
|
|
|
|
2024-11-13 15:46:21 -04:00
|
|
|
#include <AP_Arming/AP_Arming.h>
|
2023-12-07 02:49:02 -04:00
|
|
|
#include <AP_Common/Location.h>
|
2023-08-08 21:28:00 -03:00
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
|
|
|
|
class AP_ExternalControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
AP_ExternalControl();
|
|
|
|
/*
|
|
|
|
Set linear velocity and yaw rate. Pass NaN for yaw_rate_rads to not control yaw.
|
|
|
|
Velocity is in earth frame, NED [m/s].
|
|
|
|
Yaw is in earth frame, NED [rad/s].
|
|
|
|
*/
|
2023-10-30 21:18:30 -03:00
|
|
|
virtual bool set_linear_velocity_and_yaw_rate(const Vector3f &linear_velocity, float yaw_rate_rads) WARN_IF_UNUSED {
|
2023-08-08 21:28:00 -03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-12-07 02:49:02 -04:00
|
|
|
/*
|
|
|
|
Sets the target global position with standard guided mode behavior.
|
|
|
|
*/
|
|
|
|
virtual bool set_global_position(const Location& loc) WARN_IF_UNUSED {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2024-11-13 15:46:21 -04:00
|
|
|
/*
|
|
|
|
Arm the vehicle
|
|
|
|
*/
|
|
|
|
virtual bool arm(AP_Arming::Method method, bool do_arming_checks) WARN_IF_UNUSED;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Disarm the vehicle
|
|
|
|
*/
|
|
|
|
virtual bool disarm(AP_Arming::Method method, bool do_disarm_checks) WARN_IF_UNUSED;
|
|
|
|
|
2023-10-30 21:18:30 -03:00
|
|
|
static AP_ExternalControl *get_singleton(void) WARN_IF_UNUSED {
|
2023-08-08 21:28:00 -03:00
|
|
|
return singleton;
|
|
|
|
}
|
2023-12-07 02:49:02 -04:00
|
|
|
protected:
|
|
|
|
~AP_ExternalControl() {}
|
2023-08-08 21:28:00 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
static AP_ExternalControl *singleton;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
namespace AP
|
|
|
|
{
|
|
|
|
AP_ExternalControl *externalcontrol();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // AP_EXTERNAL_CONTROL_ENABLED
|