## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= [[ROS/Tutorials|ROS Tutorials]] ## descriptive title for the tutorial ## title = Using SICK Laser Scanners with the sicktoolbox_wrapper ## multi-line description to be displayed in search ## description = This tutorial is an introduction to using a SICK laser scanner connected to a desktop. After reading this tutorial, you should be able to bring up the sicklms node and display the laser data. ## the next tutorial description ## next = ## links to next tutorial ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = SICK, laser, driver, `LMS200`, `LMS291` #################################### <> <> === Compiling === Start by getting the dependencies and compiling the driver and rviz. {{{ $ rosdep install sicktoolbox_wrapper rviz $ rosmake sicktoolbox_wrapper rviz }}} === Powered On and Plugged In === Make sure that your SICK laser is plugged in via USB or serial port and the green power light is on. ||<#FFCCCC> '''NOTE:''' The `RS232` TX and RX lines on the SICK `LMS200`/`LMS291` are reversed. You will need a crossover or null modem cable for the data connection to work properly. || === Configuring the SICK === Make sure that the sicklms node will be able to access the SICK laser scanner. Start by listing the permissions of the SICK connection, this assumes you are using a usb to serial adapter. {{{ ls -l /dev/ttyUSB0 }}} You will see something similar to: . {{{ crw-rw-XX- 1 root dialout 166, 0 2009-10-27 14:18 /dev/ttyUSB0 }}} 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/ttyUSB0 }}} === Starting a roscore === For the sicklms node to work properly, a ros core must be running. In a '''new terminal''': {{{ $ roscore }}} === Setting Parameters === Before we can run the sicklms node we need to make sure that we have the correct configurations loaded on the parameter server. {{{ $ rosparam set sicklms/port /dev/XXX (this is the port that the SICK is connected to /dev/ttyUSB0, /dev/lms200, etc...) $ rosparam set sicklms/baud 38400 }}} === Running the sicklms node === In a '''new terminal''', run the sicklms: {{{ $ rosrun sicktoolbox_wrapper sicklms }}} You will see something similar to: . {{{ *** Attempting to initialize the Sick LMS... Attempting to open device @ /dev/ttyUSB0 SickLMS::_setTermSpeed: ioctl() failed while trying to get serial port info! NOTE: This is normal when connected via USB! SickLMS::_setTerminalBaud: ioctl() failed while trying to set serial port info! NOTE: This is normal when connected via USB! Device opened! Attempting to start buffer monitor... Buffer monitor started! Attempting to set requested baud rate... SickLMS::_setTermSpeed: ioctl() failed while trying to get serial port info! NOTE: This is normal when connected via USB! SickLMS::_setTerminalBaud: ioctl() failed while trying to set serial port info! NOTE: This is normal when connected via USB! Operating @ 38400bps Attempting to sync driver... Driver synchronized! *** Init. complete: Sick LMS is online and ready! Sick Type: Sick LMS 291-S05 Scan Angle: 180 (deg) Scan Resolution: 0.5 (deg) Measuring Mode: 8m/80m; fields A,B,Dazzle Measuring Units: Centimeters (cm) Requesting measured value data stream... Data stream started! }}} ==== Variation: Setting parameters on the command-line ==== Instead of using `rosparam` to set parameters, you can set them on the command line when launching `sicklms`, e.g.: {{{ $ rosrun sicktoolbox_wrapper sicklms _port:=/dev/XXX _baud:=38400 }}} === Viewing the data === To see that everything is working and data is being published to ros, in a '''new terminal''': {{{ $ rosrun rviz rviz }}} You will see the laser scan in rviz: {{attachment:rviz_sick.png||width=100%}} ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## DriverCategory ## LaserDriverCategory