PX4 GPS to Arduino

Hi …

I am seeking some help, and would be grateful to anyone that can descibe:

  1. Exactly what kind of data can be output from a PX4?

  2. Does the information include GPS coordinates, including critical waypoints specified in Mission Planner or similar GCS?

  3. If so, how can these waypoints feed to an Arduino in order to trigger pre-configured procedures?

Many thanks!

Jack

Hi Jack,

  1. Exactly what kind of data can be output from a PX4?

Anything you want that the autopilot knows about.

  1. Does the information include GPS coordinates, including critical waypoints specified in Mission Planner or similar GCS?

Yes.

  1. If so, how can these waypoints feed to an Arduino in order to trigger pre-configured procedures?

Could you please explain a bit more detailed what you want to do? Do you want to send the entire set of waypoints in the current mission to the arduino? Or just a command when some particular wp is reached? You can also read up on mavlink, the protocol used for the communication between the autopilot and the GCS.
https://mavlink.io/en/

Hi Carl

First … I appreciate taking the time to respond.

It would be commands. I want to fly the aircraft using waypoints, a subset of which will send a trigger to the companion board to take a measurement, and log the measurement with time and the GPS coordinate (including altitude). I might want to trigger a photo of each event as well.

I will read up on mavlink too. What is the mapping software used to graph the flight plan? Is it Mission Planner? Can those data be used to also display the flight in different presentations, e.g., from various perspectives? Could it also be annotated with the specific waypoint data such as time and GPS? Is there a resource of other software used for graphical presentation or/and data analysis ? (I know this goes beyond my initial question, but what the heck.)

Jack

Okey. I would do the following:

  • Write an Arduino script that can parse mavlink messages sent from the autopilot.
  • Connect the Arduino to the autopilot over serial and start a mavlink instance on the correct port
  • Decide on which mavlink message you want to use to trigger the measurement
  • If you use the camera trigger message you could probably use the same infrastructure which is currently used for geotagging images to get a file with GPS coordinates of the trigger events.

Regarding the mapping software, not sure exactly what you mean but the logs are uLog format, so there are several programs that can be used for postprocessing. Like these ones, or this one if you have Matlab.

And by the way, mission planner is used for the APM flight stack, for PX4 you probably want to use QGC

Thx again Carl. It’s new for me, but look forward to it all.