Arena snapshots from simulation

Requests regarding how to set up experiments in ARGoS.
pawel-jakubowski
Posts: 6
Joined: Mon Nov 30, 2015 10:11 pm

Arena snapshots from simulation

Postby pawel-jakubowski » Mon Jun 06, 2016 2:01 pm

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!

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Arena snapshots from simulation

Postby pincy » Mon Jun 06, 2016 6:05 pm

Hi Pawel,

You have a number of ways to do this. The two simplest ways are:
  1. Turn on frame grabbing in the GUI, set the "draw frame every" parameter to what you need, and press fast-forward
  2. 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
I made ARGoS.

pawel-jakubowski
Posts: 6
Joined: Mon Nov 30, 2015 10:11 pm

Re: Arena snapshots from simulation

Postby pawel-jakubowski » Mon Jun 06, 2016 9:47 pm

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.

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Arena snapshots from simulation

Postby pincy » Tue Jun 07, 2016 12:30 am

You can't in the current version of the code. You'd need to patch the Qt OpenGL widget to obtain this effect.
I made ARGoS.


Return to “How to... ?”