ROS Navigation-----costmap_2d之staticmap层简介

1 概述

  静态地图中包含的大多数是来自外部源的不变数据(see the map_server package for documentation on building a map)。

1.1 Subscribed Topics
"map" ( nav_msgs/OccupancyGrid)
  • 代价地图可以选择使用用户定义的静态地图来初始化它(see the static_map parameter)。 如果该选项被选择,代价地图将使用service call从 map_server 获取静态地图
1.2 Parameters
unknown_cost_value ( int, default: -1)
  • 从map server提供地图中读到这个值,其代价将被按unknown看待。 If the costmap is not tracking unknown space, costs of this value will be considered occupied. A value of zero also results in this parameter being unused.
lethal_cost_threshold ( int, default: 100)
  • The threshold value at which to consider a cost lethal when reading in a map from the map server.
map_topic ( string, default: "map")
  • 指定代价地图用来订阅静态地图的主题。 This parameter is useful when you have multiple costmap instances within a single node that you want to use different static maps. - New in navigation 1.3.1
first_map_only ( bool, default: false)
  • Only subscribe to the first message on the map topic, ignoring all subsequent messages
subscribe_to_updates ( bool, default: false)
  • In addition to map_topic, also subscribe to map_topic + "_updates"
track_unknown_space ( bool, default: true)
  • If true, unknown values in the map messages are translated directly to the layer. Otherwise, unknown values in the map message are translated as FREE_SPACE in the layer.
use_maximum ( bool, default: false)
  • Only matters if the static layer is not the bottom layer. If true, only the maximum value will be written to the master costmap.

trinary_costmap (bool, default: true)

如果是true, 所有地图消息都将被转义成3个值:NO_INFORMATION/FREE_SPACE/LETHAL_OBSTACLE (three values);如果是false,地图消息可能会转义成一系列值


在Robot Operating System (ROS)中,配置costmap_converter节点以接收并处理地图数据通常涉及到以下几个步骤: 1. **安装和启动**: - 首先,你需要确保已经安装了`ros-navigation`或`move_base`相关的包,其中包含了`costmap_converter`组件。如果没有,你可以通过`rosdep install <package_name>`来安装。 2. **创建map_server**: costmap_converter通常需要一个实时更新的地图数据源,比如` nav_msgs/OccupancyGrid`或` nav_msgs/GridMap`消息。你需要运行一个`map_server`节点来提供这个数据,它可以从多种来源加载,如`.yaml`文件、传感器数据或者其他动态生成的数据。 ``` $ rosrun map_server map_server map_file:=your_map_file.yaml ``` 3. **设置`costmap_converter`参数**: - 在`~/.bashrc`或其他启动文件中,设置`costmap_converter`的相关参数,例如分辨率(`resolution`)、更新频率(`update_frequency`)以及是否从`map_server`获取静态地图(`use_sim_time`等)。例如: ```bash export ROS_NAMESPACE=your_namespace export ROS_IP=your_ip_address export ROS_MASTER_URI=http://your_ros_master:11311 ``` 4. **启动`costmap_converter`**: - 确保`map_server`已运行,然后启动`costmap_converter`: ``` $ roslaunch your_package name_of_costmap_converter.launch ``` 5. **订阅和发布**: - `costmap_converter`会自动订阅`map_server`发布的地图数据,并将其转换成所需的导航数据类型(如`nav_msgs/Costmap2D`),然后发布到`~/odom`话题供其他导航系统使用。 ```bash $ rosrun tf static_transform_publisher 0 0 0 0 0 0 /odom base_link ``` 这是为了确保`odom`话题有正确的坐标信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值