Fixed camera control related issues and

This commit is contained in:
Ubuntu
2025-04-01 15:38:31 +00:00
parent 1a189f1f1c
commit 1009af4a32
3 changed files with 12 additions and 6 deletions
+8 -3
View File
@@ -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);
}