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中浅尝内存泄漏的实战记录

《在SpringBoot中浅尝内存泄漏的实战记录》本文给大家分享在SpringBoot中浅尝内存泄漏的实战记录,结合实例代码给大家介绍的非常详细,感兴趣的朋友一起看看吧... 目录使用静态集合持有对象引用,阻止GC回收关键点:可执行代码:验证:1,运行程序(启动时添加JVM参数限制堆大小):2,访问 htt

MySQL 中查询 VARCHAR 类型 JSON 数据的问题记录

《MySQL中查询VARCHAR类型JSON数据的问题记录》在数据库设计中,有时我们会将JSON数据存储在VARCHAR或TEXT类型字段中,本文将详细介绍如何在MySQL中有效查询存储为V... 目录一、问题背景二、mysql jsON 函数2.1 常用 JSON 函数三、查询示例3.1 基本查询3.2

Python获取中国节假日数据记录入JSON文件

《Python获取中国节假日数据记录入JSON文件》项目系统内置的日历应用为了提升用户体验,特别设置了在调休日期显示“休”的UI图标功能,那么问题是这些调休数据从哪里来呢?我尝试一种更为智能的方法:P... 目录节假日数据获取存入jsON文件节假日数据读取封装完整代码项目系统内置的日历应用为了提升用户体验,

Spring Boot 配置文件之类型、加载顺序与最佳实践记录

《SpringBoot配置文件之类型、加载顺序与最佳实践记录》SpringBoot的配置文件是灵活且强大的工具,通过合理的配置管理,可以让应用开发和部署更加高效,无论是简单的属性配置,还是复杂... 目录Spring Boot 配置文件详解一、Spring Boot 配置文件类型1.1 applicatio

MySQL INSERT语句实现当记录不存在时插入的几种方法

《MySQLINSERT语句实现当记录不存在时插入的几种方法》MySQL的INSERT语句是用于向数据库表中插入新记录的关键命令,下面:本文主要介绍MySQLINSERT语句实现当记录不存在时... 目录使用 INSERT IGNORE使用 ON DUPLICATE KEY UPDATE使用 REPLACE

Python 中的异步与同步深度解析(实践记录)

《Python中的异步与同步深度解析(实践记录)》在Python编程世界里,异步和同步的概念是理解程序执行流程和性能优化的关键,这篇文章将带你深入了解它们的差异,以及阻塞和非阻塞的特性,同时通过实际... 目录python中的异步与同步:深度解析与实践异步与同步的定义异步同步阻塞与非阻塞的概念阻塞非阻塞同步

Python Dash框架在数据可视化仪表板中的应用与实践记录

《PythonDash框架在数据可视化仪表板中的应用与实践记录》Python的PlotlyDash库提供了一种简便且强大的方式来构建和展示互动式数据仪表板,本篇文章将深入探讨如何使用Dash设计一... 目录python Dash框架在数据可视化仪表板中的应用与实践1. 什么是Plotly Dash?1.1

Spring Boot中定时任务Cron表达式的终极指南最佳实践记录

《SpringBoot中定时任务Cron表达式的终极指南最佳实践记录》本文详细介绍了SpringBoot中定时任务的实现方法,特别是Cron表达式的使用技巧和高级用法,从基础语法到复杂场景,从快速启... 目录一、Cron表达式基础1.1 Cron表达式结构1.2 核心语法规则二、Spring Boot中定

Java进阶学习之如何开启远程调式

《Java进阶学习之如何开启远程调式》Java开发中的远程调试是一项至关重要的技能,特别是在处理生产环境的问题或者协作开发时,:本文主要介绍Java进阶学习之如何开启远程调式的相关资料,需要的朋友... 目录概述Java远程调试的开启与底层原理开启Java远程调试底层原理JVM参数总结&nbsMbKKXJx

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

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