yulivee / RoboNDMapMyWorld

0 stars 0 forks source link

Build launch files #8

Closed yulivee closed 6 years ago

yulivee commented 6 years ago

1) Launch the gazebo world and your robot.

Example: $ roslaunch slam_project world.launch world_file:=~/catkin_ws/src/slam_project/worlds/kitchen_dining.world 2) Launch your teleop node.

Example: roslaunch slam_project teleop.launch Note: Here would be a good place to pause and check that the robot moves with telop and is publishing the relevant topics. If not, we will be covering debugging shortly!

3) Launch your mapping node.

Example: roslaunch slam_project mapping.launch 4) Launch Rviz.

Example: $ roslaunch slam_project rviz.launch

RTAB-Map Parameter Tutorial http://wiki.ros.org/rtabmap_ros/Tutorials/Advanced%20Parameter%20Tuning

List of RTAB-Map Parameters https://github.com/introlab/rtabmap/blob/master/corelib/include/rtabmap/core/Parameters.h

mapping.launch

<?xml version="1.0" encoding="UTF-8"?>

<launch>
  <!-- Arguments for launch file with defaults provided -->
  <arg name="database_path"     default="rtabmap.db"/>
  <arg name="rgb_topic"   default="/camera/rgb/image_raw"/>
  <arg name="depth_topic" default="/camera/depth/image_raw"/>
  <arg name="camera_info_topic" default="/camera/rgb/camera_info"/>  

  <!-- Mapping Node -->
  <group ns="rtabmap">
    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">

      <!-- Basic RTAB-Map Parameters -->
      <param name="database_path"       type="string" value="$(arg database_path)"/>
      <param name="frame_id"            type="string" value="base_footprint"/>
      <param name="odom_frame_id"       type="string" value="odom"/>
      <param name="subscribe_depth"     type="bool"   value="true"/>
      <param name="subscribe_scan"      type="bool"   value="true"/>

      <!-- RTAB-Map Inputs -->
      <remap from="scan"            to="/scan"/>
      <remap from="rgb/image"       to="$(arg rgb_topic)"/>
        <remap from="depth/image"     to="$(arg depth_topic)"/>
        <remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>

        <!-- RTAB-Map Output -->
        <remap from="grid_map" to="/map"/>

           <!-- Rate (Hz) at which new nodes are added to map -->
      <param name="Rtabmap/DetectionRate" type="string" value="1"/> 

      <!-- 2D SLAM -->
      <param name="Reg/Force3DoF" type="string" value="true"/>      

      <!-- Loop Closure Detection -->
 <!-- 0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB                 9=KAZE →
<param name="Kp/DetectorStrategy" type="string" value="0"/> 

<!-- Maximum visual words per image (bag-of-words) -->
          <param name="Kp/MaxFeatures" type="string" value="400"/>  

      <!-- Used to extract more or less SURF features -->
               <param name="SURF/HessianThreshold" type="string" value="100"/>

  <!-- Loop Closure Constraint -->
<!-- 0=Visual, 1=ICP (1 requires scan)-->
      <param name="Reg/Strategy" type="string" value="0"/> 

<!-- Minimum visual inliers to accept loop closure -->
      <param name="Vis/MinInliers" type="string" value="15"/> 

      <!-- Set to false to avoid saving data when robot is not moving -->
      <param name="Mem/NotLinkedNodesKept" type="string" value="false"/>

    </node> 
  </group>
</launch>
yulivee commented 6 years ago
yulivee commented 6 years ago

Launch the world in Gazebo:

roslaunch udacity_bot udacity_world.launch

Launch the teleop node for keyboard control:

roslaunch udacity_bot teleop.launch

Launch the RTAB-Map mapping node

roslaunch udacity_bot mapping.launch

Launch the RViz GUI:

roslaunch udacity_bot rviz.launch