Can tutorial "rosbagTutorialsExporting image and video data" be modified to be more realistic?

asked 2021-03-02 05:59:56 -0500

jgv22 gravatar image

I'm noob, trying to process images stored in a ros bag, following tutorial. My basic question is "can the tutorial be modified to be easier to follow and be to more representative of a real application"?

Running the launch file named "bag_images.launch " using the command "roslaunch bag_images.launch" generates the error output below. The launch file contains the following code from the tutorial,

<launch>
  <node pkg="rosbag" type="play" name="rosbag" required="true" args="$(find image_view)/test.bag"/>
  <node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME">
    <remap from="image" to="/camera/image_raw"/>
  </node>
</launch>

The error output is

[FATAL] [1614678687.890414433]: Error opening file: /opt/ros/melodic/share/image_view/test.bag

Maybe the tutorial could be modified so that the file "test.bag" exists, or is created. So, I copied the ros bag from "remote drive path" to " /opt/ros/melodic/share/image_view/test.bag", and run again.

sudo cp ../swim/data/setup-01.bag /opt/ros/melodic/share/image_view/test.bag

Now the launch file runs but doesn't appear to generate any output. My "guess" is that the phrase 'from="image' needs to be changed. Here's the output from "rosbag info". So, maybe the tutorial could be modified to describe how to avoid this error.

$ rosbag info ../swim/data/setup-01.bag 
path:        ../swim/data/setup-01.bag
version:     2.0
duration:    Xs
start:       XX
end:        XX
size:        X GB
messages:    XX
compression: none
types:       geometry_msgs/Point [4a842b65f413084dc2b10fb484ea7f17]
             sensor_msgs/Image   [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/Imu     [6a62c6daae103f4ff57a132d6f95cec2]
topics:   /realsense/cam0_image     X msgs    : sensor_msgs/Image  
             /realsense/cam1_image     X msgs    : sensor_msgs/Image  
             /realsense/depth_image    X msgs    : sensor_msgs/Image  
             /realsense/imu/data_raw   X msgs    : sensor_msgs/Imu

I made a guess and tried changing the line

<remap from="image" to="/camera/image_raw"/>

to

<remap from="realsense/cam0_image" to="/camera/image_raw"/>

Generated the following output.

$ roslaunch bag_images.launch 
... logging to /home/john/.ros/log/e774bf72-7b4a-11eb-b821-3e5b171cbb65/roslaunch-john-desktop-3704.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://john-desktop:36069/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.10

NODES
  /
    extract (image_view/extract_images)
    rosbag (rosbag/play)

auto-starting new master
process[master]: started with pid [3725]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e774bf72-7b4a-11eb-b821-3e5b171cbb65
process[rosout-1]: started with pid [3736]
started core service [/rosout]
process[rosbag-2]: started with pid [3742]
process[extract-3]: started with pid [3744]
[ WARN] [1614684724.981643887]: extract_images: image has not been remapped! Typical command-line usage:
    $ ./extract_images image:=<image topic> [transport]
[ INFO] [1614684725.128527320]: Initialized sec per frame to 0.100000
================================================================================REQUIRED process [rosbag-2] has died!
process has finished cleanly
log file: /home/john/.ros/log/e774bf72-7b4a-11eb-b821-3e5b171cbb65/rosbag-2*.log
Initiating shutdown!
================================================================================
[extract-3] killing on exit
[rosbag-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

So, can the tutorial be modified to address

  1. Clarify what should be done so the above example runs ...
(more)
edit retag flag offensive close merge delete