ArduPilot code, modified version for use on Microsoft Visual Studio. Compatibility with Arduino studio still maintained.Also contains parser of KML files, for importing fly paths drawn in Google Earth.Installation instructions:1) Download and extract ArduPilot_20090211.zip2) Download Arduino AVR studio3) Extract above into ArduPilot.vs\arduino-0012 folder4) If you don't have Microsoft Visual Studio 2005 yet, you can download free edition here (choose Visual C++ Express 2005)

97313933rp8.th.png

5) The code is still compatible with Arduino studio, simply run arduino.exe and open project from ArduPilot.vs\ArduPilot folder

45989029tl7.th.png

Build instructions under Visual Studio:- Open workspace ArduPilot.sln- Workspace contains folder "Source files" with ArduPilot code, this is where changes can be made

39172840xv6.th.png

- Another folder "System" is containing source files from Arduino studio needed to run ArduPilot executable, do not modify these- Build project as usual, if you see "Created ArduPilot.hex" in log window, then everything is OK

81251678yb2.th.png

- To upload to board, use Upload.bat from command prompt (you need to specify correct port in -P parameter)Note: if you change anything in *.h files, hit Rebuild Solution, because source dependency is not working in this caseWhy using MS Visual Studio for building ArduPilot code, when Arduino studio does the same thing?Well, if you're a programmer, then answer is clear - VStudio has better text editor, it will assist you in writing code by tools such as finding variable/function definition and declaration, text editor code highlighting, provides auto-complete, etc.Alghough we don't use C++ compiler from Visual Studio, rather custom build step is used with AVR compiler, mentioned advantages will help to make the code reliable and robust.On other hand, Arduino studio has very simple text editor, usable for the task, but if we have better tools, why not using them.Note: Visual Studio can be used on Windows only, so using Arduino studio makes sense for Linux/Mac users.How to use KML parser:This tool transforms KML file from Google Earth into ArduPilot friendly file.Usage:- In Google Earth, use Add -> Path (Ctrl+Shift+T)

58930586ya9.th.png

- Click to define waypoints

47404789fu2.th.jpg

- Do not connect last waypoint with first, it would create polygon which is not supported- Save the path in KML format (not KMZ)

29333280mv9.th.png

68114144gu3.th.png

- Use KML parser to extract coordinates and create ArduPilot compatible file; the utility accepts 2 parameters - source KML file and destination H file; first is your KML path file from Google Earth, second is usually set to ArduPilot\waypoints.h, this will create waypoints file compilable by ArduPilot code. There's testing KML file as well as KML_test.bat file which puts proper parameters to the KML tool.- Compile ArduPilot executable and upload to boardSource code is provided for KML parser tool. It is compilable under MS Visual Studio, and runs on Windows.Problems and tasks:- Google Earth doesn't allow to define altitude for individual waypoints, or to export KML file with absolute altitude,so we end up with same altitude for every waypoints for now.We can fly on same altitude level, or manually tune altitude in generated waypoints.h file, or come with some other fix (suggestions are welcome).
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Michal,
    I'm building your simulator with hardware-in-the-loop. Got the X-plane, GE, Ardusim, baud rate at 19200, port set to 49003, the correct com #; but not sure about installing the modified code. Are you saying to create a project folder and name it "ArduPilot.vs" and then extract Ardupilot and Arduino into it? In other words, should there be a Main folder called Ardupilot.vs that contains both extracted contents? I'm getting errors during upload that say a hex file cannot be found in applet.
    Thanks
  • Maybe you don't have folder arduino-0012 inside of project folder, where is AVR Studio. Read instructions above.
  • I have upload the compiling logfile here: http://www.combatprofile400.it/blog/BuildLog.htm

    i need help!

    thx
  • hi Michal, i have one little problem with ardusim compiling in VC++ 2005, this is the result of compiler:

    1>------ Build started: Project: ArduPilot, Configuration: Release Win32 ------
    1>HardwareSerialX.cpp
    1>Impossibile trovare il percorso specificato.
    1>Project : error PRJ0019: A tool returned an error code from "HardwareSerialX.cpp"
    1>Build log was saved at "file://c:\Users\kattivik\Desktop\Arduino\ArduPilot.vs\_build\BuildLog.htm"
    1>ArduPilot - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    you can help me?

    thk's :D
  • Nick, did you run the ViPOR page?

    It allows for waypoints to be clicked onto the map with a mouse, and it generates a waypoint list.
  • I was going to try and make as mashup between these two google maps api websites.

    My plan is you could add waypoints by searching or dragging on one map and then on the second map it shows the route lists the lat/long. You would specify the altitude by double clicking on one of the markers and entering it
    Adding Markers on Google Maps
  • PS. to test the page - click ok on the debug msgbox(s). once the page shows maps, click on a button, the click on the main map to place that icon.
  • Since google earth doesn't work. I'd recommend a mashup on google maps.
    I wrote a mashup - you can set altitude in a textbox, then click, the web page will generate any format you like.

    Here is the page I did years ago. It still has some debug code.

    http://www.windwavesandsun.com/ViPOR.html

    the custom code is all client-side java so you can see how its done.
    If Chris will host a page with some shared access, I'm sure this could be whipped into shape in a few evenings.
  • Very nice! I feel more at home in VStudio.

    -tychoc
  • Cool... Great job...
This reply was deleted.