Skip to content

FRC Team #6647's library for JSON-oriented object initialization, among other things.

Notifications You must be signed in to change notification settings

VOLTEC6647/lib6647

Repository files navigation

lib6647

Team 6647's library for JSON-oriented object initialization, among other things.

Getting Started

Usage

Team 6647 encourages the usage of this library by any team that may find it useful, period. Giving us credit is optional, but greatly appreciated. Please feel free to request anything your team might need that could be added to this library.

Compiling lib6647 to your Robot

lib6647 must be added as a dependency in your Robot's build.gradle file, as well as the jackson library that it requires.

First, add the following url to your Maven repositories in build.gradle: https://jitpack.io. This is to effortlessly compile code from any github project release or commit into your code.

Your build.gradle file should look like this (if no other Maven repositories are present):

    repositories {
        mavenCentral()
        maven {
            url 'https://jitpack.io'
        }
    }

Then, add lib6647, jackson-core, jackson-databind, and jackson-annotations as a dependency in your build.gradle's dependencies like so:

    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.1'
    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.1'
    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.10.1'

    // lib6647
    compile group: 'com.github.pacoito123', name: 'lib6647', version: '-SNAPSHOT'

Your dependencies in should look like this (again, if none other than WPILib's dependencies are present):

    dependencies {
        // WPILib dependencies.
        implementation wpi.deps.wpilib()
        nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
        nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)

        implementation wpi.deps.vendor.java()
        nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
        nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)

        testImplementation 'junit:junit:4.12'

        // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
    	compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.1'
    	// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
    	compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.1'
    	// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
    	compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.10.1'

        // lib6647
        compile group: 'com.github.pacoito123', name: 'lib6647', version: '-SNAPSHOT'

        // Enable simulation gui support. Must check the box in vscode to enable support
        // upon debugging
        simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)
    }

Of course, you can change the version of the library to any specific commit in any branch, just make sure that your code is compatible with it.

Now you're ready to begin instantiating and initializing objects through JSON!

To do (for now)

  • Implement every HyperComponent Wrapper (if needed).
    • HyperAHRS
    • HyperAnalogPotentiometer
    • HyperCompressor
    • HyperDigitalInput
    • HyperDoubleSolenoid
    • HyperEncoder
    • HyperPDP
    • HyperPIDController
    • HyperSolenoid
    • HyperTalon
    • HyperUltrasonic
    • HyperVictor
  • Implement SuperComponents.
    • SuperAHRS
    • SuperAnalogPotentiometer
    • SuperComponent (Custom Component with custom initialization)
    • SuperCompressor
    • SuperDigitalInput
    • SuperDoubleSolenoid
    • SuperEncoder
    • SuperPDP
    • SuperSolenoid
    • SuperTalon
    • SuperUltrasonic
    • SuperVictor
  • Improve Controller initialization.
    • Create JController class, for initializing Buttons along with a Controller.
    • Add Buttons for each POV and axis found for the Controller.
    • Integrate Controller initialization with a Robot template.
  • Implement Team 254's Looper subroutines.
    • Create LooperRobot template.
    • Create LoopRegisterException, to be thrown when a Loop cannot be registered properly.
    • Allow for different period times across Looper instances.
  • Improve PID subsystems and calibration.
    • Facilitate updating PID values from Shuffleboard/SmartDashboard without having to reload everything.
    • Allow for different PID loops within the same PIDSuperSubsystem.
    • Re-implement max output functionality into PIDControllers.
  • Add more flexibility and configuration options.
  • Comment everything.
  • Do proper Exception handling.
  • Write proper documentation for this library.
  • Blame mechanical.

Authors

License

This project is under the BSD License for WPILib code, see: BSD_License_for_WPILib_code.txt.