0
$\begingroup$

Gazebo Answers logo

I am currently following this tutorial to publish image messages using the camera plugin. I can totally subscribe the image_raw topic and save every published image message, but that's not what I need.

I am using gazebo to collect image dataset of object manipulation. So ideally I need to capture (save to file) one image after some manipulation actions, then continue with the next round of manipulation and image capturing. So it is like a service request to save the image when needed rather than save images all the time. However, the only source of image I know in gazebo is the image topic. Does anyone have a better idea on how to do that?

Thanks!


Originally posted by wy3 on Gazebo Answers with karma: 1 on 2017-06-21

Post score: 0


Original comments

Comment by abdulhafeez on 2019-11-03:
Hello, could you provide how to subscribe to the camera topic and save every published image. I am able to the subscribe to the topic but cannot save. Thanks

$\endgroup$
1

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

After searching for a similar feature, this sounds like a user feature to implement, as opposed to something Gazebo would have a native implementation for.

For example, I wanted to gather images over a certain time period and make a video from them. The best solution I could come up with was to make a ROS node that subscribed to Gazebo node that constantly published the images. If a certain flag was true in my node, I'd save the image, and if it was false, I'd ignore the whole callback.

If you're not dealing with ROS, then you'll want to write a Gazebo plugin, which could do the above without the overhead of ROS. Check out the tutorials for more info.


Originally posted by brycestevenwilley with karma: 26 on 2017-07-13

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.