Get the current coordinate position of the robot

Requests regarding how to set up experiments in ARGoS.
Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

Get the current coordinate position of the robot

Postby Ryan » Thu Mar 19, 2020 9:17 am

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";

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

Re: Get the current coordinate position of the robot

Postby pincy » Thu Mar 19, 2020 5:29 pm

I made ARGoS.

Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

Re: Get the current coordinate position of the robot

Postby Ryan » Fri Mar 20, 2020 4:58 am

Thanks

Eksander
Posts: 8
Joined: Sun Jun 20, 2021 10:26 pm

Re: Get the current coordinate position of the robot

Postby Eksander » Mon Jun 21, 2021 11:14 pm

How about getting robot location within the robot controller rather than from the loop functions, is it possible?

Thank you!

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

Re: Get the current coordinate position of the robot

Postby pincy » Tue Jun 22, 2021 12:30 am

Yes, just use the positioning sensor.
I made ARGoS.


Return to “How to... ?”