Giter VIP home page Giter VIP logo

2024_crescendo's Introduction

2024-Crescendo

Hackbots code for the 2024 FRC Crescendo game.

DriveTrain CAN IDs:

Device ID
Front Left Module ----
Drive Motor 11
Steer Motor 12
Encoder 13
---- ----
Front Right Module ----
Drive Motor 21
Steer Motor 22
Encoder 23
---- ----
Back Left Module ----
Drive Motor 31
Steer Motor 32
Encoder 33
---- ----
Back Right Module ----
Drive Motor 41
Steer Motor 42
Encoder 43

System CAN IDs

Motor ID
Pigeon 2 50
Transport 56
Shooter Left 57
Shooter Right 58
Shooter Pivot 59
Intake 60
Elevator Left 61
Elevator Right 62

Driver Controls

Fuction Control
Translation Right Joystick
Rotation Left Joystick
Brake Wheels A Button
Point Wheels B Button
Reset Heading Left Bumper

Operator Controls

Fuction Control
</TBD> A Button
</TBD> B Button
</TBD> X Button
</TBD> Y Button
</TBD> Left Bumper
</TBD> Right Bumper
</TBD> Start Button
</TBD> Back Button
</TBD> D-PAD Up
</TBD> D-PAD Right
</TBD> D-PAD Down
</TBD> D-PAD Left
</TBD> Right Trigger
</TBD> Left Trigger

LED codes:

Event Color Pattern
Note In View Yellow
Note On Board Green Medium Flash
End Game Warning (30) White
End Game Alert (15) Strobe White
Shoot Alignment Happening Slow Blue
When Aligned Flash Blue
In Range (Shooting) Blue

2024_crescendo's People

Contributors

akshaykumar41 avatar vijayn7 avatar therekrab avatar alexjkarki avatar bczdog avatar sanjana36 avatar madisondoctor avatar heidig2007 avatar

Stargazers

John Franco Saraceno avatar  avatar  avatar  avatar

Watchers

Shrihari Bhaskar avatar  avatar Bill G. avatar  avatar  avatar  avatar Adriaan Friesen avatar Hannah Ho avatar  avatar  avatar  avatar  avatar  avatar Lucas avatar  avatar  avatar  avatar  avatar

Forkers

hackbots-3414

2024_crescendo's Issues

New transport has note logic for 3rd sensor

Intake command activates Intake and Transport
Intake IR changes LED to indicate Note Intaking
Transport middle IR sees note, slows Intake and Transport motors for repeatable stopping
Transport flywheel IR sees note, stops Intake and Transport motors

Transport has note method returns true whenever Transport middle IR || Transport flywheel IR are true.

Eject, score amp, shoot all run until transport has note is false (no timer) or interrupted.

Align isFinished() methods to use transport.hasNote() where appropriate.

Remove the brake mode from shooter motors.

Create a "keep it warm" mode for shooter when in range (default command on Shooter subsystem).

BackCam fix

  • If we can get backCam operational and reliable
  • See what happens if we put all three cameras on one Orange Pi

Auto Move for Amp

  • Use Pathplanner to move to the amp
  • Combine all logic for amp score into 1 command

Elastic Dashboard

Configure the Elastic Dashboard for competition.

  • Add Game time widget
  • Driver cameras
  • Debug View (Have Swerve Modules, Pivot cancoder, addition subsystem info needed for debugging)
  • Push configuration to Repo
  • Download elastic on all laptops. (All comp laptops at least)

Simulator Using Mechanism2D

