Creating a map with WIFI data using gmapping

From Lofaro Lab Wiki
Jump to: navigation, search

Setting up the ROS

1.) Open a new terminal and type:

 roscore


Setting up the Pioneer3dx with controller

Make sure the pioneer3dx usb and the joystick usb are plugged in.

1.) Open a new terminal and type:

 sudo chmod 777 /dev/ttyUSB0
 rosrun rosaria RosAria port:=/dev/ttyUSB0

2.) Open another terminal and type:

 sudo chmod 777 /dev/input/js0
 roslaunch joy_control pioneer_joy.launch

You now have the controller that will move the pioneer3dx.


Setting up the wifi scanning

Make sure all wifi dongles are plugged in. In this case we are using 2 and they are known to the OS as wlan1 and wlan2.

1.) Open a new terminal and type:

 sudo -s
 rosrun wifi_scanner scan_wifi -i wlan1

2.) Open another terminal and type:

 sudo -s
 rosrun wifi_scanner scan_wifi -i wlan2

3.) Now we will start the trigger. Open a terminal and type:

 sudo -s
 rosrun wifi_scanner trigger wlan1 wlan2

The trigger will now control the two scanners and the scanner will begin to write to a ROS topic called /signals.


Setting up gmapping

Now we are ready to begin mapping. Gmapping is better than hector_slam as it supports loop closure. This means the map will come out more accurate. Make sure that the Hokuyo laser is plugged in and that the pioneer3dx is on.

1.) Open a new terminal and type:

 roslaunch gmapping slam.launch


Setting up Metadata writer

Lastly we need to start the metadata writer that will write the xy data from gmapping and the corresponding wifi readings.

1.) Open a terminal and type:

 rosrun listener listener

Opening RVIZ

Now that everything is set up for mapping, we can now drive around the room and see the map begin to form. To see the map being created we can use rviz. To do so:

1.) Open a new terminal and type:

 rosrun rviz rviz

2.) Press the add button.

3.) Go to the by topic tab and add the map topic.

RVIZ should now be displaying the map.


It is also sometimes useful to see what the tf topic is doing:

1.) Press the add button.

2.) Go to the by display type tab and add the TF topic.