当前位置:网站首页>cartographer_ pose_ graph_ 2d
cartographer_ pose_ graph_ 2d
2022-06-26 05:13:00 【Ancient road】
cartographer_pose_graph_2d
0. introduction
This paper mainly studies the pose_Graph Part of the logic in , In particular, two kinds of constraint calculation in back-end optimization .
Nonstandard class diagram :

Some data structures :



The concept of nodes and constraints
- node : A.tracking_frame The position of ; B. The pose of the origin of the subgraph
- constraint : tracking_frame Coordinate transformation with the origin of the subgraph

1.PoseGraph2D::AddNode

1.1.GetLocalToGlobalTransform
GetLocalToGlobalTransform(trajectory_id) * constant_data->local_pose
- T g l ∗ T l n = T g n T_{gl} * T_{ln} = T_{gn} Tgl∗Tln=Tgn : Place nodes in local The pose in the coordinate system is transformed into global The pose in the coordinate system
- T g l T_{gl} Tgl :
GetLocalToGlobalTransform(trajectory_id) - T l n T_{ln} Tln:node stay local map frame The pose in the coordinate system

This step is mainly to node Add to PoseGraph2D Of PoseGraphData in .
// Add a new node to the node list
const NodeId node_id = data_.trajectory_nodes.Append(
trajectory_id, TrajectoryNode{
constant_data, optimized_pose});
The node pose added here , In fact, we can see from the front-end results , There is another meaning here , It includes submap The position of :

1.2.AppendNode
The front end only maintains two submap, The rest are transferred to the back end for storage :

// Test if the 'insertion_submap.back()' is one we never saw before.
// If it is the beginning of the track , perhaps insertion_submaps.back() It's the first time I've seen , Add a new subgraph
if (data_.submap_data.SizeOfTrajectoryOrZero(trajectory_id) == 0 ||
std::prev(data_.submap_data.EndOfTrajectory(trajectory_id))
->data.submap != insertion_submaps.back()) {
// We grow 'data_.submap_data' as needed. This code assumes that the first
// time we see a new submap is as 'insertion_submaps.back()'.
// If insertion_submaps.back() It's the first time I've seen , That is, the newly generated
// stay data_.submap_data Add an empty InternalSubmapData
const SubmapId submap_id =
data_.submap_data.Append(trajectory_id, InternalSubmapData());
// Save the map behind , Assign the pointer of the following map to the past
// The map is newly generated , But the map will be updated in the front part by inserting point cloud data , Only the pointer is saved here
// tag: Draw a picture to illustrate
data_.submap_data.at(submap_id).submap = insertion_submaps.back();
LOG(INFO) << "Inserted submap " << submap_id << ".";
kActiveSubmapsMetric->Increment();
}
Maps, which have a large amount of data, are pointers , Open up memory only once ,cartographer Memory management is very good .
submap Only the front end will change , The back end will not , So in that case , The front-end map without optimized pose is not accurate , Where is the map optimized ?
1.3.AddWorkItem
stay Add a subgraph trimmer AddTrimmer AddImuData AddOdometryData AddFixedFramePoseData AddLandmarkData And other external interface functions (Global Call in the ) This function is called in .
AddWorkItem() This in the argument lambda The expression does not actually execute immediately , Instead, it is added to the task scheduling .
- work_queue_ Task scheduling
- thread_pool_ Thread pool

TODO: To learn .
stay PoseGraph2D::AddNode After joining the thread pool , It's just DrainWorkQueue in Thread pool Execute in a loop .
2.ComputeConstraintsForNode Constraint calculation in subgraph

- 1. obtain node Of constant_data:

- 2. obtain trajectory_id Of a subgraph that is in an active state SubmapId :
InitializeGlobalSubmapPoses
A).data_.global_submap_poses_2d: All the optimized subgraphs are in global In a coordinate system pose
B).optimization_problem_->submap_data(): Including optimized and not yet optimized Subgraph in global In a coordinate system pose
C).ComputeLocalToGlobalTransform() Parameters of this function , It's always data_.global_submap_poses_2d, The calculation is optimized global Point to local Coordinate transformation of .
constraint :
// Containing subgraphs id, Node id, node j Relative to subgraph i Coordinate transformation of , And whether the node is in or out of the subgraph
struct Constraint {
struct Pose {
transform::Rigid3d zbar_ij;
double translation_weight;
double rotation_weight;
};
SubmapId submap_id; // 'i' in the paper.
NodeId node_id; // 'j' in the paper.
// Pose of the node 'j' relative to submap 'i'.
Pose pose;
// Differentiates between intra-submap (where node 'j' was inserted into
// submap 'i') and inter-submap constraints (where node 'j' was not inserted
// into submap 'i').
enum Tag {
INTRA_SUBMAP, INTER_SUBMAP } tag;
};

