Skip to content

Latest commit

 

History

History
189 lines (122 loc) · 6.79 KB

how_to_verify_lidar_perception_module.md

File metadata and controls

189 lines (122 loc) · 6.79 KB

Scenario 4: Perceptual lidar function test

This scenario introduces how to use the software package to start the perception lidar module, helping developers to get familiar with the Apollo perception module and lay the foundation. You can observe the detection results during the operation of the perception lidar by playing the record data package provided by Apollo.

Prerequisites

This document assumes that you have followed Package Installation > Install the Apollo environment management tool to complete step 1 and step 2. Compared with the above three scenarios, the function of the test perception module needs to use the GPU, so the GPU image of the software package must be obtained for test verification .

Step 1: Start and enter the Apollo Docker environment

  1. Create a workspace:

    mkdir apollo_v8.0
    cd apollo_v8.0
  2. Enter the following command to enter the container environment in GPU mode:

    aem start_gpu -f
  3. Enter the following command to enter the container:

    aem enter
  4. Initialize the workspace:

    aem init

Step 2: Download the record data package

  1. Enter the following command to download the data package:

    wget https://apollo-system.bj.bcebos.com/dataset/6.0_edu/sensor_rgb.tar.xz
  2. Create a directory and extract the downloaded installation package into this directory:

    sudo mkdir -p ./data/bag/
    sudo tar -xzvf sensor_rgb.tar.xz -C ./data/bag/

Step 3: Install DreamView

In the same terminal, enter the following command to install the DreamView program.

buildtool install --legacy dreamview-dev monitor-dev

Step 4: Install transform, perception and localization

  1. In the same terminal, enter the following command to install the perception program.

    buildtool install --legacy perception-dev
  2. Enter the following commands to install the localization , v2x and transform programs.

     buildtool install --legacy localization-dev v2x-dev transform-dev

Step 5: Module running

  1. In the same terminal, enter the following command to start Apollo's DreamView program.

    aem bootstrap start

    Open the browser and enter the localhost:8888 address, select the model, vehicle configuration, and map.

    包-dreamview2.png

    Click the Module Controller module in the status bar on the left side of the page to enable the Transform module:

    包- transform.png

  2. Use the mainboard method to enable the Lidar module:

     mainboard -d /apollo/modules/perception/production/dag/dag_streaming_perception_lidar.dag

Step 6: Result verification

  1. It is necessary to use the -k parameter to mask out the perception channel data contained in the record.

     cyber_recorder play -f ./data/bag/sensor_rgb.record -k /perception/vehicle/obstacles /apollo/perception/obstacles /apollo/perception/traffic_light /apollo/prediction
  2. Verify detection results: View detection results in DreamView. Click LayerMenu in the toolbar on the left side of Dreamview, open the Point Cloud in Perception, and select the corresponding channel to view the point cloud data. Check whether the 3D detection results can correspond to the Lidar sensor data.

    结果1.png

    View Results:

    包-结果2.png

Step 7: Model Replacement

The following describes the parameter configuration and replacement process of the MASK_PILLARS_DETECTION, CNN_SEGMENTATION and CENTER_POINT_DETECTION models in the lidar detection process. You can easily replace these configurations in lidar_detection_pipeline.pb.txt to load and run different models.

MASK_PILLARS_DETECTION model replacement

Modify the configuration file content in lidar_detection_pipeline.pb.txt:

 vim /apollo/modules/perception/pipeline/config/lidar_detection_pipeline.pb.txt

Replace stage_type with MASK_PILLARS_DETECTION:

stage_type: MASK_PILLARS_DETECTION

mask1.png

And modify the configuration file information content of the corresponding stage:

stage_config: {
  stage_type: MASK_PILLARS_DETECTION
  enabled: true
}

mask2.png

After saving the modified configuration file, enable the Lidar module and play the record to verify the detection result:

mask3.png

CNN_SEGMENTATION model replacement

Modify the configuration file content in lidar_detection_pipeline.pb.txt: replace stage_type with CNN_SEGMENTATION, and modify the configuration file content of the corresponding stage accordingly:

stage_type: CNN_SEGMENTATION
stage_config: {
  stage_type: CNN_SEGMENTATION
  enabled: true

  cnnseg_config: {
    sensor_name: "velodyne128"
    param_file: "/apollo/modules/perception/production/data/perception/lidar/models/cnnseg/cnnseg64_param.conf"
    proto_file: "/apollo/modules/perception/production/data/perception/lidar/models/cnnseg/cnnseg64_caffe/deploy.prototxt"
    weight_file: "/apollo/modules/perception/production/data/perception/lidar/models/cnnseg/cnnseg64_caffe/deploy.caffemodel"
    engine_file: "/apollo/modules/perception/production/data/perception/lidar/models/cnnseg/cnnseg64_caffe/engine.conf"
  }
}

Enable the lidar module and play the record verification detection result:

cnn1.png

CENTER_POINT_DETECTION model replacement

Replace stage_type with CENTER_POINT_DETECTION:

stage_type: CENTER_POINT_DETECTION

Modify the configuration file information content of the corresponding stage:

stage_config: {
  stage_type: CENTER_POINT_DETECTION
  enabled: true
}

Enable the lidar module and play the record verification detection result:

centor1.png