ros之MarkerArray使用
使用ros中的marker array来给点云画boundingbox。
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>
void ImageCloudFusion::getMarkerArray(const std::vector<CloudType> cluster_cloud_v,
visualization_msgs::MarkerArray& marker_array)
{
if (cluster_cloud_v.empty())
{
std::cerr << "getMarkerArray: input vector is empty!" << std::endl;
return;
}
marker_array.markers.clear();
visualization_msgs::Marker bbox_marker;
bbox_marker.header.frame_id = "rslidar";
bbox_marker.header.stamp = ros::Time::now();
bbox_marker.ns = "";
bbox_marker.color.r = 1.0f;
bbox_marker.color.g = 0.0f;
bbox_marker.color.b = 0.0f;
bbox_marker.color.a = 0.2;
bbox_marker.lifetime = ros::Duration();
bbo