-
Notifications
You must be signed in to change notification settings - Fork 1.7k
adding Mass Zero Thermal Camera integration #11005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
adding Mass Zero Thermal Camera integration #11005
Conversation
Signed-off-by: William Dunn <wdunn001@gmail.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||
|
What benefit does this have for general FPV pilots? I can only think of commercial uses for having thermal imaging. One of them being completely not allowed in INAV. |
Addressed in the updated PR message. Community ImpactBenefits
Contribution Value
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
…r Dependency, Remove Duplicate OSD Header, Add Safe Reconnection API
|
ok I am in the process of getting a supply and I will list them at my website masszerofpv.com (sub brand of my ends and oddity site) . The management protocol I will link there as well and its also contained within the provided readme under docs as well. will implement other changes shortly THANKS! |
Signed-off-by: William Dunn <wdunn001@gmail.com>
|
I'm interested in wildland fire detection and hotspots, but I don't see any listings, price or availability for a camera named "MassZero Thermal Camera (MZTC)". @wdunn001 Is this a DIY camera you are making and not yet available? |
|
@ZiaCreatesIdeas I was not expecting such immediate interest. https://masszerofpv.com/ you can pre purchase the camera here |
ok I think all issues have been addressed I pulled my printfs out let me know if you see any other issues! |
User description
Add MassZero Thermal Camera Integration for INAV
Overview
This PR adds comprehensive support for the MassZero Thermal Camera (MZTC) to INAV, enabling real-time thermal imaging capabilities for flight controllers. The integration includes MSP communication, OSD display elements, and transmitter channel-based control for camera parameters.
Features Added
Core Integration
Transmitter Control
Data Handling
Technical Implementation
Files Added/Modified
src/main/io/mztc_camera.c- Main camera driver and communicationsrc/main/io/mztc_camera.h- Driver interface and declarationssrc/main/config/mztc_camera.h- Configuration structures and enumssrc/main/io/osd/mztc_camera_osd.c- OSD display elementssrc/main/msp/msp_mztc.c- MSP protocol implementationsrc/main/fc/fc_tasks.c- Task scheduler integrationHardware Support
Configuration Options
Testing Status
Completed Testing
Testing Required
Documentation
User Guide
Developer Guide
Use Cases
Search & Rescue
Firefighting
Industrial Inspection
Safety & Compliance
Safety Features
Compliance
Future Enhancements
Planned Features
Extensibility
Community Impact
Benefits
Contribution Value
Testing Instructions
Setup Requirements
Test Scenarios
Validation Criteria
Code Review Focus Areas
Architecture
Performance
Safety
**This PR represents a significant enhancement to INAV's capabilities, enabling professional-grade thermal imaging for search & rescue, firefighting, and industrial applications. The implementation follows INAV's development standards and provides a solid foundation for future thermal imaging enhancements. **
**Ready for testing and review by the INAV community! **
PR Type
New Feature
Description
This description is generated by an AI tool. It may have inaccuracies.
• Adds comprehensive MassZero Thermal Camera (MZTC) integration to INAV flight controller
• Implements complete serial communication driver with protocol handling, status tracking, and camera control
• Provides MSP protocol support for external thermal data transmission and camera parameter control
• Adds OSD display elements for real-time thermal data visualization including temperature, alerts, and status
• Integrates CLI commands for thermal camera configuration, mode control, palette selection, and calibration
• Includes transmitter channel mapping for real-time parameter adjustment during flight
• Adds task scheduler integration with 10Hz update rate for thermal camera processing
• Provides SITL testing support with TCP-Serial bridge and debug utilities
• Implements comprehensive configuration system with 22 configurable parameters
• Adds parameter groups for thermal camera and OSD configuration management
• Includes duplicate OSD implementation files that should be consolidated
Diagram Walkthrough
File Walkthrough
13 files
mztc_camera.c
MassZero Thermal Camera Driver Implementationsrc/main/io/mztc_camera.c
• Implements complete MassZero Thermal Camera driver with serial
communication protocol
• Adds configuration management, status
tracking, and camera control functions
• Includes SITL mode detection
and TCP bridge support for testing
• Provides comprehensive API for
camera operations (calibration, mode setting, image parameters)
mztc_camera_osd.c
Thermal Camera OSD Display Implementationsrc/main/io/mztc_camera_osd.c
• Implements OSD display elements for thermal camera data
• Adds
temperature, status, alerts, calibration, and connection displays
•
Provides configurable positioning and visibility controls
• Includes
parameter group for OSD configuration management
cli.c
CLI Commands for Thermal Camera Controlsrc/main/fc/cli.c
• Adds comprehensive CLI commands for thermal camera control
•
Implements commands for mode, configuration, palette, zoom,
enhancement, denoising, alerts, and calibration
• Includes debug
commands for reconnection and SITL data simulation
• Provides status
display and parameter adjustment functionality
msp_mztc.c
MSP Protocol Implementation for Thermal Camerasrc/main/msp/msp_mztc.c
• Implements MSP protocol handlers for thermal camera communication
•
Adds message structures for configuration, status, frame data, and
control commands
• Provides bidirectional MSP communication for
external applications
• Includes parameter validation and error
handling
mztc_camera_osd.c
Duplicate Thermal Camera OSD Implementationsrc/main/io/osd/mztc_camera_osd.c
• Duplicate implementation of thermal camera OSD functionality
•
Provides same OSD display elements as the other OSD file
• Includes
temperature, status, alerts, calibration, and connection displays
•
Contains parameter group configuration for OSD elements
mztc_camera.h
Thermal Camera Configuration and Type Definitionssrc/main/config/mztc_camera.h
• Defines comprehensive configuration structures and enums for thermal
camera
• Includes operating modes, temperature units, color palettes,
zoom levels, and mirror modes
• Provides status structures, frame data
definitions, and error flags
• Declares function prototypes for camera
operations
msp_mztc.h
MSP Protocol Definitions for Thermal Camerasrc/main/msp/msp_mztc.h
• Defines MSP command IDs and message structures for thermal camera
•
Includes configuration, status, frame data, and control message types
• Provides MSP protocol definitions for external communication
•
Declares function prototypes for MSP command processing
mztc_camera_osd.h
Thermal Camera OSD Header Definitionssrc/main/io/osd/mztc_camera_osd.h
• Defines OSD element IDs, visibility flags, and configuration
structure
• Provides parameter group declaration for OSD configuration
• Includes function prototypes for OSD initialization and control
•
Defines constants for OSD element management
mztc_camera_osd.h
Duplicate Thermal Camera OSD Header Filesrc/main/io/mztc_camera_osd.h
• Duplicate header file with identical OSD definitions
• Contains same
element IDs, visibility flags, and configuration structure
• Provides
identical function prototypes and parameter group declarations
•
Appears to be an unintentional duplicate of the other OSD header
mztc_camera.h
Main Thermal Camera Driver Headersrc/main/io/mztc_camera.h
• Provides main header file for thermal camera driver
• Includes
external variable declarations for CLI access
• Defines function
prototypes for camera initialization and control
• Imports
configuration definitions from
config/mztc_camera.hfc_tasks.c
Thermal Camera Task Scheduler Integrationsrc/main/fc/fc_tasks.c
• Adds thermal camera task to the scheduler
• Includes
mztcUpdatefunction call with 10Hz update rate
• Sets low priority for thermal
camera processing
• Integrates thermal camera into the main task
scheduler
fc_init.c
Thermal Camera System Initializationsrc/main/fc/fc_init.c
• Adds thermal camera initialization to system startup
• Includes
calls to
mztcInit(),mztcOsdInit(), andmspMztcInit()• Integrates
thermal camera components into the main initialization sequence
•
Ensures proper startup order for thermal camera subsystems
settings.yaml
Add MassZero Thermal Camera Configuration Settingssrc/main/fc/settings.yaml
• Added comprehensive configuration tables for MassZero Thermal Camera
(MZTC) including modes, temperature units, palettes, shutter modes,
zoom levels, and mirror modes
• Introduced new parameter group
PG_MZTC_CAMERA_CONFIGwith 22 configurable settings for thermal cameraoperation
• Added settings for camera control (port, baudrate, mode),
image processing (brightness, contrast, zoom, enhancement), and
advanced features (temperature alerts, FFC calibration)
• Configured
default values and valid ranges for all thermal camera parameters
4 files
parameter_group_ids.h
Parameter Group IDs for Thermal Camerasrc/main/config/parameter_group_ids.h
• Adds parameter group IDs for thermal camera configuration
• Defines
PG_MZTC_CAMERA_CONFIGandPG_MZTC_OSD_CONFIGconstants• Updates
PG_INAV_ENDto include new parameter groups• Extends parameter group
system for thermal camera support
serial.h
Serial Port Function for Thermal Camerasrc/main/io/serial.h
• Adds
FUNCTION_MZTC_CAMERAserial port function definition• Assigns
bit 28 (268435456) for thermal camera serial communication
• Extends
serial port function enumeration for thermal camera support
• Enables
dedicated serial port assignment for thermal camera
scheduler.h
Scheduler Task Definition for Thermal Camerasrc/main/scheduler/scheduler.h
• Adds
TASK_MZTC_CAMERAto the task enumeration• Integrates thermal
camera task into the scheduler system
• Enables thermal camera to be
scheduled as a system task
• Extends task management for thermal
camera functionality
CMakeLists.txt
CMake Build Configuration for Thermal Camerasrc/main/CMakeLists.txt
• Adds thermal camera source files to build system
• Includes
mztc_camera.c,mztc_camera_osd.c, andmsp_mztc.cfiles• Adds
corresponding header files to compilation
• Integrates thermal camera
components into CMake build configuration
3 files
thermal_bridge_debug.py
Debug TCP-Serial Bridge for Thermal Camera Testingsrc/utils/thermal_bridge_debug.py
• Implements debug version of TCP-Serial bridge with enhanced logging
• Provides detailed hex dump logging for data transmission
• Includes
camera test command functionality
• Enables debugging of thermal
camera communication in SITL mode
test_thermal_camera.py
Thermal Camera Communication Test Scriptsrc/utils/test_thermal_camera.py
• Provides test script for verifying thermal camera communication
•
Implements command packet construction and transmission
• Tests device
model, FPGA version, software version, and brightness commands
•
Enables direct testing of thermal camera on COM13 port
thermal_bridge.py
TCP-Serial Bridge for SITL Thermal Camera Testingsrc/utils/thermal_bridge.py
• Implements simple TCP-Serial bridge for SITL testing
• Connects
Windows COM port to INAV SITL in WSL environment
• Provides
bidirectional data forwarding with basic logging
• Enables thermal
camera testing in simulation environment