Connecting APM 2.0 and Raspberry Pi

Hey guys, I am currently working on a university project and I was wondering if there is a way to interface the apm 2.0 board with the raspberry pi. Is a straight usb connection possible? The goal is to send APM GPS data to the raspberry pi board to be used in conjunction with image processing with openCV. Thanks for the help!

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

Join diydrones

Email me when people reply –

Replies

  • Hi Randy, 

    Working on the same. Any help apprciated.

    Thanks & Regards

    Randy said:

    I've attempted to attach a Raspberry Pi to a Pixhawk today with some mixed results. I was able to get serial bytes passing back and forth between the RPi and the Pixhawk but I wasn't able to issue commands (like "arm") from the RPi and have them executed on the Pixhawk.

    My plan by the way is to use MavProxy on the RaspberryPi to interpret the mavlink stream and send commands to the Pixhawk.

    The wiki page is here and hopefully I'll clear up the details to get it working with Tridge tomorrow.

  • Hi Anderson,

    Yes i would like you to share you information. Any help would be appreciated. I am interfacing the pixhawk to raspberry pi to get the imu and gps data.

    Thanks and Regards

    Sameena Shaikh

    Jonathan Anderson said:

    I've been working on a similiar project. I am connecting a Gumstix Overo to the ArduPilot and streaming GPS coordinates, Altitude, and Attitude information between the devices. I have successful gotten the stream the work (Or so it appears). If you want to share information I'd love to.

  • Hi Larsen,

    What are the libraries you had to install and what kind of a connection was done by you.

    Thanks & Regards

    Tommy Larsen said:

    I use this Python to extract LAT/LON on my Pi :

     

    #!/usr/bin/python

    import serial

    import socket

    #import sys

    ser = serial.Serial('/dev/ttyUSB0', 4800, timeout=1)

    latitude = ''

    longitude = ''

    def readgps(latitude,longitude):

    while 1:

    try:  

    line = ser.readline()

            print line

            if "GPGGA" in line:

            latitude = line[18:26] #Yes it is positional info for lattitude

            longitude = line[31:39] #do it again

            return(latitude,longitude)

        print "Finished"

    ser.close()

  • Hi,

    Have you found those things you listed? I too am in need of it. Will appreciate any help.

    Thanks & Regards

    Shyam Balasubramanian said:

    Hi Simon/ Paul,

    Could any one of you forward me some more details of the setup. Like the steps you used to achive the goal, the script used to extract the GPS, source code would be helpful too.

    Thanks.

  • I am working on a similar project. Interfacing pixhawk to raspberry pi to get the gps data from pixhawk to raspberry pi so that i can use it for image processing on raspberry pi. Any help would be appreciated. I have just made the connection setup. . Didn't find anythin to move forward with. I have connected the pixhawk through the GPIO pins and powered the pixhawk through USB.

    This is the thing i have been able to do till now. I could use mode to change modes, param set and show but couldn't find any command to get gps or imu data.

    pi@raspberrypi:~ $ sudo -s
    root@raspberrypi:/home/pi# mavproxy.py --master=/dev/ttyACM0 --baudrate 57600 --aircraft plane
    Connect /dev/ttyACM0 source_system=255
    no script plane/mavinit.scr
    Log Directory: plane/logs/2017-12-15/flight1
    Telemetry log: plane/logs/2017-12-15/flight1/flight.tlog
    MAV> Waiting for heartbeat from /dev/ttyACM0
    *o]l`:H9%online system 1
    ALT_HOLD> Mode ALT_HOLD
    [S$<f1z9;>;APM: APM:Copter V3.5.4 (284349c3)
    APM: PX4: 0384802e NuttX: 1bcae90b
    APM: Frame: QUAD
    APM: PX4v3 00490021 33355119 38393235
    Received 773 parameters
    Saved 773 parameters to plane/logs/2017-12-15/flight1/mav.parm
    fence breach
    mode
    ALT_HOLD> ('Available modes: ', ['RTL', 'POSHOLD', 'LAND', 'OF_LOITER', 'STABILIZE', 'AUTO', 'GUIDED', 'THROW', 'DRIFT', 'FLIP', 'AUTOTUNE', 'ALT_HOLD', 'BRAKE', 'LOITER', 'AVOID_ADSB', 'POSITION', 'CIRCLE', 'SPORT', 'ACRO'])
    Thanks & Regards
  • how did you do that  i try everything can someone help me  i connot download of fail the pymavlink 

  • Hi All,

    Need some HELP is it possible to map the USB link from APM2.5 to the RasPi using Mavproxy and route the telemetry info via UDP thru the Pi,then VPN through the 4g network ton the ground station or do i have to use the serial to LLC to telemetry port to get the data to the station.

    I have attached image of how i think it should work.

    Any help would be appreciated!!

     Thx.

    FPV setup.001.png

  • Are you making an object tracking Quadcopter?

  • Hi Jonathan, 

    I am trying to do something similar  - connect an Odroid U3 to APM2.6's UART2 port. Can you give me some detail on how you did this, eg type/spec of headers, pitch. Is there an ready made FTDI USB cable I can get hold of for this?

  • How can I know when the RPi detects the pixhawk???

This reply was deleted.

Activity