Page 2 of 2

Re: Human Control of Robots

Posted: Mon Sep 07, 2015 4:53 am
by M_Rizk
That's great! Thanks, Carlo :)

Re: Human Control of Robots

Posted: Mon Sep 07, 2015 6:23 am
by pincy
The release is online. Let me know if you have issues!

Carlo

Re: Human Control of Robots

Posted: Tue Sep 29, 2015 4:19 pm
by M_Rizk
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?

Re: Human Control of Robots

Posted: Sat Oct 03, 2015 5:52 am
by pincy
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

Re: Human Control of Robots

Posted: Wed Oct 07, 2015 3:51 pm
by M_Rizk
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 :)

Re: Human Control of Robots

Posted: Thu Oct 08, 2015 8:37 am
by pincy
"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.