小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
cartographer仿真出现建筑与rviz显示地图方位不一致
-
在gazebo平台进行仿真,大范围建图时出现了重影,建筑与建筑之间方位不一致(rviz显示与gazebo平台)的问题
背景:
作为一个本科毕设,需要实现在室外进行slam建图与导航,现在是需要使用仿真模拟室外环境并使用cartographer算法进行建图
问题描述:
在gazebo平台进行仿真的时候,我建立了一个较大的world模型(模拟室外环境),在使用cartographer算法进行建图时,我先扫描了其中一个建筑(用一个方块代替),之后又扫描了另一个模型(用圆柱代替),两个建筑相距较远,会出现雷达扫描范围超了的情况。在扫描了两个建筑之后,我再返回去扫描一开始的扫描过的建筑(方块),rviz显示会多出一个方块,且方位并不准确,不会回环
具体细节:
硬件平台:rk3588
系统版本 :Ubuntu 20.04
ros版本: foxy
一切步骤都按照文档的来的中间无任何报错结果图如下图所示:
且在运行launch文件后,如果初始状态下,雷达范围内无任何建筑的时候,rviz会显示map没有接收到,map会显示状态出错 如下图所示
在加入新的建筑后立马恢复正常
在回复正常后 tf输如下图所示
下面是gazebo日志:orangepi@orangepi5plus:~/fishbot_ws$ ros2 launch fishbot_description gazebo.launch.py [INFO] [launch]: All log files can be found below /home/orangepi/.ros/log/2024-04-07-21-18-24-481081-orangepi5plus-87094 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [87096] [INFO] [gazebo-2]: process started with pid [87098] [INFO] [spawn_entity.py-3]: process started with pid [87100] [robot_state_publisher-1] [WARN] [1712495904.633827192] [robot_state_publisher]: No robot_description parameter, but command-line argument available. Assuming argument is name of URDF file. This backwards compatibility fallback will be removed in the future. [robot_state_publisher-1] Parsing robot urdf xml string. [robot_state_publisher-1] Link base_link had 5 children [robot_state_publisher-1] Link caster_link had 0 children [robot_state_publisher-1] Link imu_link had 0 children [robot_state_publisher-1] Link laser_link had 0 children [robot_state_publisher-1] Link left_wheel_link had 0 children [robot_state_publisher-1] Link right_wheel_link had 0 children [robot_state_publisher-1] [INFO] [1712495904.636303999] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-1] [INFO] [1712495904.636348040] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1712495904.636356790] [robot_state_publisher]: got segment caster_link [robot_state_publisher-1] [INFO] [1712495904.636365249] [robot_state_publisher]: got segment imu_link [robot_state_publisher-1] [INFO] [1712495904.636372832] [robot_state_publisher]: got segment laser_link [robot_state_publisher-1] [INFO] [1712495904.636379832] [robot_state_publisher]: got segment left_wheel_link [robot_state_publisher-1] [INFO] [1712495904.636386832] [robot_state_publisher]: got segment right_wheel_link [spawn_entity.py-3] [INFO] [1712495905.119205472] [spawn_entity]: Spawn Entity started [spawn_entity.py-3] [INFO] [1712495905.119660175] [spawn_entity]: Loading entity XML from file /home/orangepi/fishbot_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot_gazebo.urdf [spawn_entity.py-3] [INFO] [1712495905.122507103] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity.py-3] [INFO] [1712495905.122863516] [spawn_entity]: Waiting for service /spawn_entity [gazebo-2] Gazebo multi-robot simulator, version 11.11.0 [gazebo-2] Copyright (C) 2012 Open Source Robotics Foundation. [gazebo-2] Released under the Apache 2 License. [gazebo-2] http://gazebosim.org [gazebo-2] [gazebo-2] Gazebo multi-robot simulator, version 11.11.0 [gazebo-2] Copyright (C) 2012 Open Source Robotics Foundation. [gazebo-2] Released under the Apache 2 License. [gazebo-2] http://gazebosim.org [gazebo-2] [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] [Msg] Waiting for master. [gazebo-2] [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [gazebo-2] [Msg] Publicized address: 192.168.123.192 [gazebo-2] [Msg] Loading world file [/home/orangepi/fishbot_ws/install/fishbot_description/share/fishbot_description/world/world.world] [gazebo-2] [Wrn] [OBJLoader.cc:80] Both `d` and `Tr` parameters defined for "Ambulance". Use the value of `d` for dissolve (line 8 in .mtl.) [gazebo-2] Both `d` and `Tr` parameters defined for "Firetruck_Wheels". Use the value of `d` for dissolve (line 22 in .mtl.) [gazebo-2] [spawn_entity.py-3] [INFO] [1712495908.133287593] [spawn_entity]: Calling service /spawn_entity [spawn_entity.py-3] [INFO] [1712495908.642843695] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [fishbot] [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] [INFO] [1712495908.785244622] [diff_drive]: Wheel pair 1 separation set to [0.200000m] [gazebo-2] [INFO] [1712495908.786096279] [diff_drive]: Wheel pair 1 diameter set to [0.065000m] [gazebo-2] [INFO] [1712495908.788233006] [diff_drive]: Subscribed to [/cmd_vel] [gazebo-2] [INFO] [1712495908.791125725] [diff_drive]: Advertise odometry on [/odom] [gazebo-2] [INFO] [1712495908.793320785] [diff_drive]: Publishing odom transforms between [odom] and [base_footprint] [INFO] [spawn_entity.py-3]: process has finished cleanly [pid 87100] [gazebo-2] [INFO] [1712495908.809913815] [fishbot_joint_state]: Going to publish joint [right_wheel_joint] [gazebo-2] [INFO] [1712495908.809994314] [fishbot_joint_state]: Going to publish joint [left_wheel_joint] [gazebo-2] libGL error: failed to create dri screen [gazebo-2] libGL error: failed to load driver: rockchip [gazebo-2] [Msg] Waiting for master. [gazebo-2] [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [gazebo-2] [Msg] Publicized address: 192.168.123.192 [gazebo-2] [Err] [InsertModelWidget.cc:403] Missing model.config for model "/home/orangepi/.gazebo/models/person_walking" [gazebo-2] [Wrn] [OBJLoader.cc:80] Both `d` and `Tr` parameters defined for "Ambulance". Use the value of `d` for dissolve (line 8 in .mtl.) [gazebo-2] Both `d` and `Tr` parameters defined for "Firetruck_Wheels". Use the value of `d` for dissolve (line 22 in .mtl.) [gazebo-2] ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [robot_state_publisher-1] [INFO] [1712496034.582995492] [rclcpp]: signal_handler(signal_value=2) [INFO] [robot_state_publisher-1]: process has finished cleanly [pid 87096] [ERROR] [gazebo-2]: process has died [pid 87098, exit code 255, cmd 'gazebo --verbose -s libgazebo_ros_init.so -s libgazebo_ros_factory.so /home/orangepi/fishbot_ws/install/fishbot_description/share/fishbot_description/world/world.world']. [gazebo-2] [gazebo-2]
下面是rviz的日志:
[occupancy_grid_node-2] [WARN] [1712495930.847788183] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495931.347832180] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495931.847851676] [occupancy_grid_node]: submap_slices and last_frame_id is empty [cartographer_node-1] [WARN] [1712495932.021012314] [cartographer_ros]: W0407 21:18:52.000000 87157 ordered_multi_queue.cc:155] Queue waiting for data: (0, scan) [occupancy_grid_node-2] [WARN] [1712495932.347814298] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495932.847797920] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495933.347766959] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495933.847759914] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495934.347715537] [occupancy_grid_node]: submap_slices and last_frame_id is empty [occupancy_grid_node-2] [WARN] [1712495934.847811157] [occupancy_grid_node]: submap_slices and last_frame_id is empty [cartographer_node-1] [WARN] [1712495934.870992283] [cartographer_ros]: W0407 21:18:54.000000 87157 ordered_multi_queue.cc:155] Queue waiting for data: (0, scan) [cartographer_node-1] [INFO] [1712495935.291487968] [cartographer_ros]: I0407 21:18:55.000000 87157 ordered_multi_queue.cc:172] All sensor data for trajectory 0 is available starting at '621355972129980000'. [cartographer_node-1] [INFO] [1712495935.302785847] [cartographer_ros]: I0407 21:18:55.000000 87157 collated_trajectory_builder.cc:72] odom rate: unknown [cartographer_node-1] [INFO] [1712495935.302835721] [cartographer_ros]: I0407 21:18:55.000000 87157 local_trajectory_builder_2d.cc:295] Extrapolator not yet initialized. [cartographer_node-1] [WARN] [1712495935.303591713] [cartographer_ros]: W0407 21:18:55.000000 87157 pose_extrapolator.cc:168] Queue too short for velocity estimation. Queue duration: 0 ms [occupancy_grid_node-2] [WARN] [1712495935.347781071] [occupancy_grid_node]: submap_slices and last_frame_id is empty [rviz2-3] [INFO] [1712495948.352420272] [rviz2]: Trying to create a map of size 86 x 85 using 1 swatches [rviz2-3] [ERROR] [1712495948.357629091] [rviz2]: Vertex Program:rviz/glsl120/indexed_8bit_image.vert Fragment Program:rviz/glsl120/indexed_8bit_image.frag GLSL link result : [rviz2-3] active samplers with a different type refer to the same texture image unit [cartographer_node-1] [INFO] [1712495950.459108861] [cartographer_ros]: I0407 21:19:10.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 9.03e-17 s (pulsed at 74.13% real time) [cartographer_node-1] [INFO] [1712495950.459216193] [cartographer_ros]: I0407 21:19:10.000000 87157 collated_trajectory_builder.cc:72] scan rate: 4.99 Hz 2.00e-01 s +/- 1.93e-03 s (pulsed at 73.82% real time) [rviz2-3] [INFO] [1712495956.878398730] [rviz2]: Trying to create a map of size 86 x 86 using 1 swatches [cartographer_node-1] [INFO] [1712495965.696076425] [cartographer_ros]: I0407 21:19:25.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 7.64e-17 s (pulsed at 72.14% real time) [cartographer_node-1] [INFO] [1712495965.696219632] [cartographer_ros]: I0407 21:19:25.000000 87157 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 1.35e-03 s (pulsed at 72.10% real time) [rviz2-3] [INFO] [1712495969.877722654] [rviz2]: Trying to create a map of size 87 x 86 using 1 swatches [rviz2-3] [INFO] [1712495970.870254811] [rviz2]: Trying to create a map of size 87 x 89 using 1 swatches [rviz2-3] [INFO] [1712495972.374432173] [rviz2]: Trying to create a map of size 87 x 91 using 1 swatches [rviz2-3] [INFO] [1712495975.870259904] [rviz2]: Trying to create a map of size 89 x 91 using 1 swatches [rviz2-3] [INFO] [1712495976.357694994] [rviz2]: Trying to create a map of size 95 x 91 using 1 swatches [rviz2-3] [INFO] [1712495976.861545783] [rviz2]: Trying to create a map of size 97 x 91 using 1 swatches [rviz2-3] [INFO] [1712495977.373990438] [rviz2]: Trying to create a map of size 100 x 91 using 1 swatches [rviz2-3] [INFO] [1712495977.853808443] [rviz2]: Trying to create a map of size 102 x 91 using 1 swatches [rviz2-3] [INFO] [1712495978.366066725] [rviz2]: Trying to create a map of size 103 x 91 using 1 swatches [rviz2-3] [INFO] [1712495978.894650289] [rviz2]: Trying to create a map of size 105 x 91 using 1 swatches [cartographer_node-1] [INFO] [1712495980.724580231] [cartographer_ros]: I0407 21:19:40.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 9.03e-17 s (pulsed at 74.42% real time) [cartographer_node-1] [INFO] [1712495980.724741229] [cartographer_ros]: I0407 21:19:40.000000 87157 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 7.33e-04 s (pulsed at 74.47% real time) [rviz2-3] [INFO] [1712495981.374233035] [rviz2]: Trying to create a map of size 106 x 91 using 1 swatches [rviz2-3] [INFO] [1712495983.872206624] [rviz2]: Trying to create a map of size 107 x 91 using 1 swatches [rviz2-3] [INFO] [1712495984.861788313] [rviz2]: Trying to create a map of size 107 x 99 using 1 swatches [rviz2-3] [INFO] [1712495985.390027131] [rviz2]: Trying to create a map of size 107 x 103 using 1 swatches [rviz2-3] [INFO] [1712495985.874998831] [rviz2]: Trying to create a map of size 107 x 105 using 1 swatches [rviz2-3] [INFO] [1712495986.349664892] [rviz2]: Trying to create a map of size 107 x 108 using 1 swatches [rviz2-3] [INFO] [1712495986.861729217] [rviz2]: Trying to create a map of size 107 x 111 using 1 swatches [rviz2-3] [INFO] [1712495989.880081584] [rviz2]: Trying to create a map of size 107 x 112 using 1 swatches [rviz2-3] [INFO] [1712495990.877800685] [rviz2]: Trying to create a map of size 107 x 113 using 1 swatches [cartographer_node-1] [INFO] [1712495995.915635705] [cartographer_ros]: I0407 21:19:55.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 9.03e-17 s (pulsed at 73.73% real time) [cartographer_node-1] [INFO] [1712495995.915757037] [cartographer_ros]: I0407 21:19:55.000000 87157 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 9.58e-04 s (pulsed at 73.73% real time) [rviz2-3] [INFO] [1712495996.862190607] [rviz2]: Trying to create a map of size 108 x 113 using 1 swatches [rviz2-3] [INFO] [1712495997.366226018] [rviz2]: Trying to create a map of size 110 x 113 using 1 swatches [rviz2-3] [INFO] [1712495998.850472553] [rviz2]: Trying to create a map of size 111 x 113 using 1 swatches [rviz2-3] [INFO] [1712496006.353848761] [rviz2]: Trying to create a map of size 111 x 115 using 1 swatches [rviz2-3] [INFO] [1712496007.858297662] [rviz2]: Trying to create a map of size 111 x 120 using 1 swatches [rviz2-3] [INFO] [1712496008.370193405] [rviz2]: Trying to create a map of size 111 x 121 using 1 swatches [rviz2-3] [INFO] [1712496008.850597946] [rviz2]: Trying to create a map of size 111 x 125 using 1 swatches [rviz2-3] [INFO] [1712496009.365623240] [rviz2]: Trying to create a map of size 111 x 127 using 1 swatches [cartographer_node-1] [INFO] [1712496009.531540705] [cartographer_ros]: I0407 21:20:09.000000 87157 submap_2d.cc:187] Added submap 2 [cartographer_node-1] [INFO] [1712496009.807173532] [cartographer_ros]: I0407 21:20:09.000000 87165 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1712496009.807296614] [cartographer_ros]: I0407 21:20:09.000000 87165 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 0 [rviz2-3] [INFO] [1712496009.862534187] [rviz2]: Trying to create a map of size 111 x 129 using 1 swatches [rviz2-3] [INFO] [1712496010.367553379] [rviz2]: Trying to create a map of size 111 x 133 using 1 swatches [cartographer_node-1] [INFO] [1712496011.081270661] [cartographer_ros]: I0407 21:20:11.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 9.03e-17 s (pulsed at 73.84% real time) [cartographer_node-1] [INFO] [1712496011.081419992] [cartographer_ros]: I0407 21:20:11.000000 87157 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 1.17e-03 s (pulsed at 74.12% real time) [rviz2-3] [INFO] [1712496011.357449190] [rviz2]: Trying to create a map of size 111 x 137 using 1 swatches [rviz2-3] [INFO] [1712496011.866350716] [rviz2]: Trying to create a map of size 115 x 140 using 1 swatches [rviz2-3] [INFO] [1712496012.373079057] [rviz2]: Trying to create a map of size 117 x 141 using 1 swatches [rviz2-3] [INFO] [1712496013.355770779] [rviz2]: Trying to create a map of size 118 x 142 using 1 swatches [rviz2-3] [INFO] [1712496013.869821333] [rviz2]: Trying to create a map of size 122 x 144 using 1 swatches [rviz2-3] [INFO] [1712496014.862245574] [rviz2]: Trying to create a map of size 123 x 144 using 1 swatches [rviz2-3] [INFO] [1712496015.374684104] [rviz2]: Trying to create a map of size 124 x 144 using 1 swatches [rviz2-3] [INFO] [1712496016.366441603] [rviz2]: Trying to create a map of size 125 x 144 using 1 swatches [rviz2-3] [INFO] [1712496016.876303869] [rviz2]: Trying to create a map of size 127 x 144 using 1 swatches [rviz2-3] [INFO] [1712496017.374196263] [rviz2]: Trying to create a map of size 132 x 144 using 1 swatches [rviz2-3] [INFO] [1712496017.854386723] [rviz2]: Trying to create a map of size 135 x 144 using 1 swatches [rviz2-3] [INFO] [1712496018.353221774] [rviz2]: Trying to create a map of size 140 x 144 using 1 swatches [rviz2-3] [INFO] [1712496018.872387231] [rviz2]: Trying to create a map of size 142 x 144 using 1 swatches [rviz2-3] [INFO] [1712496019.348913522] [rviz2]: Trying to create a map of size 144 x 144 using 1 swatches [rviz2-3] [INFO] [1712496019.887898975] [rviz2]: Trying to create a map of size 145 x 144 using 1 swatches [rviz2-3] [INFO] [1712496020.383458644] [rviz2]: Trying to create a map of size 146 x 144 using 1 swatches [cartographer_node-1] [INFO] [1712496026.206167513] [cartographer_ros]: I0407 21:20:26.000000 87157 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 1.04e-16 s (pulsed at 75.41% real time) [cartographer_node-1] [INFO] [1712496026.206297595] [cartographer_ros]: I0407 21:20:26.000000 87157 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 6.74e-04 s (pulsed at 75.55% real time) ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [occupancy_grid_node-2] [INFO] [1712496033.778813225] [rclcpp]: signal_handler(signal_value=2) [cartographer_node-1] [INFO] [1712496033.778920266] [rclcpp]: signal_handler(signal_value=2) [cartographer_node-1] [INFO] [1712496033.779456927] [cartographer_ros]: I0407 21:20:33.000000 87157 node.cc:545] Shutdown the subscriber of [scan] [cartographer_node-1] [INFO] [1712496033.779481718] [cartographer_ros]: I0407 21:20:33.000000 87157 node.cc:545] Shutdown the subscriber of [odom] [cartographer_node-1] [INFO] [1712496033.780370709] [cartographer_ros]: I0407 21:20:33.000000 87157 map_builder_bridge.cc:149] Finishing trajectory with ID '0'... [cartographer_node-1] [INFO] [1712496033.780454416] [cartographer_ros]: I0407 21:20:33.000000 87157 map_builder_bridge.cc:158] Running final trajectory optimization... [cartographer_node-1] [INFO] [1712496033.780677830] [cartographer_ros]: I0407 21:20:33.000000 87165 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1712496033.780697664] [cartographer_ros]: I0407 21:20:33.000000 87165 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 0 [rviz2-3] [INFO] [1712496033.784762578] [rclcpp]: signal_handler(signal_value=2) [INFO] [occupancy_grid_node-2]: process has finished cleanly [pid 87159] [cartographer_node-1] [INFO] [1712496033.829356765] [cartographer_ros]: I0407 21:20:33.000000 87165 pose_graph_2d.cc:382] Remaining work items in queue: 1 [cartographer_node-1] [INFO] [1712496033.829483347] [cartographer_ros]: I0407 21:20:33.000000 87164 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1712496033.829503472] [cartographer_ros]: I0407 21:20:33.000000 87164 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 0 Optimizing: Done. [cartographer_node-1] [INFO] [1712496033.834004715] [cartographer_ros]: I0407 21:20:33.000000 87166 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1712496033.834030673] [cartographer_ros]: I0407 21:20:33.000000 87166 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 0 Optimizing: Done. [cartographer_node-1] [INFO] [1712496033.836776394] [cartographer_ros]: I0407 21:20:33.000000 87165 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1712496033.836837060] [cartographer_ros]: I0407 21:20:33.000000 87165 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 0 [INFO] [cartographer_node-1]: process has finished cleanly [pid 87157] [INFO] [rviz2-3]: process has finished cleanly [pid 87161]
下面是cartographer lua文件配置内容
include "map_builder.lua" include "trajectory_builder.lua" options = { map_builder = MAP_BUILDER, trajectory_builder = TRAJECTORY_BUILDER, map_frame = "map", tracking_frame = "base_link", --base_link -- base_link改为odom,发布map到odom之间的位姿态 published_frame = "odom", --odom odom_frame = "odom", --odom -- true改为false,不用提供里程计数据 provide_odom_frame = false, -- false改为true,仅发布2D位资 publish_frame_projected_to_2d = true, -- false改为true,使用里程计数据 use_odometry = true, use_nav_sat = false, use_landmarks = false, -- 0改为1,使用一个雷达 num_laser_scans = 1, -- 1改为0,不使用多波雷达 num_multi_echo_laser_scans = 0, -- 10改为1,1/1=1等于不分割 num_subdivisions_per_laser_scan = 1, num_point_clouds = 0, lookup_transform_timeout_sec = 0.2, submap_publish_period_sec = 0.3, pose_publish_period_sec = 5e-3, trajectory_publish_period_sec = 30e-3, rangefinder_sampling_ratio = 1., odometry_sampling_ratio = 1., fixed_frame_pose_sampling_ratio = 1., imu_sampling_ratio = 1., landmarks_sampling_ratio = 1., } -- false改为true,启动2D SLAM MAP_BUILDER.use_trajectory_builder_2d = true -- 0改成0.10,比机器人半径小的都忽略 TRAJECTORY_BUILDER_2D.min_range = 0.10 --0.10 -- 30改成3.5,限制在雷达最大扫描范围内,越小一般越精确些 TRAJECTORY_BUILDER_2D.max_range = 5 --5 -- 5改成3,传感器数据超出有效范围最大值 TRAJECTORY_BUILDER_2D.missing_data_ray_length = 3. --3.0 -- true改成false,不使用IMU数据,大家可以开启,然后对比下效果 TRAJECTORY_BUILDER_2D.use_imu_data = false -- false改成true,使用实时回环检测来进行前端的扫描匹配 TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true -- 1.0改成0.1,提高对运动的敏感度 TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1) --0.1 -- 0.55改成0.65,Fast csm的最低分数,高于此分数才进行优化。 POSE_GRAPH.constraint_builder.min_score = 0.65 --0.6改成0.7,全局定位最小分数,低于此分数则认为目前全局定位不准确 POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7 -- 设置0可关闭全局SLAM -- POSE_GRAPH.optimize_every_n_nodes = 0 return options
launch文件没有改动,其余部分无任何改动
尝试过的解决方法:
参照了某些厂商的lua配置参数,但效果还是没任何变化
-
@2475887309 需要注意的是,无论哪一类建图方法,只要是有雷达参与,都需要有障碍物的,没有障碍物就没有参考,没有参考就没办法匹配,就没办法建图。在室外的雷达,一般测距范围都在80m+的多线雷达,你可以调整雷达的测距范围并在Gazebo中模拟室外的场景,来实现建图效果。
-
@小鱼 大佬,那么说明,出现这个问题并不是因为lua配置文件参数出的问题吗,我之前问过老师,老师说可能是里程计问题,但在仿真中我唯一能想到的就是lua配置文件里面可能没用到里程计
-
@2475887309 按照我过去的经验认为,和里程计没有关系,仅仅是因为雷达的点云全部打空,变成了inf即无限大,故无法建立地图,你可以按照我的上一个回答进行测试,尽可能模拟户外场景,而不是使用空旷的环境。
-
@小鱼 好的,谢谢大佬,请问一下,雷达的测距范围是修改lua文件配置还是修改机器人描述文件里的参数啊
-
1.修改Gazebo仿真插件中雷达的扫描距离(一般在URDF中描述的)
2.修改lua文件中的配置的雷达使用距离 -
@小鱼 好的好的,谢谢大佬
-
-
朋友,你好,我想问一下你在arm64上是如何下载gazebo_ros的