cartographer Back end constraint type :

3.ComputeConstraints Constraint calculation between subgraphs ( Loop back detection )
The constraint between two subgraphs calls the same function , All are node <--> submap. among for One step in the cycle :
Nodes are matched to a part of the subgraph ConstraintBuilder2D::MaybeAddConstraint ( Only this... Will be executed during drawing creation , Loop detection through local search )
Nodes are matched with all subgraphs ConstraintBuilder2D::MaybeAddGlobalConstraint ( It is possible to perform this operation only when positioning )
The main logic flows to ( One node With a submap Match ):
/** * @brief Compute a constraint between nodes and subgraphs ( Loop back detection ) * Rough matching with a matcher based on branch and bound algorithm , And then use ceres Perform fine matching * * @param[in] submap_id submap Of id * @param[in] submap Map data * @param[in] node_id node id * @param[in] match_full_submap Is it local matching or full subgraph matching * @param[in] constant_data Node data * @param[in] initial_relative_pose The initial value of the constraint * @param[in] submap_scan_matcher matcher * @param[out] constraint Calculated constraints */
void ConstraintBuilder2D::ComputeConstraint(
const SubmapId& submap_id, const Submap2D* const submap,
const NodeId& node_id, bool match_full_submap,
const TrajectoryNode::Data* const constant_data,
const transform::Rigid2d& initial_relative_pose,
const SubmapScanMatcher& submap_scan_matcher,
std::unique_ptr<ConstraintBuilder2D::Constraint>* constraint) {
- Step:1 Get the node at local frame The coordinates under
- Step:2 Use the matcher based on branch and bound algorithm for rough matching ( Innovation of the paper , Study by writing alone ), If the score is too low , No more fine matching , Go straight back to
- Step:3 Use ceres Perform fine matching , It is the function used for front-end scan matching
- Step:4 Get nodes to submap Coordinate transformation between the origin of the coordinate system
- Step:5 Returns the calculated constraint
Loop back detection consists of two modes :
- // param: global_localization_min_score The lowest score threshold for loop detection of a whole subgraph 0.6 ( Pure positioning )
- // param: min_score The lowest score threshold for loop detection of local subgraphs 0.55
边栏推荐
- Cookie and session Basics
- localStorage浏览器本地储存,解决游客不登录的情况下限制提交表单次数。
- Generalized linear model (logistic regression, Poisson regression)
- ModuleNotFoundError: No module named ‘numpy‘
- cartographer_local_trajectory_builder_2d
- Pycharm package import error without warning
- 关于支付接口回调地址参数字段是“notify_url”,签名过后的特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)
- 瀚高数据库自定义操作符‘!~~‘
- 【上采样方式-OpenCV插值】
- Modify the case of the string title(), upper(), lower()
猜你喜欢

红队得分方法统计

Codeforces Round #802 (Div. 2)(A-D)

Using requests library and re library to crawl web pages

关于支付接口回调地址参数字段是“notify_url”,签名过后的特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)

Machine learning final exercises

Illustration of ONEFLOW's learning rate adjustment strategy
![[unity3d] rigid body component](/img/57/344aae65e4ac6a7d44b235584f95d1.png)
[unity3d] rigid body component

【Unity3D】刚体组件Rigidbody

UWB超高精度定位系统原理图

ECCV 2020 double champion team, take you to conquer target detection on the 7th
随机推荐
The localstorage browser stores locally to limit the number of forms submitted when tourists do not log in.
cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配
C# 40. Byte[] to hexadecimal string
Codeforces Round #802 (Div. 2)(A-D)
Sentimentin tensorflow_ analysis_ layer
线程优先级
apktool 工具使用文档
UWB超高精度定位系统原理图
The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!
PHP之一句话木马
Introduction to classification data cotegory and properties and methods of common APIs
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
Final review of brain and cognitive science
PHP 2D / multidimensional arrays are sorted in ascending and descending order according to the specified key values
Lstms in tensorflow_ Cell actual combat
2. < tag dynamic programming and conventional problems > lt.343 integer partition
两步处理字符串正则匹配得到JSON列表
PHP二维/多维数组按照指定的键值来进行升序和降序
[unity3d] collider assembly
Happy New Year!