• Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

\

Achieve pure positioning

 

(1) Because the normal cartographer’s map is published by cartographer; The following

 

rostopic info /map

Type: nav_msgs/OccupancyGrid

Publishers:

 * /cartographer_occupancy_grid_node

Therefore, we need to replace the map publication with

 

<node name=”map_server” pkg=”map_server” type=”map_server”

args=”/home/lx/carto_ws/map/2d-1.yaml” />

 

Let’s get rid of that

<node name=”cartographer_occupancy_grid_node” pkg=”cartographer_ros”

Type = “cartographer_occupancy_grid_node” args = “- the resolution of 0.05” / >

This was changed in the Launch file where the Cartographer was running

 

(2) Open pure positioning

In the configuration parameters of the Lua file

 

 

TRAJECTORY_BUILDER.pure_localization_trimmer = {

Max_submaps_to_keep = 3, // The maximum number of subgraphs can be saved, but only the current and the previous subgraph can be saved. I set 2 here

}

Pose_graph. optimize_every_n_nodes = 20

 

The principle of pure positioning

Pure positioning TF tree

The TF from Map to Footpint is the actual robot pose

 

Optimization of pure positioning

 

Pure positioning has at least two trajectories

Pure localization is different from mapping. First, we expect lower latency for both local and global SLAM. Second, global SLAM typically finds a very large number of mutual constraints between the frozen trajectory as a map and the current trajectory.

 

If you run pure_localization in, submaps.resolution should match.pbstream with the resolution of the subgraph you are running. Using different resolutions is currently untested and may not work as expected.

 

The need to reduce pose_graph.optimize_every_n_nodes increases the frequency of optimization

Reducing global_sampling_ratio reduces the global sampling frequency, and reducing constraint_builder.sampling_ratio reduces the sampling frequency for common constraints. So the computation is reduced

 

To run pure localization, submaps.resolution should match the resolution of the subgraph of.pbStream.

 

The relevant data

Application adaptation of Cartographer’s pure positioning mode on low performance processors

Blog.csdn.net/zhzwang/art…