Using the model photo shot plugin
Ignition Gazebo offers a model photo taking tool that will take perspective, top, front, and both sides pictures of a model. You can test the demo world in Ignition Gazebo, located at examples/worlds/model_photo_shoot.sdf
, by running the following command:
This will start Ignition Gazebo server, load the model and the plugin, take the pictures and shutdown after 50 iterations. The pictures can be found at the same location where the command was issued.
Model Photo Shoot configurations
SDF is used to load and configure the Model Photo Shoot
plugin. The demo SDF contains a good example of the different options and other related plugins:
- The physics plugin:
A physics plugin is needed only if the <random_joints_pose>
option is to be used. This will allow the Model Photo Shoot
plugin to set the joints to random positions.
- The render engine plugin:
A render plugin is needed to render the image. If ogre2
is used, as shown in the example, the <backgrond_color>
tag can be used to set the background of the pictures taken by the plugin. Please note that lights added by the plugin will also affect the final resulting background color on the images.
- The model and the photo shoot plugin:
The model is loaded through the <uri>
tag. Then the model photo shoot
plugin and its options are specified:
<translation_data_file>
: (optional) Location to store the camera translation, scaling data and joints position (if using the<random_joints_pose>
option) that can be used to replicate the pictures using other systems.<random_joints_pose>
: (optional) When set totrue
the joints in the model will be set to random positions prior to taking the pictures.
- Camera sensor:
A camera sensor
must be added as it will be used by the plugin to take the pictures. This allows plugin users to set the different parameters of the camera to their desired values.