Launch

There are 6 steps in this launch file:

  1. Play a ROSbag
    1. We use a dataset in this tutorial to keep things simple vs. running live sensors.
    2. There is however no reason the code in this tutorial wouldn't work with live sensors, just with a little bit of topic remapping.
    3. The specific dataset we use here.
  2. Image topic throttlers
    1. As mentioned earlier, throttling the images to 5 Hz for detection and CLIP embedding computation is ideal.
  3. RViz: built-in ROS visualization tool
  4. Object Detection
    1. This is launching another file in darknet_ros. Ensure it's been built in your workspace.
  5. CLIP Embeddings Node:
    1. This is a sample node that's provided along with the tutorial for quick and dirty CLIP embedding computation. This is plain PyTorch, so its not performant but it gets the job done at 5 Hz.
  6. Finally, Smart Capture
    1. After setting the trigger_file_path as a rosparam, we run the Smart Capture node we've implemented in this tutorial.

The full launch file below.

<?xml version="1.0"?>
<launch>

    <!-- Play ROSbag -->
    <node pkg="rosbag" type="play" name="player" output="screen" args="--clock UrbanNav-HK_TST-20210517_sensors.bag"/>

    <!-- Image Throttler -->
    <node name="rgb_throttler" type="throttle" pkg="topic_tools" args="messages /zed2/camera/left/image_raw 5 /zed2/camera/left/image_raw_throttled" />

    <!-- RVIZ Visualizer -->
    <node pkg="rviz" type="rviz" name="rviz" output="screen"/>

    <!--   YOLO Object Detection   -->
    <include file="$(find darknet_ros)/launch/darknet_ros.launch" >
        <arg name="image" value="/zed2/camera/left/image_raw_throttled" />
    </include>

    <!-- CLIP Embeddings Node -->
    <node pkg="smartcapture_ros1" name="clip_rosnode" type="clip_rospy.py" output="screen">
        <remap from="/zed2/camera/left/image_raw" to="/zed2/camera/left/image_raw_throttled"/>
    </node>

    <!--   Smart Capture Sample Node   -->
    <param name="trigger_file_path" type="str" value="$(find smartcapture_ros1)/triggers/triggers.json" />
    <node name="sc_ros" pkg="smartcapture_ros1" type="smartcapture_cpp_ros1_lidar" output="screen" required="true">
        <!-- launch-prefix="valgrind" -->
        <remap from="/zed2/camera/left/image_raw" to="/zed2/camera/left/image_raw_throttled"/>
    </node>
</launch>

Did this page help you?