[WPILib:] (https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/physics-sim.html)
[CTRE:] (https://v6.docs.ctr-electronics.com/en/stable/docs/api-reference/simulation/simulation-intro.html)

WPI is easy to follow but some things are different when using falcon motors. For that you will need to use the CTRE example to figure out the logic.

  • Elevator Simulation
  • Decide if you need to change the logic to simulate a staged elevator since we have one on the robot.
  • Shooter Pivot Sim
  • Combine the pivot sim to the elevator to mimic what we have physically. (called Ligaments in code)

Note deadzone + Logic with intake

  • Wait for new sensors and mechanical changes
  • add logics to intake transport and shooter for new sensors.
  • shooter is finished should be triggered by the last ir sensor

Verify Intake

  • Test that it works
  • make sure it spins the right way
  • add command for auto use

Test Auton Paths

  • 2 Piece Center
  • 2 Piece on either side
  • 4 Piece (clearing wing)
  • 3 Piece (clearing from center)
  • Push limits with 5? maybe 6? piece

Driver Joystick optimization

  • See this Spreadsheet: https://group.me/3A8XLlZvM5HtGI

  • Make a new copy with each stick/axis on a separate tab. Sweet spot (exponent) is identified in cell G2

  • Don't forget to divide the joystick input by its maximum input. Ex. Max of joystick is 0.6 and current value is 0.6. 0.6/0.6 is 1 which when given to code will give us maximum output

  • Make sure joystick values are positive and negative when they should be

Fix Manual Elevator Move

"Basically, when it goes all the way down, if bottom sensor triggered, entire system makes a loud noise and jerks up before settling down" - Akshay

I'm not sure exactly what this means so maybe talk to Akshay about this one

Cameras

  • See how many and where we want cameras
  • check with mentors about more info on this topic

LED enhancements

  • Run during auton
  • Use sensors to trigger indicators during auton
  • Flash green when intaking a note (normally should be brief)
  • Validate endgame lights
  • Test more thoroughly

Refactor ranging method and create JUnit

The ranging logic is an ideal candidate for a JUnit. Refactor the method / command to support automated unit testing.

May want to create an inner class to hold the pivot and speed values as a return type. Or, might make those fields on the object that a JUnit could access via getters. Lots of ways to do it, but most importantly, test with different odometry values (pass odometry as input). Ensure zero, out of range, equal to single row in table, between row 1 and 2, between row last - 1 and last, are covered.

LEDs

  • Establish new LED patterns and sequences
  • when shooter is aligned change color
  • when note in intaked change color
  • when auto driving during tele op
  • make important leds flash color to grab attention
  • update README

Turtle Mode for Driver

Slow drivetrain down while a button is held so driver can make fine adjustments.

  • Drive Speed slowdown
  • Angular Speed Slowdown
  • Bind to Controller

Add MathUtil.applyDeadband to cubic inputs, scale for limited travel on flight controller axes

Related to #73, need to add MathUtils.applyDeadband() to the cubic input enhancement.

Centered joysticks do not necessarily return a precise zero on both axes. WPILib supplies a method on MathUtils that will force a zero value when the input is within specified range around zero. It automatically scales the remaining number space between zero and 1.

See https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/math/MathUtil.html#applyDeadband(double,double).

We will need constants for each axis.

Additionally, the joystick maximums on the flight controllers do not necessary reach 1.0. We need to divide the axis by its maximum (more constants). See https://github.com/hackbots-3414/2023-Energize/blob/main/2023-Energize/src/main/java/frc/robot/RobotContainer.java#L91 for examples. 2023's 0.7 and 0.9 are probably still good but should be verified. Potentiometer-based joysticks are prone to wear.

Current Limits

Add current limits to drivetrain and all other motors. Drivetrain might already have code to do so.

Pickup from anywhere

  • Note detection using photon vision.
  • make drive to note command
  • check if pose is in the field
  • test
  • bind to button on driver controller

Auton Organization

  • Add choosers to elastic dashboard
  • Filter off number of pieces
  • starting position (Amp-side, middle, Source-side, other)

Individual Motor Control

Add individual motor control for motors related for transport to elastic. Mostly intake motors and transport motor.

Shoot from anywhere

  • add auto shoot from afar command
  • build paths around new commands
  • ensure that it works in various paths

Configure drivetrain for selective AprilTag updates to odometry

Configure drivetrain such that AprilTags can be turned off, turned on, and turned on just for shooting.

AprilTag updates to odometry field-wide are coming online late in testing, limiting the opportunity to identify problems. Configuring the drivetrain such that AprilTag enable / disable / shoot-only is visible on the dashboard and can be set by commands on the dashboard may be an important tool to mitigate risk.

One state is the quiet, on-the-fly update from anywhere AprilTags are visible. This is the desired target state.

Second is a total disable of AprilTag processing.

Third is normally disabled processing, with the shoot commands enabling AprilTag updates from just the Red or Blue alliance tag immediately under the speaker. As there are two tags there, processing is further restricted to read only one of them to permit accurate ranging. Once shooting completes, AprilTag updates turn completely off.

Commands on the dashboard can be used to toggle between states should Drive Team need to make adjustments on-the-fly.

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.