Skip to content

Creating a 3D map

Will Heitman edited this page Oct 30, 2021 · 2 revisions

Overview

Pointcloud maps are filtered, processed collections of points gathered from Lidar sensors over time and space. We use these maps as references when we localize the vehicle.

This is an overview of creating a pointcloud map from scratch. We'll do it in the SVL simulator. Instructions for real-world map generation should be added later, but should follow the same general process.

Demonstration

A brief video demo is available here.

Requirements

  • Latest VDE (1.0.2 is used here)
  • SVL, installed on the host outside of VDE
    • Don't forget that you'll need a free account with them
  • The SVL Bridge

Creating a map

  1. Start the SVL simulator and enter a simulation. The SanFrancisco map is used here, along with the AWFLexus2016RXHybrid and a ROS2 bridge connected on 127.0.0.1:90901.
  2. Enter VDE in two separate sessions.
  3. In the first session, start the LGSVL Bridge by sourcing its directory (e.g. source ~/tools/ros2-lgsvl-bridge/install/setup.bash) and simply running lgsvl_bridge.
  4. In the second session, source Autoware.Auto (source /opt/AutowareAuto/setup.bash) and launch the mapping nodes by running ros2 launch ndt_mapping_nodes ndt_mapper.launch.py.

That's it. The ndt_mapper nodes will generate a .pcd file in your current working directory (wherever you ran the launch file). To stop mapping, simply stop the launch file by pressing Ctrl+C.

Explanation

Obviously the Autoware.Auto nodes are doing all the work here. Let's take a brief look at ndt_mapper.launch.py.

Param files

The launch file loads three parameter files.

  • ndt_mapper.param.yaml specifies
    • The maximum size of the new map
    • Options for the real-time localizer, which is basically lidar-based dead reckoning.
    • The output file name.
  • scan_downsampler.param.yaml specifies how our point cloud will be reduced to a grid.
  • vlp16_sim_lexus_filter_transform.param.yaml is a vehicle-specific file that outlines how the Lidar sensors' observations are transformed into the vehicle's main frame (called base_link).

Nodes

These param files are sent to three nodes, or executables:

  • point_cloud_filter_transform_node_exe is responsible for removing any points we don't need from the incoming Lidar data, including ground points.
  • voxel_grid_node_exe creates a simplified, grid-based representation of our map that complements our detailed point cloud version.
  • ndt_mapper_node_exe is the big boss. It takes our points (which are now filtered, transformed, and downsampled) and registers them to our new map.

Visualizing the map

We can use a lightweight tool called pcl_viewer to inspect our new pointcloud map. This tool is only availble for Linux.

In the host machine, outside of VDE, do the following:

  1. sudo apt update && sudo apt install pcl-tools
  2. Navigate to the VDE share folder where the .pcd file is stored, e.g. cd ~/vdehome
  3. Launch the viewer with pcl_viewer -multiview 1 <filename.pcd>

PCD viewer Example of PCD Viewer visualization

Clone this wiki locally