6. start point initializing using gps in hdl_loclization - tkkim-robot/SLAM_Wiki GitHub Wiki
Introduction
This issue is talking about changing source codes of hdl_localization for adaptively initializing start point using gps data. So, the prerequisite, installation, required files and run commands are basically same as the 'issue 5 hdl_localization'. So, please read the wiki page 'issue 5 hdl_localization' first to briefly understand the structure and the flow of hdl_localization.
start point initializing in original hdl_localization (previous problem)
You can specify the initial sensor pose using "2D Pose Estimate" on rviz, or using ros params in launch file "src/hdl_localization/launch/hdl_localization.launch". It is ok when always start at a same point. But if the program is shut down on the middle of the road due to some problem and restarted again, it couldn't initialize its start point adaptively.
new idea: use topic /gnss_pose to initialize start point
I have a idea to solve this problem. Launch 'nmea2tfpose' to listen nmea_sentence (gps) then publish /gnss_pose. And adaptively initialize its start point using /gnss_pose topic when hdl_localization is launched.
What codes is changed (MAIN CONTENTS !!)
to be updated
1. Installation
If you have followed the 'issue 4 hdl_graph_slam' or 'issue 5 hdl_localization' already, there are nothing to install anymore. Go to "clone repository and catkin_make" section.
ROS Install (kinetic is recommended !! )
http://wiki.ros.org/kinetic/Installation/Ubuntu
Libraries
OpenMP
sudo apt-get install libomp-dev
PCL 1.7 (cmake needed)
http://pointclouds.org/documentation/tutorials/compiling_pcl_posix.php
Make Catkin Workspace (if you have already, skip this)
mkdir catkin_ws && cd catkin_ws
mkdir src && cd src
catkin_init_workspace
Clone Repository and Catkin_make
cd /catkin_ws/src
git clone https://github.com/koide3/ndt_omp.git (If you don't have ndt_omp. you should have it if you followed hdl_graph_slam or hdl_localization)
git clone https://github.com/ktk1501/hdl_localization.git (If you followed hdl_localization on issue 5, you should delete the directory 'hdl_localization' and clone this.)
cd /catkin_ws
catkin_make
source devel/setup.bash
2. How to run
AUTOWARE 'nmea2tfpose'
It needs /gnss_pose topic to listen. So, I temporary decided to use 'nmea2tfpose' in AUTOWARE. Go to your autoware folder, then:
cd ros
source devel/setup.bash
roslaunch gnss_localizer nmea2tfpose.launch
It will run the nmea2tfpose node, and listen nmea_sentence, then publish /gnss_pose.
hdl_localization
Then, run the hdl_localization. Instructions are exactly same in the wiki page issue 5 hdl_localization
3. Result
You can see the video : https://www.youtube.com/watch?v=YjBkCdDhbc4
It was tested by starting "first_modified_imu.bag" at 30 seconds, so the startpoint is not origin. It automatically listen to the first /gnss_pose, and put the base_link frame on the GPS position.