Skip to content

Commit

Permalink
Release/state comp (#166)
Browse files Browse the repository at this point in the history
* Turn to an angle based on vision (#157)

* turn to an angle based on vision

* cleaned up

* Add PreScoreShuffle command

* Add logging

* tuning on bot

* auto scoring based on proximity

* Create AutoChooser

* Add entries and groups + a bug

* linter

* WORKING CHANGEABLE CHOOSER

* Make linter happy (again)

* add TODOs

* fix stuff

* intake mostly working

* maybe this is how to rotate?

* area threshold

* add remaining autos to chooser

* bind climbers and auto-score toggle to POV up/down

* more than one way to test things

* feed

* avoid bad stuff

* Update vendor deps and split pre score shuffle into multiple commands

* Use scoring shuffling commands in intake

* working feeding

* fix subwoofer shot

* working turn to note in sim

* Split constants into their own files

* linter

* more led patterns

* ramping = false if disabled auto scoring

* ignore sim ctre stuff

* stuffnthings

* debounce intake

* AAA EVERYTHING IS BROKEN

* uhhh

* intake in auto fixed

* auto actually fixed

* fixture locations

* Remove ramping and only use score

* Add tags to an auto and fix paths

* Don't ramp when in zone and more climbing distance

* autos tuned

* address comments about constants

---------

Co-authored-by: 5690 <[email protected]>

* Show multiple vision targets simultaneously (#161)

* show multiple vision targets simultaneously

* linter

* Don't mark explicit

* add comment

* fix drivebase width length

* pathplanner pid good enough

* Documentation for state, removal of unused code (#163)

* Remove unused command compositions, document commands

* More documentation

* Add remaining LED entries to README

---------

Co-authored-by: 5690 <[email protected]>
Co-authored-by: having11 <[email protected]>

* make build

* Simp Auto

* Remove Climbing Limits when Enabled and Add the Real OwO Binding (#165)

* Add ability to remove limits on climbing in shuffleboard

* Slow down amp arm speed

* Make auto factory generic

* bind the real OwO

* linter

* cleanup

---------

Co-authored-by: Evan Rust <[email protected]>
Co-authored-by: 5690 <[email protected]>
Co-authored-by: having11 <[email protected]>
  • Loading branch information
4 people authored May 10, 2024
1 parent 7af2a78 commit 2771834
Show file tree
Hide file tree
Showing 80 changed files with 2,235 additions and 1,261 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ logs
*.tar.gz
*.rar

ctre_sim/*.dat

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

Expand Down
219 changes: 156 additions & 63 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions elastic-layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1.0,"grid_size":40,"tabs":[{"name":"Competition","grid_layout":{"layouts":[],"containers":[{"title":"Auto Modes","x":600.0,"y":280.0,"width":240.0,"height":120.0,"type":"ComboBox Chooser","properties":{"topic":"/SmartDashboard/Auto Modes","period":0.06,"sort_options":false}},{"title":"Field","x":0.0,"y":0.0,"width":600.0,"height":400.0,"type":"Field","properties":{"topic":"/SmartDashboard/Field","period":0.06,"field_game":"Crescendo","robot_width":0.85,"robot_length":0.85,"show_other_objects":true,"show_trajectories":true}},{"title":"Has Note","x":600.0,"y":0.0,"width":240.0,"height":160.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Has Note","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"HAS TARGET LOCK","x":1080.0,"y":160.0,"width":200.0,"height":120.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/HAS TARGET LOCK","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"FMSInfo","x":840.0,"y":0.0,"width":440.0,"height":160.0,"type":"FMSInfo","properties":{"topic":"/FMSInfo","period":0.06}},{"title":"Rear Left Motor","x":840.0,"y":280.0,"width":120.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Rear Left Motor","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Rear Right Motor","x":960.0,"y":280.0,"width":120.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Rear Right Motor","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Front Left Motor","x":840.0,"y":160.0,"width":120.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Front Left Motor","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Front Right Motor","x":960.0,"y":160.0,"width":120.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Front Right Motor","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Proximity","x":720.0,"y":160.0,"width":120.0,"height":120.0,"type":"ComboBox Chooser","properties":{"topic":"/SmartDashboard/Proximity","period":0.06,"sort_options":false}},{"title":"aimbot enabled","x":1080.0,"y":280.0,"width":200.0,"height":120.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/aimbot enabled","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note Count","x":600.0,"y":160.0,"width":120.0,"height":120.0,"type":"ComboBox Chooser","properties":{"topic":"/SmartDashboard/Note Count","period":0.06,"sort_options":false}}]}},{"name":"Axies","grid_layout":{"layouts":[],"containers":[{"title":"Arm Reset Encoder","x":0.0,"y":0.0,"width":400.0,"height":120.0,"type":"Command","properties":{"topic":"/SmartDashboard/Arm Reset Encoder","period":0.06,"show_type":true}},{"title":"Left Climber Reset Encoder","x":440.0,"y":0.0,"width":400.0,"height":120.0,"type":"Command","properties":{"topic":"/SmartDashboard/Left Climber Reset Encoder","period":0.06,"show_type":true}},{"title":"Right Climber Reset Encoder","x":880.0,"y":0.0,"width":400.0,"height":120.0,"type":"Command","properties":{"topic":"/SmartDashboard/Right Climber Reset Encoder","period":0.06,"show_type":true}},{"title":"Arm Absolute Position","x":0.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Arm Absolute Position","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Arm At Max","x":200.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Arm At Max","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Arm At Min","x":0.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Arm At Min","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Arm Pid Enabled","x":0.0,"y":320.0,"width":400.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Arm Pid Enabled","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Arm Speed %","x":200.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Arm Speed %","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Left Climber At Max","x":640.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Left Climber At Max","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Left Climber At Min","x":440.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Left Climber At Min","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Left Climber Pid Enabled","x":440.0,"y":320.0,"width":400.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Left Climber Pid Enabled","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Left Climber Position","x":440.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Left Climber Position","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Left Climber Speed %","x":640.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Left Climber Speed %","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Right Climber At Max","x":1080.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Right Climber At Max","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Right Climber At Min","x":880.0,"y":240.0,"width":200.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Right Climber At Min","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Right Climber Pid Enabled","x":880.0,"y":320.0,"width":400.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Right Climber Pid Enabled","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Right Climber Position","x":880.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Right Climber Position","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"Right Climber Speed %","x":1080.0,"y":120.0,"width":200.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/Right Climber Speed %","period":0.06,"data_type":"double","show_submit_button":false}}]}},{"name":"Intake","grid_layout":{"layouts":[],"containers":[{"title":"Note present Lower center ","x":240.0,"y":160.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present Lower center ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note present lower amp ","x":480.0,"y":240.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present lower amp ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note present lower podium ","x":0.0,"y":240.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present lower podium ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note present upper amp ","x":480.0,"y":0.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present upper amp ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note present upper center ","x":240.0,"y":80.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present upper center ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Note present upper podium ","x":0.0,"y":0.0,"width":240.0,"height":80.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Note present upper podium ","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"Has Note","x":760.0,"y":80.0,"width":240.0,"height":160.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/Has Note","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}}]}},{"name":"Pathplanner","grid_layout":{"layouts":[],"containers":[{"title":"Field","x":0.0,"y":0.0,"width":760.0,"height":400.0,"type":"Field","properties":{"topic":"/SmartDashboard/Field","period":0.06,"field_game":"Crescendo","robot_width":0.85,"robot_length":0.85,"show_other_objects":true,"show_trajectories":true}},{"title":"TURN TO ANGLE relative target deg","x":1000.0,"y":0.0,"width":280.0,"height":120.0,"type":"Text Display","properties":{"topic":"/SmartDashboard/TURN TO ANGLE relative target deg","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"TURN TO POSE AT GOAL","x":1000.0,"y":120.0,"width":280.0,"height":120.0,"type":"Boolean Box","properties":{"topic":"/SmartDashboard/TURN TO POSE AT GOAL","period":0.06,"data_type":"boolean","true_color":4283215696,"false_color":4294198070}},{"title":"activePath","x":760.0,"y":240.0,"width":240.0,"height":160.0,"type":"Text Display","properties":{"topic":"/PathPlanner/activePath","period":0.06,"data_type":"double[]","show_submit_button":false}},{"title":"currentPose","x":760.0,"y":0.0,"width":240.0,"height":120.0,"type":"Text Display","properties":{"topic":"/PathPlanner/currentPose","period":0.06,"data_type":"double[]","show_submit_button":false}},{"title":"inaccuracy","x":1000.0,"y":240.0,"width":160.0,"height":160.0,"type":"Text Display","properties":{"topic":"/PathPlanner/inaccuracy","period":0.06,"data_type":"double","show_submit_button":false}},{"title":"targetPose","x":760.0,"y":120.0,"width":240.0,"height":120.0,"type":"Text Display","properties":{"topic":"/PathPlanner/targetPose","period":0.06,"data_type":"double[]","show_submit_button":false}},{"title":"vel","x":1160.0,"y":240.0,"width":120.0,"height":160.0,"type":"Text Display","properties":{"topic":"/PathPlanner/vel","period":0.06,"data_type":"double[]","show_submit_button":false}}]}}]}
6 changes: 4 additions & 2 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ void Robot::RobotInit() {
frc::DataLogManager::Start();

// Logs joystick data without hogging NT bandwidth
// *May* tax the rio, should be tested
frc::DriverStation::StartDataLog(frc::DataLogManager::GetLog());
m_container.Initialize();
}
Expand All @@ -38,7 +37,10 @@ void Robot::RobotInit() {
* <p> This runs after the mode specific periodic functions, but before
* LiveWindow and SmartDashboard integrated updating.
*/
void Robot::RobotPeriodic() { frc2::CommandScheduler::GetInstance().Run(); m_container.Periodic(); }
void Robot::RobotPeriodic() {
frc2::CommandScheduler::GetInstance().Run();
m_container.Periodic();
}

/**
* This function is called once each time the robot enters Disabled mode. You
Expand Down
Loading

0 comments on commit 2771834

Please sign in to comment.