处理和显示激光雷达数据

时间:2020-08-30 01:15:06

标签: opencv ros point-cloud-library point-clouds

我是激光雷达加工的新手。我对激光雷达数据的深度/范围值感兴趣。我想提取这些值并像代码中显示的图像数据一样显示。最好的方法是什么?我只显示了代码的相关部分

#include <sensor_msgs/PointCloud2.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>

static const std::string OPENCV_WINDOW = "Image window";

using namespace sensor_msgs;
using namespace message_filters;

void callback(const ImageConstPtr& image1, const sensor_msgs::PointCloud2ConstPtr& pc1)
 {
   cv_bridge::CvImagePtr cv_ptr;
   try
   {
     cv_ptr = cv_bridge::toCvCopy(image1, sensor_msgs::image_encodings::BGR8);
   }
   catch (cv_bridge::Exception& e)
   {
     ROS_ERROR("cv_bridge exception: %s", e.what());
     return;
   }

    // Update GUI Window
    cv::imshow(OPENCV_WINDOW, cv_ptr->image);
    cv::waitKey(3);

0 个答案:

没有答案