Skip to content
Lucas Bubner edited this page Oct 22, 2024 · 14 revisions

Welcome to the BunyipsLib wiki!

Note! A major v6.0.0 release for BunyipsLib is being scheduled. Wiki progress has been paused and information here only reflects operations in BunyipsLib <= v5.1.1 (not including dev master branch).

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 vision, deadwheels, command-based programming, Autonomous, the RoadRunner library, 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 Bunyips Robotics Club
  • A different team interested in using 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.

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.


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.

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 move forward by 40 centimeters in Autonomous is as simple as:

makeTrajectory()
    .forward(40, Centimeters)
    .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.stopTask());

// 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.