udacity sensor fusion(1)Lidar Obstacle Detection学习记录

2023-10-14 07:30

本文主要是介绍udacity sensor fusion(1)Lidar Obstacle Detection学习记录,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

INTRODUCE TO LIDAR AND POINTS CLOUDS

10 The course starter code

告诉了这一部分代码的主要作用
在这里插入图片描述

13 The PCL Viewer

解释了PCL库中的VIEWER,在environment.cpp中,将初始化的viewer传引用到两个函数中

15 ~ 16

使用lidar.h中的structure

  1. 初始化struct pointor lidar
  2. 调用lidar->scan(),创建pcl::PointXYZ 类型的点云
  3. 调用PCL viewer可视化创建的点云

17 Templates and Different Point Cloud Data

  1. 介绍模板的概念:
    http://www.cplusplus.com/doc/oldtutorial/templates/
    Function templates are special functions that can operate with generic types. This allows us to create a function template whose functionality can be adapted to more than one type or class without repeating the entire code for each type.

The format for declaring function templates with type parameters is:

template <class identifier> function_declaration;
template <typename identifier> function_declaration;

For example, to create a template function that returns the greater one of two objects we could use:

template <class myType>
myType GetMax (myType a, myType b) {return (a>b?a:b);
}

To use this function template we use the following format for the function call:

 function_name <type> (parameters);

For example, to call GetMax to compare two integer values of type int we can write:

int x,y;
GetMax <int> (x,y); // <int>中int就相当于myType,调用时要放在函数名之后

Point Cloud Segmentation

For the most part, any free space on the road is not an obstacle, and if the road is flat it’s fairly straightforward to pick out road points from non-road points. To do this we will use a method called Planar Segmentation which uses the RANSAC (random sample consensus) algorithm.

03 Point Processing

在Environment里面初始化一个ProcessPointClouds类对象
可以使用两种方式:heap 和 stack, 以及注意模板类方法的使用

    // TODO:: Create point processor// Template type is going to be a PCL point XYZ// ProcessPointClouds<pcl::PointXYZ> pointProcessor // instantiate on the stackProcessPointClouds<pcl::PointXYZ>* pointProcessor = new ProcessPointClouds<pcl::PointXYZ>(); // instantiate on the heap | use open parentheses to instantiate it

04 Segmenting the Plane with PCL

// At the top of the function, you will notice a template parameter PointT. 
// You will be using this as a variable to represent any type of point cloud, 
// and it will come in handy later when you are processing point clouds with intensity values.
// SegmentPlane Function Signaturestd::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> SegmentPlane(typename pcl::PointCloud<PointT>::Ptr cloud, int maxIterations, float distanceThreshold);// The function accepts a point cloud, max iterations, and distance tolerance as arguments. // Segmentation uses an iterative process. More iterations have a chance of returning better results // but take longer. The segmentation algorithm fits a plane to the points and uses the distance tolerance// to decide which points belong to that plane. A larger tolerance includes more points in the plane. 
// Extracting indices from a PointCloud
// http://pointclouds.org/documentation/tutorials/extract_indices.php#extract-indices

05 Separating Point Clouds

在这里插入图片描述

  1. 主要是完成ProcessPointClouds类模板中的两个模板函数
    SeparateClouds();// 分割后pcl extract点云提取参数设置

SegmentPlane(); // 分割pcl segment参数的设置

参考:
http://pointclouds.org/documentation/tutorials/extract_indices.php#extract-indices

06. RANSAC

RANSAC overview

One type of RANSAC version selects the smallest possible subset of points to fit. For a line, that would be two points, and for a plane three points. Then the number of inliers are counted, by iterating through every remaining point and calculating its distance to the model. The points that are within a certain distance to the model are counted as inliers. The iteration that has the highest number of inliers is then the best model. This will be the version that you will implement in this quiz.

