Skip to content

Containerized ROS node that communicates with x4 lidar via USB pass though from the docker host

License

Notifications You must be signed in to change notification settings

ptrks/ROS-YDLidar-x4-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Containerized ROS node that communicates with x4 lidar via USB pass though from the docker host

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published