mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 15:06:33 +00:00
Refactored a8 codes and added remote testing app a8_remote.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct GPSData
|
||||
{
|
||||
float latitude; // Decimal degrees
|
||||
float longitude; // Decimal degrees
|
||||
float altitude; // Meters
|
||||
};
|
||||
|
||||
struct CameraData
|
||||
{
|
||||
uint16_t height; // Pixels
|
||||
uint16_t width; // Pixels
|
||||
float pitch; // Degrees
|
||||
float yaw; // Degrees
|
||||
float fow; // Degrees
|
||||
};
|
||||
|
||||
struct DroneData
|
||||
{
|
||||
GPSData gps;
|
||||
float yaw; // Degrees
|
||||
float pitch; // Degrees
|
||||
float roll; // Degrees
|
||||
};
|
||||
|
||||
class UtilsTargetLocation
|
||||
{
|
||||
public:
|
||||
static GPSData getLocation(float altitude, float latitude, float lognitude, float yaw, float pitch, float roll, float targetTrueSize, uint16_t targetPixelSize);
|
||||
static void getAnglesToOnScreenTarget(uint16_t targetX, uint16_t targetY, float &resultYaw, float &resultPitch);
|
||||
|
||||
private:
|
||||
static CameraData getCameraData();
|
||||
static float calculateTargetDistance(float targetSize, uint16_t targetPixelSize, uint16_t imageWidth, float fov);
|
||||
static float degreesToRadians(float degrees);
|
||||
static GPSData calculateTargetLocation(DroneData drone, CameraData camera, float distance, float bearing);
|
||||
};
|
||||
Reference in New Issue
Block a user