mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 10:16:33 +00:00
deb607237e
Added functionality to set camera ready for bringing it down or up. Camera will be made available for AI after bringCameraDown command is given via UDPSocket. Camera will be made unavailable for AI after bringCameraUp command is given via UDPSocket.
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QMap>
|
|
#include <QUdpSocket>
|
|
#include "aienginedefinitions.h"
|
|
#include "aienginegimbalserveractions.h"
|
|
#include "aienginegimbalserverudpcommand.h"
|
|
#include "aienginegimbalserverudpresponse.h"
|
|
#include "aienginegimbalserverudp.h"
|
|
|
|
|
|
class AiEngineGimbalServer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit AiEngineGimbalServer(QObject *parent = nullptr);
|
|
bool isAvailable(void);
|
|
|
|
public slots:
|
|
void dronePositionSlot(AiEngineDronePosition);
|
|
void zoomToAiTargetSlot(AiEngineCameraTarget);
|
|
void cameraPositionSlot(AiEngineCameraPosition);
|
|
|
|
signals:
|
|
void aiTargetZoomed(AiEngineTargetPosition);
|
|
void newCameraPosition(AiEngineCameraPosition);
|
|
|
|
private:
|
|
AiEngineGimbalServerUDP mUdpSocket;
|
|
AiEngineGimbalStatus mGimbalStatus;
|
|
|
|
AiEngineDronePosition mDronePosition;
|
|
AiEngineGimbalServerUDPCommand mUdpCommand;
|
|
AiEngineGimbalServerUDPResponse mUdpResponse;
|
|
AiEngineGimbalServerActions mActions;
|
|
bool mIsAvailable;
|
|
QUdpSocket mReceiveUdpSocket; // UDP socket for receiving commands
|
|
|
|
private slots:
|
|
void processPendingDatagrams(void); // Handles incoming UDP messages
|
|
};
|