当前位置:网站首页>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
边栏推荐
- [unity3d] rigid body component
- As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
- 出色的学习能力,才是你唯一可持续的竞争优势
- C# 40. Byte[] to hexadecimal string
- Dbeaver installation and configuration of offline driver
- 二次bootloader关于boot28.asm应用的注意事项,28035的
- How to select the data transmission format of instant messaging application
- Pycharm package import error without warning
- One of token passing between microservices @feign's token passing
- Sentimentin tensorflow_ analysis_ layer
猜你喜欢
Technical past: tcp/ip protocol that has changed the world (precious pictures, caution for mobile phones)

How to ensure the efficiency and real-time of pushing large-scale group messages in mobile IM?

AD教程系列 | 4 - 创建集成库文件

As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source

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

A company crawling out of its grave

Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning

Apktool tool usage document

2.< tag-动态规划和常规问题>lt.343. 整数拆分

Setting pseudo static under fastadmin Apache
随机推荐
vscode config
cartographer_optimization_problem_2d
Datetime data type - min() get the earliest date and date_ Range() creates a date range, timestamp() creates a timestamp, and tz() changes the time zone
[quartz] read configuration from database to realize dynamic timing task
localStorage浏览器本地储存,解决游客不登录的情况下限制提交表单次数。
AD教程系列 | 4 - 创建集成库文件
Happy New Year!
ThreadPoolExecutor实现文件上传批量插入数据
thread priority
[leetcode] 713: subarray with product less than k
【Unity3D】碰撞体组件Collider
Pytorch forecast house price
【红队】要想加入红队,需要做好哪些准备?
Two step processing of string regular matching to get JSON list
Apktool tool usage document
Sentimentin tensorflow_ analysis_ cell
程序人生
广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
Generalized linear model (logistic regression, Poisson regression)
cartographer_pose_graph_2d