Navigate and clasified objects at the same time

Hi, I want to share with you a launch file to use the deep perception node and the navigation node at the same time. It is simple, but maybe is useful to someone that wants to use the both nodes.

<launch>

  <arg name="map_yaml"                doc="filepath to previously captured map (required)" />
  <arg name="rviz"     default="true" doc="whether to show Rviz" />
  <arg name="debug_directory" value="$(env HELLO_FLEET_PATH)/debug/"/>

<!-- REALSENSE D435i -->
  <include file="$(find stretch_core)/launch/d435i_high_resolution.launch"></include>
  <node name="d435i_configure" pkg="stretch_core" type="d435i_configure" output="screen">
    <!--<param name="initial_mode" type="string" value="Default"/>-->
    <param name="initial_mode" type="string" value="High Accuracy"/>
  </node>
  <!-- -->

  <!-- STRETCH DRIVER -->
  <param name="/stretch_driver/broadcast_odom_tf" type="bool" value="true"/>
  <param name="/stretch_driver/mode" type="string" value="navigation" />
  <param name="/stretch_driver/fail_out_of_range_goal" type="bool" value="false"/>
  <include file="$(find stretch_core)/launch/stretch_driver.launch" pass_all_args="true"/>

  <!-- CENTERED BASE LINK -->
  <node name="centered_base_link_tf_publisher" pkg="tf" type="static_transform_publisher" args="-0.1 0 0 0 0 0 1 /base_link /centered_base_link 100" />

  <!-- LASER RANGE FINDER -->
  <include file="$(find stretch_core)/launch/rplidar.launch" />

  <!-- MAP SERVER -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_yaml)" />

  <!-- LOCALIZATION -->
  <include file="$(find amcl)/examples/amcl_diff.launch" />
  
   <!-- FRUSTUM FIELD OF VIEW VISUALIZATION -->	
  <node name="d435i_frustum_visualizer" pkg="stretch_core" type="d435i_frustum_visualizer" output="screen" />
  <!-- -->
  
  <!-- OBJECT DETECTOR -->
  <node name="object_detector" pkg="stretch_deep_perception" type="detect_objects.py" output="screen">
    <param name="debug_directory" type="string" value="$(arg debug_directory)"/>
  </node>
  <!-- -->

  <!-- NAVIGATION -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find stretch_navigation)/config/common_costmap_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find stretch_navigation)/config/common_costmap_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find stretch_navigation)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find stretch_navigation)/config/global_costmap_params_withmap.yaml" command="load" />
    <rosparam file="$(find stretch_navigation)/config/base_local_planner_params.yaml" command="load" />
    <remap from="/cmd_vel" to="/stretch/cmd_vel" />
  </node>

  <!-- VISUALIZE -->
  <node name="rviz" pkg="rviz" type="rviz" output="log" args="-d $(find stretch_navigation)/rviz/navigation.rviz" if="$(arg rviz)" />

</launch>
3 Likes

Thanks for sharing @Humberto_Andres_Hida!