GithubHelp home page GithubHelp logo

2023-inseason's People

Contributors

dependabot[bot] avatar keithsterthegreat avatar nolanknight avatar ocurr avatar prestonhopper avatar rubikscube4 avatar

Watchers

 avatar  avatar

2023-inseason's Issues

[CANdle] Indicate cone/cube in disabled for preload

Goal:

Based on a gamepiece preload variable, set the candle to the color to indicate the selected preload in disabled. Integrates with GreyDash.

Steps:

  • Create a member variable in Robot.java for the preload. Use the GamePiece enum in the Claw class
  • In disabled periodic, set the candle to yellow for cone and purple for cube

Testing Requirements:

  • Final sign-off by Oliver/Chris

Resources:

[Limelight] Adhere April Tags

Goal:

To get the official april tags ready for the field

Steps:

  • Put the April tags on the polycarb boards without bubbles and aligned perfectly

Testing Requirements:

  • Final sign off by Oliver/Chris

[Code Prep] Create 2023-inseason repository

Goal:

We need to create the 2023-inseason repository for our code

Steps:

  • Make sure you have the new 2023 WPILib installed
  • On GitHub, create a new repository called 2023-inseason
  • Clone the repository locally using git clone
  • Open the cloned folder in VS Code
  • Use the WPILib extension to create a new Timed Robot template
  • Verify build
  • Add Lombok and Spotless to the Gradle dependencies
  • Make build depend on Spotless apply
  • Verify build

Testing Requirements:

  • Project must build correctly
  • Final sign off by Oliver/Chris

Resources:

[Wrist] Create get and set functions for wrist angle

Create the function getWristAngle that should return the current wrist angle in degrees.
Use m_writstMotor.getRotorPosition to get the current position of the wrist motor in rotations and use the wrist gear ratio to convert to a wrist position in degrees. Use a rotation2d object to convert from rotations to degrees. Rotation2d.fromRotations(rot).getDegrees.

[CANdle] Red flash in disabled when exception has ocurred

Goal:

We need an indicator that something bad happened and we need to check our exception log. Flash the CANdle red in disabled

Steps:

  • Implement flash function in the CANdle subsystem. Read the docs.
  • using logException, set a boolean in the Robot class to indicate that we logged an exception
  • In disabledPeriodic, check if this boolean is true and flash the CANdle

Testing Requirements:

  • Final sign-off by Oliver/Chris

Resources:

[Claw] Testing

Goal:

Test Claw and get manual control working.

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Claw] Rename member variables

Goal:

Rename some member varaibles to make the code more clear

Steps:

  • Rename m_clawMotor to m_intakeMotor
  • Rename m_clawMotorOutput to m_intakeMotorOutput
  • Rename ClawState to IntakeState
  • Rename m_clawState to m_intakeState
  • Rename ClawInfo.FX_ID to ClawInfo.INTAKE_FX_ID

Testing Requirements:

  • Code compiles
  • Final sign-off by Oliver/Chris

[Misc] Update CAN IDs

Goal:

Give values to CAN IDs that make sense.

Steps:

  • Update IDs

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Auto] Select preload from GreyDash

Goal:

We want to select whether we have preloaded a cone or cube with GreyDash. The UI logic is there, but we need to implement this in our Java client

Steps:

  • Create similar logic to the auto mode selection in the GreyDash client for these:
  • /GreyDash/auto/availableGamePieces
  • /GreyDash/auto/selectedGamePiece
  • Make the selected game piece available to the automanager

Testing Requirements:

  • Verify piece is selected correctly
  • Final sign-off by Oliver/Chris

[Claw] Add wrist motor

Goal:

Add a motor for controlling the wrist

Steps:

Part 1: Motor setup

  • Add a CAN ID for the wrist. Do this in RobotInfo > ClawInfo
  • Add a TalonFX in the Claw subsystem
    • Call it m_wristMotor
    • Make sure it's using com.ctre.phoenixpro.hardware.TalonFX
    • Initialize it with the CAN ID from above
  • For now, initialize it with the same config as the m_intakeMotor...
    • m_wristMotor.getConfigurator().apply(motorConfig);

Part 2: Fix methods

  • Rename getclawCurrentAngle to getWristCurrentAngle
  • Fix getWristCurrentAngle to use m_wristMotor, not m_intakeMotor
  • Rename setClawTargetAngle to setWristTargetAngle

Part 3: Motor Control

  • In update, set the target angle to the motor

Testing Requirements:

  • Test on the robot
  • Final sign-off by Oliver/Chris

[Compressor] Add compressor in main Robot.java

Goal:

Add a compressor object in Robot.java so we can build pressure

Steps:

  • Create a new branch called compressor-init
