在roslaunch上提取图像的格式错误的字符串

时间:2016-10-18 22:40:55

标签: ros

我正在使用这个简单的启动脚本尝试从183GB的rosbag中提取jpg图像。

<launch>
        <node pkg="rosbag" type="play" name="rosbag" args="-d 2 /media/aaron/TOSHIBA\ EXT/udacity/data_2/dataset-2-2.bag"/>
        <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
        <param name="sec_per_frame" value="0.02"/>
        <param name="filename_format" value="frame%05.jpg"/>
                <remap from="image" to="center_camera/image_color"/>
        </node>
</launch>

但是我收到以下错误,

PARAMETERS
 * /extract/filename_format: frame%05.jpg
 * /extract/sec_per_frame: 0.02
 * /rosdistro: kinetic
 * /rosversion: 1.12.5

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

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[rosbag-1]: started with pid [12638]
process[extract-2]: started with pid [12639]
terminate called after throwing an instance of        'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::io::bad_format_string> >'
  what():  boost::bad_format_string: format-string is ill-formed
[extract-2] process has died [pid 12639, exit code -6, cmd /opt/ros    /kinetic/lib/image_view/extract_images image:=center_camera/image_color __name:=extract __log:=/home/aaron/.ros/log/e34ccf72-9510-11e6-bbf0-0017c4cb3b67/extract-2.log].
log file: /home/aaron/.ros/log/e34ccf72-9510-11e6-bbf0-0017c4cb3b67/extract-2*.log

所以这个包继续加载播放,这个尺寸开始播放的rosbag需要30多分钟,但它无法启动图像提取节点。主题名称是正确的,我可以使用rosrun中的图像提取,但我不能格式化文件名。此外,我只使用rosbag play / rosrun提取物从70659中获得了9882 jpgs。

为什么说它的字符串格式错误?

1 个答案:

答案 0 :(得分:0)

看起来你错过了小数类型&#39; i&#39;或者&#39; d&#39;为您的filename_format

<launch>
    <node pkg="rosbag" type="play" name="rosbag" args="-d 2 /media/aaron/TOSHIBA\ EXT/udacity/data_2/dataset-2-2.bag"/>
    <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
    <param name="sec_per_frame" value="0.02"/>
    <param name="filename_format" value="frame%05d.jpg"/>
            <remap from="image" to="center_camera/image_color"/>
    </node>