Git Product home page Git Product logo

pyrapidreact's Introduction

pyrapidreact

The Drop Bears' robot code for FIRST Rapid React (FRC 2022).

Install dependencies

On a computer

With pipenv:

pipenv install

With plain pip:

pip3 install -r requirements-sim.txt

For the roboRIO

# Online:
robotpy-installer download-python
robotpy-installer download -r requirements.txt

# On the robot network:
robotpy-installer install-python
robotpy-installer install -r requirements.txt

pre-commit

This project has pre-commit.com set up.

Code style

This codebase adheres to the code style enforced by the black autoformatter:

black .

This is enforced by CI. To install this:

pip3 install black

See PEP 8 on naming conventions.

Docstrings should follow Google style. See also PEP 257.

Run

Simulation (desktop)

./robot.py sim

Deploy to robot

./robot.py deploy

This project is configured to automatically deploy to 4774's robot.

pyrapidreact's People

Contributors

atomic-gong avatar auscompgeek avatar james-ward avatar lucienmorey avatar oliverw10 avatar pre-commit-ci[bot] avatar whert-dev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kenwoodfox

pyrapidreact's Issues

requrements.txt broken

ERROR: Cannot install -r requirements.txt (line 2), -r requirements.txt (line 3), -r requirements.txt (line 4), -r requirements.txt (line 5) and wpilib~=2022.2.1 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested wpilib~=2022.2.1
robotpy-ctre 2022.0.2 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-navx 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-rev 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-wpilib-utilities 2020.0.3 depends on wpilib<2021.0.0 and >=2020.1.2.1
The user requested wpilib~=2022.2.1
robotpy-ctre 2022.0.2 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-navx 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-rev 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-wpilib-utilities 2020.0.2 depends on wpilib<2021.0.0 and >=2020.1.2.1
The user requested wpilib~=2022.2.1
robotpy-ctre 2022.0.2 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-navx 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-rev 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-wpilib-utilities 2020.0.1 depends on wpilib<2021.0.0 and >=2020.1.2.1
The user requested wpilib~=2022.2.1
robotpy-ctre 2022.0.2 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-navx 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-rev 2022.0.0 depends on wpilib<2023.0.0 and >=2022.2.1.0
robotpy-wpilib-utilities 2020.0.0 depends on wpilib<2021.0.0 and >=2020.1.2.1

Intake/indexer functionality

  • Driver input deploys intake and starts it running
    • Driver input should be toggle so that the intake can be retracted if driver changes mind
  • Indexer runs while intaking until ball is detected in indexer
    • Stop indexer when ball detected
    • Briefly reverse intake when ball detected
    • Retract intake when ball detected
  • Check ball colour in indexer
    • If incorrect colour -> reverse indexer and reject ball
  • Driver input triggers indexer to run and inject ball into shooter

Add LED status for drivers

Add addressable LEDs that let the drive team know what state the robot is in.

All LEDs should be the same colour so that their placement on the robot is not constrained in any way.

Suggested patterns:

  • Too close to goal -> red
  • Too far away -> blue
  • Ready to fire -> green
  • No cargo -> flashing
  • Auto-fire mode -> slow pulse

In order to write this software:

  1. Create a new component. Create methods to make it do various things, e.g. pulse(colour) etc. Do the pulsing in the execute() method.
  2. Create a new controller. This should have the LED component from above as a member, along with whatever else it needs to know the status of. In its execute() method it will check on the various systems and update the lighting code according to the robot status.

Add swerve drive control

At the moment we know that we will be using:

  • two Falcons for each module - one for drive and one for steer
  • a CANcoder for initialising the absolute position of the module

Fix shooter speed tuning

In Hawaii Qualifier 38 (https://github.com/thedropbears/pyrapidreact/releases/tag/hawaii-q38) we changed the shooter speed from being a will_reset_to to just a regular float. This made the shooter flywheels go completely haywire. This was reverted in the next match (https://github.com/thedropbears/pyrapidreact/releases/tag/hawaii-q43) and everything worked again.

There is some sort of bug here, and we have been relying on this behaviour all season. Suggest we work out what it is, and retune the shooter so that it is working properly.

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.