[FTC]: Alicorn For FTC - Code Less, Build More

Hey everyone on CD! ;D

I’d like to share with you all something I’ve been working on since the FTC kickoff this year - Alicorn for FTC teams.

TL;DR: Alicorn is a Ruby and Java framework that makes programming robots fun and easy. I’ve been working on it for ~2 years now, and started making an FTC version of it once they announced the new control system. I’m happy to say that it’s super stable and very reliable (we’ve been testing the heck out of it these past few months), and is even being used in some local community college classes.

Before I bore you with more text, here’s a super simple Alicorn program which controls a tank drive robot:


class Hello < Alicorn::Sphere
    def create
        @sdk = $("AndroidFTC")
        @joy1 = @sdk.get("gamepad_1")
    end
    
    def update
        @sdk.set("motor_0", @joy1.get("y1"))
        @sdk.set("motor_1", @joy1.get("y2").invert())
    end
end

With Alicorn, just drop the code into a file named hello.rb, put it in a folder on your phone, and you’re ready to run! Now, back to my wall of text…

As opposed to the current standard of downloading a new app every time you change your code, Alicorn only needs to be installed one time. Once it’s installed, you just need to drag a .rb file into a folder on your phone, and Alicorn will automatically pick it up and register it as a new OpMode - no more waiting forever while your apps compile, just edit and go! In addition, Alicorn will automagically scan for your hardware configuration and figure out what you want to do - no need to specify you’re setting a motor or a servo or…a flower pot? Hey, it’s your robot. Do what you like.

To summarize, Alicorn gives you the following advantages over the other…offerings:

  • Much simpler and beginner-friendly compared to the Android SDK and Java.

  • Nothing needs to be installed anywhere except for an APK on your phone.

  • You don’t need to specify hardware configs or mess with them in your code; Alicorn will figure out what you’re trying to set and get, and react accordingly.

  • You can write code in any text editor, even Notepad.
    This makes Alicorn ideal for schools where it’s hard or impossible to get dev tools installed on computers.

  • Instant reload of code changes. Just edit the file and restart the app; no compilation or downloading necessary.

  • Alicorn uses JRuby in the background, so you don’t lose any performance or abilities from Java
    . You can even access the standard Java APIs from your Ruby code.

  • Automatic OpMode loading.
    No need to edit a config file in your code; just make a new .rb for each OpMode, and Alicorn will handle the rest.

  • Full compatibility with the FTC Robot Controller. Alicorn is a drop-in replacement for the FTC Robot Controller
    , and will even detect any hardware configurations you’ve specified.

Finally, Alicorn is completely legal and compliant with the 2015 - 2016 FTC game rules - it is simply a standard FTC Robot Controller app with a different icon and the ability to load Ruby files and treat them like OpModes.

Check out http://alicorn.io for more info, and http://alicorn.io/docs/ftc-getting-started.html for the FTC getting started tutorial.

Tell me what you all think! ;D

Brandon