git checkout main  # Go to the main branch
git pull main  # make sure it is updated
git checkout -b compressor-init  # create the new branch
  • Read WPILib Guide (see resources) and create a CTREPCM compressor in RobotInit. The variable should be visible to the whole class, private, and final
  • Add a fake ID to RobotInfo.java

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Intake] Add logic/motors

Goal:

Update the Intake to match CAD

Steps:

  • Add TalonFX motor for intake
  • For cubes, intake at 1.0. For cones, intake at -1.0
    • Update state machine to handle this
  • Outtake should be opposite

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Auto] Create PickupGamePiece Command

Goal:

Create an auto command that picks up a game piece

Steps:

  • Create a new AutoCommand: auto/commands/PickupGamePiece.java
  • The constructor should take the claw subsystem and a GamePiece value from the enum located in the Claw subsystem
public PickupGamePiece(Claw claw, GamePiece gamePiece) {
  //...
}
  • The run command should call m_claw.setGamePiece with the game piece we passed to the constructor
  • It should also call m_claw.setIntakeState(IntakeState.In)

Testing Requirements:

  • Test the AutoCommand on the robot by creating an auto containing only the command
  • Final sign-off by Oliver/Chris

Resources:

[CANdle] Fix turning off after score

The candle is staying on after we score. More specifically, it turns off when we hold the score button, then turns back on

It should stay off

[Limelight] Test April Tags

Goal:

To research and test April tags with the new Limelight firmware

Steps:

  • Verify Limelight network connection
  • Read documentation for Limelight april tags
  • Test out features with our printouts

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Arm] Create Subsystem

Goal:

Create a basic arm subsystem

Steps:

  • Create a new branch called arm-init
  • Create the subsystem java file
  • Add motor for arm movement up and down
  • Create methods to manually move setArmRotationOutput(double percent)
  • Create update function that sets the current state to the motor using private variables containing the state
    • create a private double m_armMotorOutput = 0.0 and update this with the setArmRotationOutput(double percent) method
  • Commit, push, PR referencing this issue

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Claw] Create Subsystem

Goal:

Create a black-box claw system

Steps:

  • Create a new branch called claw-init
  • Create the subsystem java file
  • Create methods for control
    • open() close() intake() outtake()
    • Have each method change a local variable:
      • open: this.clampState = ClampState.OPEN
      • close: this.clampState = ClampState.CLOSED
      • intake: this.clampState = IntakeState.IN
      • outtake: this.clampState = IntakeState.OUT
    • ClampState and IntakeState will be enums you create as a private enum
  • In the update function, do switch cases for the enums but don't fill them in:
switch(m_clampState) {
    case: ClampState.OPEN:
        break;
    case: ClampState.CLOSED:
        break;
   default:
        break;
}

and also something similar for IntakeState

  • Commit, push, PR referencing this issue

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

  • None provided

[Arm] Update Arm to match CAD

Goal:

Update Arm subsystem to reflect the latest CAD.

Image

Steps:

  • new branch called arm-cad-update
  • m_armMotor can be renamed to m_wristMotor
  • Rename setArmMotorOutput to setWristMotorOutput
  • Add a solenoid for the linear extension. Fake ID in RobotInfo.java
  • Add a state machine and logic in update
private enum ExtensionState {
    RETRACTED,
    EXTENDED
}

Also initialize: private ExtensionState m_extensionState = ExtensionState.RETRACTED

and in update()

switch (m_extensionState) {
    case RETRACTED:
        m_armSolenoid.set(false);
        break;
    case EXTENDED:
        m_armSolenoid.set(true);
        break;
    default:
        break;
}

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Code Prep] Install vendor deps

Goal:

We need to install vendor deps so we can use libraries such as CTRE

Steps:

Testing Requirements:

  • Project must build correctly
  • Final sign off by Oliver/Chris

Resources:

[Auto] Autonomous Framework Update

Goal:

Let's port the autonomous framework to java and update some of the pain-points.

Steps:

  • Finish porting the command based auto in 2022-offseason
  • Test a basic auto mode
  • Implement variadic args for constructing sequences
  • Reimplement the basic auto mode with this

Testing Requirements:

  • Field testing
  • Final sign off by Oliver/Chris

Resources:

[Misc] Organize Robot Info

Goal:

Clean up RobotInfo.java.

Steps:

  • Move Robot Info constants into seperate subclasses
  • Update code to match new variable names

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Elevator] Testing

Goal:

Tune the Elevator so that it works.

Steps:

  • Find Bugs
  • Fix Bugs

Testing Requirements:

  • Final sign-off by Oliver/Chris

[GreyDash] Create Java Client

Goal:

Create a Java client to add charts and other data to GreyDash

Steps:

  • Add Gyro data
  • Add match data (time, operation)
  • Add auto selection
  • Add chart builder

Testing Requirements:

  • Test chart creation
  • Verify gyro and match data
  • Test auto selection

[Claw] Wrist angle command

