Human Control of Robots

Requests regarding how to set up experiments in ARGoS.
M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Re: Human Control of Robots

Postby M_Rizk » Mon Sep 07, 2015 4:53 am

That's great! Thanks, Carlo :)

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

Re: Human Control of Robots

Postby pincy » Mon Sep 07, 2015 6:23 am

The release is online. Let me know if you have issues!

Carlo
I made ARGoS.

M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Re: Human Control of Robots

Postby M_Rizk » Tue Sep 29, 2015 4:19 pm

I've been looking at the new code and working on incorporating it into a project similar to the manual control example you released a few months ago, though I'm not sure how to go about it. Where would I call the SelectEntity function? Would that be in footbot_manualcontrol.cpp? If so, how do I construct the CEntity object to be passed to the function?

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

Re: Human Control of Robots

Postby pincy » Sat Oct 03, 2015 5:52 am

The functions to select robots are designed to be called from the loop functions. In the loop functions, you would do it when you want to select a certain robot because of some reason, such as that robot being in a certain place.

The PreStep() and PostStep() functions are good candidates for this kind of stuff. You first need to get a handle to the Qt user functions. To do this, you can use this line of code:

Code: Select all

void CMyLoopFunctions::PostStep() { CQTOpenGLUserFunctions& cUF = dynamic_cast<CQTOpenGLRender&>(GetSimulator().GetVisualization()).GetMainWindow().GetUserFunctions(); // find the robot you want to select (cMyRobot) cUF.SelectEntity(cMyRobot); }
I found out that the method GetUserFunctions() is missing. I'm making a new release in which this method is included. Sorry for that.

Cheers,
Carlo
I made ARGoS.

M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Re: Human Control of Robots

Postby M_Rizk » Wed Oct 07, 2015 3:51 pm

The first line of the function is causing errors. Most notably:

"Expected type-specifier before CQTOpenGLRender"
"CQTOpenGLRender was not declared in this scope"
"GetSimulator was not declared in this scope"

I have tried running 'make' in the argos3 directory after pulling the newest update and I tried #including loop_functions.h (since that's the file which contains GetSimulator). I have also looked through the github and haven't been able to find a location where CQTOpenGLRender is mentioned. Is there something I'm missing?

Apologies if this is an easy question, I'm still learning my way around the finer details of the argos implementation. Thank you for your patience :)

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

Re: Human Control of Robots

Postby pincy » Thu Oct 08, 2015 8:37 am

"Expected type-specifier before CQTOpenGLRender"
"CQTOpenGLRender was not declared in this scope"
This simply means that you need to add an #include statement to tell the compiler about the missing class symbol:

Code: Select all

#include <argos3/plugins/simulator/visualizations/qt-opengl/qtopengl_render.h>
You put this line in the file in which the error appears, before any code.
"GetSimulator was not declared in this scope"
As I don't have your code, I can't understand why this happens. The general idea is that GetSimulator() is a method of CLoopFunctions, so if you're calling it from the wrong place (e.g., not within the loop functions) you need to also include the loop function object.
I made ARGoS.


Return to “How to... ?”