Integration Report: Integration
Test 1
Project: QUT – 450 – G6
WP Name: Subsystem Refinement
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
1
of
75
Test Completion Date: 05/08/2025
Type of Test:
Integration Test
WP Number: WP-IMP-09, WP-OPI-09
Test Article:
Integration Test C- Operator Interfaces and
Image Processing and Target Acquisition
Systems Integration- Semester 2 Week 6
Test Equipment:
-
Raspberry Pi 400 + Kit
Raspberry Pi 4
Monitor
Oak-D Pro
See Section 4 for details of all Test Equipment.
System Requirements:
Directly Supported Requirements:
REQ-U-15-2-1, REQ-U-15-2-2, REQ-U-15-3, REQ-U-15-4, REQ-U-15-5, REQ-U-15-6, REQU-15-7, REQ-U-16, REQ-U-17, REQ-U-18, REQ-U-19, REQ-U-20, REQ-F-27-02, REQ-F-2701, REQ-P-21-2 / REQ-P-21-3 / REQ-P-21-4 / REQ-P-21-5, REQ-F-21-6, REQ-P-21-7
Partially Supported Requirements:
REQ-F-15, REQ-P-15-1, REQ-F-11, REQ-P-12, REQ-F-14, REQ-P-04
Indirectly Supported Requirements:
REQ-F-01, REQ-F-02, REQ-F-06, REQ-U/F-07, REQ-F/P-10, REQ-F-22, REQ-P-22, REQPH-09, REQ-PH-24
Test Operator(s):
Test Engineer(s):
Samuel Di Bartolo
Jasmine Jesi
Nima Wangchuk
WP Project Manager:
Samuel Di Bartolo
Jasmine Jesi
Nima Wangchuk
WP Supervisor:
Ryan King
Dr Felipe Gonzalez
Test Summary
This document presents the results of the integration test conducted on 26 August 2025,
evaluating the Operator Interfaces and Image Processing & Target Acquisition subsystems of
the QUTAS UAV system. The objective of the test was to verify the combined functionality of
these subsystems during both manual and autonomous flight operations. Live telemetry and
imagery data were collected, displayed, and logged through the Ground Control Station (GCS),
while target detection and localisation processes were validated to confirm subsystem readiness.
The outcomes of this integration test demonstrate progress toward system maturity, ensuring
continued flight development and supporting safe, reliable operation of the UAV in mission
scenarios.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
2
of
75
Test Completion Date: 05/08/2025
Revision Record
Document
Issue/Revision
Status
1.0
Description of Change
Initial Issue
2.0
Completed Report
A
Approved
Date
Approved
24/08/25
Ryan King
…
…
29/08/25
Ryan King
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
3
of
75
Test Completion Date: 05/08/2025
Table of Contents
Revision Record ......................................................................................................................... 2
Table of Contents ....................................................................................................................... 3
List of Figures and Tables .......................................................................................................... 4
Glossary ..................................................................................................................................... 5
1.
Introduction ........................................................................................................................ 7
1.1
Scope .......................................................................................................................... 7
1.2 Requirements ................................................................................................................... 7
1.3
Background .............................................................................................................. 10
2
Reference Documents ...................................................................................................... 11
3
Test Objectives ................................................................................................................. 14
4
Test Equipment ................................................................................................................ 15
5
Test Setup ......................................................................................................................... 17
5.1 Hardware Setup .............................................................. Error! Bookmark not defined.
5.2 Software Setup ............................................................... Error! Bookmark not defined.
Power Setup ..................................................................... Error! Bookmark not defined.
Motor Setup...................................................................... Error! Bookmark not defined.
Safety Configuration ........................................................ Error! Bookmark not defined.
6
Procedure ......................................................................................................................... 18
6.1 Pre-flight .................................................................................................................... 23
6.2 Manual flight test ....................................................... Error! Bookmark not defined.
6.3 Imaging and processing ............................................. Error! Bookmark not defined.
6.5 Autonomous flight test ............................................... Error! Bookmark not defined.
6.4 Post flight ................................................................... Error! Bookmark not defined.
7
Results .............................................................................................................................. 44
8
Analysis............................................................................................................................ 47
9
Conclusions and Recommendations ................................................................................ 48
10 Video Documentation: ........................................................ Error! Bookmark not defined.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
4
of
75
Test Completion Date: 05/08/2025
List of Figures and Tables
Table 1: List of Unit Test Equipment ....................................................................................... 16
Figure 1: UAV Ready for Test Flight ....................................... Error! Bookmark not defined.
Figure 2: QGC Power Setup Interface ..................................... Error! Bookmark not defined.
Figure 3: QGC Motor Calibration Interface ............................ Error! Bookmark not defined.
Table 2: Summary of Unit Test Results ................................... Error! Bookmark not defined.
Figure 4: Successful Test Flight ............................................... Error! Bookmark not defined.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
5
of
75
Test Completion Date: 05/08/2025
Glossary
Term /
Acronym
Definition
GCS
Ground Control Station
HLO
High Level Objective
S&R
Search and Rescue
SRUAV
Search and Rescue Unmanned Aerial Vehicle
UAS
Unmanned Aerial System
UAV
Unmanned Aerial Vehicle
QUT
Queensland University of Technology
QUTAS
Queensland University of Technology Aerospace Systems
MSR
Mars Search and Rescue
QGC
QGroundControl
PX4
PX4 Autopilot Firmware
MAVLink
Micro Air Vehicle Link Protocol
RC
Radio Control
IMU
Inertial Measurement Unit
EKF2
Extended Kalman Filter Version 2
RTL
Return to Launch
SBUS
Serial Bus (RC Receiver Protocol)
TELEM3
Telemetry Port 3 on the Pixhawk Flight Controller
USB–UART
USB to Serial Communication Interface
MAVROS
MAVLink interface for ROS
MTOW
Maximum Take-Off Weight
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
6
of
75
Test Completion Date: 05/08/2025
Term /
Acronym
Definition
ROS
Robot Operating System
Pixhawk 6X
PX4-compatible flight controller used in the project
DA16S+
Radio Transmitter and Receiver used for manual flight control
Companion
Computer
Onboard processing unit (e.g., Raspberry Pi) for advanced control and
perception
RVIZ
A 3D visualization tool for ROS that enables users to view sensor data,
robot state information, and simulation environments in real time.
RQT
A Qt-based graphical user interface framework for ROS that provides a
modular, plugin-based environment for system introspection and
debugging.
SSH
SSH enables encrypted communication between a client and a server,
allowing users to execute commands, transfer files, and perform
administrative tasks on remote systems.
GUI
Graphical User Interface
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
7
of
75
Test Completion Date: 05/08/2025
1. Introduction
This document details the finding of continued integration testing of the QUTAS UAV
system to verify the combined operation of the Imagery and Operator interfaces sub-systems.
The test involves conducting both manual and fully autonomous flight in addition to
component isolated testing to validate system readiness for continued flight development and
safety. The test aims to provide a progress checkpoint for the assessed subsystems to assist in
the provisions for further development.
1.1
Scope
This test verifies the progressive integration of the Operator Interfaces and Image and Target
Acquisition sub-systems by executing an autonomous flight with waypoint navigation. The
purpose is to confirm the operational readiness of the system to allow for further system
integration and flight testing.
The scope of the test requires collecting evidence of the following checkpoints:
•
•
•
•
•
•
•
•
•
•
•
Live imagery and telemetry transmitted from the UAV and logged/displayed on the
GCS.
The current flight mode, position, and altitude of the UAV displayed and logged.
Battery data logged and displayed in the GCS.
A real-time 3D visualization of the search area displayed on the GCS using ROS.
Results from a vibration-damping image capture quality test.
Progress towards the onboard computer identifying and localizing a target with an
accuracy of 2m.
The onboard computer storing ArUco marker IDs and locations with an accuracy of
2m.
An ROI coordinate published in the ROS network after target detection.
Live imagery from the onboard camera with a target detection overlay.
Confirmation that the UAV uses and interfaces with the QUT ASL ROS-based
software for control and navigation.
Live video from the onboard camera streamed to the GCS and displayed by the
operator interface using Rviz and RQT software.
1.2 System Requirements
This integration test will aim to address and demonstrate further progress towards Semester 2
project requirements, building on those successfully achieved in Semester 1. The test will aim
to validate or show progress towards the critical requirements listed above to enable
autonomous control in line with the customer needs. The table below addresses the system
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
8
of
75
Test Completion Date: 05/08/2025
requirements both directly and partially supported within the scope of this report and
provides mapping to its associated High Level Objective (HLO).
System
Requirement
Supported
by ITR
HLO
Scope Description
REQ-U-15-2-1
Directly
HLO-M-1 Navigation state (position, altitude, attitude)
/ HLO-M- displayed on GCS.
3
REQ-U-15-2-2
Directly
HLO-M-1 Mission status (e.g. armed, standby, landing)
/ HLO-M- displayed on GCS.
3
REQ-U-15-3
Directly
HLO-M-1 Current navigation goal displayed to
/ HLO-M- operator.
3
REQ-U-15-4
Directly
HLO-M-1 Battery data logged and displayed in the
/ HLO-M- GCS.
3
REQ-U-15-5
Directly
HLO-M-1 UAV position and attitude shown in RViz
/ HLO-M- 3D representation.
3
REQ-U-15-6
Directly
HLO-M-1 Live imagery displayed on the GCS
/ HLO-M- interface.
3
REQ-U-15-7
Directly
HLO-M-1 Target detection overlay displayed on
/ HLO-M- imagery feed.
3
REQ-U-16
Directly
HLO-M-3 Real-time graphical display of all sensor
information.
REQ-U-17
Directly
HLO-M-3 GCS vocalises target location to one
decimal place.
REQ-U-18
Directly
HLO-M-3 GCS vocalises detected target type.
REQ-U-19
Directly
HLO-M-3 Real-time 3D visualisation of the search
area in ROS.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
9
of
75
Test Completion Date: 05/08/2025
REQ-U-20
Directly
HLO-M-3 All data published and available via
standard ROS messages.
REQ-F-27-02
Directly
HLO-M-7 OPI subsystem demonstration (video
streaming, telemetry GUI, tmux
automation).
REQ-F-27-01
Directly
HLO-M-7 ITA subsystem demonstration (ROS topics,
ArUco detection, vibration test, localisation
methodology).
REQ-P-21-2
Directly
HLO-M-4 Human target (action figure) identified and
localised within 2 m.
REQ-P-21-3
Directly
HLO-M-4 Backpack target identified and localised
within 2 m.
REQ-P-21-4
Directly
HLO-M-4 Landing ArUco marker identified and
localised within 2 m.
REQ-P-21-5
Directly
HLO-M-4 10 ArUco waypoint markers identified and
localised within 2 m.
REQ-F-21-6
Directly
HLO-M-4 Detected ArUco IDs and coordinates stored
in system memory.
REQ-P-21-7
Directly
HLO-M-4 System robust against false positives in
target detection.
REQ-F-15
Partially
HLO-M-1 Transmission of telemetry and imagery to
/ HLO-M- GCS (verified in part, broader verification
3
across subsystems).
REQ-P-15-1
Partially
HLO-M-1 Communication rate suitable for live
/ HLO-M- monitoring (implicitly supported, not fully
3
measured).
REQ-F-11
Partially
HLO-M-2 Obstacle avoidance using occupancy grid
(visualised in OPI but verified elsewhere).
REQ-P-12
Partially
HLO-M-2 Stable flight tracking error <0.2 m (indirect
evidence through imagery/telemetry).
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
10 of
75
Test Completion Date: 05/08/2025
REQ-F-14
Partially
HLO-M-3 Integration of sensors and decision-making
(partially demonstrated in target acquisition,
autonomy verified later).
REQ-P-04
Partially
HLO-M-2 Optimal path-planning algorithm (ArUco
storage demonstrated; optimisation not fully
tested here).
1.3
Background
The Queensland University of Technology Aerospace Systems (QUTAS) is currently
developing an unmanned aircraft system (UAS) to conduct a search and rescue mission. This
task calls for the implementation of various sub-systems to design and manufacture a multirotor unmanned drone capable of achieving mission success through target verification,
payload deployment and ground control links. The mission is successfully completed when the
mission person, their respective items (backpack), and emergency items are located and
delivered. Specifically, Group 6 has been tasked with this mission in an astronomical setting
on Mars.
Integration Report: Integration
Test 1
2
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
11 of
75
Test Completion Date: 05/08/2025
Reference Documents
The acronymic conventions and test procedures referenced throughout this document are
supported by the following source materials:
Ref.
Code
RD/1
RD/2
RD/3
RD/4
Document
Description / Purpose
Customer Needs
Kit List
EGB349 Lecture Slides
EGB349 Tutorial Content
Full system setup documentation for software,
firmware, and ROS integration
Datasheet Raspberry Pi 4 Model B
Datasheet Raspberry Pi 400
Full system setup documentation for software,
firmware, and ROS integration
IMG Preliminary Design Report
IMG Unit Test Report 1
RD/37
DOC-CN
DOC-KL
DOC-LS
DOC-TC
UAV Setup Guides
(QUTAS 2025)
DOC-RP4
DOC-RP400
UAV Setup Guides
(QUTAS 2025)
QUT-349-G6-ITA-DES-1
QUT-349-G6-UTR-IMG01
QUT-349-G6-OPI-UTR01
QUT-349-G6-OPI-UTR02
QUT-349-G6-OPI-DES01
QUT-349-G6-IMG-ITR01
QUT-349-G6-OPI-ITR-01
RD/39
DOC-DAI
DepthAI Software Documents
RD/40
Maintenance Logs
RD/41
QUT-349-G6MaintainLog
DOC-OCV
RD/42
DOC-OAK
OAK-D Pro Datasheet
RD/43
DOC-ROS
ROS Noetic Wiki
RD/5
RD/12
RD/13
RD/14
RD/26
RD/27
RD/28
RD/29
RD/30
RD/35
OPI Unit Test Report 1
OPI Unit Test Report 2
OPI Preliminary Design Report
IMG Integration Test Report 1
OPI Integration Test Report 1
OpenCV Documentation
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
12 of
75
Test Completion Date: 05/08/2025
3 System Requirements
The system requirements addressed by this test are grouped into three categories: those
directly validated, those partially addressed or supported, and those for which this test
demonstrates progression or serves as a prerequisite. These are detailed below.
3.1 Directly Validated System Requirements
REQ-F-15 – Telemetry to GCS
Imagery including raw imagery and overlayed detection imagery was successfully
transmitted from the onboard computer the GCS, allowing real-time monitoring during the
flight.
REQ-F-27-02 – Operator Interface Subsystem Progress
The GCS successfully monitored telemetry and mission execution. This lays the groundwork
for advanced operator interface features.
REQ-U-15-6 – Live Imagery
The onboard RGB camera streamed live imagery to the GCS via ROS topics, supporting
situational awareness.
REQ-U-15-7 – Imagery Overlay
Detected targets generated visual overlays in the live imagery stream, allowing operators to
identify Regions of Interest (ROI).
REQ-U-16 – Graphical Sensor Display
All sensor telemetry (pose, battery, imagery, mission status) was graphically displayed on the
GCS interface for operator monitoring.
REQ-F-27-01 – Image Processing Subsystem Progress
A vibration-damping camera mount was prototyped and installed. While target tracking was
demonstrated, further refinement is required to improve robustness against false positives.
REQ-P-21-7 – Robustness Against False Positives
The system showed resistance to false positives during ArUco detection, though extended
testing under cluttered conditions is still needed.
3.2 Supported / Partially Addressed System Requirements
REQ-P-13 – Autonomous Landing Accuracy
Landing on the ArUco marker was achieved within the specified tolerance of 50 cm.
REQ-P-23 – Use of Customer-Provided Equipment
The test employed the Pixhawk 6X, DA16S+ transmitter, and Holybro X500 V2 frame as
supplied by the customer, confirming compatibility.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
13 of
75
Test Completion Date: 05/08/2025
REQ-P-28 – Systems Engineering Approach
Battery logs, subsystem documentation, and integration planning were recorded, contributing
to systematic project management and traceability.
3.3 Indirectly Progressed / Pre-requisite for System Requirements
REQ-F-06 – Fully Autonomous Operation
Successful waypoint navigation, target diversion, and payload deployment confirm the
foundation of the system’s autonomy loop, enabling future mission-level autonomy.
REQ-F-27-05 – Payload Subsystem Progress
The tested payload release mechanism demonstrated functional operation, though final
integration with mission logic will occur in subsequent tests.
REQ-P-28 – Documentation of Systems Engineering
Test procedures, logs, and integration evidence documented in this report contribute to
systems engineering traceability.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
14 of
75
Test Completion Date: 05/08/2025
4 Test Objectives
The primary objective of this integration test C is to verify the continued integration of the
Imagery and Operator interfaces sub-systems carried out through autonomous flight testing in
Weeks 5 and 6 practicals in semester 2 of 2025.
Specifically, the test aims to:
•
•
•
•
•
•
•
•
•
•
•
Live imagery and telemetry transmitted from the UAV and logged/displayed on the
GCS.
The current flight mode, position, and altitude of the UAV displayed and logged.
Battery data logged and displayed in the GCS.
A real-time 3D visualization of the search area displayed on the GCS using ROS.
Results from a vibration-damping image capture quality test.
Progress towards the onboard computer identifying and localizing a target with an
accuracy of 2m.
The onboard computer storing ArUco marker IDs and locations with an accuracy of
2m.
An ROI coordinate published in the ROS network after target detection.
Live imagery from the onboard camera with a target detection overlay.
Confirmation that the UAV uses and interfaces with the QUT ASL ROS-based
software for control and navigation.
Live video from the onboard camera streamed to the GCS and displayed by the
operator interface using Rviz and RQT software.
Integration Report: Integration
Test 1
5
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
15 of
75
Test Completion Date: 05/08/2025
Test Equipment
Item
Holybro X500 V2
Frame Kit
Pixhawk 6X Flight
Controller
DA16S+ Radio
Controller
DA16S+ Radio
Receiver
USB–UART Cable
4× Brushless Motors
+ ESCs
4S LiPo Battery
(14.8 V)
Power Distribution
Board (PDB)
Battery Elimination
Circuit (BEC)
QGroundControl
(QGC)
Laptop with QGC
Installed
Flat Open Test Area
GCS Monitor
GCS Raspberry Pi
400
Onboard Raspberry
Pi 4
Oak-D pro
QUT UAS power
PCB
Payload servos
carry case
Payload release
attachment
3D-printed battery
protection
Description
Assembled UAV airframe with landing gear and integrated motor
mounts.
PX4-compatible flight controller responsible for low-level flight
control and position hold.
16-channel transmitter used to arm the UAV and for control when
in “position” flight mode.
Paired receiver mounted on the UAV, connected to Pixhawk via
SBUS.
Connects Pixhawk TELEM3 to Raspberry Pi 4 USB port for
MAVLink communication.
Power and thrust units responsible for vertical lift and controlled
stability.
Power source for propulsion and flight controller subsystems.
Interfaces between the battery and ESCs for clean power delivery.
Voltage regulator that steps down battery voltage to a stable 5 V
rail for flight controller and receiver.
Used to configure PX4 parameters and monitor telemetry.
Connected via USB to the DA16S+ receiver during preflight
setup.
Used as secondary, redundant ground control station.
Controlled indoor or outdoor environment for performing lowaltitude hover testing.
Ground Control Station Monitor running ROS tools for
visualisation and command.
GSC Companion computer for GCS visualisation and processing.
Companion computer for onboard image processing and ROS
integration.
Stereo depth RGB camera used for ArUco detection and
localisation.
Custom PCB managing payload-specific power routing and
protection.
Servo motors for actuating the payload release mechanism.
Mounted structure on the drone to hold and protect the payload
prior to release.
Mechanism controlled by servos to release payload during test.
Custom protective enclosure designed to secure the battery and
prevent damage during hard landings.
Integration Report: Integration
Test 1
IP43 rated cowl
Anti-vibration
attachment
Tools
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
16 of
75
Test Completion Date: 05/08/2025
Protective cover mounted to the top deck to shield components
from dust and splashes.
Mounting mechanism to reduce vibration transfer to onboard
sensors and camera, ensuring vision is clear and sensors are not
damaged.
Set of basic tools required for UAV assembly, tuning, and
maintenance.
Table 1: List of Unit Test Equipment
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
17 of
75
Test Completion Date: 05/08/2025
6 Test Setup
The integration test was conducted on 26 August 2025 in the QUT flight arena O-134, with the
objective of evaluating the combined functionality of the Operator Interfaces and Image
Processing & Target Acquisition subsystems. The setup was designed to simulate both manual
and autonomous flight operations while ensuring reliable logging, visualisation, and
communication of imagery and telemetry data between the UAV and the GCS. For detailed
description of the Test Setup for the Operator Interfaces and Imaging Subsystems, please refer
to the Operator Interfaces Preliminary Design Report 1- RD/30 and IMG Preliminary Design
Report- RD/26. To complete this integration test, the following information details the required
Hardware and Software components:
5.1 Hardware
EQUIPMENT TYPE
Raspberry Pi 400 (GCS)
Display Monitor with HDMI to Micro HDMI Connection
UAV onboard computer (Raspberry Pi 4)
Oak-D Pro Camera
Pixhawk autopilot
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
18 of
75
Test Completion Date: 05/08/2025
5.2 Software
REQUIRED SOFTWARE
Ubuntu MATE 20.04
ROS Noetic
MAVROS
RViz
RQT
YOLOV5
DepthAI Publisher Nodes
ArUco Marker Detection Library – OpenCV
Matlab
5.2.1 Training for YoloV5 target detection
Training the YoloV5 target detection neural network is essential for further development of the
I&TA subsystem and is essential for integration with the navigation subsystem.
5.2.1.1
Collecting data for YoloV5 training
Before beginning the training, data must be collected to train the model with. Typically, the
best way to do this is to capture a video recording that contains frames with each target type
from different angles. With the ROS architecture and navigation subsystem this is easy to
complete. Follow the guides outlined in Integration Test Report A to record a rosbag of a
standard flight. You may want to perform the manual flight and hover over the targets to get
more imagery and data.
Once you have the rosbag, use the matlab code in Appendix 1: Matlab Code for Rosbag
Extraction: to convert the imagery from the rosbag into a mp4 video file. Note: your rosbag
must be in the same file location as the Matlab script for this to work. Once you have the mp4,
the data collection stage has been completed.
Integration Report: Integration
Test 1
5.2.1.2
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
19 of
75
Test Completion Date: 05/08/2025
Labelling data using Roboflow
Labelling the dataset is an important step in developing an effective target acquisition system.
The quality and how the data is labelled can have a significant impact on the effectiveness of
your model and can significantly impact your model’s ability to correctly identify targets.
Begin by signing up to Roboflow. Once signed in you should reach the Projects page. Create a
new project and fill out the sections as shown below then press “Create Public Project”:
Figure 1: Project creation menu Roboflow
Once your project is created, drag and drop your mp4 file into Roboflow from the Upload Data
section. Adjust the number of frames as you see fit but it is recommended to include at least
2000 frames. Once the data is uploaded select the annotate menu and you should be brought to
the following page:
Figure 2: Annotation menu Roboflow
Select Start Annotating. For each image draw a box around any of the 2 desired targets and
label using either the “person” or “bag” identifier. Be sure to only capture the target within the
bounding box. There are several tools that can be used to speed up this process such as the auto
labeller. Continue to label the images and skip any images that don’t contain a target.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
20 of
75
Test Completion Date: 05/08/2025
Figure 3: Roboflow image labelling.
Once finished labelling, add the images to the dataset and divide them among the 3 folders
(Train, Valid, Test). Once the dataset is finalised, click the “Versions” tab and then click “New
Version”:
Figure 4: Version manager Roboflow
Fill out the form as shown above being sure to add the Augmentations then click “Continue”
and then click “Create”
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
21 of
75
Test Completion Date: 05/08/2025
Once the Version is created, click Download Dataset and fill out the form as shown and click
continue:
Figure 5: Download code generator Roboflow
Copy and save the generated URL for later use in training.
5.2.1.3
Training and Deployment to OAK-D Pro
To effectively train the object detection model, use the customer provided Jupyter Notebook
which can be found here:
https://github.com/Piaktipik/depthai_publisher/blob/yolo_detector/YoloV5_training_450.ipyn
b
Open the notebook in Google Colab and connect to a cloud port to make use of the server
resources to train the model. Follow the guide in the Jupyter Notebook until you reach the
following
point:
In this command line, replace the URL with the Roboflow Version URL. Continue to execute
code and progress through the Jupyter notebook.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
22 of
75
Test Completion Date: 05/08/2025
Once the training section shown below is reached, consider changing the parameters of the
training procedure namely the number of epochs in the train will have the most significant
impact. It is recommended to use between 10 and 50 epochs for an effective model.
Continue and run the validation. After this runs, navigate to the the best.pt file found in the
following file location in the Colab environment: runs/train/exp*/weights/best.pt. Download
this file and save it somewhere on your computer.
The last step is to convert the best.pt into a .blob and .json file to be integrated into the
Depthai_Publisher yolo deployment scripts. To do this, use the conversion tool for automatic
ecport for OAKs:
https://tools.luxonis.com/
Fill out the above form as shown and press submit. Wait for the files to be downloaded and
then extract the best.json file and best_openvino_2022.1_6shave.blob file. These will need to
be transferred to the onboard computer to work.
5.2.2 Setup of Depthai and Imagery code
To setup Depthai and Imagery code on the onboard Pi, first establish and SSH connection and
navigate to the catkin_ws using: cd catkin_ws. Then follow the installation process from:
https://github.com/Piaktipik/depthai_publisher/tree/yolo_detector
After the github is cloned, move to the depthai_publisher folder: cd src/depthai_publisher
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
23 of
75
Test Completion Date: 05/08/2025
From here change the branch to the yolo_detector branch: git checkout yolo_detector
Be sure to run catkin_make from catkin_ws directory after changing branches.
Then navigate to the models folder and copy across the .json and .blob files to this folder
location (See Figure 6)
Figure 6: File location for models
The final process is to update the code in the aruco_subscriber and
dai_publisher_yolov5_runner ROS nodes. The updated code can be found in Appendix 2:
aruco_subscriber and Appendix 3: dai_publisher_yolov5_runner.
7
Procedure
This procedure documents the approach undertaken to conduct the integration test and validate
the combined operation of the Operator Interfaces and Imagery sub-systems. To test the various
objectives, a range of tests were undertaken in both the flight test area as organised by PM and
in the S-Block laboratory where equipment was able to be isolated for usage. The procedure
will document each objective as a subheading with proof of integration in the body of each
section:
6.1 Live imagery and telemetry transmitted from the UAV and logged/displayed
on the GCS
Test 6.1 verifies that the Operator Interfaces subsystem can successfully receive both imagery
and telemetry from the UAV in real-time, display the data on the Ground Control Station
(GCS), and log the information for subsequent analysis. The telemetry parameters of interest
include UAV state, position, and orientation published by MAVROS, while the imagery stream
consists of raw camera frames transmitted over ROS.
The purpose of the test is to demonstrate system integration between the Autopilot and
Navigation, Image and Target Acquisition, and Operator Interfaces subsystems, ensuring that
the GCS provides mission operators with the required situational awareness, allowing for the
mission to be completed in an optimised and safe matter, while also supporting post-mission
review through the process of ROS bag logging.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
24 of
75
Test Completion Date: 05/08/2025
To complete this test, the following procedure was initiated:
1. Complete steps 1-9 pertaining to the GCS Software set up in Section 5.2 of
Integration Report A (RD/44).
2. Verify Telemetry connection through the RViz plugin in RQT.
3. Ensure a live camera feed is established in the Image viewer plugin and is subscribed
to the /processed_aruco/image/compressed and monitor the live imagery on the GCS
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
25 of
75
Test Completion Date: 05/08/2025
4. Ensure a terminal in the tmux session is dedicated to enabling rosbag logging for post
mission analysis
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
26 of
75
Test Completion Date: 05/08/2025
6.2 The current flight mode, position, and altitude of the UAV displayed and
logged
Test 6.2 verifies that the GCS is able to receive, display, and log critical flight status data from
the UAV. Specifically, the GCS must show the UAV’s flight mode, position (latitude, longitude,
relative position), and altitude (above ground level) in real time. All data is displayed on the
GCS through the subscription of appropriate topics and logged via ROS bag for post-mission
analysis, ensuring traceability and operational accountability.
To complete this test, the following procedure was initiated:
1. Complete steps 1-9 pertaining to the GCS Software set up in Section 5.2 of
Integration Report A (RD/44).
2. In the automated tmux session, locate the /mavros/local_position/pose and
vision_pose/pose terminals
3. Run these respective terminals using the rostopic echo command to enable the
realtime UAV position and altitude data
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
27 of
75
Test Completion Date: 05/08/2025
4. In the RQT window find the locate mavros GUI terminal. This will enable the mission
operator to view the UAV connection status and flight mode state.
5. Use the allocated rosbag terminal to log this data. This is saved to the UAV Raspberry
Pi 4 and can be accessed to complete post mission analysis
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
28 of
75
Test Completion Date: 05/08/2025
6.3 Battery data logged and displayed in the GCS
Test 6.3 verifies that the Operator Interfaces subsystem can both receive and display the UAVs
battery data in real time which is particularly critical during mission testing. The battery data
collected includes topics capebale of publishing the voltage, current and remaining capacity,
all of which are transmitted via mavros topics. This is logged as a visual element in the RQT
GUI which provides an interactive display of the battery percentage when connected to the
UAV. To further inform the operator, code has been deployed to provide the operator with a
low battery warning pop up ensuring that operator is notified and has time to react accordingly.
Currently, the python node implemented is configured to produce a pop up when the battery
falls below 20%, however this code will be further refined in later weeks to produce further
notifications and will also incorporate the vocalisation feature to announce the pop ups
accordingly.
To complete this test, the following procedure was initiated:
1. Complete steps 1-9 pertaining to the GCS Software set up in Section 5.2 of
Integration Report A (RD/44)
2. Navigate to the RQT GUI and locate the Generic HUD plugin window. Through the
subscription of the /battery/voltage topic, the battery percentage will be displayed in
this window.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
29 of
75
Test Completion Date: 05/08/2025
3. To produce the low battery message, the following source code was implemented on
the GCS and saved locally:
4. To enable the low battery, pop up during mission testing, the following python source
code must be initiated in a new terminal (C) on the GCS:
python3 ~/catkin_ws/src/simple_batt_warn.py
5. Finally, a rostopic echo must be called in a new terminal (D) that subscribes to the
/rosout topic and filters the logs to only show the relevant lines to the battery.
rostopic echo /rosout | grep simple_batt_warn
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
30 of
75
Test Completion Date: 05/08/2025
6.4 A real-time 3D visualization of the search area displayed on the GCS using
ROS
Test 6.4 verifies that the GCS successfully provides the operator with real-time 3D visualisation
of the search area using ROS visualisation tools. The objective is to display the UAV state,
odometry, grid maps, operator input, and markers, allowing the operator to monitor mission
progress within a 3D ROS environment, enhancing situational awareness for the operator and
allowing for a clear view of the test area, obstacles and relative UAV position.
To verify this test, the following procedure was initiated:
1. Complete steps 1-9 pertaining to the GCS Software set up in Section 5.2 of
Integration Report A (RD/44). Ensure all terminals are running
2. In the RQT display, navigate to the ensure the following topics are subscribed too*:
a. /uav/status
b. /uavasr/odom
c. /grid
d. /move_base_simple/goal
e. /Visualization_marker_array
*A link to evidence of the listed RViz displays can be found here:
https://youtube.com/shorts/dk3q4pdKH-E
3.
Using the command window in the automated tmux session, push spar navigation
commands to enable autonomous flight on the UAV. Use RViz to monitor the UAVs
positional information on the map in real time. Evidence can be found here:
https://youtube.com/shorts/ZHQlt7CYM2M?feature=share
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
31 of
75
Test Completion Date: 05/08/2025
6.5 Live video from the onboard camera streamed to the GCS and displayed by
the operator interface using Rviz and RQT software
Test 6.5 verifies the integration between the Image Processing and Operator Interfaces
subsystem can receive a live video stream from the UAV’s onboard camera, transmit it to the
GCS, and display it to the operator in real time. In this test, the GCS subscribes to topics
published by the ITA subsystems over ROS and can be viewed in the RQT Image Viewer.
To verify this test, the following procedure was initiated:
1. Complete steps 1-9 pertaining to the GCS Software set up in Section 5.2 of
Integration Report A (RD/44).
2. Ensure roscore is running and launch the Depth AI node to published an RGB image
stream to the /depthai_node/image/compressed.
3. Next launch the aruco_subscriber to subscribe to the image feed and output detected
markers to /aruco_detections.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
32 of
75
Test Completion Date: 05/08/2025
4. Use the RQT image viewer to visualise the compressed RGB feed
5. Verify that detection overlays appear in the Image viewer when the aruco markers
enter the camera view
Full Video can be seen here: https://youtu.be/g-mvrd3Jyjw
6. For the purpose of documenting and post mission analysis, ensure that the rosbag
terminal in the automated tmux session is launched to capture the image and telemetry
data
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
33 of
75
Test Completion Date: 05/08/2025
6.6 Results from a vibration-damping image capture quality test- Sam/ Nima
Test 6.6 aims to capture the efficacy of the vibration damping mount during standard flight
procedures. To capture the necessary data for this test, an imagery link via distributed ROS was
established which enabled live imagery monitoring. Furthermore, the captured imagery was
published within the ROS network which could be reviewed through the recorded rosbag.
The standard procedure for this test was designed to easily integrate with the standard flight
procedures outlined in Integration Test Report A.
1) Conduct preflight setup and checks outlined in Integration Test Report A
2) From the run349 tmux environment run the following code:
• rosrun depthai_publisher dai_publisher_yolov5_runner
• rosrun aruco_subscriber
3) From the GCS terminal run rqt to show visualisations and make sure the
camera feed can be seen
4) Before takeoff run this command in run349 tmux pane : rosbag record -a
5) Launch the takeoff by running: rosrun spar_node auto_roi_deploy
6) Monitor the camera during flight (you don’t need to be continually observant
as the rosbag will )
7) Once the flight has concluded, click in the rosbag tmux pane (the one in
which rosbag record -a was run) and ctrl+c to finish the rosbag.
8) To make sure the rosbag was saved check in the desktop directory. If the
rosbag has the extension .active it means the rosbag didn’t correctly close
and the process must be repeated.
9) Extract the rosbag using scp terminal command on a personal laptop or
computer connected to the same wifi network as the onboard pi
10) Once the rosbag is on a personal laptop or computer, open webviz
11) Drag and drop the rosbag (.bag) file into the webviz page
12) Using the slider at the bottom of the page, play through the flight and note
any blurriness, vibrations, or camera quality issues that could be attributed to
vibrations.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
34 of
75
Test Completion Date: 05/08/2025
6.7 Progress towards the onboard computer identifying and localizing a target
with an accuracy of 2m- Sam/ Nima
Test 6.7 aimed to verify and quantify the precision of the target localisation component of the
Imagery and Target acquisition subsystem. This test involved testing not only the relative
position estimates for target acquisition but also demonstrating the integration with the mavros
drone pose rostopic to ensure the global position of the targets were effectively published.
It was noted that this subsystem could not be thoroughly tested during flight so a simple
verification test bench was completed instead of full flight integration which will be completed
during a flight test on 02/09/2025.
The following procedure was used to validate the subsystem:
1) Connect necessary peripherals to the onboard computer: camera, monitor and
wireless keyboard and mouse according to Figure 11.
Figure 7: Camera connection setup
2) Connect power supply to the raspberry pi and wait for the OS to boot.
3) Open a terminal: ctr+alt+T
4) In terminal: type run349 to launch the tmux terminal: you should see the below
setup:
Figure 8: Picture of run349 panes
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
35 of
75
Test Completion Date: 05/08/2025
5) Run the commands shown in the run349 panes launch and visualise the image
processing. Be sure to do them in order and in separate tmux panes:
- rosrun depthai_publisher dai_publisher_yolov5_runner
- rqt_image_view
- rostopic pub -r 10 /mavros/local_position/pose
geometry_msgs/PoseStamped "header:
frame_id: 'map'
pose:
position: {x: 5.0, y: 5.0, z: 2.5}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}"
The last code here simulates the mavros position of the drone and makes the
drone “think” it is at a position (x =5, y = 5, z=2.5). This is to check that the global
pose estimation works and not just relative pose.
6) Once rqt_image_view has launched you should be able to see the camera
footage being displayed in a window as shown below
7) Verify that the position labelled on the image are relatively correct using the
following criteria:
- Target in top right corner:
x>5, y<5
- Target in bottom right corner:
x<5, y<5
- Target in top left corner:
x>5, y>5
- Target in bottom left corner:
x<5, y>5
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
36 of
75
Test Completion Date: 05/08/2025
8) Verify that the position is correctly published by running: rostopic echo
/marker_locations/id/bag or rostopic echo /marker_locations/id/person
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
37 of
75
Test Completion Date: 05/08/2025
6.8 The onboard computer storing ArUco marker IDs and locations with an
accuracy of 2m- Sam/ Nima
Test 6.8 aims to validate the Imagery and Target Acquisition subsystem’s functionality to
localise and publish the position and ID or detected ArUco markers within the global/map
coordinate frame. This test involved validation of the integration between the mavros pose
estimate and the aruco detection scripts such that the global position of the markers was
correctly published and recorded during flight.
The test procedure was conducted during routine flight and contains a flight procedure to a
standard flight. To alleviate the repetition across reports the pre flight setup can be found in
Integration Test Report A
-
13) Conduct preflight setup and checks outlined in Integration Test Report A
14) From the run349 tmux environment run the following code:
• rosrun depthai_publisher dai_publisher_yolov5_runner
• rosrun aruco_subscriber
15) From the GCS terminal run rqt to show visualisations and make sure the
camera feed can be seen
16) Before takeoff run this command in run349 tmux pane : rosbag record -a
17) Launch the takeoff by running: rosrun spar_node auto_roi_deploy
18) Monitor the camera during flight (you don’t need to be continually observant
as the rosbag will )
19) Once the flight has concluded, click in the rosbag tmux pane (the one in
which rosbag record -a was run) and ctrl+c to finish the rosbag.
20) To make sure the rosbag was saved check in the desktop directory. If the
rosbag has the extension .active it means the rosbag didn’t correctly close
and the process must be repeated.
21) Extract the rosbag using scp terminal command on a personal laptop or
computer connected to the same wifi network as the onboard pi
22) Once the rosbag is on a personal laptop or computer, open webviz
23) Drag and drop the rosbag (.bag) file into the webviz page
24) Add the following pannels shown below in Figure 9.
25) Use the player along the bottom to the first instance in which the marker is
detected. Compare the marker location and drone location and verify the
estimation with the following criteria
Target in top right corner:
x>5, y<5
Target in bottom right corner:
x<5, y<5
Target in top left corner:
x>5, y>5
Target in bottom left corner:
x<5, y>5
Integration Report: Integration
Test 1
Figure 9: Picture of webviz environment
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
38 of
75
Test Completion Date: 05/08/2025
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
39 of
75
Test Completion Date: 05/08/2025
6.9 An ROI coordinate published in the ROS network after target detectionSam/ Nima
Test 6.9 aims to verify that the coordinates of both markers and targets are published within the
ROS network. As the publication of these topics is to be integrated with the navigation
subsystem, the information is published as a PointStamped geometry message which includes
xyz coordinates as well as a timestamp and header information.
The procedure for this test has already been completed within test 6.8 and 6.7 and can be
validated by running any of the following scripts in the terminal during test procedure:
-
rostopic echo /marker_locations/id/person
rostopic echo /marker_locations/id/bag
rostopic echo /marker_locations/id/<ID> : where <ID> is the ID of a detected
ArUco marker
If a result is displayed upon running these commands, then the coordinate has been correctly
published within the ROS network. Alternatively, visualize the rostopics in the above
commands through webviz if a rosbag has been recorded during the test procedure. The
procedure for visualisation in webviz using a recorded rosbag has been outlined in 6.8.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
40 of
75
Test Completion Date: 05/08/2025
6.10 Live imagery from the onboard camera with a target detection overlaySam/Nima
Test 6.10 aims to verify the functionality of the target detection overlay as part of the imagery
and target acquisition subsystem. Target detection refers to the detection of both persons and
bag targets on the floor. As these targets are challenging over identify through simple image
processing techniques (thresholding, filtering and blob detection), a custom YoloV5s model
was trained to perform this detection and deployed on the OAK-D Pro camera. The targets on
which the model was trained have been shown in
Figure 10: Pictures of Targets within the test environment
To verify the functionality of the detection overlays, the following procedure was implemented:
26) Connect necessary peripherals to the onboard computer: camera, monitor
and wireless keyboard and mouse according to Figure 11.
Figure 11: Camera connection setup
27) Connect power supply to the raspberry pi and wait for the OS to boot.
28) Open a terminal: ctr+alt+T
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
41 of
75
Test Completion Date: 05/08/2025
29) In terminal: type run349 to launch the tmux terminal: you should see the
below setup:
Figure 12: Picture of run349 panes
30) Run the commands shown in the run349 panes launch and visualise the
image processing. Be sure to do them in order and in separate tmux panes:
- rosrun depthai_publisher dai_publisher_yolov5_runner
- rqt_image_view
31) Once rqt_image_view has launched you should be able to see the camera
footage being displayed in a window as shown below
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
42 of
75
Test Completion Date: 05/08/2025
32) Show images of the targets to the camera and test their detections, note if
there are any false positives. Also note the average frame rate displayed on
the window.
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
43 of
75
Test Completion Date: 05/08/2025
6.11 Confirmation that the UAV uses and interfaces with the QUT ASL ROSbased software for control and navigation- Sam/Nima
Test 6.11 aims to validate the integration between the Imagery and Target acquisition subsystem
and the navigation subsystem, namely that the information published by the I&TA subsystem
can be received by the navigation subsystem and successfully acted upon by the navigation
subsystem. The intention of this test was to implement this functionality within the hardware
however due to limitations with timing and testing opportunities, this test was only completed
through simulation and not practical flight test.
In the simulation run, the UAV calculated the locations of ArUco markers and objects (man &
backpack). It then sent these locations via ROS topics using the point stamp format. This
matched the real system’s data format. This made sure the information could be used by other
parts of the system without problems
STEPS:
* Based on simulation sending the location via rostopic with exact same format, we
successfully see diversion
Integration Report: Integration
Test 1
8
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
44 of
75
Test Completion Date: 05/08/2025
Results
The following table summarises the results of the Integration Test conducted across Weeks 5
and 5 in Semester 2. Each action was designed to validate the correct operation of the respective
subsystems.
Subsystem
Test Name
Description of Test
Result/
Notes
Pass/
Shows
Progress
Towards
OPI
Live imagery and
telemetry transmitted
from the UAV and
logged/displayed on
the GCS.
33) Live imagery stream
successfully detected on
UAV
34) UAV Position and flight
state are visualised in RViz
OPI
The current flight
mode, position, and
altitude of the UAV
displayed and logged.
35) The Operator Interfaces
subsystem successfully
displays and logs UAV
flight mode, position, and
altitude on the GCS. Data
were received in real time,
visualised using RViz, and
logged for post-flight
analysis.
Pass/
Shows
Progress
Towards
OPI
Battery data logged
and displayed in the
GCS.
36) The Operator Interfaces
subsystem successfully
receives, displays, and logs
UAV battery telemetry
data. The GCS provides
situational awareness via
both visual indicators and
automated low-battery
warnings, ensuring the
operator can respond to
critical energy constraints.
Pass/
Shows
Progress
Towards
OPI
A real-time 3D
visualization of the
search area displayed
37) The Operator Interfaces
subsystem successfully
displayed the UAV’s state,
odometry, mission area
grid, operator-defined
Pass/
Shows
Progress
Towards
Integration Report: Integration
Test 1
on the GCS using
ROS.
OPI
Live video from the
onboard camera
streamed to the GCS
and displayed by the
operator interface using
Rviz and RQT
software.
IMG
Results from a
vibration-damping
image capture quality
test.
IMG
Progress towards the
onboard computer
identifying and
localizing a target with
an accuracy of 2m.
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
45 of
75
Test Completion Date: 05/08/2025
goals, and detected targets
in real time using RViz.
This integrated 3D
visualization enhances
operator situational
awareness and supports
mission execution.
The GCS
successfully
receives and
displays
imagery from
the ITA
subsystem,
allowing for
the
visualisation
of ArUco
marker
detections.
This validates
the crosssubsystem
integration
between the
two
subsystems
and allows for
mission data
to be logged
and stored for
future system
enhancements.
The camera effectively produces
constant and steady camera footage.
Minimal blur is present throughout
flight even during fast movements.
Camera’s autofocus functionality
improves stability.
Camera can effectively identify and
localise targets using yolov5 custom
trained model. Yet to numerical
quantify the accuracy of the
localization. Software effectively
integrates with mavros pose data.
Pass/
Shows
Progress
Towards
Pass
Shows
Progress
Towards
Integration Report: Integration
Test 1
IMG
The onboard computer
storing ArUco marker
IDs and locations with
an accuracy of 2m.
IMG
An ROI coordinate
published in the ROS
network after target
detection.
IMG
Live imagery from the
onboard camera with a
target detection
overlay.
IMG
Confirmation that the
UAV uses and
interfaces with the
QUT ASL ROS-based
software for control
and navigation.
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
46 of
75
Test Completion Date: 05/08/2025
Camera can effectively identify and
localise ArUco markers using opencv
aruco detector library. Yet to quantify
the numerical accuracy of the
localisation. Software effectively
integrates with mavros pose data.
Marker and Target coordinates are
effectively transmitted in the ROS
network. Topics have the correct
structure (PointStamped) to be
integrated with navigation subsystem.
Detected markers and targets both
captured by bounding boxes which
can be visualised through rqt. The
bounding boxes only capture the
necessary details and don’t extend
beyond the target or marker.
The rostopics published by the I&TA
subsystem can be effectively
integrated with the software for
control and navigation. This has been
demonstrated through simulation
however shows promising signs of
easy integration on hardware.
Shows
Progress
Towards
Pass
Pass
Shows
Progress
Towards
Integration Report: Integration
Test 1
9
Analysis
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
47 of
75
Test Completion Date: 05/08/2025
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
48 of
75
Test Completion Date: 05/08/2025
10 Conclusions and Recommendations
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
49 of
75
Test Completion Date: 05/08/2025
Appendices
Appendix 1: Matlab Code for Rosbag Extraction:
function outVideoPath = depthai_bag_to_video(bagPath, outVideoPath, preferCompressed)
arguments
bagPath (1,1) string
outVideoPath (1,1) string = ""
preferCompressed (1,1) logical = true
end
assert(isfile(bagPath), "Bag not found: %s", bagPath);
compressedTopic = '/depthai_node/image/compressed';
rawTopic
= '/depthai_node/image/raw';
camInfoTopic
= '/depthai_node/camera/camera_info';
fprintf("Opening bag: %s\n", bagPath);
bag = rosbag(bagPath);
% Pick topic order
if preferCompressed
topicOrder = {compressedTopic, rawTopic};
else
topicOrder = {rawTopic, compressedTopic};
end
% Choose first topic with messages
chosenTopic = '';
chosenSel = [];
for k = 1:numel(topicOrder)
tk = topicOrder{k};
try
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
50 of
75
Test Completion Date: 05/08/2025
sel = select(bag, 'Topic', tk);
if sel.NumMessages > 0
chosenTopic = tk;
chosenSel = sel;
break;
end
catch
end
end
if isempty(chosenTopic)
error("No messages found on '%s' or '%s' in the bag.", compressedTopic, rawTopic);
end
fprintf("Using topic: %s (messages: %d)\n", chosenTopic, chosenSel.NumMessages);
% Default output path
if outVideoPath == ""
[bagDir, bagFile] = fileparts(bagPath);
safeTopic = strrep(chosenTopic, '/', '_');
outVideoPath = fullfile(bagDir, sprintf("%s%s.mp4", bagFile, safeTopic));
end
msgs = readMessages(chosenSel, 'DataFormat', 'object'); % try objects first
if isempty(msgs)
msgs = readMessages(chosenSel, 'DataFormat', 'struct'); % fallback to struct
end
% Estimate FPS
t = chosenSel.MessageList.Time;
estFPS = estimateFPS(t);
fprintf("Estimated FPS: %g\n", estFPS);
% Probe a decodable frame
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
51 of
75
Test Completion Date: 05/08/2025
[firstImg, firstIdx] = findFirstDecodable(msgs);
if isempty(firstImg)
% If compressed failed, try raw automatically
if strcmp(chosenTopic, compressedTopic)
warning("Could not decode any frame on %s. Falling back to %s ...", compressedTopic,
rawTopic);
sel2 = select(bag, 'Topic', rawTopic);
if sel2.NumMessages == 0
error("No decodable frames on compressed topic, and raw topic has no messages.");
end
chosenTopic = rawTopic;
chosenSel = sel2;
msgs = readMessages(chosenSel, 'DataFormat', 'object');
if isempty(msgs), msgs = readMessages(chosenSel, 'DataFormat', 'struct'); end
[firstImg, firstIdx] = findFirstDecodable(msgs);
if isempty(firstImg)
error("Could not decode any frame on %s either.", rawTopic);
end
else
error("Could not decode any frame on %s", chosenTopic);
end
end
[H,W,C] = size(firstImg);
fprintf("Frame size: %dx%dx%d (first decodable index %d)\n", W, H, C, firstIdx);
% Video writer
vw = VideoWriter(outVideoPath, 'MPEG-4');
vw.FrameRate = max(1, min(estFPS, 120));
open(vw);
cleaner = onCleanup(@() safeClose(vw));
Integration Report: Integration
Test 1
% Write frames
N = numel(msgs);
lastPct = -1;
written = 0;
for i = 1:N
img = tryReadImageRobust(msgs{i});
if isempty(img), continue; end
if ndims(img) == 2, img = repmat(img,1,1,3); end
if ~isa(img,'uint8'), img = im2uint8(img); end
writeVideo(vw, img);
written = written + 1;
pct = floor(100*i/N);
if pct ~= lastPct && mod(pct,5)==0
fprintf("Progress: %3d%% (%d/%d)\n", pct, i, N);
lastPct = pct;
end
end
fprintf("Wrote %d frames -> %s\n", written, outVideoPath);
% Save latest CameraInfo if present
try
selCI = select(bag, 'Topic', camInfoTopic);
if selCI.NumMessages > 0
ciMsgs = readMessages(selCI, 'DataFormat', 'struct');
ci = ciMsgs{end}; %#ok<NASGU>
[vDir,vFile] = fileparts(outVideoPath);
save(fullfile(vDir, vFile + "_camerainfo.mat"), 'ci');
fprintf("Saved CameraInfo alongside the video.\n");
end
catch ME
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
52 of
75
Test Completion Date: 05/08/2025
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
53 of
75
Test Completion Date: 05/08/2025
fprintf("CameraInfo read skipped: %s\n", ME.message);
end
end
%% Helpers
function fps = estimateFPS(t)
if numel(t) <= 1, fps = 30; return; end
dt = diff(t); dt = dt(dt>0);
if isempty(dt), fps = 30; else, fps = 1/median(dt); end
end
function [img, idx] = findFirstDecodable(msgs)
img = []; idx = NaN;
for k = 1:numel(msgs)
img = tryReadImageRobust(msgs{k});
if ~isempty(img), idx = k; return; end
end
end
function img = tryReadImageRobust(msg)
% Handle both Image and CompressedImage, as object or struct, across MATLAB releases.
img = [];
% 1) Try rosReadImage if available/compatible
try
img = rosReadImage(msg);
if ~isempty(img), return; end
catch
% continue to manual paths
end
% Convert struct<->object field accessors uniformly
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
54 of
75
Test Completion Date: 05/08/2025
isObj = ~isstruct(msg);
% 2) CompressedImage manual decode
try
if (isObj && (isprop(msg,'Format') && isprop(msg,'Data'))) || ...
(~isObj && (isfield(msg,'Format') && isfield(msg,'Data')))
fmt = lower(getField(msg,'Format'));
bytes = uint8(getField(msg,'Data'));
% Normalize format
if strcmp(fmt,'jpeg'), fmt = 'jpg'; end
% 2a) Use imdecode if present
try
img = imdecode(bytes, fmt); % R2022a+ typically
if ~isempty(img), return; end
catch
% 2b) Portable fallback: write to temp file then imread
try
ext = ['.' fmt];
if ~ismember(fmt, {'jpg','jpeg','png'}), ext = '.jpg'; end
tmp = [tempname ext];
fid = fopen(tmp,'w'); fwrite(fid, bytes, 'uint8'); fclose(fid);
img = imread(tmp);
delete(tmp);
if ~isempty(img), return; end
catch
end
end
end
catch
% ignore; try raw path
end
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
55 of
75
Test Completion Date: 05/08/2025
% 3) Raw sensor_msgs/Image manual path (if rosReadImage failed)
try
if (isObj && (isprop(msg,'Encoding') && isprop(msg,'Data') && isprop(msg,'Height')
&& isprop(msg,'Width'))) || ...
(~isObj && (isfield(msg,'Encoding') && isfield(msg,'Data') && isfield(msg,'Height')
&& isfield(msg,'Width')))
enc = lower(string(getField(msg,'Encoding')));
h = double(getField(msg,'Height'));
w = double(getField(msg,'Width'));
data = uint8(getField(msg,'Data'));
switch enc
case {"bgr8","rgb8"}
C = 3;
img = reshape(data, [C, w, h]); img = permute(img,[3 2 1]);
if enc == "bgr8"
img = img(:,:,[3 2 1]); % BGR->RGB
end
case {"mono8","8uc1"}
C = 1;
img = reshape(data, [w, h])'; % transpose to HxW
otherwise
% last resort: let rosReadImage throw again
img = [];
end
end
catch
img = [];
end
end
function v = getField(msg, name)
if isstruct(msg), v = msg.(name); else, v = msg.(name); end
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
56 of
75
Test Completion Date: 05/08/2025
end
function safeClose(vw)
try, if ~isempty(vw) && isvalid(vw), close(vw); end, catch, end
end
Appendix 2: aruco_subscriber
#!/usr/bin/env python3
import cv2
import rospy
import numpy as np
import threading
from sensor_msgs.msg import CompressedImage, Image
from geometry_msgs.msg import PoseStamped, PointStamped
from std_msgs.msg import Float32MultiArray
from cv_bridge import CvBridge, CvBridgeError
from collections import defaultdict, deque
class ArucoDetector():
# Topics (override via ROS params if needed)
frame_sub_topic_compressed = '/depthai_node/image/compressed'
frame_sub_topic_raw
= '/depthai_node/image/raw'
pose_sub_topic
= '/mavros/local_position/pose'
out_image_topic
= '/processed_aruco/image/compressed'
out_markers_topic
= '/marker_locations'
def __init__(self):
# ---- Params ---self.hfov_deg = float(rospy.get_param('~hfov_deg', 54.0))
self.vfov_deg = float(rospy.get_param('~vfov_deg', 54.0))
self.fixed_alt_m = float(rospy.get_param('~fixed_altitude_m', 2.5))
self.use_live_alt = bool(rospy.get_param('~use_live_altitude', True))
self.avg_window = int(rospy.get_param('~avg_window', 10))
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
57 of
75
Test Completion Date: 05/08/2025
self.publish_first_only = bool(rospy.get_param('~publish_first_only', True))
self.use_raw_image = bool(rospy.get_param('~use_raw_image', False))
self.alt_ema_alpha = float(rospy.get_param('~alt_ema_alpha', 0.25))
smoothing
# altitude
# Image intrinsics computed on first frame
self.W = None; self.H = None
self.fpx_h = None; self.fpx_v = None
# Latest pose (guarded by lock)
self._pose_lock = threading.Lock()
self.pos_x = None
self.pos_y = None
self.altitude_m = None
self._alt_ema = None
# For optional smoothing/averaging (map frame)
self.hist = defaultdict(lambda: deque(maxlen=self.avg_window))
# One-shot per ID publishing
self.id_pubs = {}
# id -> rospy.Publisher(PointStamped)
self.published_ids = set() # IDs already published if publish_first_only=True
# --- ArUco setup --dict_id = cv2.aruco.DICT_5X5_100
try:
self.aruco_dict = cv2.aruco.getPredefinedDictionary(dict_id)
self.aruco_params = cv2.aruco.DetectorParameters()
self.detector = cv2.aruco.ArucoDetector(self.aruco_dict, self.aruco_params)
self._use_new_api = True
except AttributeError:
self.aruco_dict = cv2.aruco.Dictionary_get(dict_id)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
58 of
75
Test Completion Date: 05/08/2025
self.aruco_params = cv2.aruco.DetectorParameters_create()
self._use_new_api = False
# Publishers
self.aruco_pub
queue_size=10)
=
rospy.Publisher(self.out_image_topic,
CompressedImage,
self.marker_pub
queue_size=10)
=
rospy.Publisher(self.out_markers_topic,
Float32MultiArray,
self.br = CvBridge()
# Subscribers (NO SYNC)
if not rospy.is_shutdown():
if self.use_raw_image:
rospy.loginfo("[ArucoDetector]
self.frame_sub_topic_raw)
Subscribing
to
RAW
images:
%s",
rospy.Subscriber(self.frame_sub_topic_raw, Image, self.img_cb,
queue_size=1, buff_size=2**24)
else:
rospy.loginfo("[ArucoDetector] Subscribing to COMPRESSED images: %s",
self.frame_sub_topic_compressed)
rospy.Subscriber(self.frame_sub_topic_compressed,
self.img_cb,
CompressedImage,
queue_size=1, buff_size=2**24)
rospy.Subscriber(self.pose_sub_topic, PoseStamped, self.pose_cb, queue_size=10)
rospy.loginfo("[ArucoDetector] Sync-free; using latest pose. Translation-only; first-hit
per ID.")
# -------- Pose callback (stores latest) -------def pose_cb(self, msg: PoseStamped):
with self._pose_lock:
self.pos_x = float(msg.pose.position.x)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
59 of
75
Test Completion Date: 05/08/2025
self.pos_y = float(msg.pose.position.y)
z = float(msg.pose.position.z)
self._alt_ema = z if self._alt_ema is None else (self.alt_ema_alpha * z + (1 self.alt_ema_alpha) * self._alt_ema)
self.altitude_m = self._alt_ema
# -------- Image callback (process every image) -------def img_cb(self, img_msg):
# Decode image
try:
if isinstance(img_msg, CompressedImage):
frame = self.br.compressed_imgmsg_to_cv2(img_msg)
else:
frame = self.br.imgmsg_to_cv2(img_msg, desired_encoding='bgr8')
except CvBridgeError as e:
rospy.logerr("[ArucoDetector] CvBridgeError: %s", str(e))
return
except Exception as e:
rospy.logerr("[ArucoDetector] Unexpected decode error: %s", str(e))
return
self._ensure_intrinsics(frame)
# Copy latest pose atomically
with self._pose_lock:
px = self.pos_x
py = self.pos_y
h = self.altitude_m
# Fallbacks if pose not yet available
if not self.use_live_alt or h is None or h <= 0.0:
h = float(self.fixed_alt_m)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
60 of
75
Test Completion Date: 05/08/2025
if px is None: px = 0.0
if py is None: py = 0.0
annotated_frame, new_ids_array = self.find_aruco_and_project_first_only(frame, px, py,
h)
# Show banner if using fallback pose/altitude
if (self.pos_x is None) or (self.pos_y is None) or (self.altitude_m is None):
cv2.putText(annotated_frame, "NO LIVE POSE: using (0,0) and/or fixed altitude",
(10,
cv2.LINE_AA)
24),
cv2.FONT_HERSHEY_SIMPLEX,
0.6,
(0,165,255),
2,
# Publish annotated image every frame
self.publish_image(annotated_frame)
# Optionally publish aggregate array (new IDs only this frame)
if new_ids_array:
self.marker_pub.publish(Float32MultiArray(data=new_ids_array))
def _ensure_intrinsics(self, frame):
if self.W is None or self.H is None:
self.H, self.W = frame.shape[:2]
self.fpx_h = (self.W / 2.0) / np.tan(np.deg2rad(self.hfov_deg / 2.0))
self.fpx_v = (self.H / 2.0) / np.tan(np.deg2rad(self.vfov_deg / 2.0))
rospy.loginfo(f"[ArucoDetector] Image {self.W}x{self.H}, fpx_h={self.fpx_h:.2f},
fpx_v={self.fpx_v:.2f}")
def find_aruco_and_project_first_only(self, frame, px, py, h):
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
if self._use_new_api:
corners, ids, _ = self.detector.detectMarkers(gray)
else:
Integration Report: Integration
Test 1
corners,
ids,
_
parameters=self.aruco_params)
=
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
61 of
75
Test Completion Date: 05/08/2025
cv2.aruco.detectMarkers(gray,
self.aruco_dict,
triples_new = [] # [x_map, y_map, id, ...] ONLY for newly published IDs
if ids is not None and len(corners) > 0:
ids = ids.flatten()
cv2.aruco.drawDetectedMarkers(frame, corners, ids)
cx = self.W / 2.0
cy = self.H / 2.0
for (marker_corner, marker_id) in zip(corners, ids):
# Only publish the FIRST detection per ID if enabled
if self.publish_first_only and (marker_id in self.published_ids):
continue
pts = marker_corner.reshape((4, 2)).astype(float)
(tl, tr, br, bl) = pts
u = np.mean([tl[0], tr[0], br[0], bl[0]]) # column (right +)
v = np.mean([tl[1], tr[1], br[1], bl[1]]) # row (down +)
# Image-centered pixel offsets: top=+x_cam, left=+y_cam
x_px = (cy - v)
y_px = (cx - u)
# Project to meters on ground at height h
x_cam = h * (x_px / self.fpx_v)
y_cam = h * (y_px / self.fpx_h)
# Translation-only into local map/ENU (no rotation)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
62 of
75
Test Completion Date: 05/08/2025
x_map = px + x_cam
y_map = py + y_cam
# Publish per-ID (latched)
if self.publish_first_only:
self.published_ids.add(marker_id)
self.publish_per_id(mid=marker_id, x_map=x_map, y_map=y_map)
# annotate
cpt = (int(round(u)), int(round(v)))
cv2.circle(frame, cpt, 4, (0, 255, 255), -1)
tag = "[FIRST]" if self.publish_first_only else ""
cv2.putText(frame, f"map({x_map:.2f},{y_map:.2f}) id={int(marker_id)} {tag}",
(cpt[0] + 5, cpt[1] - 5),
cv2.FONT_HERSHEY_SIMPLEX, 0.45, (0, 255, 255), 1, cv2.LINE_AA)
# Aggregate array (new IDs only this frame)
triples_new.extend([float(x_map), float(y_map), float(marker_id)])
return frame, triples_new
def publish_per_id(self, mid, x_map, y_map):
"""
Publish a latched PointStamped (once per ID if publish_first_only=True) on:
/marker_locations/id/<id>
"""
if mid not in self.id_pubs:
topic = f"/marker_locations/id/{mid}"
self.id_pubs[mid] = rospy.Publisher(topic, PointStamped, queue_size=1, latch=True)
rospy.loginfo(f"[ArucoDetector] Created per-ID topic: {topic}")
msg = PointStamped()
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
63 of
75
Test Completion Date: 05/08/2025
msg.header.stamp = rospy.Time.now()
msg.header.frame_id = "map"
msg.point.x = float(x_map)
msg.point.y = float(y_map)
msg.point.z = 0.0
self.id_pubs[mid].publish(msg)
def publish_image(self, frame):
ok, enc = cv2.imencode('.jpg', frame)
if not ok:
rospy.logwarn("[ArucoDetector] Failed to encode JPEG")
return
msg_out = CompressedImage()
msg_out.header.stamp = rospy.Time.now()
msg_out.header.frame_id = "camera_frame"
msg_out.format = "jpeg"
msg_out.data = enc.tobytes()
self.aruco_pub.publish(msg_out)
def main():
rospy.init_node('EGB349_vision', anonymous=True)
rospy.loginfo("Aruco: sync-free; latest pose; translation-only; first-hit per ID.")
_ = ArucoDetector()
rospy.spin()
if __name__ == "__main__":
main()
Appendix 3: dai_publisher_yolov5_runner
#!/usr/bin/env python3
"""
Runs your DepthAI YOLO model and publishes first-known target locations
(translation-only; no yaw) as PointStamped on:
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
64 of
75
Test Completion Date: 05/08/2025
/marker_locations/id/person
/marker_locations/id/bag
Also publishes:
/depthai_node/image/compressed (raw compressed)
/depthai_node/image/raw
(raw sensor_msgs/Image)
/depthai_node/detection/compressed (annotated)
/depthai_node/camera/camera_info
"""
from pathlib import Path
import time
import json
import cv2
import numpy as np
import depthai as dai
import rospy
from sensor_msgs.msg import CompressedImage, Image, CameraInfo
from geometry_msgs.msg import PoseStamped, PointStamped
from cv_bridge import CvBridge
# =========================== Model / Paths ===========================
pipeline = None
cam_source = 'rgb' # 'rgb', 'left', 'right'
syncNN = True
modelsPath
"/home/uavteam6/catkin_ws/src/depthai_publisher/src/depthai_publisher/models"
modelName = 'best_openvino_2022.1_6shave'
confJson = 'best.json'
configPath = Path(f'{modelsPath}/{modelName}/{confJson}')
if not configPath.exists():
=
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
65 of
75
Test Completion Date: 05/08/2025
raise ValueError("Path {} does not exist!".format(configPath))
with configPath.open() as f:
config = json.load(f)
nnConfig = config.get("nn_config", {})
metadata = nnConfig.get("NN_specific_metadata", {})
classes = metadata.get("classes", {})
coordinates = metadata.get("coordinates", {})
anchors = metadata.get("anchors", {})
anchorMasks = metadata.get("anchor_masks", {})
iouThreshold = float(metadata.get("iou_threshold", 0.5))
confidenceThreshold = float(metadata.get("confidence_threshold", 0.5))
nnMappings = config.get("mappings", {})
labels = nnMappings.get("labels", {})
#
===========================
===========================
Helper
mapping
def canonical_target(label_str):
"""Map raw YOLO label to the canonical IDs we publish."""
s = (label_str or "").strip().lower()
if s == "person":
return "person"
if s in ("bag", "backpack", "handbag", "suitcase"):
return "bag"
return None
# =========================== Main class ===========================
class DepthaiCamera():
fps = 10.0
pub_topic = '/depthai_node/image/compressed'
pub_topic_raw = '/depthai_node/image/raw'
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
66 of
75
Test Completion Date: 05/08/2025
pub_topic_detect = '/depthai_node/detection/compressed'
pub_topic_cam_inf = '/depthai_node/camera/camera_info'
def __init__(self):
# ---- Projection params ---self.hfov_deg = float(rospy.get_param('~hfov_deg', 54.0))
self.vfov_deg = float(rospy.get_param('~vfov_deg', 54.0))
self.fixed_alt_m = float(rospy.get_param('~fixed_altitude_m', 2.5))
self.use_live_alt = bool(rospy.get_param('~use_live_altitude', True))
self.publish_first_only = bool(rospy.get_param('~publish_first_only', True))
self.alt_ema_alpha = float(rospy.get_param('~alt_ema_alpha', 0.25))
# DepthAI input size
self.nn_shape_w, self.nn_shape_h = (416, 416)
if "input_size" in nnConfig:
self.nn_shape_w,
self.nn_shape_h
nnConfig.get("input_size").split('x')))
=
tuple(map(int,
# focal pixels from FOV
self.fpx_h = (self.nn_shape_w / 2.0) / np.tan(np.deg2rad(self.hfov_deg / 2.0))
self.fpx_v = (self.nn_shape_h / 2.0) / np.tan(np.deg2rad(self.vfov_deg / 2.0))
# Latest MAVROS pose (translation-only)
self.pos_x = None
self.pos_y = None
self.altitude_m = None
self.alt_ema = None
# Track first-hit per canonical ID
self.published_ids = set() # e.g., {"person", "bag"}
# ROS pubs
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
67 of
75
Test Completion Date: 05/08/2025
self.pub_image = rospy.Publisher(self.pub_topic, CompressedImage, queue_size=10)
self.pub_image_raw = rospy.Publisher(self.pub_topic_raw, Image, queue_size=10)
self.pub_image_detect = rospy.Publisher(self.pub_topic_detect,
queue_size=10)
self.pub_cam_inf
queue_size=10)
=
CompressedImage,
rospy.Publisher(self.pub_topic_cam_inf,
CameraInfo,
# lazy per-ID PointStamped publishers (latched)
self.id_pubs = {} # "person"/"bag" -> rospy.Publisher
# CameraInfo timer
self.timer =
oneshot=False)
rospy.Timer(rospy.Duration(1.0
/
10),
self.publish_camera_info,
# Pose subscriber
rospy.Subscriber("/mavros/local_position/pose",
queue_size=10)
PoseStamped,
self.pose_cb,
self.br = CvBridge()
rospy.on_shutdown(lambda: self.shutdown())
rospy.loginfo("DepthAI YOLO → /marker_locations/id/<person|bag> (first detection
only; translation-only).")
# Build pipeline once (clearer path join)
blob_path = (Path(modelsPath) / modelName / f"{modelName}.blob").resolve()
self.pipeline = self.createPipeline(str(blob_path))
# ---------------- MAVROS pose ---------------def pose_cb(self, msg: PoseStamped):
self.pos_x = msg.pose.position.x
self.pos_y = msg.pose.position.y
z = float(msg.pose.position.z)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
68 of
75
Test Completion Date: 05/08/2025
self.alt_ema = z if self.alt_ema is None else (self.alt_ema_alpha * z + (1 self.alt_ema_alpha) * self.alt_ema)
self.altitude_m = self.alt_ema
# ---------------- CameraInfo ---------------def publish_camera_info(self, _evt=None):
m = CameraInfo()
m.header.frame_id = "camera_frame"
m.header.stamp = rospy.Time.now()
m.height = self.nn_shape_h
m.width = self.nn_shape_w
m.K = [615.381, 0.0, 320.0, 0.0, 615.381, 240.0, 0.0, 0.0, 1.0]
m.D = [-0.10818, 0.12793, 0.00000, 0.00000, -0.04204]
m.R = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
m.P = [615.381, 0.0, 320.0, 0.0, 0.0, 615.381, 240.0, 0.0, 0.0, 0.0, 1.0, 0.0]
m.distortion_model = "plumb_bob"
self.pub_cam_inf.publish(m)
# ---------------- DepthAI pipeline ---------------def createPipeline(self, nnPath):
p = dai.Pipeline()
p.setOpenVINOVersion(version=dai.OpenVINO.Version.VERSION_2022_1)
det = p.create(dai.node.YoloDetectionNetwork)
det.setConfidenceThreshold(float(confidenceThreshold))
det.setNumClasses(int(classes))
det.setCoordinateSize(int(coordinates))
det.setAnchors(anchors)
det.setAnchorMasks(anchorMasks)
det.setIouThreshold(float(iouThreshold))
det.setBlobPath(nnPath)
det.setNumPoolFrames(4)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
69 of
75
Test Completion Date: 05/08/2025
det.input.setBlocking(False)
det.setNumInferenceThreads(2)
if cam_source == 'rgb':
cam = p.create(dai.node.ColorCamera)
cam.setPreviewSize(self.nn_shape_w, self.nn_shape_h)
cam.setInterleaved(False)
cam.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
cam.setFps(40)
cam.preview.link(det.input)
else:
cam = p.create(dai.node.MonoCamera)
if cam_source == 'left':
cam.setBoardSocket(dai.CameraBoardSocket.LEFT)
else:
cam.setBoardSocket(dai.CameraBoardSocket.RIGHT)
manip = p.create(dai.node.ImageManip)
manip.setResize(self.nn_shape_w, self.nn_shape_h)
manip.setKeepAspectRatio(True)
manip.setFrameType(dai.RawImgFrame.Type.RGB888p)
cam.out.link(manip.inputImage)
manip.out.link(det.input)
xout_rgb = p.create(dai.node.XLinkOut)
xout_rgb.setStreamName("nn_input")
xout_rgb.input.setBlocking(False)
det.passthrough.link(xout_rgb.input)
xout_det = p.create(dai.node.XLinkOut)
xout_det.setStreamName("nn")
xout_det.input.setBlocking(False)
det.out.link(xout_det.input)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
70 of
75
Test Completion Date: 05/08/2025
return p
# ---------------- Publishing helpers ---------------def publish_to_ros(self, frame):
msg_out = CompressedImage()
msg_out.header.stamp = rospy.Time.now()
msg_out.format = "jpeg"
msg_out.header.frame_id = "camera_frame"
msg_out.data = np.array(cv2.imencode('.jpg', frame)[1]).tobytes()
self.pub_image.publish(msg_out)
self.pub_image_raw.publish(self.br.cv2_to_imgmsg(frame, encoding="bgr8"))
def publish_detect_to_ros(self, frame):
msg_out = CompressedImage()
msg_out.header.stamp = rospy.Time.now()
msg_out.format = "jpeg"
msg_out.header.frame_id = "camera_frame"
msg_out.data = np.array(cv2.imencode('.jpg', frame)[1]).tobytes()
self.pub_image_detect.publish(msg_out)
def publish_point_once(self, target_id, x_map, y_map):
"""Publish a latched PointStamped once per target_id ('person' or 'bag')."""
if target_id in self.published_ids and self.publish_first_only:
return
if target_id not in self.id_pubs:
topic = f"/marker_locations/id/{target_id}"
self.id_pubs[target_id]
latch=True)
=
rospy.Publisher(topic,
PointStamped,
rospy.loginfo(f"[YOLO] Created per-ID topic: {topic}")
msg = PointStamped()
queue_size=1,
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
71 of
75
Test Completion Date: 05/08/2025
msg.header.stamp = rospy.Time.now()
msg.header.frame_id = "map" # local world frame
msg.point.x = float(x_map)
msg.point.y = float(y_map)
msg.point.z = 0.0
self.id_pubs[target_id].publish(msg)
self.published_ids.add(target_id)
# ---------------- Projection math (no yaw) ---------------def bbox_center_uv(self, det):
"""Return bbox center (u, v) in pixel coords of the NN frame."""
u = ((det.xmin + det.xmax) * 0.5) * self.nn_shape_w
v = ((det.ymin + det.ymax) * 0.5) * self.nn_shape_h
return float(u), float(v)
def project_to_map_translation_only(self, u, v):
"""Project (u,v) to (x_map,y_map) with ground-plane assumption and translation-only."""
# choose height
if self.use_live_alt and (self.altitude_m is not None) and (self.altitude_m > 0.0):
h = float(self.altitude_m)
else:
h = float(self.fixed_alt_m)
cx = self.nn_shape_w / 2.0
cy = self.nn_shape_h / 2.0
# image-centered: top=+x_cam, left=+y_cam
x_px = (cy - v) # up is +x
y_px = (cx - u) # left is +y
# meters in camera ground-plane
x_cam = h * (x_px / self.fpx_v)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
72 of
75
Test Completion Date: 05/08/2025
y_cam = h * (y_px / self.fpx_h)
# translation-only into local ENU (map)
px = float(self.pos_x) if self.pos_x is not None else 0.0
py = float(self.pos_y) if self.pos_y is not None else 0.0
x_map = px + x_cam
y_map = py + y_cam
return x_map, y_map
# ---------------- Main loop ---------------def run(self):
# Let Device(self.pipeline) auto-start the pipeline (don't call startPipeline again)
with dai.Device(self.pipeline) as device:
cams = device.getConnectedCameras()
depth_enabled
=
(dai.CameraBoardSocket.LEFT
(dai.CameraBoardSocket.RIGHT in cams)
in
cams)
and
if cam_source != "rgb" and not depth_enabled:
raise RuntimeError("Unable to run on {} camera! Available: {}".format(cam_source,
cams))
# Output queues from the pipeline
q_nn_input = device.getOutputQueue(name="nn_input", maxSize=4, blocking=False)
q_nn
= device.getOutputQueue(name="nn",
# FPS accounting
start_time = time.time()
counter = 0
fps = 0.0
while not rospy.is_shutdown():
inRgb = q_nn_input.tryGet()
inDet = q_nn.tryGet()
maxSize=4, blocking=False)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
73 of
75
Test Completion Date: 05/08/2025
if inRgb is None or inDet is None:
time.sleep(0.001)
continue
frame = inRgb.getCvFrame()
detections = inDet.detections
overlay = frame.copy()
found_classes = set()
for det in detections:
lbl = labels[det.label] if det.label < len(labels) else str(det.label)
canon = canonical_target(lbl)
if canon is None:
continue
found_classes.add(canon)
# bbox & label
x1, y1, x2, y2 = self.frameNorm(overlay, (det.xmin, det.ymin, det.xmax,
det.ymax))
cv2.rectangle(overlay, (x1, y1), (x2, y2), (255, 0, 0), 2)
cv2.putText(overlay, f"{canon} {int(det.confidence*100)}%",
(x1 + 10, y1 + 20), cv2.FONT_HERSHEY_TRIPLEX, 0.5, 255)
# project bbox center → map (translation-only; no yaw)
u, v = self.bbox_center_uv(det)
x_map, y_map = self.project_to_map_translation_only(u, v)
# annotate coords
cv2.putText(overlay, f"map({x_map:.2f},{y_map:.2f})",
(x1 + 10, y1 + 40), cv2.FONT_HERSHEY_TRIPLEX, 0.5, 255)
Integration Report: Integration
Test 1
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
74 of
75
Test Completion Date: 05/08/2025
# publish once per canonical ID (latched)
self.publish_point_once(canon, x_map, y_map)
# FPS HUD
counter += 1
now = time.time()
elapsed = now - start_time
if elapsed >= 1.0:
fps = counter / elapsed
counter = 0
start_time = now
cv2.putText(overlay, "NN fps: {:.2f}".format(fps), (2, overlay.shape[0] - 6),
cv2.FONT_HERSHEY_TRIPLEX, 0.5, (255, 0, 0))
if found_classes:
cv2.putText(overlay, "Found: {}".format(sorted(found_classes)), (2, 14),
cv2.FONT_HERSHEY_TRIPLEX, 0.5, (255, 0, 0))
# Publish images
self.publish_to_ros(frame)
self.publish_detect_to_ros(overlay)
# Utilities
def frameNorm(self, frame, bbox):
normVals = np.full(len(bbox), frame.shape[0])
normVals[::2] = frame.shape[1]
return (np.clip(np.array(bbox), 0, 1) * normVals).astype(int)
def shutdown(self):
cv2.destroyAllWindows()
def main():
Integration Report: Integration
Test 1
rospy.init_node('depthai_node')
dai_cam = DepthaiCamera()
try:
dai_cam.run() # run once; it has its own loop
finally:
dai_cam.shutdown()
if __name__ == "__main__":
main()
Doc No: QUT–450–G6–ITR–C
Issue:
1.0
Page:
75 of
75
Test Completion Date: 05/08/2025
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )