Coding for APM without APM =)

 

Right now I'm far away from home, but I've found some extra time to work on my code for APM. But how am I going to test it without APM? Here is the video which shows a successful run of modified APM code on virtual APM =)

"\n" is not working good on this emulator.

 

Here is what you need:

Arduino IDE  direct link

Proteus (I'm using v7.7 sp2)  Demo version (according to demo limitations it cannot save or modify any MCU simulations, but you won't need it - you can use mine in read-only way, no problems with changing firmware) UPDATE: Unfortunately, there is no way to run my simulation file unless you have full (paid) version of Proteus.

APM firmware source code v2.24 (use newest if available)

and my Proteus simulation file attached (or you can do you own - it is really simple) ardupilot_sim.rar

 

UPDATE2: It is also possible to use AVR Simulator from AVR studio with HAPSIM plugin to get it running, but on my netbook it is sooo slow - so I couldn't make the video. 

 

I hope it helps.

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Weird, one person already asked me about that file and I've reuploaded it. So now error comes back. Send me a PM and I will send you that file.

  • @Jakaria - I think you can achieve what you want(although I didn't really get the idea) - but Proteus has one component which will emulate uart port of AVR and will output all data to real com-port of your PC.

  • Moderator

    I think I need a drink!

  • Updated the first post with info about free software emulation.

  • Thanx!

  • Developer

    @Yure, the desktop build is a way to build ArduPlane and ArduCopter with the g++ compiler for any CPU you like (eg, for X86 or X86-64). If you are on Linux or MacOS, you do this:

      cd ArduPlane

      make -f ../libraries/Desktop/Makefile.desktop clean hil

    It will build a ArduPlane.elf file, which you can run as a native executable. The serial ports are mapped to TCP sockets.

    MichaelO has also managed to get it building on Windows using Cygwin. He can give you more information on that.

     

     

  • If you change anything in code but it still can be changed with Planner - it is ok. But if you want to create new parameters - you'll have to add them as new variables to the main class.

  • I'm building for 1280 but in Proteus file you can change atmega to 2560 and it is going to be fine. For HIL mode and for my case to test CLI mode error message it is working fine.

     

    What is Desktop build? Where can I get info on it? Never heard about it, except the folder on GIT.

  • Developer

    nice work! You might also like to take a look at the APM Desktop build. Have a look at my recent posting on the autotest system for some pointers.

     

  • Developer

    one thing i dont see you mention. do you build for 1280 or 2560?

This reply was deleted.