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