I want to connect Velodyne Lidar(VLP-16) to docker environment. But I have a problem.
I can't Lidar data in docker environment. Lidar works fine because I can get Lidar data successfully in Ubuntu-18.04(not docker environment).
my computer's IP is 192.168.10.250, and Lidar's IP is 192.168.10.201 (I changed Lidar's IP to connect my computer).
But, vEthernet(WSL)'s IP is 172.19.208.1 (may be changed when my computer reboot, and it will be 172.19.xx.xx). And my docker's IP is 172.17.0.xx (docker0 IP).
I wonder why I can ping successfully to Lidar from docker environment, even if computer's ip(192.168.10.xx) and docker's ip(172.17.0.xx) are different.
Although Lidar and Docker are connected(I can ping to Lidar from docker environment), I cannot get Lidar's data. I have the following problem when I enter these commands.
catkin_make (success)
source setup.bash (success)
roslaunch velodyne_pointcloud VLP16_points.launch (error!)
I think I have similar problem in https://github.com/ros-drivers/velodyne/issues/232 . But I can't solve it.
Thank you.
This issue is because the subnet your docker container uses is different than that of your LIDAR. The Velodyne operates on a 255.255.0.0
subnet where the first two octets are different than the container. The easiest way to fix this is to change those LIDAR settings to match what your container uses.
This would look something like having the Host
field be your container IP: 172.17.xx.xx
and making sure the velodyne is on the same subnet: 172.17.10.201