Skip to content
Lucas Bubner edited this page Dec 14, 2024 · 30 revisions

BunyipsLib GitHub Release Recommended FTC SDK version View Changelog

Welcome to the BunyipsLib wiki!

BunyipsLib is an FTC (FIRST Tech Challenge) custom library created to make coding your robot quicker and more efficient, while also giving you access to more features right out of the gate. BunyipsLib has functions and classes created for subsystems, tasks, vision, deadwheels, command-based programming, Autonomous, RoadRunner v1.0, and is constantly being updated with new functionality. BunyipsLib takes inspiration from libraries such as WPILib, FTCLib, and RoadRunner, and tries to centralise these features into readable, reusable modules.

If you're reading this, you're probably either

  • A new programmer in the MBHS Student Robotics Club
  • A different team interested in using or researching BunyipsLib
  • Mr Heath

This wiki is designed to help you get BunyipsLib up and running, as well as giving you documentation on some of the most vital parts of the library. You'll find examples, method documentation, robot set up and more! Regardless of your use-case, we hope BunyipsLib will meet your every need. Unless you're Mr Heath, in which case I hope this confuses you.


For how to install BunyipsLib, go here.

To start learning about BunyipsLib, start by reviewing the Paradigms.

If you're a more advanced Java/Kotlin programmer, go here to read the accompanying API documentation.

You can navigate this wiki with the sidebar to access examples, tutorials, and information about BunyipsLib. Note that all examples and code written throughout this wiki will be written in Java.


Prerequisites

While BunyipsLib is designed to support you on your FTC programming journey, it is assumed that you know the syntax of Java (Kotlin is optional) and the basic operations of the FTC SDK in Blocks or Java. This includes the hardware classes such as DcMotor, Servo, the OpMode lifecycle, and the general gist of using the base SDK, as it will also be required for BunyipsLib OpModes.

Tip

You can learn more about the base features of the FTC SDK with Learn Java For FTC and the FTC documentation.

This wiki will cover more advanced features, such as vision, odometry, Autonomous, control systems, and provide an essential guide to using our library. BunyipsLib is built around the SDK, so it's important you have a baseline idea of how OpModes work—even just in Blocks—before using our abstractions.

Without this prerequisite, it will feel like learning calculus before you can count.

Release cycle

The release cycle of BunyipsLib follows a variant of semantic versioning, where changes are reflected by the change in numbering to the version. Features and other integrations to our library are based on what we need as a team, and while it does not include every possible built-in subsystem or feature for every conceivable robot component, it makes it so that BunyipsLib has many new features being integrated to fit our club needs.

BunyipsLib is expected to work up until the 2027 control systems migration, where new paradigms will replace the entire FTC control system (new "Mobile Robot Controller"). It may be the case after the 2027 migration, WPILib or another powerful library will take place and provide the features BunyipsLib provides today.

Core ethos

Many teams resort to other libraries to build highly effective OpModes. With many robots we built among our teams, we found a lot of the code we used was very repetitive, effectively rehashing the same components and subsystems. We also noticed many solutions offered by libraries, such as RoadRunner, were designed to be one-use. Static constants that apply to one robot, requiring multiple codebases to manage various teams. Design patterns that were highly one-and-done. For most teams, this is fine, but we wanted to do better.

Pre-BunyipsLib, we ended up making a folder between our robots, called common, which started at the roots of a catch-all exception handler. Before the modern stack trace popup, OpModes would crash into an EMERGENCY STOP state, requiring a full restart to recover from a user exception. Using these utilities helped us develop faster, removing some variables that slowed us down in the limited time we had to test the software.

Eventually, functionality within these common functions evolved into an ecosystem of functions, all linking with one another. We decided to create BunyipsLib as a complete library of general capabilities and powers the general goals for what BunyipsLib is.

1. Common ground

BunyipsLib takes heavy inspiration from accredited libraries such as WPILib, RoadRunner, and FTCLib. The features available in these libraries are very powerful and allow teams to create advanced OpModes. We often needed to access multiple features between libraries simultaneously, with limited common ground for interop. BunyipsLib was designed to make a common ground for these library features by abstracting over the OpMode and providing all of these features as components and utility methods.

2. "Mindstorms Level" of Ease

RoadRunner, the command-based paradigm, and vision systems are complex topics for new programmers. We wanted to develop utilities that document and wrap around these functions to provide easy ways to build code similar to LEGO Mindstorms. In BunyipsLib, telling a robot to rotate by 90 degrees in an Autonomous is as simple as:

drive.makeTrajectory()
    .turn(90, Degrees)
    .addTask();

whereas binding a button to do something in TeleOp can be accomplished in whichever paradigm is most comfortable to the programmer.

// Command-based
driver().whenPressed(Controls.X)
    .run(drive.tasks.stop());

// Procedural
if (gamepad1.getDebounced(Controls.X)) {
   drive.stop();
}

All BunyipsLib-written OpModes should be easy to read, where anyone can look at the code without comments and know exactly what the robot will do.

3. Education & Learning

BunyipsLib doesn't aspire to be the world's latest and greatest FTC library. Teams always prioritise whatever works for them, and BunyipsLib works for us. Our homebrewed software solutions have been designed entirely by students, and we hope that BunyipsLib can lower the learning curve associated with lower-level computer science and mathematical concepts.

By designing BunyipsLib, we tackle the issue of prerequisites when using other libraries by allowing BunyipsLib to be a documentation-rich, common-ground integrated system that assists FTC programming in small modules and utilities.

At the end of the day, BunyipsLib has been designed to teach various concepts and applications of programming, which may be the catalyst required to elevate teams into using advanced FTC Java, whether it be for code references and ideas or to use the library.

Clone this wiki locally