Page 1 of 1
Arena snapshots from simulation
Posted: Mon Jun 06, 2016 2:01 pm
by pawel-jakubowski
Hi,
Can I in ARGoS save automatically snapshots of the experiment (ex. on 1k, 2k and 3k simulation step)?
I am almost sure that I've read somewhere that it is possible, but I cannot find it now
Thank you for your help!
Re: Arena snapshots from simulation
Posted: Mon Jun 06, 2016 6:05 pm
by pincy
Hi Pawel,
You have a number of ways to do this. The two simplest ways are:
- Turn on frame grabbing in the GUI, set the "draw frame every" parameter to what you need, and press fast-forward
- Do it in the loop functions. In the PreStep() method, call the method CQTOpenGLWidget:: SetGrabFrame(bool) with true when you want to start saving frames, and with false when you want to stop. To get a reference to the visualization, you can do something like this:
Code: Select all
void CMyLoopFunctions()::PreStep() {
CQTOpenGLRender& render = dynamic_cast<CQTOpenGLRender&>(GetSimulator().GetVisualization());
CQTOpenGLWidget& widget = render. GetMainWindow().GetOpenGLWidget();
if(/* must save frame */)
widget.SetGrabFrame(true);
else
widget.SetGrabFrame(false);
}
Cheers,
Carlo
Re: Arena snapshots from simulation
Posted: Mon Jun 06, 2016 9:47 pm
by pawel-jakubowski
I like this fist option
Additional question, if I may. Can I set orthogonal projection instead of perspective projection? It top-view I would like to have 2D-like image.
Re: Arena snapshots from simulation
Posted: Tue Jun 07, 2016 12:30 am
by pincy
You can't in the current version of the code. You'd need to patch the Qt OpenGL widget to obtain this effect.