ROS 1 package for berry detection on UAV imagery, with GPS-linked outputs for mapping and visualization.
The current default runtime path uses a TensorFlow Lite model compiled for Google Coral Edge TPU and publishes per-image cloudberry counts together with georeferenced visualization markers.
- Subscribes to camera images, GPS fixes, range sensor data, base-station RTK data, and camera info.
- Splits each incoming image into a grid of crops.
- Runs inference on each crop and sums the detected cloudberries.
- Publishes a
sensor_msgs/NavSatFixresult for each processed image. - Publishes a
visualization_msgs/Markerfor RViz-style spatial visualization.
The default launch file is launch/berry_detector.launch and starts:
- Node:
image_gps_node_tf_lite_coral.py - ROS package identifier:
berries_detector - Default model:
models/best_full_integer_quant_edgetpu.tflite - Namespace:
$(arg UAV_NAME)
This is the active path to document and use first. The repository also contains older ONNX and non-Coral variants for comparison and experimentation.
- launch/berry_detector.launch: main launch entrypoint
- config/berry_detector.yaml: runtime parameters and topic names
- scripts/image_gps_node_tf_lite_coral.py: current Coral / TFLite detector
- scripts/image_gps_node_tf_lite.py: CPU TFLite variant
- scripts/image_gps_node.py: ONNX variant
- models/: packaged model artifacts
From config/berry_detector.yaml and the active Coral node:
continuous_gopro_photo/image_rawcontinuous_gopro_photo/camera_infogps/filteredhw_api/rtkhw_api/distance_sensor
When launched under a UAV namespace, these resolve relative to /<UAV_NAME>/... except for topics that are configured with absolute names.
inference_resultsassensor_msgs/NavSatFixmarker/berry_detectionasvisualization_msgs/Marker
The active node stores the berry count in NavSatFix.position_covariance[0].
- Latitude, longitude, and altitude come from the closest GPS fix to the image timestamp.
- The marker position is derived relative to the RTK base station.
- The marker color is a heatmap driven by the detected cloudberry count.
- Images are divided into a grid of patches based on image resolution.
- Each patch is resized to the model input size.
- The Coral/TFLite model is run per patch.
- Counts are accumulated across the full image.
- The active post-processing path counts class IDs
2and3, corresponding to cloudberry and cloudberry-unripe.
Default class labels are:
BilberryBilberry-unripeCloudberryCloudberry-unripeCrowberryCrowberry-unripeLingonberryLingonberry-unripeBog-bilberryBog-bilberry-unripeMushroom
This is a ROS 1 catkin package. The package metadata currently declares:
geometry_msgsroscpprospysensor_msgsstd_msgs
At runtime, the active detector code also imports and uses:
cv_bridgevisualization_msgsmrs_msgs
The repository ships requirements.txt with:
numpy==1.24.4onnxruntimeopencv-pythoncv-bridgepandastflite_runtime
The active Coral path additionally requires:
pycoralutm
For the default launch path you also need a working Coral Edge TPU runtime and a compatible Edge TPU-compiled .tflite model.
Clone the package into a ROS 1 catkin workspace:
cd ~/catkin_ws/src
git clone <repo-url> berries_detector
cd ..
catkin_make
source devel/setup.bashInstall Python dependencies in the environment used by your ROS nodes:
pip install -r src/berries_detector/requirements.txt
pip install pycoral utmSet the UAV namespace and launch the detector:
export UAV_NAME=uav15
roslaunch berries_detector berry_detector.launchTo override the model at launch time:
roslaunch berries_detector berry_detector.launch model_name:=yolo11a_edgetpu.tfliteKey parameters loaded from config/berry_detector.yaml:
PARQUET_FILE:/tmp/inference_results.parquetPUBLISHED_TOPIC:inference_resultsMODEL_INPUT_SIZE:[320, 320]IMAGE_TOPIC:continuous_gopro_photo/image_rawCAMERA_INFO_TOPIC:continuous_gopro_photo/camera_infoFRAME_ID:common_originMARKER_TOPIC:marker/berry_detectionGPS_TOPIC:gps/filteredBASE_STATION_TOPIC:hw_api/rtkGARMIN_TOPIC:hw_api/distance_sensorODOM_TOPIC:lio_sam/imupreintegration/odomMARKER_FRAME_ID:uav15/fcuCLOUD_BERRY_CLASS_ID:2CONFIDENCE_THRESHOLD:0.7CONCURRENT_WORKERS:1
The launch file also sets:
HFOV:156.0VFOV:156.0Z_REF:0.32A_REF:0.0039
- The repository includes multiple detector implementations. The launch file currently selects the Coral/TFLite path.
- The ONNX and CPU TFLite scripts are still present, but they are not the default runtime entrypoint.
- A Parquet output path is configured, but the active Coral node currently publishes ROS outputs and does not actively append inference rows to the Parquet file in its main processing path.