Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using the Hokuyo Sensor with ROS on the Raspberry Pi

Similar presentations


Presentation on theme: "Using the Hokuyo Sensor with ROS on the Raspberry Pi"— Presentation transcript:

1 Using the Hokuyo Sensor with ROS on the Raspberry Pi
Varanon Austin Pukasamsombut 留学生 Field Robotics Group, Tohoku University Prof. Yoshida Kazuya, Assoc. Prof. Keiji Nagatani May 12, 2015

2 Basics Required Skills: Basic Knowledge of C++
Experience with the ROS system on the Raspberry Pi My Methods: Raspberry Pi Model B+ running Raspbian ROS Indigo installed from Source Hokuyo UST-20LX Sensor with Ethernet Cable Connection (Other sensor models should work as well) UST-20LX

3 Installation First install the following ROS packages:
hokuyo_node [Main sensor package] urg_node [Updated version for newer sensor models] If you are using a new Hokuyo sensor model (ex. UST-20LX), use urg_node. If you are using an older model that has a USB interface, you will only need the hokuyo_node package.

4 Connecting the UST-20LX to the Raspberry Pi
If you are using a Hokuyo Sensor with an Ethernet cable (UST-20LX), connect it to the Raspberry Pi’s Ethernet port. You will need to edit “/etc/network/interfaces” and add a static IP address for the eth0 port. “ ” is the default IP address for the Hokuyo Sensor. So to use a static IP address to connect with the Raspberry Pi, use “ XX” . The last two digits should be different from “10”. Confirm the connection by pinging the sensor. $ ping

5 Obtain Data from the Hokuyo Sensor
Once you have powered the Hokuyo Sensor and properly established connection to the Raspberry Pi, use urg_node to obtain data from the Hokuyo Sensor through ROS. $ rosrun urg_node urg_node _ip_address:= If you cannot connect and get an error message, make sure that you are connected to the Hokuyo Sensor (ping ).

6 Connecting other Hokuyo Models
If the Hokuyo connects via USB, it should automatically be able to connect to the Raspberry Pi by just plugging it in. You can then use hokuyo_node to connect to the sensor. You may need to change the default parameters to connect.

7 Reading Data from the Hokuyo Sensor
If you successfully connect, open a new terminal window and type: $rostopic echo /scan to see the data from the sensor. (However, it will be too fast to read.) This image shows the message details of the scan. Ranges and Intensities are defined as arrays.

8 Understanding the Data [UST 20LX]
The data from the sensor is put into two arrays. ranges[ ] //Range = Distance intensities [ ] 270° Every “step” is 0.25°. [Look At Image] Step 0 = 0° Step 540 = 135° [Front of UST] Step 1080 = 270° A Full 270 ° scan will have 1081 steps. So the arrays have a size of 1081. ranges[0], ranges[1], …. ranges[1080] Measurement Steps: 1081 Detection Angle: 270° Angular Resolution: 0.25° For example, to find the distance and intensity directly in front of the UST sensor, use: float distance_front = ranges[540]; float intensity_front = intensities[540]; *Information on reading the sensor data can also be found on the sensor’s data sheet.

9 Writing C++ Code to Obtain the Data in your own ROS program.
To obtain the sensor data in your own program, just subscribe to “/scan”. This is a basic ROS concept that can be learned from the wiki page. Make sure to also properly update your CMake and package files. My sensor test code to obtain the Distance and Intensity of the front of the sensor is shown in the next slide.

10

11 Test Code Output

12 Other Notes If you are using both USB and the Ethernet cable at the same time to connect to an ip address, one will stop the other. To avoid this, enable hotplug for both ports in /etc/network/interfaces.

13 End More information and instructions for using urg_node and hokuyo_node can be found on their respective wiki pages on the ROS site. If you have any questions, feel free to contact me at: Varanon Austin Pukasamsombut 留学生 Field Robotics Group, Tohoku University Prof. Yoshida Kazuya, Assoc. Prof. Keiji Nagatani May 12, 2015


Download ppt "Using the Hokuyo Sensor with ROS on the Raspberry Pi"

Similar presentations


Ads by Google