三轮全向轮底盘SLAM挖坑系列-虚拟墙

虚拟墙是在turtlebot2那里调包出来修改的,主要在RVIZ上面布置一些虚拟的墙体,并加进去虚拟的激光,好让虚拟的墙体也拥有膨胀区域,机器人到达虚拟墙体能够进行避障。

1、安装好yocs_virtual_sensor的包,这个包需要安装比较多的依赖文件

$ git clone https://github.com/yujinrobot/yujin_ocs.git
$ sudo apt-get install ros-kinetic-ecl-*
$ git clone https://github.com/yujinrobot/yocs_msgs.git
$ sudo apt-get install ros-kinetic-ar-track-alvar
2、编译yovs_virtual_sensor包,这个包需要自己更改CMakeLists.txt文件,不然启动launch文件时候会提示找不到节点,主要更改下面这几句:

## Specify additional locations of header files
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
 
## Declare a cpp executable
add_executable(virtual_sensor_node src/virtual_sensor_node.cpp)
 
## Add cmake target dependencies of the executable/library
add_dependencies(virtual_sensor_node yocs_msgs_gencpp)
 
## Specify libraries to link a library or executable target against
target_link_libraries(virtual_sensor_node ${catkin_LIBRARIES})
 
#############
## Install ##
#############
 
install(TARGETS virtual_sensor_node
        DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
3、配置standalone.launch文件,需要添加yaml文件进去,还有虚拟墙的节点。

<launch>
  <arg name="virtual_wall" default="$(find yocs_virtual_sensor)/data/wall_list.yaml"/>
  <node name="virtual_sensor" pkg="yocs_virtual_sensor" type="virtual_sensor_node" >
    <param name="range_min"    value="0.0"/>
    <param name="range_max"    value="6.0"/>
    <param name="frequency"    value="10.0"/>
    <param name="hits_count"   value="3"/>
    <param name="global_frame" value="/map"/>
    <param name="sensor_frame" value="/base_link"/>
  </node>
  <node pkg="tf" type="static_transform_publisher" name="base_to_virtual" args="0 0 0 0 0 0 /base_footprint /virtual_laser 50"/>
  <node name="wall_publisher" pkg="yocs_virtual_sensor" type="wall_publisher.py" required="true" >
    <param name="virtual_wall" value="$(arg virtual_wall)"/>
  </node>
 
</launch>
4、添加好虚拟激光进去costmap.yaml文件,本来一个scan的,现在添加为两个scan

obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.3, -0.3], [-0.3, 0.3], [0.3, 0.3], [0.3, -0.3]]
#robot_radius: ir_of_robot
inflation_radius: 0.5
cost_scaling_factor: 10.0
observation_sources: scan1 scan2
 
scan1: {sensor_frame: base_link,  observation_persistence: 0.0, max_obstacle_height: 0.4, min_obstacle_height: 0.0, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
scan2: {sensor_frame: base_link,  observation_persistence: 0.0, max_obstacle_height: 0.4, min_obstacle_height: 0.0, data_type: LaserScan, topic: /virtual_sensor_scan, marking: true, clearing: false}
5、可以启动导航包看效果了,后面墙的参数自己再好好消化。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值