Giter Site home page Giter Site logo

not-very-stronghold's Introduction

not-very-stronghold

Adding a Subsystem

Follow these steps for each subsystem.

Annotate the subsystem with @Singleton to allow only one copy of this class to be created.

// Coconut.java
@Singleton
public class Coconut extends Subsystem {
  // ...

Annotate the subsystem constructor with @Inject to allow the class to be automatically instantiated by dependency injection. If using Talons, add Talons to the constructor to have it injected for your use.

Add talons to the TelemetryService to allow graphing.

// Coconut.java
@Inject
public Coconut(Talons talons) {
  coconutTalon = talons.getTalon(40); // get pre-configured Talon
  Robot.COMPONENTS.telemetryService().register(new TalonItem(coconutTalon, "Coconut Talon (40)")); // add Talon to grapher
  // ...

Add a method declaration for getting the subsystem instance to the RobotComponents interface.

// RobotComponents.java
Coconut coconutSubsystem();

Using a Subsystem

Once a subsystem is configured you can use it in commands, for example:

// CoconutStop.java
public class CoconutStop extends InstantCommand {
  private final Coconut COCONUT = Robot.COMPONENTS.coconutSubsystem();

  @Override
  protected void initialize() {
    COCONUT.stop();
  }

  public CoconutStop() {
    requires(COCONUT);
  }
}

Talons

Subsystem Talon ID PDP
Drive left-master 0
Drive right-master 1
Drive left-slave-1 2
Drive right-slave-1 3
Drive left-slave-2 4
Drive right-slave-2 5
Shooter left 20
Shooter right 21
Shooter-shoulder elevation 30
Coconut coconut 40
Intake shoulder-left 50
Intake shoulder-right 51
Intake roller 52

not-very-stronghold's People

Contributors

golgothasterror avatar jhh avatar mwitcpalek avatar rabsamu avatar rl507 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.