-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
187273f
commit 6326296
Showing
42 changed files
with
942 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ | |
"valarray": "cpp", | ||
"*.ipp": "cpp", | ||
"string": "cpp", | ||
"random": "cpp" | ||
"random": "cpp", | ||
"iterator": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
front_end_node.rq.rq.log.ERROR.20200303-182534.3549 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
...localization/config/front_end/config.yaml → ...ocalization/config/mapping/front_end.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
data_path: ./ # 数据存放路径 | ||
|
||
registration_method: NDT # 选择点云匹配方法,目前支持:NDT | ||
# 匹配时为了精度更高,应该选用scan-to-map的方式 | ||
# map是以历史帧为中心,往前后时刻各选取extend_frame_num个关键帧,放在一起拼接成的 | ||
extend_frame_num: 5 | ||
loop_step: 5 # 防止检测过于频繁,每隔loop_step个关键帧检测一次闭环 | ||
detect_area: 10.0 # 检测区域,只有两帧距离小于这个值,才做闭环匹配 | ||
diff_num: 100 # 过于小的闭环没有意义,所以只有两帧之间的关键帧个数超出这个值再做检测 | ||
fitness_score_limit: 0.2 # 匹配误差小于这个值才认为是有效的 | ||
|
||
# 之所以要提供no_filter(即不滤波)模式,是因为闭环检测对计算时间要求没那么高,而点云越稠密,精度就越高,所以滤波与否都有道理 | ||
map_filter: voxel_filter # 选择滑窗地图点云滤波方法,目前支持:voxel_filter、no_filter | ||
scan_filter: voxel_filter # 选择当前帧点云滤波方法,目前支持:voxel_filter、no_filter | ||
|
||
# 各配置选项对应参数 | ||
## 匹配相关参数 | ||
NDT: | ||
res : 1.0 | ||
step_size : 0.1 | ||
trans_eps : 0.01 | ||
max_iter : 30 | ||
## 滤波相关参数 | ||
voxel_filter: | ||
map: | ||
leaf_size: [0.3, 0.3, 0.3] | ||
scan: | ||
leaf_size: [0.3, 0.3, 0.3] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
lidar_localization/include/lidar_localization/mapping/loop_closing/loop_closing.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* @Description: 闭环检测算法 | ||
* @Author: Ren Qian | ||
* @Date: 2020-02-04 18:52:45 | ||
*/ | ||
#ifndef LIDAR_LOCALIZATION_MAPPING_LOOP_CLOSING_LOOP_CLOSING_HPP_ | ||
#define LIDAR_LOCALIZATION_MAPPING_LOOP_CLOSING_LOOP_CLOSING_HPP_ | ||
|
||
#include <deque> | ||
#include <Eigen/Dense> | ||
#include <pcl/registration/ndt.h> | ||
#include <yaml-cpp/yaml.h> | ||
|
||
#include "lidar_localization/sensor_data/key_frame.hpp" | ||
#include "lidar_localization/sensor_data/loop_pose.hpp" | ||
#include "lidar_localization/models/registration/registration_interface.hpp" | ||
#include "lidar_localization/models/cloud_filter/cloud_filter_interface.hpp" | ||
|
||
namespace lidar_localization { | ||
class LoopClosing { | ||
public: | ||
LoopClosing(); | ||
|
||
bool Update(const KeyFrame key_frame, const KeyFrame key_gnss); | ||
|
||
bool HasNewLoopPose(); | ||
LoopPose& GetCurrentLoopPose(); | ||
|
||
private: | ||
bool InitWithConfig(); | ||
bool InitParam(const YAML::Node& config_node); | ||
bool InitDataPath(const YAML::Node& config_node); | ||
bool InitRegistration(std::shared_ptr<RegistrationInterface>& registration_ptr, const YAML::Node& config_node); | ||
bool InitFilter(std::string filter_user, std::shared_ptr<CloudFilterInterface>& filter_ptr, const YAML::Node& config_node); | ||
|
||
bool DetectNearestKeyFrame(int& key_frame_index); | ||
bool CloudRegistration(int key_frame_index); | ||
bool JointMap(int key_frame_index, CloudData::CLOUD_PTR& map_cloud_ptr, Eigen::Matrix4f& map_pose); | ||
bool JointScan(CloudData::CLOUD_PTR& scan_cloud_ptr, Eigen::Matrix4f& scan_pose); | ||
bool Registration(CloudData::CLOUD_PTR& map_cloud_ptr, | ||
CloudData::CLOUD_PTR& scan_cloud_ptr, | ||
Eigen::Matrix4f& scan_pose, | ||
Eigen::Matrix4f& result_pose); | ||
|
||
private: | ||
std::string key_frames_path_ = ""; | ||
int extend_frame_num_ = 3; | ||
int loop_step_ = 10; | ||
int diff_num_ = 100; | ||
float detect_area_ = 10.0; | ||
float fitness_score_limit_ = 2.0; | ||
|
||
std::shared_ptr<CloudFilterInterface> scan_filter_ptr_; | ||
std::shared_ptr<CloudFilterInterface> map_filter_ptr_; | ||
std::shared_ptr<RegistrationInterface> registration_ptr_; | ||
|
||
std::deque<KeyFrame> all_key_frames_; | ||
std::deque<KeyFrame> all_key_gnss_; | ||
|
||
LoopPose current_loop_pose_; | ||
bool has_new_loop_pose_ = false; | ||
}; | ||
} | ||
|
||
#endif |
48 changes: 48 additions & 0 deletions
48
lidar_localization/include/lidar_localization/mapping/loop_closing/loop_closing_flow.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* @Description: | ||
* @Author: Ren Qian | ||
* @Date: 2020-02-29 03:32:14 | ||
*/ | ||
#ifndef LIDAR_LOCALIZATION_MAPPING_LOOP_CLOSING_LOOP_CLOSING_FLOW_HPP_ | ||
#define LIDAR_LOCALIZATION_MAPPING_LOOP_CLOSING_LOOP_CLOSING_FLOW_HPP_ | ||
|
||
#include <deque> | ||
#include <ros/ros.h> | ||
// subscriber | ||
#include "lidar_localization/subscriber/key_frame_subscriber.hpp" | ||
// publisher | ||
#include "lidar_localization/publisher/loop_pose_publisher.hpp" | ||
// loop closing | ||
#include "lidar_localization/mapping/loop_closing/loop_closing.hpp" | ||
|
||
namespace lidar_localization { | ||
class LoopClosingFlow { | ||
public: | ||
LoopClosingFlow(ros::NodeHandle& nh); | ||
|
||
bool Run(); | ||
|
||
private: | ||
bool ReadData(); | ||
bool HasData(); | ||
bool ValidData(); | ||
bool PublishData(); | ||
|
||
private: | ||
// subscriber | ||
std::shared_ptr<KeyFrameSubscriber> key_frame_sub_ptr_; | ||
std::shared_ptr<KeyFrameSubscriber> key_gnss_sub_ptr_; | ||
// publisher | ||
std::shared_ptr<LoopPosePublisher> loop_pose_pub_ptr_; | ||
// loop closing | ||
std::shared_ptr<LoopClosing> loop_closing_ptr_; | ||
|
||
std::deque<KeyFrame> key_frame_buff_; | ||
std::deque<KeyFrame> key_gnss_buff_; | ||
|
||
KeyFrame current_key_frame_; | ||
KeyFrame current_key_gnss_; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
lidar_localization/include/lidar_localization/models/cloud_filter/no_filter.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* @Description: 不滤波 | ||
* @Author: Ren Qian | ||
* @Date: 2020-02-09 19:37:49 | ||
*/ | ||
#ifndef LIDAR_LOCALIZATION_MODELS_CLOUD_FILTER_NO_FILTER_HPP_ | ||
#define LIDAR_LOCALIZATION_MODELS_CLOUD_FILTER_NO_FILTER_HPP_ | ||
|
||
#include "lidar_localization/models/cloud_filter/cloud_filter_interface.hpp" | ||
|
||
namespace lidar_localization { | ||
class NoFilter: public CloudFilterInterface { | ||
public: | ||
NoFilter(); | ||
|
||
bool Filter(CloudData::CLOUD_PTR& input_cloud_ptr, CloudData::CLOUD_PTR& filtered_cloud_ptr) override; | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.