mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 06:46:34 +00:00
Fixed camera control related issues and
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QUdpSocket>
|
||||
|
||||
#include "aienginegimbalserver.h"
|
||||
#include "aienginegimbalserveractions.h"
|
||||
|
||||
|
||||
AiEngineGimbalServer::AiEngineGimbalServer(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
@@ -31,8 +32,12 @@ AiEngineGimbalServer::AiEngineGimbalServer(QObject *parent)
|
||||
|
||||
// Create and bind the new UDP socket for receiving commands
|
||||
mReceiveUdpSocket = new QUdpSocket(this);
|
||||
mReceiveUdpSocket->bind(QHostAddress::LocalHost, 45454);
|
||||
|
||||
|
||||
|
||||
// mReceiveUdpSocket->bind(QHostAddress::LocalHost, 45454);
|
||||
if (!mReceiveUdpSocket->bind(QHostAddress::LocalHost, 45454)) {
|
||||
qDebug() << "Failed to bind UDP socket:" << mReceiveUdpSocket->errorString();
|
||||
}
|
||||
// Connect the socket to handle incoming messages
|
||||
connect(mReceiveUdpSocket, &QUdpSocket::readyRead, this, &AiEngineGimbalServer::processUdpCommands);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,9 @@ private:
|
||||
AiEngineGimbalServerUDPResponse mUdpResponse;
|
||||
AiEngineGimbalServerActions mActions;
|
||||
bool mIsAvailable;
|
||||
QUdpSocket mReceiveUdpSocket; // UDP socket for receiving commands
|
||||
QUdpSocket *mReceiveUdpSocket; // UDP socket for receiving commands
|
||||
|
||||
private slots:
|
||||
void processPendingDatagrams(void); // Handles incoming UDP messages
|
||||
// void processPendingDatagrams(void); // Handles incoming UDP messages
|
||||
void processUdpCommands(void);
|
||||
};
|
||||
|
||||
@@ -623,7 +623,7 @@ static int convert_image_rga(image_buffer_t* src_img, image_buffer_t* dst_img, i
|
||||
if (drect.width != dstWidth || drect.height != dstHeight) {
|
||||
im_rect dst_whole_rect = {0, 0, dstWidth, dstHeight};
|
||||
int imcolor;
|
||||
char* p_imcolor = &imcolor;
|
||||
int* p_imcolor = &imcolor;
|
||||
p_imcolor[0] = color;
|
||||
p_imcolor[1] = color;
|
||||
p_imcolor[2] = color;
|
||||
|
||||
Reference in New Issue
Block a user