Documentation

  • 2021.2
  • 06/30/2021
  • Public Content

Launch Cartographer with 2D LIDAR

Prerequisites

Before you run the sample application, you must add a udev rule.
  1. Enter the command:
    sudo nano /etc/udev/rules.d/rpildar.rules
  2. Add these lines:
    # set the udev rule, make the device_port be fixed by rplidar # KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0777", SYMLINK+="rplidar"
  3. Reload the rules:
    sudo udevadm control --reload-rules sudo udevadm trigger

Run the Sample Application

  1. Go to the
    AMR_containers
    folder:
    cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
  2. Open a terminal. Run the command below to start the Docker* container.
    Terminal A
    ./run_interactive_docker.sh amr-ubuntu2004-full-flavour-sdk:<TAG> ros2 launch rplidar_ros2 view_rplidar_a3_launch.py
  3. Open another terminal. Attach to the running container and get the container ID of your running Docker image:
    Terminal B
    docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ad0af7a34051 ger-is-registry.caas.intel.com/sunsetlake/amr-ubuntu2004-full-flavour-sdk "/docker_entrypoint.…" 3 hours ago Up 3 hours amr_sdk_docker docker exec -it <container_id> /bin/bash # (e.g. docker exec -it ad0af7a34051 /bin/bash)
  4. Within the Docker container, run the commands:
    source /ros_entrypoint.sh ros2 run cartographer_ros cartographer_node -configuration_directory /opt/ros/foxy/share/cartographer/configuration_files/ -configuration_basename rplidar_a3.lua
  5. Go to rviz that is already open and uncheck
    LaserScan
    on the left side.
  6. Click
    Add
    in lower left corner, click by topic and add
    PointCloud2
    from the
    /scan_matched_points2
    topic.

Summary and Next Steps

In this tutorial, you learned how to launch the Cartographer application with 2D LIDAR.
As a next step, see the Run FastMapping Algorithm tutorial.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.