说明: 最后一年的论文项目实施谷歌制图仪开发印度理工学院德里校区道路地图使用...
(Final year thesis project on implementation of google cartographer to develop a map of the IIT Delhi campus road using 3D point cloud data)
# Google-Cartographer-ROS
Final year thesis project on implementation of google cartographer to develop a map of the IIT Delhi campus road using 3D point cloud data. Also to implement localization using the in built cartographer features.Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations
Fig.1 Map developed by 3D PCL compared to the actual Google map of the area
Installation and workspace setup
We shall be using the Google cartographer ROS kinetic package for the same, the installation of the same can be seen
here
For this we would need rosbags with both "3D point cloud" and "IMU data" using which only we can deploy the package. The package configeration files need to be changed according to the topics we would be using. The following shows what all changes need to be done to get a map.
Step 1: Creation of a .pbstream file from the ros bag
Since we did not have a proper /tf tree, we decided to use a
urdf file description for providing the frames required by the cartographer. The URDF used by us can be found in the config files folder of the repo. This file was made assuming the dimentions of the Mahindra E20 vehicle, this needs to be modified according to the proper dimentions with proper links.
We used the launch file test.launch for the first process of generation of .pbstream file. The settings for this launch file were made using insights from the working configurations as uploaded by a user
here
test.launch was made specifically for our use and all the changes made can be seen
here
Once the launch file was ready run the following to generate the pbstream file
```
$ roslaunch cartographer_ros test.launch bag_filename:=/path/to/your_bag.bag \
```
Step 2: Creation of maps from the generated .pbstream file
Upon obtaining a .pbstream file, a point cloud file (.ply) can be obtained by running:
```
$ roslaunch cartographer_ros assets_writer_backpack_4d.launch bag_filenames:=/path/to/your_bag.bag pose_graph_filename:=/path/to/your_bag.pbstream\
```
The .ply file (along with some image files) will be generated in the same folder as the bag and .pbstream file.
We had created our custom
lua file for the generation of the point cloud file, the steps followed can be found
here
Once the script was run the respective maps and ply files were successfuly created
Results
The following maps were generated after running the scripts on a
rosbag file , which was created by the E20 vehicle going around the campus.
The blue line shows the trajectory the vehicle took while transversing the campus roads.
Fig.2 Cartographer Map, and Google map IIT Delhi Campus, Himadi Circle
Some of the other test results are as shown
Fig.3 Cartographer Map Nilgiri Hostel
Fig.4 Cartographer Map New Campus Area
More images of the maps generated can be found out in the images folder uploaded in this repository\
We stiched all the maps together to get the complete path followed by the car on the campus road
Fig.5 Full Campus map
Google Cartographer Localization
We also tested Cartographers inbuilt localisation package on the bag files for offline
localisation of the car in the 3D maps. The blue coloured trajectories denote the actual
trajectory of the car during the course of the experiment and the green trajectory
represents the output trajectory of the Cartographer localisation package. We were also
able to obtain the coordinates of the points of the trajectory as it is generated along the
way with respect to the map frame.
Fig.6 Cartographer Localization on pre built map
Fig.7 Test Comparison b/w actual and calculated trajectory
Qt based Sensor Analysis Desktop Application
We built a PyQt5 based sensor data visualization GUI for real-time analysis of various
sensors information. We used GPS coordinates in (Latitude, Longitude) and converted it
into Universal Transverse Mercator (UTM) system coordinates for accurate plotting of
points on Google Map of IIT Delhi Campus. We did the same using utm libraries in Python
and incorporated the Python application with ROS for acquiring the Pixhawk GPS
coordinates and plotting it using a PyQt5 application on a Matplotlib window.In order to analyse the accuracy of the data, we used the Google
Map of the specific parts of the campus set to maximum zoom level as the background tile.
The result of the QT GUI plotter can be seen as below
Fig.8 QT GUI GPS plotter