Trouble with image_saver
Hi! I'm trying to use the ROS service for the image_saver tool from image_view essentially using this roslaunch file:
<?xml version="1.0"?>
<launch>
<!-- This is a sensor_msgs/Image (proof in attached image) -->
<arg name="image_topic" default="/camera/rgb/image_raw" />
<node pkg="image_view" type="image_saver" name="image_saver" >
<remap from="image" to="$(arg image_topic)"/>
<param name="save_all_image" value="false"/>
<param name="filename_format" value="%04i.%s"/>
</node>
</launch>
Then, according to this answer, to call the service, you run
rosservice call /image_saver/save
However, when I run the launch file above and call the service command, nothing is saved. Any suggestions are appreciated!
From where are you running the launch file? The folder that you are in when you make the roslaunch call is the folder to which the files should be saved. Have you checked there? Also, adding "--screen" to your
roslaunch
command will give you more information.Thanks for your response. I've been running the roslaunch command from the project directory. That is, from Documents/husky as shown in the picture. After adding --screen, the program reports "Saved image 0000.jpg" but I can't find it anywhere on the computer (including searching all the computer's files). Seems like a strange bug because it works perfectly when I just rosrun the node like:
Have a look in the ~/.ros folder (it's a hidden folder). To specify where to store the images you can use the following format:
If the folder you specify doesn't exist, the image_saver will create it. But beware: If the folder doesn't exist yet, storing the first image will fail. So to prevent missing images, create the folder first, then start the node.