Integrated picoc as a runtime thread in VicaCopter. The current version locks up, it doesn't do floating point, it crashes your entire autopilot when it encounters an internal error, but after working around all the problems, managed to get some nifty flights out of it.It's like turtle graphics with a very very expensive turtle. U can build up incredibly complex flights out of reusable maneuvers. U can repeat maneuvers. U can nest maneuvers in maneuvers.Ironically, picoc was written to fly airplanes but its author never flew it in an airplane. His only application was that Surveyor rover.The lack of floating point means we can only do relative waypoints & no latitude & longitude.

That was a 15m altitude change & 2 pirouettes in picoc.

That was the cross mission & 2 circuits in picoc.

That was 4 orbits with the nose pointing in different directions in picoc. Impossible with tables of waypoints.It locks up if you forget a comma in an argument list. Don't use "assert" in programs which are intended to fly things. Run it in a thread so if it locks up, it doesn't crash you. A floating point trig library would be nice.
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • I've just released a new version of PicoC:

    http://code.google.com/p/picoc/
  • Great to see this language moving along, I can see this becoming somewhat of a standard for embedded C in the UAV area at the very least.
    Congratz and keep up the effort Zik.
  • Jack, I fixed a bug in floating point constants. You may want to update.
  • Thanks for the bug report. That's fixed now.
  • Promoting integers would be nice. It seems to be implemented as COERCE_FP functions but it doesn't work.

    void function(double x)
    {
    printf("%f\n", x);
    }


    function(100000);
  • I've fixed the "missing comma bug". Do an update to get the latest version. I think this addresses all the bugs you found. Please let me know about any new bugs you find.
  • Jack, you said "a floating point trig library would be nice". I've just added one. It supports: sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, fabs, log, log10, pow and sqrt from your native maths library. You'll need to define MATH_LIBRARY in your platform definition to get it. Let me know if you need any other functions in there.
  • Jack, I've checked in some fixes to floating point which should sort out the problems you were having with it. Let me know if you have any more problems.
  • Okay - I just duplicated it - I left out a comma between the print string and a function ...

    printf("%d\n" gps_head(35000000, 121000000, 35100000, 121500000));
  • Thanks Howard. Strange. When I run "printf("test %d\n" 12);" I see:

    testcomma.c:1: value not expected here

    which is as it should be. This is under cygwin - but it might be a platform-dependent problem so I'll run it on my SVR-1 tonight and see if I can reproduce it there.

    Jack, what processor/OS are you running on your autopilot?
This reply was deleted.