Skip to main content

LiDAR Object Detection Algorithm

Feature Overview

The LiDAR object detection algorithm is a CenterPoint model trained on the nuscenes dataset using OpenExplorer.

The algorithm takes 32-line LiDAR point cloud data as input and outputs 3D bounding boxes, confidence scores, and object categories. It supports six object classes: car, truck, bus, barrier, motorcycle, and pedestrian.

This example uses local LiDAR point cloud files as input, performs inference on the BPU, and publishes rendered image messages containing the point cloud data, detected bounding boxes, and orientations. The results are visualized in a web browser on a PC.

Code repository: (https://github.com/D-Robotics/hobot_centerpoint)

Supported Platforms

PlatformRuntime EnvironmentExample Functionality
RDK UltraUbuntu 20.04 (Foxy)Uses local point cloud playback and displays rendered inference results via web
RDK S100, RDK S100PUbuntu 22.04 (Humble)Uses local point cloud playback and displays rendered inference results via web

Prerequisites

RDK Platform

  1. The RDK has been flashed with an Ubuntu 20.04 or Ubuntu 22.04 system image.
  2. TogetheROS.Bot has been successfully installed on the RDK.
  3. Ensure your PC can access the RDK over the network.

Usage Guide

RDK Platform

Using Local Point Cloud Files for Playback

The LiDAR object detection algorithm example replays pre-recorded LiDAR point cloud files. After inference, it renders the results into images and publishes them as ROS messages. These messages are then streamed to a PC web browser via a WebSocket package for visualization.

Prepare the LiDAR point cloud files:

# Download point cloud playback files on the device
wget http://archive.d-robotics.cc/TogetheROS/data/hobot_centerpoint_data.tar.gz

# Extract files
mkdir config
tar -zxvf hobot_centerpoint_data.tar.gz -C config
# After extraction, data will be located under config/hobot_centerpoint_data

Launch the algorithm example:

# Configure the tros.b environment
source /opt/tros/setup.bash

# Start the WebSocket service
ros2 launch websocket websocket_service.launch.py

# Launch the example
ros2 launch hobot_centerpoint hobot_centerpoint_websocket.launch.py lidar_pre_path:=config/hobot_centerpoint_data

Result Analysis

After launching the algorithm example, the terminal outputs the following logs:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [hobot_centerpoint-1]: process started with pid [22470]
[INFO] [websocket-2]: process started with pid [22472]
[hobot_centerpoint-1] [WARN] [0948485758.916907430] [centerpoint_node]:
[hobot_centerpoint-1] preprocess_config: config/centerpoint_preprocess_5dim.json
[hobot_centerpoint-1] model_file: config/model/model.hbm
[hobot_centerpoint-1] lidar_list_file: ./config/nuscenes_lidar_val.lst
[hobot_centerpoint-1] is_show: 1
[hobot_centerpoint-1] is_loop: 1
[hobot_centerpoint-1] pub_topic_name: /hobot_centerpoint
[hobot_centerpoint-1] lidar_pre_path: ./config/hobot_centerpoint_data
[hobot_centerpoint-1] [BPU_PLAT]BPU Platform Version(1.3.3)!
[hobot_centerpoint-1] [HBRT] set log level as 0. version = 3.14.25.0
[hobot_centerpoint-1] [DNN] Runtime version = 1.12.3_(3.14.25 HBRT)
[hobot_centerpoint-1] [WARN] [0948485759.205674972] [dnn]: Run default SetOutputParser.
[hobot_centerpoint-1] [WARN] [0948485759.205820889] [dnn]: Set output parser with default dnn node parser, you will get all output tensors and should parse output_tensors in PostProcess.
[hobot_centerpoint-1] [WARN] [0948485759.208895472] [hobot_centerpoint]: A total of 81 files were fetched!
[hobot_centerpoint-1] [WARN] [0948485759.400904472] [CenterPoint_Node]: input fps: -1.00, out fps: -1.00, infer time ms: 61, post process time ms: 57
[hobot_centerpoint-1] [WARN] [0948485759.839328014] [CenterPoint_Node]: input fps: -1.00, out fps: -1.00, infer time ms: 27, post process time ms: 53
[hobot_centerpoint-1] [WARN] [0948485760.281992264] [CenterPoint_Node]: input fps: -1.00, out fps: -1.00, infer time ms: 28, post process time ms: 53
[hobot_centerpoint-1] [WARN] [0948485760.731948223] [CenterPoint_Node]: input fps: 2.93, out fps: 3.01, infer time ms: 27, post process time ms: 56
[hobot_centerpoint-1] [WARN] [0948485761.155906223] [CenterPoint_Node]: input fps: 2.93, out fps: 3.01, infer time ms: 28, post process time ms: 56
[hobot_centerpoint-1] [WARN] [0948485761.572980640] [CenterPoint_Node]: input fps: 2.93, out fps: 3.01, infer time ms: 27, post process time ms: 53
[hobot_centerpoint-1] [WARN] [0948485761.983718973] [CenterPoint_Node]: input fps: 2.40, out fps: 2.40, infer time ms: 28, post process time ms: 55
[hobot_centerpoint-1] [WARN] [0948485762.396930973] [CenterPoint_Node]: input fps: 2.40, out fps: 2.40, infer time ms: 28, post process time ms: 55
[hobot_centerpoint-1] [WARN] [0948485762.816782057] [CenterPoint_Node]: input fps: 2.40, out fps: 2.40, infer time ms: 27, post process time ms: 56
[hobot_centerpoint-1] [WARN] [0948485763.239294099] [CenterPoint_Node]: input fps: 2.39, out fps: 2.39, infer time ms: 27, post process time ms: 57
[hobot_centerpoint-1] [WARN] [0948485763.661555807] [CenterPoint_Node]: input fps: 2.39, out fps: 2.39, infer time ms: 27, post process time ms: 57
[hobot_centerpoint-1] [WARN] [0948485764.084410183] [CenterPoint_Node]: input fps: 2.39, out fps: 2.39, infer time ms: 27, post process time ms: 57
[hobot_centerpoint-1] [WARN] [0948485764.502788849] [CenterPoint_Node]: input fps: 2.37, out fps: 2.37, infer time ms: 27, post process time ms: 55

According to the output logs, the algorithm publishes inference results on the topic /hobot_centerpoint, and processes a total of 81 replayed point cloud files. The overall pipeline—including inference, post-processing (which includes rendering and publishing results)—achieves approximately 2.4 FPS.

To view the rendered images and algorithm results, open a web browser on your PC and navigate to http://IP:8000 (replace IP with the actual IP address of your RDK).