Home | Tutorials | Wiki | Issues
Ask Your Question

Some issues about the images capture in gazebo

asked 2017-05-14 08:53:48 -0500

shin gravatar image

By the tutorial in http://gazebosim.org/tutorials?tut=sy..., 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 ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-05-15 14:06:06 -0500

iche033 gravatar image

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

edit flag offensive delete link more


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

shin gravatar imageshin ( 2017-05-18 06:01:26 -0500 )edit
shin gravatar imageshin ( 2017-05-21 19:56:31 -0500 )edit

answered 2017-05-15 16:18:37 -0500

sloretz gravatar image

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=ca...

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.

edit flag offensive delete link more


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.

shin gravatar imageshin ( 2017-05-17 04:04:01 -0500 )edit

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.

sloretz gravatar imagesloretz ( 2017-05-17 09:02:01 -0500 )edit

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?

shin gravatar imageshin ( 2017-05-17 10:18:00 -0500 )edit

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

sloretz gravatar imagesloretz ( 2017-05-17 10:31:36 -0500 )edit

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.

shin gravatar imageshin ( 2017-05-18 03:00:46 -0500 )edit

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?

shin gravatar imageshin ( 2017-05-20 09:44:11 -0500 )edit

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?

shin gravatar imageshin ( 2017-05-20 09:44:43 -0500 )edit
shin gravatar imageshin ( 2017-05-21 19:56:02 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-05-14 08:53:48 -0500

Seen: 331 times

Last updated: May 15