obstacle_cost_exponent和min_obstacle_dist的设置,一般都会进入if情况。 注意 max cost (before weighting) is the same as the straight line version and that all other costs are below the straight line (for positive exponent), so it may be necessary to increase weight_obstacle and/or the inflation_weight when using larger exponents.
After running optimize() once, I am finding a high number of outliers. Is there any way to delete a single edge out of the graph and run optimize again, or do I have to construct it again?
The method removeEdge() removes the edge from a graph and unlinks it from all of the vertices it was attached to. After you call it on your edges, I think you need to call initializeOptimization() to reset all of g2o’s internal data structures to the new graph configuration. You should then be able to call optimize()
setLevel(int ) is useful when you call optimizer.initializeOptimization(int ). If you assign initializeOptimization(0), the optimizer will include all edges up to level 0 in the optimization, and edges set to level >=1 will not be included
// Inter constraints, different trajectories 线段的两个端点 constraint_marker->points.push_back( ToGeometryMsgPoint(submap_pose.translation())); constraint_marker->points.push_back( ToGeometryMsgPoint(constraint_pose.translation())); // Inter residuals, different trajectories 线段的两个端点 residual_marker->points.push_back( ToGeometryMsgPoint(constraint_pose.translation())); residual_marker->points.push_back( ToGeometryMsgPoint(trajectory_node_pose.translation()));
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake
sed -i "s/2.8.3/3.19/g" `grep 2.8.3 -rl . --include="*.txt" `
这个命令不要滥用,否则可能更改过多
涉及PCL的一个警告
1 2 3 4 5
CMake Warning (dev) at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message): The package name passed to `find_package_handle_standard_args` (PCL_KDTREE) does not match the name of the calling package (PCL). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern.
在find_package(PCL REQUIRED)之前加上
1 2 3
if(NOT DEFINED CMAKE_SUPPRESS_DEVELOPER_WARNINGS) set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev warnings") endif()
No rule to make target
有时明明写好了,但编译会出现报错,看上去是CMakeLists中没有编译规则
1 2 3 4 5 6
make[2]: *** No rule to make target 'package/CMakeFiles/test_bin.dir/build'。 停止。 CMakeFiles/Makefile2:3192: recipe for target 'package/CMakeFiles/test_bin.dir/all' failed make[1]: *** [package/CMakeFiles/test_bin.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
此时再重新编译仍然报错,只要把CMakeLists改一下,再编译就通过了
CMakeCache 报错
执行编译时报错:
1
CMake Error: The current CMakeCache.txt directory /home/user/common/build/CMakeCache.txt is different than the directory /home/user/space/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt