Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 2.13 KB

README.md

File metadata and controls

59 lines (44 loc) · 2.13 KB

ros-ydlidar-x4-docker

Overview

This repo demonstrates launching a containorized ROS node that communicates with a lidar sensor over USB. While some of this information is specific to the YDLidar x4, much of the information is generally applicable.

Specifically this guide can help you with the following:

  • Introduction to running ROS within a docker container
  • Creating a reusable dockerfile that downloads an ROS package via git
  • Allowing for bidirectional communication between a docker container and docker host hardware
  • Using Rviz to visualize ROS data that originates from an containorized ROS node

Prerequisites


Getting Started

  • Clone this repository

     git clone [email protected]:patrick--/ROS-YDLidar-x4-docker.git
  • If you haven't gotten the Lidar working on the host OS prior to now, go ahead and run lidar_init_env.sh to create the udev rules and appropriate /dev symlinks for the lidar

     	cd ROS-YDLidar-x4-docker
     	sudo chmod +x lidar_init_env.sh
     	sudo sh +x lidar_init_env.sh
  • Build image from the provided Dockerfile

     cd ROS-YDLidar-x4-docker
     docker build --tag ros:ros-ydlidar-x4 .
  • Launch the container on the host network and ensure to share /dev/ydlidar

     docker run --device /dev/ydlidar --rm --network host --name ydlidar_x4_docker_test  ros:ros-ydlidar-x4

    Note: We use the default host network here for ease of use. If you need to isolate network communication between containers and or your host, you will need to create a network.

  • In another tab simply launch rviz with default settings

    rosrun rviz rviz
  • Change the Fixed Frame drop down to laser_frame and add the LaserScan topic to start seeing lidar data in real time.