mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 06:46:34 +00:00
Added Qt API suggestion for AI and camera interaction.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
// AiEngineGimbalControl class in the rtsp_ai_player program takes RemoteControl class as a member variable and probably puts it in the thread.
|
||||
// Communication between AiEngineGimbalControl and RemoteControl object is normal Qt's signal-slots.
|
||||
|
||||
// API suggestion
|
||||
|
||||
// Common geoposition
|
||||
typedef struct {
|
||||
float lat;
|
||||
float lon;
|
||||
float alt;
|
||||
} Position;
|
||||
|
||||
// AiEngineGimbalControl -> RemoteControl is sent when location or position of the drone changes.
|
||||
typedef struct {
|
||||
Position position;
|
||||
float pitch;
|
||||
float yaw;
|
||||
} DronePosition;
|
||||
|
||||
// AiEngineGimbalControl -> RemoteControl when AI finds the target. Index is a new variable to keep track of the targets.
|
||||
typedef struct {
|
||||
int index;
|
||||
int top;
|
||||
int left;
|
||||
int bottom;
|
||||
int right;
|
||||
} AiCameraTarget;
|
||||
|
||||
// RemoteControl -> AiEngineGimbalControl when RemoteControl has zoomed to the target defined in AiCameraTarget.
|
||||
// position variable contains calculated geoposition of the target.
|
||||
typedef struct {
|
||||
int targetIndex;
|
||||
Position position;
|
||||
} TargetPosition;
|
||||
|
||||
// AiEngineGimbalControl -> RemoteControl when AI asks to change camera direction. For example nothing interesting was not found.
|
||||
// RemoteControl -> AiEngineGimbalControl every few second so that AI knows the position of the camera.
|
||||
typedef struct {
|
||||
float yaw;
|
||||
float pitch;
|
||||
float zoom;
|
||||
} CameraPosition;
|
||||
|
||||
|
||||
class AiEngineGimbalControl {
|
||||
signals:
|
||||
void newDronePosition(DronePosition);
|
||||
void zoomToAiTarget(AiCameraTarget);
|
||||
void setCameraPosition(CameraPosition);
|
||||
slots:
|
||||
void aiTargetZoomedSlot(TargetPosition);
|
||||
void cameraPositionSlot(CameraPosition);
|
||||
}
|
||||
|
||||
|
||||
class RemoteControl {
|
||||
slots:
|
||||
void dronePositionSlot(DronePosition);
|
||||
void zoomToAiTargetSlot(AiCameraTarget);
|
||||
void cameraPositionSlot(CameraPosition);
|
||||
signals:
|
||||
void aiTargetZoomed(TargetPosition);
|
||||
void newCameraPosition(CameraPosition);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user