Hood ROS 2 Foxy Image Tools Test 20210708

From wikidb
Jump to: navigation, search

Foxy has image_tools e.g. publisher

Use cam2image

TERMINAL 1

 $ ros2 run image_tools cam2image --ros-args -p frequency:=2.0
       [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
       [INFO] [1625764868.106752791] [cam2image]: Publishing image #1
       [INFO] [1625764868.606034554] [cam2image]: Publishing image #2
       [INFO] [1625764869.106041374] [cam2image]: Publishing image #3
       [INFO] [1625764869.605974867] [cam2image]: Publishing image #4
       [INFO] [1625764870.105977910] [cam2image]: Publishing image #5
       [INFO] [1625764870.605968277] [cam2image]: Publishing image #6
       [INFO] [1625764871.105943033] [cam2image]: Publishing image #7
       [INFO] [1625764871.605912645] [cam2image]: Publishing image #8
       [INFO] [1625764872.105910776] [cam2image]: Publishing image #9

TERMINAL 2

 $ ros2 topic list
       /flip_image
       /image
       /parameter_events
       /rosout

 $ ros2 topic echo image
       header:
         stamp:
           sec: 0
           nanosec: 0
         frame_id: camera_frame
       height: 240
       width: 320
       encoding: bgr8
       is_bigendian: 0
       step: 960
       data:
       - 88
       - 89
       - 84
       - 98
       - 99
       - 94

Installed Location

 $ find /opt/ros/ -name image_tools
       /opt/ros/foxy/share/image_tools
       /opt/ros/foxy/share/ament_index/resource_index/rclcpp_components/image_tools
       /opt/ros/foxy/share/ament_index/resource_index/parent_prefix_path/image_tools
       /opt/ros/foxy/share/ament_index/resource_index/packages/image_tools
       /opt/ros/foxy/share/ament_index/resource_index/package_run_dependencies/image_tools
       /opt/ros/foxy/lib/image_tools
 $ cd /opt/ros/foxy/lib/image_tools

 $ ls
       cam2image  showimage

Use showImage

TERMINAL 2

 $ ros2 run image_tools showimage
       [INFO] [1625766280.786449084] [showimage]: Subscribing to topic 'image'
       [INFO] [1625766281.048405502] [showimage]: Received image #camera_frame
       Received image #camera_frame

ShowImage20210810.png

Notes and Logs