https://github.com/xiangkejun/chuan/tree/master/chuan_ws/src/euclidean_cluster_xx?1546276764383
将分割后的地面上的点云进行聚类提取。
并以box的形式包围起来。
参考:https://blog.csdn.net/AdamShan/article/details/83015570
//xx
//添加3dlidar
//通过flag_3dlidar_stauts 开启和关闭3dlidar
// 用地面分割后的点云进行跟踪
#include "euclidean_cluster_core.h"
#include <iostream>
int flag_3dlidar_stauts; //3d lidar 控制状态
EuClusterCore::EuClusterCore(ros::NodeHandle &nh)
{
seg_distance_ = {15, 30, 45, 60};
// cluster_distance_ = {0.5, 1.0, 1.5, 2.0, 2.5};
cluster_distance_ = {1.0, 1.0, 1.5, 2.0, 2.5};
sub_point_cloud_ = nh.subscribe("/velodyne_points", 5, &EuClusterCore::point_cb, this);
//xx
//有两个地发发布 flag_nav_to_3dlidar,1.导航交控制权给3dlidar 2.3dbox处理完发取消3dbox的发布
sub_nav_to_3dlidar_ = nh.subscribe("flag_nav_to_3dlidar",1,&EuClusterCore::flag_nav_to_3dlidar_cb,this);
// sub_point_cloud_ = nh.subscribe("/filtered_points_no_ground", 5, &EuClusterCore::point_cb, this);
// pub_bounding_boxs_ = nh.advertise<jsk_recognition_msgs::BoundingBoxArray>("/detected_bounding_boxs", 5);
pub_bounding_boxs_ = nh.advertise<jsk_recognition_msgs::BoundingBoxArray>("/box_lidar_points", 5);
ros::spin();
}
// 订阅点云数据后 得到box 以节点 /box_lidar_points发布
启动
roslaunch euclidean_cluster box_lidar_xx.launch