cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.04k stars 2.24k forks source link

use landmark cpu high stack backend optimization #1837

Closed shamengjun closed 3 years ago

shamengjun commented 3 years ago

Hello, everyone: I use cartographer in mapping with configure use_landmark = true(according this link's method publish landmarks data [https://github.com/cartographer-project/cartographer_ros/issues/1067] ) and has overlapping trimmer, but when the program run some time , when I find CPU has over 100% (before this cpu is around 20%, optimization and overlapping is normally running), get the cartographer_node pid and use pstack tool I find this stack in optimization_problem_2d.cc AddLandmarkCostFunctions() and optimization and overlapping trimmer is also stuck, but pose graph is normally insert new submaps. I don't know why this and how to solve this? Can anyone has any idea about this?@pifon2a

shamengjun commented 3 years ago

This problem has solved, after my debug, the program stuck in infinite cycle when execute this code, auto next = node_data.lower_bound(observation.trajectory_id, observation.time), binary search right = lower_bound_middle is constant , this maybe causes by overlapping trimmmer trim some trajectory node data.