Page 1 of 1

Get the current coordinate position of the robot

Posted: Thu Mar 19, 2020 9:17 am
by Ryan
Hey,
How can I get the current coordinate position of the robot? I have noticed the function: inline Real GetX() const in the CPositionalEntity class. But when I used it, there are some errors: Segmentation fault (core dumped).

I have

Code: Select all

CPositionalEntity* centity; // Real cur_y = cquaternion.GetY(); CVector3 position = centity->GetPosition(); Real cur_x = position.GetX(); // CFootBotEntity* m_pcFootBot; std::cout<<"ID:"<<ID<<"POSITION:"<<position<<"\n";

Re: Get the current coordinate position of the robot

Posted: Thu Mar 19, 2020 5:29 pm
by pincy

Re: Get the current coordinate position of the robot

Posted: Fri Mar 20, 2020 4:58 am
by Ryan
Thanks

Re: Get the current coordinate position of the robot

Posted: Mon Jun 21, 2021 11:14 pm
by Eksander
How about getting robot location within the robot controller rather than from the loop functions, is it possible?

Thank you!

Re: Get the current coordinate position of the robot

Posted: Tue Jun 22, 2021 12:30 am
by pincy
Yes, just use the positioning sensor.