A group to discuss the many ways to edit and compile the code for the Ardupilot Mega!

602 Members
Join Us!

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

Join diydrones


  • Hi Randy, thanks.

  • Developer


         The best way is probably to modify the AP_MotorsQuad.cpp file's so that it adds another motor at the bottom with zero for the roll, pitch and yaw factors.  That alone might do it.  Below is an excerpt of that file with the additional line that I think should be added.

            // X frame set-up
            add_motor(AP_MOTORS_MOT_1,   45, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 1);
            add_motor(AP_MOTORS_MOT_2, -135, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 3);
            add_motor(AP_MOTORS_MOT_3,  -45, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  4);
            add_motor(AP_MOTORS_MOT_4,  135, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  2);
            add_motor_raw(AP_MOTORS_MOT_5, 0.0,  0.0, 0.0, 5);

  • Hey Guys, I need some guidance with the following:

    1. I want to take the 4 outputs (Assuming a quad configuration) and get an average. (Mot1.Output + Mot2.Output + Mot3.Output + Mot4.Output)/4

    2. From here I want to send the average value to an available out channel - say channel 5.

    The purpose for this would be to fit a large central lifting motor on the quad taking the average pwm from the 4 balancing (normal) motors.

    I might have to apply a scalefactor / constant to achieve stability. I also foresee a yaw issue considering the torque of a large single main rotor, but will see how to manage that once a prototype is running.

    Thanks for any help.


  • I am a green hand of quadcopter,and I just could not find the main function of the arducoper in the code,forget to say,I do not use the arduino IDE but Source Insight,it can just browse the code but not compile them,where is the main function?many thanks

  • Hi Shyam

    The source code is all available at https://github.com/diydrones/ardupilot

  • Hi Aku

    I found this to be a good starting site: http://dev.ardupilot.com/

  • hye!can someone tell me what things should i know to programme this ardupilot board?i really interested in this matter. any helps i will really appreciate it.Thank you!

  • Hi,

    Can someone share with me the:

    1) Software architecture for Arducopter

    2) Stabilize and Loiter Controller architecture.

    I could not find it on DIYDrones and even googled it, can't find it. Grateful for any help here!

  • Developer

    @Janelle: Open a forum post as it's much easier to discuss than this 'Wall Feature'

    MAVLink messages are a binary protocol and you can easily create a program to process them without Mission Planner.see http://qgroundcontrol.org/mavlink/start and see http://qgroundcontrol.org/dev/mavlink_onboard_integration_tutorial

    It's just a loop and you can detect each message and then pretty print the output in your own format (or store them and print them out at a set frequency)

    I hope the links help :)

  • @Shyam, Thank You so much, but is it possible to access the Mavlink logs after the flight without using Mission Planner, again Thank you

This reply was deleted.
E-mail me when people leave their comments –

Getting mission status on UserCode.cpp

Hello, everyone!I'm trying to count how many waypoints has my drone visited and if the mission has been sucessfully finished, and for that I'm planning on writing my code on the UserCode.cpp file, but I don't know if I can define some library to extract that data from, or if I should go directly to the EEPROM, or if I can declare my own parameters and read from them somehow... What is the "good practices" way to do this? Thanks in advance.

Read more…
0 Replies

Generate remote control commands from Arduino

Hello. We are currently working on a drone for a university project work. It is quadcopter and flight controller is APM 2.5. The point of the project is to implement A* algorithm (finding short path on a discretized terrain). So the flight of the drone should be described in advance according to algorithm work results, sent from GCS via a protocol (Mavlink I guess).THE QUESTION IS - is it possible to exctract what remote control sends (when drone is told to go forward, for instance), generate…

Read more…
1 Reply

MAVLink Manual Control via Arduino / Teensy

hi @all,Inspired on Burkards Sonar Boat project i want to build my own Sonar Boat. We have some discussion to implement the MAVLink functionality and use a APM or Pixhawk with ardurover firmware.Burkard has developed a little remote with a OLED to get some information live from the Boat. This remote has a 5 Way Switch (Joystick) to control manual...A 3DR Ground Modul, a five way switch and a Oled are connected to a Teensy (Teensyduino) So far so good :)I try to implement the MAVLink Protocol to…

Read more…
0 Replies