2D LIDAR and ROS 2 Cartographer#

Slamtec* RPLIDAR A3 2D LIDAR#

  1. Connect a Slamtec* RPLIDAR A3 2D LIDAR to your system.

  2. Add a new udev rule.

    1. Create a new file:

      sudo nano /etc/udev/rules.d/rplidar.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:="0666", SYMLINK+="rplidar"
      
    3. Reload the rules:

      sudo udevadm control --reload-rules
      sudo udevadm trigger
      
  3. Check if your installation has the amr-rplidar and amr-cartographer Docker* images.

    docker images |grep amr-rplidar
    #if you have it installed, the result is:
    amr-rplidar
    
    docker images |grep amr-cartographer
    #if you have it installed, the result is:
    amr-cartographer
    

    Note

    If one or both of the images are not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).

  4. If one or both of the images are not installed, Intel® recommends installing the Robot Base Kit or Robot Complete Kit with the Get Started Guide for Robots.

  5. Check that EI for AMR environment is set:

    echo $AMR_TUTORIALS
    # should output the path to EI for AMR tutorials
    /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
    

    If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.

  6. Run the Sample Application.

    1. Export the device port name:

      export RPLIDAR_SERIAL_PORT=/dev/rplidar
      # this value was set up in the step 2b
      
    2. Run the Slamtec* RPLIDAR tutorial:

      docker compose -f $AMR_TUTORIALS/cartographer.rplidar_a3.lua.tutorial.yml up
      
      ../_images/DB95FCEF-E981-4E05-B343-027B169A871A-low.png
  7. Go to rviz2 that is already open, and turn off LaserScan.

  8. Click Add in lower left corner, click By topic, select PointCloud2 from the /scan_matched_points2 topic, and click OK.

    ../_images/5D4E1CD1-B4B1-4C1A-A3EB-D56BF37145B8-low.png
    The rviz2 window looks like this:
    ../_images/EC115068-5680-4CA7-BC80-053C11AE7446-low.png

SICK* nanoScan3* Safety Laser Scanner#

  1. Connect a SICK* nanoScan3* laser scanner to your system. For the hardware setup and configuration required in a production environment, see the SICK* website.

  2. Get the SICK* nanoScan3* laser scanner’s IP and the host’s IP.

    This information can be found when configuring the SICK* nanoScan3* laser scanner using the Safety Designer, in the “Networking” chapter.

  3. Check if your installation has the amr-sick-nanoscan and amr-cartographer Docker* images.

    docker images |grep amr-sick-nanoscan
    #if you have it installed, the result is:
    amr-sick-nanoscan
    
    docker images |grep amr-cartographer
    #if you have it installed, the result is:
    amr-cartographer
    

    Note

    If one or both of the images are not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).

  4. If one or both of the images are not installed, Intel® recommends installing the Robot Complete Kit with the Get Started Guide for Robots.

  5. Check that EI for AMR environment is set:

    echo $AMR_TUTORIALS
    # should output the path to EI for AMR tutorials
    /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
    

    If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.

  6. Run the Sample Application.

    1. Prepare the environment for lidar access:

      # Export the Sick NanoScan3 IP and the host's IP
      export HOST_IP=<host_ip>
      export SICK_NANOSCAN_IP=<sick_nanoscan_ip>
      
    2. Run the SICK* nanoScan3* laser scanner tutorial:

      docker compose -f $AMR_TUTORIALS/cartographer.sick_nanoscan.lua.tutorial.yml up
      
  7. In rviz2, add the LaserScan topic (Add > By Topic > scan/LaserScan), and change Fixed Frame to scan:

    ../_images/sick_nanoscan_rviz.png
  8. Go to rviz2 that is already open, and turn off LaserScan.

  9. Click Add in lower left corner, click By topic, select PointCloud2 from the /scan_matched_points2 topic, and click OK.

    ../_images/5D4E1CD1-B4B1-4C1A-A3EB-D56BF37145B8-low.png
    The rviz2 window looks like this:
    ../_images/sick_nanoscan_cartographer.png

Troubleshooting#

For general robot issues, go to: Troubleshooting for Robot Tutorials.