Page 1 of 1

Calculating Angle from GPS location

Posted: Wed Aug 05, 2015 3:11 pm
by M_Rizk
In the flocking example, the light from a neighboring footbot is detected as a blob and a vector is created using the distance and angle to that blob. I'm currently modifying this algorithm so that distance and angle between footbots is calculated using their gps coordinates instead.

I calculate distance using the standard distance formula but I'm not sure how to go about calculating angle?

Re: Calculating Angle from GPS location

Posted: Wed Aug 05, 2015 5:59 pm
by pincy
I don't understand exactly what you're trying to achieve.
  • Do you want a robot R to know at which distance/angle a nearby robot N is located?
    • The camera or the range-and-bearing communication system give you what you want.
  • Do you want a robot R to be able to detect the distance/heading of a nearby robot N expressed with respect to R's frame of reference?
    • A magical device that gives you this information does not exist (not in reality, nor in ARGoS). You have two options:
      1. Simulate it through the loop functions. You can manage a structure that contains position/angle of every robot, and pass a handle to this structure to every robot controller. A robot can then inspect this structure to fetch the information on the necessary robots and use the positioning sensor to calculate distance and angle. This solution corresponds to a real-life tracking system performing the very same operations.
      2. You can use the omnidirectional camera and the LEDs. You switch the LEDs on in a particular schema, and then process the LEDs seen by the omnidirectional camera in the controller. For instance, you could switch the beacon on in blue to mark the center of a robot, and switch on other three LEDs to form a triangle. The tip of the triangle would be in green to mark the heading of the robot, and the back of the robot would be marked by two red LEDs. This is more complex to achieve than the previous solution, but it would work in real life.

Re: Calculating Angle from GPS location

Posted: Mon Aug 10, 2015 4:13 am
by M_Rizk
My apologies for the lack of clarity. What I am trying to do, is to have the footbots detect the distance and angle of their neighbors via the RAB communication system rather than detecting lights through the camera. My assumption was that they would transmit their gps locations to each other and each robot would derive distance and angle from that. So I was asking how to derive angle from that information.

However, I didn't realize that the RAB system transmitted distance and angle automatically. I thought it was just for transmitting extra data. That certainly explains why it's called the range and bearing system :D This solves my problem.

Thanks!