How to get GPS and sensor data via mavlink/mavproxy

Hi all,

Im flying a raspberry Pi thats connected to a pixhawk. The raspberry is mostly used as camera , it has one (and soon several CSI) camera module('s) attached to it. Right now triggering is done by reading a GPIO port thats connected to a pixhawk relay.

Now I would like to add GPS and sensor data (angles) to the exif tags. On the raspberry I installed mavproxy and dronekit, and while they work, but there seems to be no simple way to get an external program to obtain any data from them. I thought this would be about the most basic use of a mavlink proxy or API, but I guess not.

Im at the point where Im considering branching the GPS wires to the Pi and possibly even add IMU sensors to the rapsberry because I just cant seem to interface with mavlink through anything other than a CLI or modules running inside maxproxy.

Any help would be greatly appreciated.  

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I am stuck on the same problem. Can you help me out? Did you get it done?

    Pepe Ramos said:

    Hello!! I would like you to help me, i am trying to do the same as you. Getting GPS data and attach it to a photo using a Pi

    Can u explain me what have you done?? 

    thanks in advance

    Richard Joy said:

    Thanks, that makes sense. In the meantime I started to experiment with Dronekit-Python 2.x running on a Raspberry Pi to get the GPS and barometer sensor readings. As the documentation states the library changed from a MAVProxy extension to a standalone Python module so there was no need to install MAVProxy. I have not used the gphoto2 library as I don't have a compatible camera but I would imagine you could also use python to access that library to geo-reference the images. Instead I am going to try to use picamera to take geo-referenced images.

     

  • Hello!! I would like you to help me, i am trying to do the same as you. Getting GPS data and attach it to a photo using a Pi

    Can u explain me what have you done?? 

    thanks in advance

    Richard Joy said:

    Thanks, that makes sense. In the meantime I started to experiment with Dronekit-Python 2.x running on a Raspberry Pi to get the GPS and barometer sensor readings. As the documentation states the library changed from a MAVProxy extension to a standalone Python module so there was no need to install MAVProxy. I have not used the gphoto2 library as I don't have a compatible camera but I would imagine you could also use python to access that library to geo-reference the images. Instead I am going to try to use picamera to take geo-referenced images.

     

  • Thanks, that makes sense. In the meantime I started to experiment with Dronekit-Python 2.x running on a Raspberry Pi to get the GPS and barometer sensor readings. As the documentation states the library changed from a MAVProxy extension to a standalone Python module so there was no need to install MAVProxy. I have not used the gphoto2 library as I don't have a compatible camera but I would imagine you could also use python to access that library to geo-reference the images. Instead I am going to try to use picamera to take geo-referenced images.

     

  • Yes, to some extend you can program the serial port to output the sensor data you are looking for.  You just need a Mavlink decoder to interpret the data.  This is what the OSD units use to display the visor data.

     

  • What sort of information is being sent out of the Pixhawk serial 2 port ?. Is the Mavlink protocol ?.

    Michael Burmeister said:

    I use the serial two from the Pixhawk and decode the messages on the Propeller chip I use.  Works just fine.  I get flight mode, battery levels and direction the flight controller is leaning towards.

  • I use the serial two from the Pixhawk and decode the messages on the Propeller chip I use.  Works just fine.  I get flight mode, battery levels and direction the flight controller is leaning towards.

  • I just found this post and it looks like that Drotag is using Mavproxy.

    http://diydrones.com/group/terrain-surface-mapping/forum/topics/dro...

  • Haven't gotten around to doing it myself yet but discussions with others have led me to understand that anyone capturing the GPS data alongside any sensor data is doing so by monitoring the raw GPS data stream directly.

    This data  and the code to capture it is obviously GPS model specific but ardupilot et al are reading that data for any model they support so that code is open - when I get back to this I'll just dig into the autopilot code (I'm using std supported GPS modules) and use that as a starting point.

  •  I would like to use the Raspberry Pi camera to take geo referenced images too. These guys must be some how adding the GPS data from the APM or Pixhawk to images captured from a regular camera using gphoto2 so it must be possible.

    https://www.airborneprojects.com/product/drotag-onboard-image-taggi...

    DROTAG x – Onboard Image Tagging Computer
    The DROTAG.x is an updated version of the earlier DROTAG which is a small board (71x28mm) that enables your camera to Trigger and GeoReference (Lat,…
  • I would like to use the Raspberry Pi camera to take geo referenced imagines too. Any luck finding a solution to this ?

This reply was deleted.

Activity