yuzhenning / ROS_turtlebot2

This is a file record Ubuntu based ROS and Turtlebot2 control system
0 stars 0 forks source link

27 multi lidar topic define #27

Open yuzhenning opened 4 years ago

yuzhenning commented 4 years ago

ref web : https://blog.csdn.net/sunyoop/article/details/78210891

yuzhenning commented 4 years ago

multi ridar leads a problem that: /scan topic conflix. solution is : launch command step by step, do not use multi sensor launch procedure at one time.

  1. roscore
  2. roslaunch turtlebot_bringup minimal.launch
  3. roslaunch turtlebot_bringup multisensor.launch
  4. roslaunch rplidar_ros multirplidar.launch where: multisensor is based on 3dsensor.launch multirplidar.launch is based on rplidar_launch.launch files
yuzhenning commented 4 years ago

move_base_only.launch

<launch>
  <!-- Move base -->
  <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
</launch>
yuzhenning commented 4 years ago

gmapping_only.launch

<launch>
<!-- Gmapping -->
<arg name="custom_gmapping_launch_file" default="$(find turtlebot_navigation)/launch/includes/gmapping/gmapping.launch.xml"/>
<include file="$(arg custom_gmapping_launch_file)"/>
</launch>
yuzhenning commented 4 years ago

amcl_only.launch

<launch>
  <!-- Map server -->
  <arg name="map_file" default="$(env TURTLEBOT_MAP_FILE)"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- AMCL -->
  <arg name="custom_amcl_launch_file" default="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml"/>
  <arg name="initial_pose_x" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_y" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_a" default="0.0"/>
  <include file="$(arg custom_amcl_launch_file)">
    <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
    <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
    <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
  </include>
</launch>
yuzhenning commented 4 years ago

kinect_only.launch

<launch>
  <!-- 3D sensor -->
  <arg name="3d_sensor" default="$(env TURTLEBOT_3D_SENSOR)"/>  <!-- r200, kinect, asus_xtion_pro -->
  <include file="$(find turtlebot_bringup)/launch/3dsensor.launch">
    <arg name="rgb_processing" value="false" />
    <arg name="depth_registration" value="false" />
    <arg name="depth_processing" value="false" />

    <!-- We must specify an absolute topic name because if not it will be prefixed by "$(arg camera)".
         Probably is a bug in the nodelet manager: https://github.com/ros/nodelet_core/issues/7 --> 
    <arg name="scan_topic" value="/scan" />
  </include>
</launch>

Multi sensor solution:

  1. In kinect.launch <arg name="scan_topic" value="/scan_kinect" />
  2. In 3dsensor.launch
    <!-- Laserscan topic -->
    <arg name="scan_topic" default="scan_kinect"/>

    In rplidar.launch file, added following command:

    <remap from="/scan" to="scan_rplidar"/>
yuzhenning commented 4 years ago

hokuyo_only.launch

<launch>
  <!-- laser driver -->
  <include file="$(find turtlebot_navigation)/laser/driver/hokuyo_laser.launch" />
</launch>