Converting Pose messages to Latitude and Longitude

My team and I were looking to integrate the Google Maps API by converting the Poses of a recorded path to latitude and longitude. Reading over the docs, I have an idea of how to do that, however I’m pretty unfamiliar with transforms and frames of reference. My main question is, how would I go from a Pose to a lat-long coordinate?

Also, if possible, my team will be receiving the Amiga soon, so I don’t have any recorded paths, and we were looking to get a sample JSON purely for testing the integration.

Dear DFang,

Thanks for the question.

Your Amiga currently streams pvt and relposned messages. For more context, please see GPS Message Types.

To achieve your goal, I believe that it would be easier for you to record pvt (lat/lon) messages as you record a Track rather than recording a track and doing post-processing to acquire lat/lon. If this approach works for you, please see the GPS Client example to learn how to subscribe to both pvt and relposned messages and the Record a Track example to learn how to create a Track using the FilterState messages.

Alternatively, to convert Pose messages back to pvt, you would need:

  • Convert Poses to relposned: To create a Track, we use Poses. The coordinate system of our Poses is NWU (North, West, Up). The coordinate system of relsponed is NED (North, East, Down).
  • Base Station Position: The absolute position (latitude, longitude, altitude) of the base station to which the relposned data is relative. This is because relposned provides relative, not absolute, positions.
  • Calculation Method: You’d calculate the absolute position of the rover (your Amiga) by applying the relative offsets to the base station’s absolute position. This involves converting the relative coordinates to a global coordinate system (like WGS84) and then applying these as offsets to the base station’s position.

The general steps would be:

  • Convert the base station’s geographic coordinates (latitude, longitude, altitude) to a Cartesian coordinate system (ECEF or Earth-Centered, Earth-Fixed).
  • Convert the RELPOSNED NED offsets to Cartesian coordinates.
  • Add these offsets to the base station’s Cartesian coordinates.
  • Convert the resulting Cartesian coordinates back to geographic coordinates (latitude, longitude, altitude).

This process requires understanding and handling of geodetic computations and might involve complex transformations, especially considering the Earth’s shape and the different reference systems used by GNSS (like WGS84).

Tools and Libraries : Several libraries can assist with geospatial computations, such as Proj (for coordinate transformations), GeographicLib (for geodesy functions), and specific GNSS data processing libraries that might offer utilities for these types of conversions such as GEOPY.

Lastly, a JSON sample can be found at: Define a Track.

Please let me know if you have any additional questions and happy coding!

If I were to have a JSON of latitude and longitude, would it be possible to create a Track for the Amiga to follow (considering we do not know the exact position of the base station)? I’m unsure, since there wouldn’t be any information related to the robot orientation. Apparently this has been done in the past with the Amiga?

For some perspective, we are looking to plot points on a web app through Google Maps API and then send the data to the Amiga.

Hi David,

Unfortunately, without knowing the exact position of the base station, it is not possible to create a Track for the Amiga to follow. As I explained before, the Tracks are relative to a base station. Without knowing the position of the base station, you would have “floating” points that do not necessarily translate to anything that makes sense to the Amiga.

But as I mentioned before, you can record lat/lon at the same time you’re recording a Track for the Amiga to follow. This does not involve handling any frames of reference or data processing. You would even be able to “plot” the lat/lon coordinates in real time if you have a script using the Google Maps API.

I’m happy to set up a support call to assist you.