I tried to get the ID of my footbot at the end of an experiment. But when I use the argos::CEntity with the function getID() I get a segmentation fault (core dumped).
Since I'm new to c++ (started this week-end) and that I need to rewrite what I have done in LUA to C++. It is certainly an error from my side but I don't find how to do it correctly.
The code I have in my .h file that try to use the faulty code:
Code: Select all
#include <argos3/plugins/robots/foot-bot/simulator/footbot_entity.h>
class TestClass : public CCI_Controller {
private:
CEntity* m_pcEFootBot;
}
Code: Select all
TestClass::TestClass() :
m_pcEFootBot(NULL),
void TestClass::Destroy() {
std::string m_pcID = m_pcEFootBot->GetId(); //no more segmentation fault if removed
std::cout << "stuff ID : " << m_pcID << "\n";
}
I must be missing something but I don't see what.
Thank for the help.