我是靠谱客的博主 认真黑米,这篇文章主要介绍Udacity Sensor Fusion学习笔记Creating the Lidar Object,现在分享给大家,希望可以做个参考。

24/08/2019
https://github.com/udacity/SFND_Lidar_Obstacle_Detection/tree/master/src

Code Structure

  • Top-level CMakeLists.txt
  • Readme
  • src
    • render
      • box.h - this file has the struct definitions for box objects
      • render.h
      • render.cpp - this file, along with the header, define the classes and methods for rendering objects.
    • sensors
      • data - this directory contains pcd data used in the course.
      • lidar.h - has functions using ray casting for creating pcd.
    • environment.cpp - the main file for using pcl viewer and processing and visualizing pcd.
    • processPointClouds.h
    • processPointClouds.cpp - Functions for filtering, segmenting, clustering, boxing, loading, and saving pcd.

使用工作站

Compilation Instructions

  • In the terminal workspace below, make sure that GPU is enabled.
  • Click on Desktop button on lower right.
  • Click on Terminator to load up work space desktop terminal.
  • From the terminal, go to the project root directory, cd /home/workspace/SFND-Lidar-Obstacle-Detection.
  • Create a new directory from the project root named build with the following command: mkdir build.
  • Then go into the build directory: cd build.
  • Run cmake pointing to the CMakeLists.txt in the root: cmake ... If everything went well you should see something like
    复制代码
    1
    2
    3
    4
    -- Configuring done -- Generating done -- Build files have been written to: /your directory/simple_highway/build
  • If cmake was successful, then from inside build run make: make
  • If make built target environment 100%, it will have generated an executable called environment. This build process is defined from the CMakeLists.txt file.

跑仿真

Instructions

Once you have built an executable file, you can lunch it by doing ./environment. Now you should see a window popping up that looks like the image above.

Here you have a simple highway simulator environment with the ego car in green in the center lane (thats your car), and the other traffic cars in blue. Everything is rendered using PCL with simple boxes, lines, and colors. You can move around your environment with the mouse. Try holding the left mouse button to orbit around the scene. You can also pan around the scene by holding the middle mouse button and moving. To zoom, use the middle scroll mouse button or the right mouse button while moving.

Recap

  • Using terminator in the virtual desktop, run the executable from the build directory using ./environment.
  • You should see a 3D popup window with the road and cars.
  • You can move around the environment.
  • Zoom: hold the right mouse key and move the mouse forward/backwards, or use your mouse scroller.
  • Pan: Hold down the middle mouse button (the scroller) and move the mouse.
  • Rotate: Hold the left mouse button and move the mouse.

Lidar模拟

Creating the Lidar Object

The first thing you are going to do is create a lidar object. The lidar object is defined by the src/sensors/lidar.h header file which is included at the top of environment.cpp. Also in environment.cpp is the simpleHighway function, which takes a reference argument for the PCL visualizer viewer that was discussed previously.

Exercise Instructions

You will instantiate a pointer to a Lidar object in the simpleHighway function. You should create the Lidar pointer object on the heap, using the new keyword. The Lidar constructor takes two arguments: cars and the slope of the ground - these arguments are necessary for modeling ray collisions. The Lidar object should be created with a slope of 0.

Note

The lidar arguments are necessary for modeling ray collisions. The Lidar object is going to be holding point cloud data which could be very large. By instatinating on the heap, we have more memory to work with than the 2MB on the stack. However, it takes longer to look up objects on the heap, while stack lookup is very fast.

最后

以上就是认真黑米最近收集整理的关于Udacity Sensor Fusion学习笔记Creating the Lidar Object的全部内容,更多相关Udacity内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(80)

评论列表共有 0 条评论

立即
投稿
返回
顶部