Network setup - YoshuaNava/spinning_lidar GitHub Wiki
Using an Ethernet cable connect the Hokuyo sensor to your computer.
Find out the ID of the Ethernet port to which you connected it. Once you know its ID, you'll have to set up a static IP (in the network 192.168.0.0/24) on it. The Hokuyo sensor we're using has the IP 192.168.0.10
configured by default. To set up the IP of your PC port, run:
sudo ifconfig <port_id> 192.168.0.5/24
The command presented above will set up the IP on the port until you disconnect/connect the Ethernet cable, or restart your computer.
If you want to set the IP from startup, such that you don't need to run the command each time, add the following lines to your /etc/network/interfaces
file:
auto <port_id>
iface <port_id> inet static
address 192.168.0.5
netmask 255.255.255.0
If you want to test your setup, run:
ping 192.168.0.10
You should see an output like the following:
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_seq=1 ttl=64 time=0.129 ms
64 bytes from 192.168.0.10: icmp_seq=2 ttl=64 time=0.139 ms
64 bytes from 192.168.0.10: icmp_seq=3 ttl=64 time=0.138 ms
...
Once you have configured your network, run:
roslaunch spinning_lidar_launch hokuyo_urg.launch
You should be able to visualize the LIDAR readings by opening rviz and adding the topic /spinning_lidar/scan