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

DIY Drones via Twitter
RT @chr1sa: After more than a year of only virtual races, @DIYRobocars returns to the newly renovated @circuitlaunch on May 22 for the resu…
Sunday
DIY Robocars via Twitter
RT @DAVGtech: And now available with LiDAR 🔥 https://twitter.com/Heavy02011/status/1381137016381964293
Sunday
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #9 - #ParkingLotNerds #thunderhillracetrack, CA Join us for the next race April 24th,…
Sunday
DIY Robocars via Twitter
RT @DWalmroth: Weather's finally cooperating, looking forward to racing 1:10 scale autonomous cars outdoors again! @diyrobocars, @NVIDIAEm…
Apr 7
DIY Robocars via Twitter
RT @AIDRI_: I finally succeeded in optimizing the trajectory and speed of a car on a #racetrack. Next step: implement a 2d controller and…
Apr 7
DIY Robocars via Twitter
@jetdillo @circuitlaunch Actually the second *in person* event in a year. We do virtual races every month
Apr 2
DIY Robocars via Twitter
Update: we're moving it back one day to Sunday (the 4th) at 11:00am instead
Apr 2
DIY Robocars via Twitter
@GrantEMoe @circuitlaunch Update: we're doing it on Sunday (4th) at 11:00am instead
Apr 2
Laurie J. Troy liked Jasper Kueppers's profile
Apr 1
DIY Robocars via Twitter
RT @chr1sa: Maybe we should have a mini @DIYRobocars race in our lower school's playground https://t.co/xLFeua1R6X
Mar 29
DIY Robocars via Twitter
If anybody wants to join us for an informal outdoors hack/race we're going to be meeting at the @CircuitLaunch park… https://twitter.com/i/web/status/1375907409223249923
Mar 27
DIY Robocars via Twitter
RT @SmallpixelCar: Ready to reopen, innovation has to continue. Inside/outside, LiDAR/GPS, race/delivery https://t.co/jpmvttoHEd
Mar 26
DIY Drones via Twitter
RT @DAVGtech: By far best race yet! Congratulations to the winner @Heavy02011 🥇🏆🍾👏👏👏 @diyrobocars @donkey_car @NVIDIAEmbedded https://t.co/…
Mar 20
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #8 - #ParkingLotNerds ⁦@DAVGtech⁩ ⁦@DWalmroth⁩ ⁦@OttawaAVGroup⁩ - join us tomorrow h…
Mar 20
DIY Drones via Twitter
RT @mrpollo: 11 years ago, the pxIMU was announced to the world on @DIYDrones, and it changed the life of many (mine included). The followi…
Mar 18
DIY Drones via Twitter
RT @ishcahealth: This is awesome! ☘️ @DroneDJ @DIYDrones @WorkerDrones @DroneMedia_UK @dublinaviation https://twitter.com/media_ireland/status/1372077878536462336
Mar 18
More…