Robotics StackExchange | Archived questions

Some issues about the images capture in gazebo

By the tutorial in http://gazebosim.org/tutorials?tut=system_plugin&cat=write_plugin, I can get the images of gazebo. However, I have some questions about this plugin:

1) The frequency of images capture is too high, if I want to get only one image in one second, what should I do?

2) This way needs to open gzclient, can I get images without gzclient, just by gzserver ?

3) The images captured are jpg format, can I get rgb image by this way ?

Asked by shin on 2017-05-14 08:53:48 UTC

Comments

Answers

1) in your plugin, you can probably keep track of the update timing yourself and toggle EnableSaveFrame to save images as the desired rate

2) you'll need to use a sensor plugin attached to a camera sensor. That system plugin uses user camera which is only available on the client side. When using a camera sensor, you can just set the update rate to 1H (to save one image a second), which saves you from having to keep tracking of timing as mentioned in 1)

3) yes

Asked by iche033 on 2017-05-15 14:06:06 UTC

Comments

Could you please tell me how to deal with the third problem?

Asked by shin on 2017-05-18 06:01:26 UTC

I have post a detailed problem, would you mind give me a hand? http://answers.gazebosim.org/question/16214/how-to-get-image-without-storing-into-disk-from-gazebo/

Asked by shin on 2017-05-21 19:56:31 UTC

Images can be saved without creating a plugin using a camera sensor and <save enable="true">. See this tutorial on making a video from a camera in gazebo: http://gazebosim.org/tutorials?tut=camera_save

The frequency that images are captured is controlled by the parameter <update_rate>. Gzclient does not need to be open. I beleive jpg is the only output format from this method.

Asked by sloretz on 2017-05-15 16:18:37 UTC

Comments

I have tried this way, and I find it can only get a small range of the world, for example, from its position, I want it to get the image of a desk, but it only catch its legs, I have not found any parameter to modify it, could you give me a hand? Besides, I find that only the first image has correct content, other images are all blank, I do not change its position, and I have no idea about this case.

Asked by shin on 2017-05-17 04:04:01 UTC

If the image isn't showing the part of the world you're interested in, then the camera position or parameters need to be modified to get a different image. Camera parameters are here http://sdformat.org/spec?ver=1.6&elem=sensor#sensor_camera

You might be interested in <horizontal_fov>, <width>, <height>. or the <pose> on the <sensor> itself.

Asked by sloretz on 2017-05-17 09:02:01 UTC

I have tried to changed the width and height, and I find the two parameters have no effect in the content of the images, just decide the size of images. Parameter horizontal_fov just change the perspective, I still get part of the desk with the parameter changed. I am afraid these parameter have no effect in this problem, by the way, why does the first image have correct content, and other images are all blank?

Asked by shin on 2017-05-17 10:18:00 UTC

Interesting. Would you mind posting a world that reproduces the issue?

Asked by sloretz on 2017-05-17 10:31:36 UTC

The world file is in this website : https://bitbucket.org/osrf/handsim/src/8fe03d4d113659c1cc04ea788792b1b7e995c267/worlds/arat.world?at=default&fileviewer=file-view-default . And I add the camera sensor codes in about 350th line.

Asked by shin on 2017-05-18 03:00:46 UTC

I am sorry to bother you with another problem: http://answers.gazebosim.org/question/16214/how-to-use-plugin-to-get-image-from-gazebo/ Could you please give me a hand?

Asked by shin on 2017-05-20 09:44:11 UTC

I am sorry to bother you with a new problem:http://answers.gazebosim.org/question/16214/how-to-use-plugin-to-get-image-from-gazebo/ Could you please give me a hand?

Asked by shin on 2017-05-20 09:44:43 UTC

I have modified the new problem, would you mind give me a hand? http://answers.gazebosim.org/question/16214/how-to-get-image-without-storing-into-disk-from-gazebo/

Asked by shin on 2017-05-21 19:56:02 UTC