ros 虚拟墙yocs_virtual_sensor的包的使用

虚拟墙是在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="~filename" value="$(arg virtual_wall)"/>
  </node>
 
</launch>

4、添加好虚拟激光进去costmap.yaml文件,本来一个scan的,现在添加为两个scan。

obstacle_layer:
      enabled: true
      combination_method: 1
      track_unknown_space: true
      obstacle_range: 2.5
      raytrace_range: 3.0
      observation_sources: scan scan1
      scan: {
          sensor_frame: /laser_link,
          data_type: LaserScan,                                                                                                                                                                           
          topic: /scan,
          marking: true,
          clearing: true
      }
      scan1: {
          sensor_frame: /laser_link,
          data_type: LaserScan,
          topic: /virtual_sensor_scan,
          marking: true,
          clearing: false
      }

5、修改wall_publisher.py。

#修改

wall_pub   = rospy.Publisher('wall_pose_list', WallList,    latch = True)
#为
wall_pub   = rospy.Publisher('wall_pose_list', WallList,    latch = True,queue_size= 10)

这个官方的虚拟激光包是不可以保存,所以需要增加保存激光坐标参数数据功能,每次启动读取出来
6、这是一个基于costmap2d的虚拟墙插件

https://blog.csdn.net/qq825255961/article/details/118069952?ops_request_misc=&request_id=&biz_id=102&utm_term=ros%20%E8%99%9A%E6%8B%9F%E5%A2%99&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-118069952.142v21pc_rank_34,157v15new_3&spm=1018.2226.3001.4187

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值