Create a WristAngleCommand that will set the wrist to a specific angle.

  • The constructor take as parameters the claw object, an angle in degrees, and a timeout.
  • init will set the wrist to the angle provided in the constructor
  • run will be empty since the wrist update function handles the adjustment
  • isCompleted checks hasElapsed to see if the command has timed out and checks if the wrist is at the target angle.
  • test on the robot
  • final sign-off by Chris or Oliver.

[Elevator/Drive] Reduced turn rate when elevator is up

Goal:

To keep us from tipping, we should reduce how fast we spin when the elevator is up

Steps:

  • In Robot.java teleop perodic, locate where we read rotation from the driver stick
final double rot =
          -m_rotLimiter.calculate(MathUtil.applyDeadband(m_driverStick.getRawAxis(4), 0.09))
              * DriveInfo.MAX_ANGULAR_VELOCITY_RADIANS_PER_SECOND;
  • remove the final from this variable

  • Do some math on the rotation input to reduce it based on elevator height, for example:

if (m_elevator.getHeight() > Elevator.Presets.Mid) {
  rot = rot * 0.5;
}

Testing Requirements:

  • Test that it is slower when raised
  • Final sign-off by Oliver/Chris

[Misc] Function for TalonFX Config Values to Zero

Goal:

Create a util function that sets all of the TalonFX config values to zero.

Steps:

  • On a new branch, create the function in Util.java
  • In the function, create a TalonFX and make a config that sets everything to zero.

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Misc] Add exception handling to *init methods

Goal:

Also log exceptions during robotInit, disabledInit, autonomousInit, teleopInit, testInit in Robot.java

Steps:

  • Surround all content in init functions with a try-catch

for example:

  @Override
  public void autonomousInit() {
    try {
        // Put all the existing code here
    } catch (Exception e) {
      logException(e);
    }
  }

Do this for all of the init functions in Robot.java

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Auto] Swerve Trajectories Research

Goal:

To learn and implement swerve trajectories for season's autonomous mode.

Steps:

  • Research the trajectory resources below
  • Design an example trajectory to implement

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[GreyDash] Auto Selection Indication

Goal:

Make the CANdle indicate when an automode is selected in GreyDash.

Steps:

  • Set CANdle to flash state when an automode is selected

Testing Requirements:

  • Final sign-off by Oliver/Chris

[Elevator] Add motion magic

Goal:

Given the Elevator code, implement and tune motion magic presets

Steps:

  • Implement Motion Magic control loop
    • Use a state machine in the update function to swap between manual mode and motion magic mode
      • When using joystick to manually control, state machine should switch to manual mode
      • When a preset button is pressed, the state machine should switch to motion magic mode
  • Decide on preset positions for the elevator
    • We don't have a "game" for this, so some arbitrary positions like bottom middle top will work
  • Implement presets and controls

Testing Requirements:

  • In-shop testing of presets
  • Verify we can switch out of motion magic mode to manual mode and vise versa
  • Final sign off by Oliver/Chris

Resources:

[Auto] Add AutoCommand for PathPlanner trajectory

Goal:

Research PathPlanner trajectories and implement it into a new AutoCommand.

Steps:

  • Research PathPlanner Docs
  • Research turning PathPlanner trajectory into WPILib
  • Create AutoCommand using prexisting trajectory AutoCommand

Testing Requirements:

  • Final sign-off by Oliver/Chris

Resources:

PathPlanner Docs

[Elevator] Create Subsystem

Goal:

Create a basic elevator subsystem

Steps:

  • Create a new branch called elevator-init
  • Create the subsystem java file
  • Add motor for elevator movement up and down
  • Create methods to manually move setElevatorOutput(double percent)
  • Create update function that sets each current state to the motor using private variable containing the output m_elevatorOutput
  • Commit, push, PR referencing this issue

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Elevator] Add zeroing with DigitalInput

Goal:

Add a zeroing routine for the elevator. We will have a hall effect sensor (DigitalInput in code) to tell us when the elevator is at the bottom.

Similar to the turret in this last offseason, we should go into brake mode when we have successfully zeroed.

Image

Steps:

  • Add a DigitalSensor called m_bottomHall
  • Create zeroing sequence similar to the turret (see resources)
    • This one only has one sensor, so we are only setting the elevator to one position (0)

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

[Elevator] Add 2nd motor (follower)

#29 may change our API calls for this

Goal:

Update Elevator to match CAD: Add 2nd motor

Image

Steps:

  • New branch: elevator-motor-follower
  • Add new private final TalonFX m_elevatorFollowerMotor and a fake ID in RobotInfo.java
  • Make it a follower in the constructor (see resources)
    • Something like m_elevatorFollowerMotor.follow(m_elevatorMotor);

Testing Requirements:

  • Final sign off by Oliver/Chris

Resources:

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.