RANSAC的其他损失函数:
Other methods of RANSAC could sample some percentage of the model points, for example 20% of the total points, and then fit a line to that. Then the error of that line is calculated, and the iteration with the lowest error is the best model. This method might have some advantages since not every point at each iteration needs to be considered. It’s good to experiment with different approaches and time results to see what works best.

07. Implementing RANSAC for Lines

quiz about RANSAC

08 Implementing RANSAC for Plane

Clustering Obstacles

The idea is you associate groups of points by how close together they are. To do a nearest neighbor search efficiently, you use a KD-Tree data structure which, on average, speeds up your look up time from O(n) to O(log(n)).

This is because the tree allows you to better break up your search space. By grouping points into regions in a KD-Tree, you can avoid calculating distance for possibly thousands of points just because you know they are not even considered in a close enough region.

Euclidean Clustering with PCL

  1. Any points within that distance will be grouped together. It also has min and max arguments for the number of points to represent as clusters.

  2. The idea is: if a cluster is really small, it’s probably just noise and we are not concerned with it.
    Also a max number of points allows us to better break up very large clusters.

  3. if a cluster is very large it might just be that many other clusters are overlapping, and a max tolerance can help us better resolve the object detections.

  4. The last argument to the euclidean cluster object is the Kd-Tree. The tree is created and built using the input cloud points, which in this case are going to be the obstacle cloud points.

03 Euclidean Cluster Extraction

http://pointclouds.org/documentation/tutorials/cluster_extraction.php

  1. 主要是完成ProcessPointClouds类模板中的一个模板函数
    Clustering() // 聚类参数的设置

04 Implementing KD-Tree

在这里插入图片描述
A KD-Tree is a binary tree that splits points between alternating axes. By separating space by splitting regions, nearest neighbor search can be made much faster when using an algorithm like euclidean clustering.

in the function insert which takes a 2D point represented by a vector containing two floats, and a point ID.
The ID is a way to uniquely identify points and a way to tell which index the point is referenced from on the
overall point cloud. there is a function for rendering the tree after points have been inserted into it. The image below shows line
separations, with blue lines splitting x regions and red lines splitting y regions. The image shows what the
tree looks like after all 11 points have been inserted, 

在这里插入图片描述

05-08 kdTREE 的quize

09 Bounding Box以及PCA Box的挑战

Working in real PCD

02. Load PCD

在这里插入图片描述

04 Downsampling

Michael:
we down-sample lidar data,
在这里插入图片描述
we convert the point into stixels,like what we do with the stereo cameras, stixels’ basiucally like a matchstick
so if you have the back of a vehicle, the stixels would be putting a bunch of matchsticks to hover the trunk or conver the vehicle, this give you two things:

  1. the number of matchsticks(each one say four inches wide 告诉你车辆宽度 | height of matchsticks告诉你车辆高度),但是你不需要stixel中间的数据,你只需要高度宽度,这样能减少数据

05. Filtering with PCL

在这里插入图片描述
voxel:it is a 3D pixel or called volume pixel 类似于我的世界, each of those blocks is actually a voxel

documentation from PCL for voxel grid filtering and region of interest.

http://pointclouds.org/documentation/tutorials/voxel_grid.php // voxel grid filtering
http://docs.pointclouds.org/trunk/classpcl_1_1_crop_box.html // region of interest.`在这里插入代码片`
主要补全ProcessPointClouds<PointT>::FilterCloud 类模板函数

07. Stream PCD

这一章有filter, segmentation, cluster的一些参数

这篇关于udacity sensor fusion(1)Lidar Obstacle Detection学习记录的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/209025

相关文章

国内环境搭建私有知识问答库踩坑记录(ollama+deepseek+ragflow)

《国内环境搭建私有知识问答库踩坑记录(ollama+deepseek+ragflow)》本文给大家利用deepseek模型搭建私有知识问答库的详细步骤和遇到的问题及解决办法,感兴趣的朋友一起看看吧... 目录1. 第1步大家在安装完ollama后,需要到系统环境变量中添加两个变量2. 第3步 “在cmd中

