当前位置:网站首页>cartographer_ optimization_ problem_ 2d
cartographer_ optimization_ problem_ 2d
2022-06-26 05:13:00 【Ancient road】
cartographer_optimization_problem_2d
0. introduction
The main business logic goes back to mapping/internal/2d/pose_graph_2d.cc/PoseGraph2D::HandleWorkQueue-->RunOptimization()
in . The specific optimization part is in optimization
Implementation in .
The previous calculation constraint result is :
1. Set variables to be optimized
- Of subgraphs global_pose
- Node global_pose_2d
2. Residuals
2.1. The first residual -scan_match
take The node and the origin of the subgraph are global Relative position and orientation in coordinate system And constraint As the residual term
- The first coordinate transformation : The node and the origin of the subgraph are global Coordinate transformation in coordinate system ( Predict pose )
- The second coordinate transformation : Constraints within and between subgraphs ( Measuring posture )
Residual calculation code :
/** * @brief 2d according to SPA The formula in the paper calculates the residual error * * Calculated residual error : * T12 = T1.inverse() * T2 * [R1.inverse * R2, R1.inverse * (t2 -t1)] * [0 , 1 ] * * @param[in] relative_pose * @param[in] start * @param[in] end * @return std::array<T, 3> */
template <typename T>
static std::array<T, 3> ComputeUnscaledError(
const transform::Rigid2d& relative_pose, const T* const start,
const T* const end) {
// Rotation matrix R
const T cos_theta_i = cos(start[2]);
const T sin_theta_i = sin(start[2]);
const T delta_x = end[0] - start[0]; // t2 -t1
const T delta_y = end[1] - start[1];
const T h[3] = {
cos_theta_i * delta_x + sin_theta_i * delta_y, // R.inverse * (t2 -t1)
-sin_theta_i * delta_x + cos_theta_i * delta_y,
end[2] - start[2]};
return {
{
T(relative_pose.translation().x()) - h[0],
T(relative_pose.translation().y()) - h[1],
common::NormalizeAngleDifference(
T(relative_pose.rotation().angle()) - h[2])}};
}
2.2. The second residual -Landmark
landmark data And adopt 2 The relative pose interpolated by the pose of nodes As the residual term
- The first coordinate transformation : landmark The time of data is 2 The pose interpolated from the pose of nodes ( Predict pose )
- The second coordinate transformation : landmark In the data landmark_to_tracking_transform_( Measuring posture )
struct LandmarkNode {
// landmark Data is relative to tracking_frame Relative coordinate transformation of
struct LandmarkObservation {
int trajectory_id;
common::Time time;
transform::Rigid3d landmark_to_tracking_transform;
double translation_weight;
double rotation_weight;
};
// Multiple... May be observed at the same time landmark data
std::vector<LandmarkObservation> landmark_observations;
// This frame of data corresponds to tracking_frame stay global The pose in the coordinate system
absl::optional<transform::Rigid3d> global_landmark_pose;
bool frozen = false;
};
Mainly node <--> landmark
Constraints between :
// Step: landmark data And adopt 2 The relative pose interpolated by the pose of nodes As the residual term
AddLandmarkCostFunctions(landmark_nodes, node_data_, &C_nodes, &C_landmarks,
&problem, options_.huber_scale());
A little .
2.3. The third residual -Odometer
Nodes are located between nodes global Relative coordinate transformation in coordinate system And Relative coordinate transformation interpolated from odometer data As the residual term
- The first coordinate transformation : adjacent 2 Nodes are located between global Coordinate transformation in coordinate system
- The second coordinate transformation : Then calculate these separately 2 The time of nodes is interpolated in the odometer data queue 2 Odometer position and attitude , Calculate this 2 Coordinate transformation between position and attitude of odometer
2.4. Fourth residual -local_global
Nodes are located between nodes global Relative coordinate transformation in coordinate system And adjacent 2 A node in the local Relative coordinate transformation in coordinate system As the residual term
- The first coordinate transformation : adjacent 2 There are three internodes in global Coordinate transformation in coordinate system
- The second coordinate transformation : adjacent 2 A node in the local Coordinate transformation in coordinate system
2.5. The fifth residual -gps
Node and gps The origin of the coordinate system is global Relative coordinate transformation in coordinate system And adopt gps The relative coordinate transformation obtained by data interpolation As the residual term
- The first coordinate transformation : The corresponding time of the node is gps Interpolated data gps be relative to gps The position and pose of the origin of the coordinate system
- The second coordinate transformation : Nodes in the global In coordinate system And gps Origin of coordinate system Relative coordinate transformation of
3. Theoretical reference
边栏推荐
- Two step processing of string regular matching to get JSON list
- 红队得分方法统计
- Zuul 實現動態路由
- Install the tp6.0 framework under windows, picture and text. Thinkphp6.0 installation tutorial
- Status of processes and communication between processes
- Second day of deep learning and tensorfow
- Beidou navigation technology and industrial application of "chasing dreams in space and feeling for Beidou"
- Douban top250
- A beginner's entry is enough: develop mobile IM from zero
- LeetCode 19. Delete the penultimate node of the linked list
猜你喜欢
[unity3d] human computer interaction input
Official image acceleration
Dbeaver installation and configuration of offline driver
86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
【红队】要想加入红队,需要做好哪些准备?
cartographer_optimization_problem_2d
Technical problems to be faced in mobile terminal im development
Baidu API map is not displayed in the middle, but in the upper left corner. What's the matter? Resolved!
The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!
6.1 - 6.2 introduction to public key cryptography
随机推荐
[quartz] read configuration from database to realize dynamic timing task
cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配
The parameter field of the callback address of the payment interface is "notify_url", and an error occurs after encoding and decoding the signed special character URL (,,,,,)
瀚高数据库自定义操作符‘!~~‘
A company crawling out of its grave
Dbeaver installation and configuration of offline driver
Gd32f3x0 official PWM drive has a small positive bandwidth (inaccurate timing)
LSTM in tensorflow_ Layers actual combat
【Unity3D】刚体组件Rigidbody
C# 39. Conversion between string type and byte[] type (actual measurement)
thread priority
2.< tag-动态规划和常规问题>lt.343. 整数拆分
RESNET in tensorflow_ Train actual combat
How to rewrite a pseudo static URL created by zenpart
Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning
Learn from small samples and run to the sea of stars
Fedora alicloud source
超高精度定位系统中的UWB是什么
第九章 设置结构化日志记录(一)
Day3 data type and Operator jobs