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

相关文章

在Spring Boot中集成RabbitMQ的实战记录

《在SpringBoot中集成RabbitMQ的实战记录》本文介绍SpringBoot集成RabbitMQ的步骤,涵盖配置连接、消息发送与接收,并对比两种定义Exchange与队列的方式:手动声明(... 目录前言准备工作1. 安装 RabbitMQ2. 消息发送者(Producer)配置1. 创建 Spr

k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)

《k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)》本文记录在K8s上运行的MySQL/MariaDB备份方案,通过工具容器执行mysqldump,结合定时任务实... 目录前言一、获取需要备份的数据库的信息二、备份步骤1.准备工作(X86)1.准备工作(arm)2.手

SpringBoot3应用中集成和使用Spring Retry的实践记录

《SpringBoot3应用中集成和使用SpringRetry的实践记录》SpringRetry为SpringBoot3提供重试机制,支持注解和编程式两种方式,可配置重试策略与监听器,适用于临时性故... 目录1. 简介2. 环境准备3. 使用方式3.1 注解方式 基础使用自定义重试策略失败恢复机制注意事项

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

统一返回JsonResult踩坑的记录

《统一返回JsonResult踩坑的记录》:本文主要介绍统一返回JsonResult踩坑的记录,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录统一返回jsonResult踩坑定义了一个统一返回类在使用时,JsonResult没有get/set方法时响应总结统一返回

Go学习记录之runtime包深入解析

《Go学习记录之runtime包深入解析》Go语言runtime包管理运行时环境,涵盖goroutine调度、内存分配、垃圾回收、类型信息等核心功能,:本文主要介绍Go学习记录之runtime包的... 目录前言:一、runtime包内容学习1、作用:① Goroutine和并发控制:② 垃圾回收:③ 栈和

java对接海康摄像头的完整步骤记录

《java对接海康摄像头的完整步骤记录》在Java中调用海康威视摄像头通常需要使用海康威视提供的SDK,下面这篇文章主要给大家介绍了关于java对接海康摄像头的完整步骤,文中通过代码介绍的非常详细,需... 目录一、开发环境准备二、实现Java调用设备接口(一)加载动态链接库(二)结构体、接口重定义1.类型

Android学习总结之Java和kotlin区别超详细分析

《Android学习总结之Java和kotlin区别超详细分析》Java和Kotlin都是用于Android开发的编程语言,它们各自具有独特的特点和优势,:本文主要介绍Android学习总结之Ja... 目录一、空安全机制真题 1:Kotlin 如何解决 Java 的 NullPointerExceptio

apache的commons-pool2原理与使用实践记录

《apache的commons-pool2原理与使用实践记录》ApacheCommonsPool2是一个高效的对象池化框架,通过复用昂贵资源(如数据库连接、线程、网络连接)优化系统性能,这篇文章主... 目录一、核心原理与组件二、使用步骤详解(以数据库连接池为例)三、高级配置与优化四、典型应用场景五、注意事

SpringBoot实现文件记录日志及日志文件自动归档和压缩

《SpringBoot实现文件记录日志及日志文件自动归档和压缩》Logback是Java日志框架,通过Logger收集日志并经Appender输出至控制台、文件等,SpringBoot配置logbac... 目录1、什么是Logback2、SpringBoot实现文件记录日志,日志文件自动归档和压缩2.1、