Spring Retry 实现乐观锁重试实践记录

《SpringRetry实现乐观锁重试实践记录》本文介绍了在秒杀商品SKU表中使用乐观锁和MybatisPlus配置乐观锁的方法,并分析了测试环境和生产环境的隔离级别对乐观锁的影响,通过简单验证,... 目录一、场景分析 二、简单验证 2.1、可重复读 2.2、读已提交 三、最佳实践 3.1、配置重试模板

在 Spring Boot 中使用异步线程时的 HttpServletRequest 复用问题记录

《在SpringBoot中使用异步线程时的HttpServletRequest复用问题记录》文章讨论了在SpringBoot中使用异步线程时,由于HttpServletRequest复用导致... 目录一、问题描述:异步线程操作导致请求复用时 Cookie 解析失败1. 场景背景2. 问题根源二、问题详细分

Java深度学习库DJL实现Python的NumPy方式

《Java深度学习库DJL实现Python的NumPy方式》本文介绍了DJL库的背景和基本功能,包括NDArray的创建、数学运算、数据获取和设置等,同时,还展示了如何使用NDArray进行数据预处理... 目录1 NDArray 的背景介绍1.1 架构2 JavaDJL使用2.1 安装DJL2.2 基本操

关于Spring @Bean 相同加载顺序不同结果不同的问题记录

《关于Spring@Bean相同加载顺序不同结果不同的问题记录》本文主要探讨了在Spring5.1.3.RELEASE版本下,当有两个全注解类定义相同类型的Bean时,由于加载顺序不同,最终生成的... 目录问题说明测试输出1测试输出2@Bean注解的BeanDefiChina编程nition加入时机总结问题说明

将sqlserver数据迁移到mysql的详细步骤记录

《将sqlserver数据迁移到mysql的详细步骤记录》:本文主要介绍将SQLServer数据迁移到MySQL的步骤,包括导出数据、转换数据格式和导入数据,通过示例和工具说明,帮助大家顺利完成... 目录前言一、导出SQL Server 数据二、转换数据格式为mysql兼容格式三、导入数据到MySQL数据

关于rpc长连接与短连接的思考记录

《关于rpc长连接与短连接的思考记录》文章总结了RPC项目中长连接和短连接的处理方式,包括RPC和HTTP的长连接与短连接的区别、TCP的保活机制、客户端与服务器的连接模式及其利弊分析,文章强调了在实... 目录rpc项目中的长连接与短连接的思考什么是rpc项目中的长连接和短连接与tcp和http的长连接短

Oracle查询优化之高效实现仅查询前10条记录的方法与实践

《Oracle查询优化之高效实现仅查询前10条记录的方法与实践》:本文主要介绍Oracle查询优化之高效实现仅查询前10条记录的相关资料,包括使用ROWNUM、ROW_NUMBER()函数、FET... 目录1. 使用 ROWNUM 查询2. 使用 ROW_NUMBER() 函数3. 使用 FETCH FI

Python MySQL如何通过Binlog获取变更记录恢复数据

《PythonMySQL如何通过Binlog获取变更记录恢复数据》本文介绍了如何使用Python和pymysqlreplication库通过MySQL的二进制日志(Binlog)获取数据库的变更记录... 目录python mysql通过Binlog获取变更记录恢复数据1.安装pymysqlreplicat

Servlet中配置和使用过滤器的步骤记录

《Servlet中配置和使用过滤器的步骤记录》:本文主要介绍在Servlet中配置和使用过滤器的方法,包括创建过滤器类、配置过滤器以及在Web应用中使用过滤器等步骤,文中通过代码介绍的非常详细,需... 目录创建过滤器类配置过滤器使用过滤器总结在Servlet中配置和使用过滤器主要包括创建过滤器类、配置过滤