Fresno is a framework and generator for writing FRC controller code in Mirah, a JVM language that compiles down to Java but offers a friendlier syntax.
To get started, follow the instructions for setting up a Java environment in the FRC Getting Started guide, including the updates for the Sun SPOT environment.
Once you have Java setup along with the FRC dependencies, hop over to the JRuby website and install the JRuby package. Mirah uses JRuby as its language for parsing and compiling to Java, and Fresno uses it to run the generator code.
To install Fresno, simply run
gem install fresno (or
jgem install fresno) with a JRuby powered installation of RubyGems, which should be installed by default with your JRuby package.
By default, Fresno's generator will create a directory structure and setup an Ant
build.xml to build a project using WPILib's
IterativeRobot class as its base. To create a project, simply execute:
fresno create MyRobot
...where MyRobot is the name of your robot/project. Fresno will then create a directory with the name of the robot/project and place inside of it a few files:
LICENSEfile with a license for the code contained within. By default, this is the MIT Open Source License, but feel free to change or delete that file, especially if you never plan to open source your code.
LICENSE_FOR_WPI_LIBfile which contains the BSD license for all the WPILib code as required by its license.
build.propertiesfile for building with Ant. These are heavily based on the files from WPILib's Netbeans templates with a few alterations and clarifications.
.gitignorefile to ignore build files when committing to a Git repository.
README.mdfile in Markdown format; you should definitely keep a current
READMEfor your project!
- A robot source file in
To build your robot's code, execute
ant compile. To deploy a new release, execute
ant deploy. If you're using Netbeans, you can add a Netbeans project file to your Fresno project with the
fresno create MyRobot --netbeans
If you'd like to use
SimpleRobot as your base rather than
IterativeRobot, you can specify the
--simple option to the generator:
fresno create MyRobot --simple
A command based template is coming soon!
Currently, the Fresno framework isn't hooked into anything, and in reality, it's only a single class right now.
Now that the generator is functional, features can begin to be added to the framework. In the future, the framework will be built at the time of the gem build (or install?) and then subsequently added to the classpath at build time.
- Implement the command template
- Build out a bit of the convenience framework
- Tweak the ant build so that we can build bytecode using Mirah and deploy that; otherwise, we lose a couple of the cool features of Mirah
- Documentation! Documentation! Documentation!