Thermal Imaging Camera User Guide¶
You can connect a thermal imaging camera to the Raspberry Pi 5 on a quadcopter to build thermal images and determine precise temperatures at individual points within the frame.
Principle of Operation¶
A thermal imaging camera captures infrared radiation emitted from surrounding objects. The camera’s sensor converts this radiation into electrical signals, which are then processed by onboard electronics to generate a thermal image. This image provides a visual representation of the temperature distribution across object surfaces.
The integrated thermal module features a resolution of 256x192 pixels and outputs two data streams: a processed thermal image and a temperature matrix.
Data in ROS 2¶
The clover2_thermal driver splits the raw camera data and publishes it via two separate ROS 2 topics. By default, both topics utilize the sensor_msgs/msg/Image message type.
Topic |
Encoding |
Content |
|---|---|---|
|
|
Processed grayscale thermal image. Each pixel contains a brightness value from 0 to 255. |
|
|
Temperature matrix. Each pixel contains the exact temperature in degrees Celsius as a 32-bit floating-point number. |
Both images maintain a consistent size of 256×192 pixels. Pixel coordinates are identical across both topics.
Use the image_viz topic for visual monitoring and thermal imaging. Access the temperature topic to obtain precise temperature measurements.
Hint
Do not rely on pixel brightness alone to determine temperature. The grayscale image is for visualization and does not represent exact numerical temperature values.
How to Install the Camera¶
The thermal imaging camera can be mounted on the quadcopter using one of two methods.
Method 1: Front-facing Mount¶
Install the thermal imaging camera into the provided mount.
Camera in the mount¶
Secure the mount (with the camera installed) onto the guard arcs, as shown in the figure below.
Mount installed to the quadcopter guard arcs¶
Connect the USB cable from the kit to the camera.
Plug the other end of the USB cable into an available USB port on the Raspberry Pi 5.
Secure the cable using zip ties to ensure it remains clear of the propeller rotation area.
Method 2: Horizontal Mount¶
Install the thermal imaging camera into the provided mount.
Camera in the mount¶
Secure the mount to the bottom deck using M3x8 screws, as shown in the figure.
Mount secured to the bottom deck¶
Connect the USB cable from the kit to the camera.
Plug the other end of the USB cable into an available USB port on the Raspberry Pi 5.
Secure the cable using zip ties to ensure it remains clear of the propeller rotation area.
Configuration¶
Enabling via clover2-settings¶
To enable the thermal imaging camera on your quadcopter, update the system configuration using the clover2-settings utility.
Open a terminal and execute:
clover2-settings
Select the
additional_sensorsgroup.
Navigating to sensors¶
In the
additional_sensorsgroup, select thethermal_camerasetting and change its value totrue.
Enabling the camera¶
Press
Ctrl+Sto save the changes (a notifiaction will confirm the save).
Saving¶
Press
Escseveral times to exit the application.Restart the
clover2service with the following command:
sudo systemctl restart clover2
Once the service has started, the thermal camera driver will automatically begin publishing data to the /thermal_camera/image_viz and /thermal_camera/temperature topics.
Usage¶
For Python development, you can obtain the temperature matrix using the Clover2 client:
from clover2 import Clover2
drone = Clover2()
temperature = drone.thermal_camera.get_temperature()
# The NumPy matrix has shape (192, 256), with indices in [y, x] order.
print(f"Temperature at the center of the frame: {temperature[96, 128]:.2f} °C")
The pixel coordinate system originates from the top-left corner: x-axis increases from left to right, and y-axis increases from top to bottom.
The get_temperature() method returns the most recent temperature matrix as a NumPy array. On the initial call, the method will wait up to 5 seconds for data. If no data received, a TimeoutError exception will be raised.
To obtain the original ROS message instead of a processed NumPy matrix, use the drone.thermal_camera.get_temperature_msg() method.