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

相关文章

将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中配置和使用过滤器主要包括创建过滤器类、配置过滤

正则表达式高级应用与性能优化记录

《正则表达式高级应用与性能优化记录》本文介绍了正则表达式的高级应用和性能优化技巧,包括文本拆分、合并、XML/HTML解析、数据分析、以及性能优化方法,通过这些技巧,可以更高效地利用正则表达式进行复杂... 目录第6章:正则表达式的高级应用6.1 模式匹配与文本处理6.1.1 文本拆分6.1.2 文本合并6

python与QT联合的详细步骤记录

《python与QT联合的详细步骤记录》:本文主要介绍python与QT联合的详细步骤,文章还展示了如何在Python中调用QT的.ui文件来实现GUI界面,并介绍了多窗口的应用,文中通过代码介绍... 目录一、文章简介二、安装pyqt5三、GUI页面设计四、python的使用python文件创建pytho

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06