在跟着创客智造学习autoware时,上面的教程使用的是autoware1.12,而我电脑里配置的是autoware1.14的版本,可能由于版本不同,在进行autoware入门教程-使用Euclidean Clustering进行检测时,在rviz显示中,选择boundingBoxArray,topic为bounding_box无法显示矩形框。
进而,我就在网上查找资料,就找到了此解决方案,进行相关的代码修改:https://blog.csdn.net/qq_38861347/article/details/126103048
1)找到lidar_euclidean_cluster_detect.cpp源码文件
vim ~/autoware.ai/src/autoware/core_perception/lidar_euclidean_cluster_detect/nodes/lidar_euclidean_cluster_detect/lidar_euclidean_cluster_detect.cpp
2)添加头文件<BoundingBoxArray.h>及变量
#include <jsk_recognition_msgs/BoundingBoxArray.h>
ros::Publisher _pub_bounding_boxes;
3)在main函数添加bounding_boxes话题
pub_bounding_boxs_ = h.advertise<jsk_recognition_msgs::BoundingBoxArray>("/bounding_boxes", 5);
4)添加源码,发布话题
添加如下几行源码:
5)编译lidar_euclidean_cluster_detect单个功能包
AUTOWARE_COMPILE_WITH_CUDA=1 colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --continue-on-error --packages-select lidar_euclidean_cluster_detect
6)修改参数
$roslaunch runtime_manager runtime_manager.launch
点开coputing->lidar_euclidean_cluster_detect->app
将输入话题改成 /points_raw,勾选simulation的bag包播放,在选择computing的lidar_euclidean_cluster_detect进行分割显示,显示效果如下图。