2016年4月11日 星期一

compile ardupilot on arduino



step 1:

   

Install Git-SCM

  1. Download and run the install file from: http://git-scm.com/download/win

step 2 :

     下載 source code

     git clone git://github.com/ArduPilot/ardupilot.git

step 3:

       

Install MHV_AVR_Tools to its default location

   
  http://firmware.ardupilot.org/Tools/Arduino/MHV_AVR_Tools_20121007.exe


step 4 :

Install ArduPilot-Arduino



step 5:

Configure Arduino

  1. Go to your Arduino folder
  2. Double click the Arduino icon
    ../_images/arduino_icon.jpg
  3. When Arduino opens, go to the file menu
    ../_images/arduino_menu_preferences.jpg
  4. Select preferences
    ../_images/arduino_preferences_dialog.png
    • Set Sketchbook location to your ArduPilot directory in your GIT folder.
    • Set verbose for both compile and upload
    • And DO NOT check for updates on start-up… (Remember, this is a special version just for ArduPilot.)
  5. Click OK and close Arduino

Connect your APM to your USB

  1. Re-open ArduPilot and under the file tab, click on sketchbook, then the program you wish to load onto your APM2.x (for this example we will use Copter, though the others use the same methods.
    ../_images/arduino_tools_sketchbook_copter.jpg
  2. Once this is loaded, click on the ArduPilot tab, and select ArduPilot mega 2.x out of the HAL options.
    ../_images/arduino_tools_target_apm2.jpg
  3. Then click the “Tools” tab and select “Arduino Mega 2560 or Mega ADK” from the “Board” tab.
    ../_images/arduino_tools_select_target_board.jpg
  4. Next select the Tools tab again, and set the “Serial Port” to the one your APM is connected to.
    ../_images/arduino_tools_serial_port.jpg
  5. In my case it was COM4, but check under device manager / Ports to find out on your system.
    ../_images/arduino_tools_confirm_correct_com_port_in_drivers.jpg

Configure Copter

  1. Click on the APM_Config.h file tab.
  2. Set your frame type (e.g. #define FRAME_CONFIG HEXA_FRAME) in order to get the right image for your frame
  3. Enable or disable the features you wish in this file.
    Ie if you want to compile with auto tune disabled, simply un-comment the line
    //# AUTOTUNE DISABLED // disable the auto tune functionality to save 7k of flash
    
    To disable Auto Tune which is enabled by default you would change it to:
    # AUTOTUNE DISABLED // disable the auto tune functionality to save 7k of flash
    
    The commented out options are the NON-default and all that needs to be done is to un-comment them to use them instead.
  4. Save this file and select the file Copter.
    At this point you are ready to compile.
    I would choose Verify for the first attempt.
    ../_images/arduino_tools_verify_button.jpg

Upload to your ArduPilot

  1. Then if all is well upload to the autopilot, as shown:
    ../_images/arduino_tools_upload_ardupilot_button.png
    This may take a while…
  2. You should end up with the message as shown below.
    ../_images/arduino_tools_upload_complete_message.jpg
  3. Configure Your ArduPilot using planner, as normal.



http://ardupilot.org/dev/docs/building-ardupilot-with-arduino-windows.html#building-ardupilot-with-arduino-windows

沒有留言:

張貼留言