无网不进  
软硬件开发

Diego 1#中已经整合了不少的组件,一个一个启动比较麻烦,这里整理了一份启动的launch文件。

<launch>
  <master auto="start"/>

  <arg name="camera" default="camera" />

  <node pkg="xfei_asr" type="tts_subscribe_speak" name="tts_subscribe_speak" output="screen">
  </node>

  <node pkg="sound_play" type="soundplay_node.py" name="soundplay_node" output="screen">
  </node>

  <node name="arduino" pkg="ros_arduino_python" type="arduino_node.py" output="screen">
      <rosparam file="$(find ros_arduino_python)/config/my_arduino_params.yaml" command="load" />
  </node>  

  <node pkg="diego_nav" type="robot_camera_tf_publisher" name="robot_camera_tf_publisher" output="screen">
  </node>    

  <node pkg="diego_nav" type="robot_laser_tf_publisher" name="robot_laser_tf_publisher" output="screen">
  </node> 

  <!-- start sensor-->
  <include file="$(find openni_launch)/launch/openni.launch">
    <arg name="camera" default="$(arg camera)"/>
  </include>

  <!-- run pointcloud_to_laserscan node -->
  <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
      <remap from="cloud_in" to="$(arg camera)/depth_registered/points"/>
      <remap from="scan" to="$(arg camera)/scan"/>
      <rosparam>
          target_frame: camera_link # Leave disabled to output scan in pointcloud frame
          transform_tolerance: 0.01
          min_height: 0.0
          max_height: 1.0

          angle_min: -1.5708 # -M_PI/2
          angle_max: 1.5708 # M_PI/2
          angle_increment: 0.087 # M_PI/360.0
          scan_time: 0.3333
          range_min: 0.45
          range_max: 4.0
          use_inf: true

          # Concurrency level, affects number of pointclouds queued for processing and number of threads used
          # 0 : Detect number of cores
          # 1 : Single threaded
          # 2->inf : Parallelism level
          concurrency_level: 1
      </rosparam>

  </node>  

  <!-- gmapping node -->

  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping">
    <remap from="scan" to="$(arg camera)/scan"/>
    <param name="delta" value="0.1"/>
    <param name="maxUrange" value="4.99"/>
       <param name="xmin" value="-5.0"/>
       <param name="ymin" value="-5.0"/>
    <param name="xmax" value="5.0"/>
    <param name="ymax" value="5.0"/>
    <param name="particles" value="60"/>
    <param name="srr" value="0"/>
    <param name="srt" value="0"/>
    <param name="str" value="0.05"/>
    <param name="stt" value="0.05"/>
    <param name="minimumScore" value="200"/>
    <param name="map_update_interval" value="1"/>
    <param name="lsigma" value="0.05"/>
  </node>  

  <!-- amcl node -->
  <node pkg="amcl" type="amcl" name="amcl" output="screen">

  <remap from="scan" to="$(arg camera)/scan"/>
  <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="use_map_topic" value="true"/>
  <param name="odom_model_type" value="omni"/>
  <param name="odom_alpha5" value="0.1"/>
  <param name="transform_tolerance" value="0.5" />
  <param name="gui_publish_rate" value="10.0"/>
  <param name="laser_max_beams" value="300"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <param name="kld_err" value="0.1"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.1"/>
  <param name="odom_alpha2" value="0.1"/>
  <!-- translation std dev, m -->
  <param name="odom_alpha3" value="0.1"/>
  <param name="odom_alpha4" value="0.1"/>
  <param name="laser_z_hit" value="0.9"/>
  <param name="laser_z_short" value="0.05"/>
  <param name="laser_z_max" value="0.05"/>
  <param name="laser_z_rand" value="0.5"/>
  <param name="laser_sigma_hit" value="0.2"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_model_type" value="likelihood_field"/>
  <!-- <param name="laser_model_type" value="beam"/> -->
  <param name="laser_min_range" value="1"/>
  <param name="laser_max_range" value="5"/>
  <param name="laser_likelihood_max_dist" value="2.0"/>
  <param name="update_min_d" value="0.2"/>
  <param name="update_min_a" value="0.5"/>
  <param name="resample_interval" value="1"/>
  <param name="transform_tolerance" value="0.1"/>
  <param name="recovery_alpha_slow" value="0.0"/>
  <param name="recovery_alpha_fast" value="0.0"/>


  </node>

  <!-- move_base node -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find diego_nav)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find diego_nav)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find diego_nav)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find diego_nav)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find diego_nav)/config/base_local_planner_params.yaml" command="load" />
  </node>
</launch>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124

遇到一个比较奇怪的问题,OpenNI放在此launch文件中一起启动时,不知道为什么会有xtion启动不起来的情况,但单独启动openni却可以启动。所以可以把此文件中启动openni的部分注释掉,分别在两个终端启动

roslaunch openni_launch openni.launch 
roslaunch diego_nav diego_run.launch
  • 1
  • 2

我的包名名称是diego_nav, launch文件名称是diego_run.launch

查看tf关系

rosrun tf view_frames
  • 1

查看节点关系

rosrun rqt_graph rqt_graph
  • 1

查看xtion的图像

rqt_image_view
  • 1

启动rviz

rosrun rviz rviz
  • 1
版权声明:本文为博主原创文章,未经博主允许不得转载。
posted on 2018-01-11 09:38  无网不进  阅读(417)  评论(0)    收藏  举报