ROS 自定义地图加载和导航(turtlebot测试)
1、构建地图
- 启动turtlebot底盘
roslaunch turtlebot_bringup minimal.launch
- 启动传感器(激光雷达和惯性导航)
roslaunch lms1xx LMS1xx.launch #启动激光雷达
- 启动hector slam
roslaunch lms1xx hector_mapping_demo.launch
- 启动远程遥控
roslaunch turtlebot_teleop keyboard_teleop.launch
- 启动遥控xbox
roslaunch turtlebot_teleop xbox360_teleop.launch ? ? #(1)
#(2) joy_node节点修改 # ###
- 保存地图
rosrun map_server map_saver -f ~/my_map2、自定义地图amcl导航
- 启动turtlebot底盘
roslaunch turtlebot_bringup minimal.launch
- 启动激光雷达
roslaunch turtlebot_navigation lms1xx.launch
- 启动amcl导航
roslaunch turtlebot_navigation lab_amcl_nomap.launch #不带加载地图,单独加载
- 加载地图
rosrun map_server map_server my_map.yaml
- rviz查看
roslaunch turtlebot_navigation view_robot.launch
- (1)地图显示不正确
文章图片
打开yaml文件
image: my_map.png注意:
resolution: 0.050000
origin: [-51.224998, -51.224998, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
图像像素值[0-255].
- If negate is false, p = (255 - x) / 255.0. This means that black (0) now has the highest value (1.0) and white (255) has the lowest (0.0).
- If negate is true, p = x / 255.0. This is the non-standard interpretation of images, which is why it is called negate, even though the math indicates that x is not negated. Nomenclature is hard.
【ROS 自定义地图加载和导航(turtlebot测试)】p = (255 - x) / 255.0
- If p > occupied_thresh(0.65,换算为灰度值,约为90,也就是说像素小于90为占用(障碍物)), output the value 100 to indicate the cell is occupied.
- If p < free_thresh(0.196,换算为灰度值,约为205,也就是说像素大于205为空(自由空间站)), output the value 0 to indicate the cell is free.
- Otherwise, output -1 a.k.a. 255 (as an unsigned char), to indicate that the cell is unknown.
文章图片
文章图片
推荐阅读
- SpringBoot调用公共模块的自定义注解失效的解决
- python自定义封装带颜色的logging模块
- 列出所有自定义的function和view
- 拿着旧地图,找不到新大陆
- 地图|地图 旅行 菜系
- Spring|Spring Boot 自动配置的原理、核心注解以及利用自动配置实现了自定义 Starter 组件
- 自定义MyAdapter
- Android自定义view实现圆环进度条效果
- Flutter自定义view|Flutter自定义view —— 闯关进度条
- js保留自定义小数点