Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development Tracking of the Ignition ModelPhotoShot plugin #1

Closed
7 of 10 tasks
marcoag opened this issue Jan 19, 2022 · 6 comments
Closed
7 of 10 tasks

Development Tracking of the Ignition ModelPhotoShot plugin #1

marcoag opened this issue Jan 19, 2022 · 6 comments
Assignees

Comments

@marcoag
Copy link
Owner

marcoag commented Jan 19, 2022

This is the current progress on the different steps needed to achieve a functional plugin:

  • Load model into ign-gazebo (done through the sdf config, couldn't find a way to receive command line params in a plugin)
  • Create camera
  • Create lights
  • Change background color (not working yet)
  • Render and take picture with camera
  • Center model in picture
  • Add different picture positions
  • Make model move in random position
  • Add save-to-file option for the poses
  • Shutdown server (it seems that this feature still not available: /server_control stop does nothing gazebosim/gz-sim#1237)

Currently working on: Testing current results against drake.

@marcoag marcoag self-assigned this Jan 19, 2022
@marcoag
Copy link
Owner Author

marcoag commented Jan 19, 2022

Work towards EricCousineau-TRI/repro#73.

FYI @EricCousineau-TRI.

@luca-della-vedova
Copy link

Thanks for picking this up, this would be super useful! A few scattered thoughts

* [ ]  Change background color (not working yet)

Looks like there should be support in sdformat for setting a scene's background color but to be honest I've never used it so I don't know if it works, I have considered in the past enclosing the whole model in a big colored sphere but that doesn't sound too clean 😅

* [ ]  Make model move in random position

I was wondering what is the need of this? From what I understand for the sake of taking snapshots it is preferable to have a few fixed poses (i.e. top, perspective, side, front) and the usual approach is to move the camera around instead?

* [ ]  Shutdown server (it seems that this feature still not available: [/server_control stop does nothing ignitionrobotics/ign-gazebo#1237](https://github.com/ignitionrobotics/ign-gazebo/issues/1237))

If you plan to run this plugin through ign gazebo, something that could help is the --iterations argument where you can set the number of iterations to run before closing the software cleanly, so for example if you wanted to run headless for 5 seconds and you were using the default 1ms time step you could run:

ign gazebo model_photo_shoot.sdf -r -s --iterations 5000

@marcoag
Copy link
Owner Author

marcoag commented Jan 24, 2022

Thanks for all the info, it's very helpful!

Looks like there should be support in sdformat for setting a scene's background color but to be honest I've never used it so I don't know if it works, I have considered in the past enclosing the whole model in a big colored sphere but that doesn't sound too clean 😅

I tried the sdformat background option and it didn't work. I also tested using SetBackgroundColor on the scene instance without much luck, maybe I'm missing something, will do more research on this...

I was wondering what is the need of this? From what I understand for the sake of taking snapshots it is preferable to have a few fixed poses (i.e. top, perspective, side, front) and the usual approach is to move the camera around instead?

This is just a requirement we have, since we will compare the results of this plugin with drake. Maybe a more generic option where the position is not only random but can be set to something specific somehow is a better option but I'm not sure how that could be done... random is enough for us anyway.

If you plan to run this plugin through ign gazebo, something that could help is the --iterations argument where you can set the number of iterations to run before closing the software cleanly, so for example if you wanted to run headless for 5 seconds and you were using the default 1ms time step you could run:

ign gazebo model_photo_shoot.sdf -r -s --iterations 5000

This great! That should probably work for now. Thanks!

@EricCousineau-TRI
Copy link

Just for tracking - is this a fair "downstream motivation" issue?
RobotLocomotion/drake#15024

Also, is it possible to mention this plugin, and perhaps provide a comparison?
https://community.gazebosim.org/t/gsoc-2021-machine-learning-extension-to-ignition-gazebo/1070

@luca-della-vedova
Copy link

This is just a requirement we have, since we will compare the results of this plugin with drake. Maybe a more generic option where the position is not only random but can be set to something specific somehow is a better option but I'm not sure how that could be done... random is enough for us anyway.

The set_pose service should work for the purpose.
If I remember correctly you can use either the Entity or the model's name to tell the system which model you want to set the pose of, example usage is here

@marcoag
Copy link
Owner Author

marcoag commented Feb 10, 2022

Moving this to gazebosim/gz-sim#1331. I will close the issue.

@marcoag marcoag closed this as completed Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants