< >
Home » ROS与Bebop入门教程 » ROS与Bebop-运行驱动

ROS与Bebop-运行驱动

ROS与Bebop-运行驱动

说明:

  • 介绍如何使用驱动
  • 可以作为nodelet启动或作为独立的节点启动
  • 如果是想要执行视频流的各种处理,建议使用nodelet

准备:

  • 启用工作空间:
$source ~/bebop_ws/devel/setup.bash
  • 确保Bebop固件是最新的2.0.29和计算机连上Bebop的wifi网络

节点启动:

  • 启动命令:
$ roslaunch bebop_driver bebop_node.launch
  • bebop_node.launch内容:
<?xml version="1.0"?>
<launch>
    <arg name="namespace" default="bebop" />
    <arg name="ip" default="192.168.42.1" />
    <arg name="config_file" default="$(find bebop_driver)/config/defaults.yaml" />
    <arg name="camera_info_url" default="package://bebop_driver/data/bebop_camera_calib.yaml" />
    <group ns="$(arg namespace)">
        <node pkg="bebop_driver" name="bebop_driver" type="bebop_driver_node" output="screen">
            <param name="camera_info_url" value="$(arg camera_info_url)" />
            <param name="bebop_ip" value="$(arg ip)" />
            <rosparam command="load" file="$(arg config_file)" />
        </node>
        <include file="$(find bebop_description)/launch/description.launch" />
    </group>
</launch>

Nodelet启动:

  • 启动命令:
$ roslaunch bebop_tools bebop_nodelet_iv.launch
  • bebop_tools/launch/bebop_nodelet_iv.launch内容:
<?xml version="1.0"?>
<launch>
    <!-- include the nodelet launch file from bebop_driver -->
    <arg name="namespace" default="bebop" />
    <include file="$(find bebop_driver)/launch/bebop_nodelet.launch">
      <arg name="namespace" value="$(arg namespace)" />
    </include>
    <!-- use the same nodelet manager and namespace, then load image_view nodelet -->
    <group ns="$(arg namespace)">
       <node pkg="nodelet" type="nodelet" name="bebop_image_view_nodelet"
          args="load image_view/image bebop_nodelet_manager">
          <remap from="image" to="image_raw" />
        </node>
    </group>
</launch>
  • bebop_driver/launch/bebop_nodelet.launch内容:
<?xml version="1.0"?>
<launch>
    <arg name="namespace" default="bebop" />
    <arg name="ip" default="192.168.42.1" />
    <arg name="config_file" default="$(find bebop_driver)/config/defaults.yaml" />
    <arg name="camera_info_url" default="package://bebop_driver/data/bebop_camera_calib.yaml" />
    <group ns="$(arg namespace)">
        <!-- nodelet manager -->
        <node pkg="nodelet" type="nodelet" name="bebop_nodelet_manager" args="manager" output="screen"/>
        <!-- bebop_nodelet -->
        <node pkg="nodelet" type="nodelet" name="bebop_nodelet"
          args="load bebop_driver/BebopDriverNodelet bebop_nodelet_manager">
            <param name="camera_info_url" value="$(arg camera_info_url)" />
            <param name="bebop_ip" value="$(arg ip)" />
            <rosparam command="load" file="$(arg config_file)" />
        </node>
        <include file="$(find bebop_description)/launch/description.launch" />
    </group>
</launch>

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros与bebop