## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## links to any required tutorials ## note.0= [[ROS/Tutorials|ROS tutorials]] ## descriptive title for the tutorial ## title = How to use Hokuyo Laser Scanners with the hokuyo_node ## multi-line description to be displayed in search ## description = This tutorial is an introduction to using a Hokuyo laser scanner connected to a desktop. After reading this tutorial, you should be able to bring up the hokuyo_node and display the laser data. ## the next tutorial description ## next = ## links to next tutorial ## next.0.link= [[hokuyo_node/Tutorials/UsingReconfigureGUIToChangeHokuyoLaserParameters|How to dynamically reconfigure the hokuyo_node]] ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = Hokuyo, laser, driver, `UTM-30LX`, `URG-04LX`, `UBG-04LX-F01`, `URG-04LX-UG01` #################################### <<IncludeCSTemplate(TutorialCSHeaderTemplate)>> <<TableOfContents(4)>> {{{#!wiki yellow/solid Looking for a newer driver? [[urg_node|urg_node]] is fully [[http://ros.org/reps/rep-0138.html|REP-138]] compliant AND compatible with Ethernet/MultiEcho Hokuyos! Hokuyo_node will remain maintained for current users and PR2s. Check it out at: [[urg_node|http://ros.org/wiki/urg_node]] }}} === Install === First you have to get the hokuyo_node package. You can install it using {{{ $ sudo apt-get install ros-%DISTro%-hokuyo-node }}} === Powered On and Plugged In === Make sure that your USB Hokuyo is plugged in and the power light is on. === Configuring the Hokuyo === Make sure that the hokuyo_node will be able to access the Hokuyo laser scanner. Start by listing the permissions of the Hokuyo: {{{ $ ls -l /dev/ttyACM0 }}} You will see something similar to: . {{{ crw-rw-XX- 1 root dialout 166, 0 2009-10-27 14:18 /dev/ttyACM0 }}} If XX is rw: the laser is configured properly. If XX is --: the laser is not configured properly and you need to: {{{ $ sudo chmod a+rw /dev/ttyACM0 }}} === Starting a roscore === For the hokuyo_node to work properly, a ros core must be running. In a '''new terminal''': {{{ $ roscore }}} === Setting Parameters === Before we can run the hokuyo_node we need to make sure that we have the correct configurations loaded on the parameter server. This option will speed up the startup of the driver, but will lead to less acurate timestamps: {{{ $ rosparam set hokuyo_node/calibrate_time false }}} If your Hokuyo is not at the default `/dev/ttyACM0` you have to indicate where it is below: {{{ $ rosparam set hokuyo_node/port /dev/ttyACM0 }}} === Running the hokuyo_node === In a '''new terminal''', run the hokuyo_node: {{{ $ rosrun hokuyo_node hokuyo_node }}} You will see something similar to: . {{{ [ INFO] 1256687975.743438000: Connected to device with ID: H0807344 }}} === Viewing the data === To see that everything is working and data is being published to ros, in a '''new terminal''': {{{ $ rosrun rviz rviz -d `rospack find hokuyo_node`/hokuyo_test.vcg }}} You will see the laser scan in rviz: {{attachment:hokuyo_rviz.png||width=100%}} ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## DriverCategory ## LaserDriverCategory