Launch
There are 6 steps in this launch file:
- Play a ROSbag
- We use a dataset in this tutorial to keep things simple vs. running live sensors.
- There is however no reason the code in this tutorial wouldn't work with live sensors, just with a little bit of topic remapping.
- The specific dataset we use here.
- Image topic throttlers
- As mentioned earlier, throttling the images to 5 Hz for detection and CLIP embedding computation is ideal.
- RViz: built-in ROS visualization tool
- Object Detection
- This is launching another file in
darknet_ros. Ensure it's been built in your workspace.
- This is launching another file in
- CLIP Embeddings Node:
- 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.
- Finally, Smart Capture
- After setting the
trigger_file_pathas arosparam, we run the Smart Capture node we've implemented in this tutorial.
- After setting the
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>
Updated 10 months ago
Did this page help you?