Moderator

Pixhawk & raspberry pi

Hello guys!

I am making for my final year project a quad-copter that will detect an object at a specific longitude and latitude. I am using raspberry pi for image processing and pixhawk for the control.
As you know the the GPS is not accurate enough and it might give an error of 1 + meters. For that, the logic behind the project is to let the quad-copter go first to the predefined lon/lat of the object then try to find the target.
My question is the following: I know that I can interface the raspberry pi and pixhawk using Mavlink. But is there any command in Mavlink that allows the raspberry pi to send a move left command for x meters...to the pixhawk?  

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

Join diydrones

Email me when people reply –

Replies

        • Hi Nicolas

          I see what you mean.  I have a little longer and will try and build on the other tutorial at http://qgroundcontrol.org/dev/mavlink_linux_integration_tutorial.

          I am also interested in integrating OpenCV at some stage, but that I think is 6 months or so away and by then I hope to have in place a robust, if simple, program on the Pi to request data from various sources, process it and then send a variety of Mavlink messages to the Pixhawk.

          Good luck and keep us updated!

          Regards

          Mike

    • Moderator

      Hey Sergey, 

      It's good to know that I am not the only one stuck with this problem.

      I managed to successfully send commands to the pixhawk via Mavproxy. 

      This is my sequence of commands after running mavproxy.py according to this thread (http://dev.ardupilot.com/wiki/raspberry-pi-via-mavlink/) :

      switch 0

      rc 3 1500 //(throttle)

      arm throttle

      These commands will activate the motors, so be careful and remove your propellers. Also, you can send yaw, pitch and roll commands by changing the number in the 2nd command. e.g: rc i 1600; i= 1, 2, 3, 4.

      By the way, do you know anything about the problem that I am facing with the vibrations? (video)

      Thank you & good luck!

      NJ

      • Hey Nicolas-Michael,

        Thank you for your response!

        I managed to send those commands. And it work!

        But my aim is to control the quad on a lower level via MAVLink commands (like MANUAL_CONTROL, RC_CHANNELS_OVERRIDE..)

        And about vibration of the video. How you mount you camera?

        You could some foam material between your quad fram and camera it could absorb some of the vibrations. Or you could use more professional camera gimbal.

        Good luck!

        Sergey

  • This reply was deleted.
    • Why do you say that Rpi and Pixhawk are redundant? Did you mean that Pixhawk is unnecessary since Rpi can do all the work of calculating everything both related to flight and image recognition, etc. Why would I want to use a KK multicopter board instead of a Pixhawk? 

      Thank you in advance!

    • Hi Peluzza

      I see your point, but I am taking the same approach of using a PxH and Pi together.  Partly this is to keep the overall system modular and partly because I prefer to adapt the APM code as little as possible - it's quite complex and I do not want to introduce errors through my own ineptitude!

      The issue for me is whether Mavproxy can be adapted to send the commands required on a continual basis, or whether it's best to program from scratch, using the Mavlink libraries and header generators provided.

      Thanks for your input,

      Mike

    • Moderator

      Hi!

      Thanks for your response!

      I am connecting the raspberry pi and pixhawk according to the following tutorial:

      http://dev.ardupilot.com/wiki/raspberry-pi-via-mavlink/

      GPIO--> Telemetry

      The main problem that I am having is the fact that I am using C/C++ for image processing and I am trying to track an object. The raspberry pi is taking care, of course, of the image processing, and will send movements commands to the pixhawk (such as move left, right... ) according to the image processed. 

      The main problem is that I am not understanding how should I send these movement commands to the Pixhawk. I know that I should use either Mavlink or Mavproxy but i dont know how...

      Appreciate your help

This reply was deleted.

Activity

Jose Araujo liked Jose Araujo's profile
Aug 29
spencer harvey liked spencer harvey's profile
Jul 9
More…