小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
使用map_server发布保存的地图rviz无法收到
-
使用cartographer建图使用map_server保存后,使用map_server加载,
显示一切正常[INFO] [1676349360.531463185] [map_server]: map_server lifecycle node launched. Waiting on external lifecycle transitions to activate See https://design.ros2.org/articles/node_lifecycle.html for more information. [INFO] [1676349360.531553193] [map_server]: Creating [INFO] [1676349364.388825500] [map_server]: Configuring [INFO] [map_io]: Loading yaml file: ./fishbot_map.yaml [DEBUG] [map_io]: resolution: 0.05 [DEBUG] [map_io]: origin[0]: -3.3 [DEBUG] [map_io]: origin[1]: -2.96 [DEBUG] [map_io]: origin[2]: 0 [DEBUG] [map_io]: free_thresh: 0.25 [DEBUG] [map_io]: occupied_thresh: 0.65 [DEBUG] [map_io]: mode: trinary [DEBUG] [map_io]: negate: 0 [INFO] [map_io]: Loading image_file: ./fishbot_map.pgm [DEBUG] [map_io]: Read map ./fishbot_map.pgm: 133 X 118 map @ 0.05 m/cell [INFO] [1676349369.553119216] [map_server]: Activating [INFO] [1676349369.553240332] [map_server]: Creating bond (map_server) to lifecycle manager.
但在rviz中显示no map recevied
输入ros2 topic info /map -v
显示Publisher count: 1 Node name: map_server Node namespace: / Topic type: nav_msgs/msg/OccupancyGrid Endpoint type: PUBLISHER GID: 01.0f.6e.93.81.6d.f9.3e.01.00.00.00.00.00.1f.03.00.00.00.00.00.00.00.00 QoS profile: Reliability: RELIABLE History (Depth): UNKNOWN Durability: TRANSIENT_LOCAL Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite Subscription count: 1 Node name: rviz Node namespace: / Topic type: nav_msgs/msg/OccupancyGrid Endpoint type: SUBSCRIPTION GID: 01.0f.6e.93.8c.6d.9f.ae.01.00.00.00.00.00.2f.04.00.00.00.00.00.00.00.00 QoS profile: Reliability: RELIABLE History (Depth): UNKNOWN Durability: TRANSIENT_LOCAL Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite
使用ros2 topic echomap显示
header: stamp: sec: 1676349936 nanosec: 235408782 frame_id: map info: map_load_time: sec: 1676349936 nanosec: 235407546 resolution: 0.05000000074505806 width: 133 height: 118 origin: position: x: -3.3 y: -2.96 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 data: - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - '...' ---
环境为ubuntu22.04.1 ros-humble
-
-
@小鱼 问题解决了,多次重启之后莫名其妙地好了
-
@lockxx2021 应该是qos问题造成的
参考如下帖子
@追逐我的明天 在 配置激活map_server报错,Transitioning failed 中说:
问题:配置map_server时报错
-
@小鱼 我通过ros2 topic info /map -v显示出的qos是相同的...重启后也仍然不行
-
@小鱼 问题解决了,多次重启之后莫名其妙地好了
-
-
和我的环境一样,也是出了相同的问题,我重启了多次,rviz依然无法显示载入地图
-
@vico1999 可以先启动一个rviz2,添加map,修改好qos,接着再启动cartographer,
-
和我的一样,rviz不能显示地图
-
@vico1999 把map的qos设置成这样试试。Reliability Policy设置成Reliable,Durability Policy设置成Transient Local,改完我这边能显示栅格地图了。
-
-
-
@1959255334 正解,感谢感谢
-
@1959255334 先启动ros2 run nav2_map_server map_server --ros-args --param yaml_filename:=map/fishbot_map.yaml
再打开rviz2,把设置都改好后,再手动激活和配置节点
ros2 lifecycle set /map_server configure
ros2 lifecycle set /map_server activate -
成功了,十分感谢
-
遇到了同样的问题,修改为如下配置后可正常显示: