Open yuzhenning opened 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.
move_base_only.launch
<launch>
<!-- Move base -->
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
</launch>
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>
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>
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:
<arg name="scan_topic" value="/scan_kinect" />
<!-- Laserscan topic -->
<arg name="scan_topic" default="scan_kinect"/>
In rplidar.launch file, added following command:
<remap from="/scan" to="scan_rplidar"/>
hokuyo_only.launch
<launch>
<!-- laser driver -->
<include file="$(find turtlebot_navigation)/laser/driver/hokuyo_laser.launch" />
</launch>
ref web : https://blog.csdn.net/sunyoop/article/details/78210891