Neato XV-11 to ROS, SLAM – Tutorial

 

WARNING: This tutorial is badly outdated. If you follow it, things will not work 100%. Please use it only for reference.

 

Documentation on ROS-Wiki can sometimes be a little hard to understand for some beginners. In this tutorial, we’re going to go through software steps for connecting Neato XV-11 sensor (which I will refer as Neato in short) to ROS and later also to SLAM. For this tutorial the reader is expected to have the basic knowledge of ROS. All this was done on Linux 14.04.
NeatoToROS

 

 

The first thing to do is to connect Neato to your computer and test it out. The documentation on ROS Wiki HERE is pretty good, so I’m just going to skip this step. Although my setup is a little different, it should work just the same.

My setup:

 

Capture

 

Next you have to setup the driver for reading data from Neato. Here are the commands for terminal, but if you get lost HERE is the source.

cd catkin_ws/src

git clone https://github.com/rohbotics/xv_11_laser_driver.git

cd ..

catkin_make

source devel/setup.bash

roscore

in new terminal:

source devel/setup.bash

rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyUSB0

in new terminal:

rosrun rviz rviz

Now a new window called Rviz will be opened and you have to configure it so it shows the raw data from sensor. Again, follow the source HERE for details, but here is a pic of what you should do:

.RVIZ setup

.

.

Then you should be able to see something like this:

 

 

Problems that can occur:

  • If you see the points on rviz, but they are randomly dispersed you should use this command to start the driver:
    rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyUSB0 _firmware_version:=2
    .I
  • If you don’t see any points on the screen, check your Rviz config again and check the voltage on your power supply. It should be exactly 3V.
    .
  • If you get weird output from laser (dots change colours to all red, dots disappear and appear again) check your connections again, and wire it exactly as seen on picture, FTDI can’t power the laser radar alone… I can’t stress this enough… this took a long time for me to realize -.-
    .
  • If you get errors about permissions check out THIS link on how to give permission for using USB.
    .
  • Also check that Neato is recognized as ttyUSB0. If this isn’t the case, change the command for running Neato driver accordingly. You can check the number of connected USB with the command:
    ls /dev/tty*
  • If at any point your scan is “kindof blinking”, this can cause problems with SLAM. This can be due to bad connection of Neato lidar. Make shure you solder a good connector or something.

 

Make sure that you are getting the right data from sensor before going to the next step!

.

.


Neato XV-11 sensor with SLAM

Next up is setting up the Hector_SLAM package to work with Neato.

Download the SLAM package from HERE and unzip the files into “src” folder in your workspace next to the “xv_11_laser_driver” package. “catkin_make” and “source devel/setup.bash” the whole workspace again.

Now some files have to be changed in order to prepare the SLAM for Neato sensor. If you want to understand exactly what you are changing, you can read about it HERE, but following is a brief description:

When reading the text below, look at the picture above.

.

.

ROS has something called REP, which comes in handy when transforming from one coordinate system to another.  For example if your LIDAR is not quite in centre of your robot, you can tell ROS, the offset of the sensor, and it will be automatically included in localization. Take 5 minutes and read THIS great, short explanation of the image above.


You can tell ROS the offset data with the following .launch files:

Go to directory:

YOUR_WS_DIR/src/hector_slam-catkin/hector_slam_launch/launch/

and add neato.launch file found on this Github.

and in directory

YOUR_WS_DIR/src/hector_slam-catkin/hector_mapping/launch/

1.) change the name of mapping_default.launch to mapping_default_old.launch.

2.) Then copy mapping_default.launch from GitHub to the launch directory.

Just to be clear – you should now have two files in your lunch directory: a) The original one, named mapping_default_old.launch and b) The one from github named mapping_default.launch


.

Now you have to change the driver a little bit:

cd YOUR WS/src/xv_11_laser_driver/src/

nano neato_laser_publisher.cpp

Find the word  “neato_laser” and change it to “laser”. (without the quotes). The whole line then looks like:

priv_nh.param(frame_id, frame_id, std::string(laser));

Because you changed a cpp file you have to catkin_make the whole workspace again:

cd YOUR WS

catkin_make

.

.


After that you should be able to run Hector mapping with commands:

rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyUSB0 _firmware_version:=2

and in new terminal:

source devel/setup.bash

roslaunch hector_slam_launch neato.launch

A new Rviz window should appear and again you have to set it up. Here is a picture of my config:

.

RVIZSLAMconfig

.

..

.

You should now see something like this:

.

Things that can go wrong here:

  • If you get your map, and after closing and reopening everything you don’t any more: Restart the whole roscore. With the cheap FTDI drivers USB probably doesn’t close properly and it causes problems. That is why the USB driver is launched separately from mapping, so you can close the Rviz as often as you like, making changes while the coms with Neato are always running in background.
  • If at any point your scan is “kindof blinking”, this can cause problems with SLAM. This can be due to bad connection of Neato lidar. Make shure you solder a good connector or something.

 

Next challenge: Making an odom messege and transform in ROS HERE,

all ROS tutorials HERE,

and the latest news about my work can be found HERE.

.

.

.

.

.

Share on FacebookShare on LinkedInTweet about this on TwitterEmail this to someone

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *