Skip to content

Commit

Permalink
Photonvision 2022 got deleted, full manual for demos
Browse files Browse the repository at this point in the history
  • Loading branch information
secmancer committed Jan 8, 2025
1 parent 0140746 commit 26ca45e
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 863 deletions.
28 changes: 1 addition & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id "cpp"
id "google-test-test-suite"
id "edu.wpi.first.GradleRIO" version "2022.4.1"
id "org.ysb33r.doxygen" version "0.7.0"
}

// For using remote development artifacts
Expand Down Expand Up @@ -205,29 +204,4 @@ task testRelease {
task intellisense(type: Exec) {
dependsOn 'generateCompileCommands'
commandLine 'python3', './buildscripts/copy_compile_commands.py'
}

doxygen {
executables {
doxygen version : '1.9.2',
baseURI : 'https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen'
}

exclude 'frc/*'
exclude 'photonlib/*'

extension_mapping 'inc=C++'
generate_html true
generate_latex false
generate_treeview true
html_extra_stylesheet 'docs/theme.css'
html_timestamp true
quiet true
project_name 'Robot-2022'
use_mathjax true
warn_as_error 'FAIL_ON_WARNINGS'
warn_if_undocumented true

source 'src/main/include'
outputDir 'build/docs/'
}
}
48 changes: 7 additions & 41 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ Robot::Robot() : frc::TimesliceRobot{2_ms, Constants::kControllerPeriod} {
// dashboard plots
SetNetworkTablesFlushEnabled(true);

// AUTONOMOUS MODES
m_autonChooser.AddAutonomous("Drive Backwards", [=] { AutoBackwards(); });
m_autonChooser.AddAutonomous("Shoot One", [=] { AutoShootOne(); });
m_autonChooser.AddAutonomous("Shoot Two", [=] { AutoShootTwo(); });
m_autonChooser.AddAutonomous("Shoot Three", [=] { AutoShootThree(); });
m_autonChooser.AddAutonomous("Shoot Four", [=] { AutoShootFour(); });

// TIMESLICE ALLOCATION TABLE
//
Expand Down Expand Up @@ -113,10 +107,6 @@ Robot::Robot() : frc::TimesliceRobot{2_ms, Constants::kControllerPeriod} {
if constexpr (!IsSimulation()) {
frc::CameraServer::StartAutomaticCapture().SetResolution(160, 120);
}

vision.SubscribeToVisionData(drivetrain.visionQueue);
vision.SubscribeToVisionData(backFlywheel.visionQueue);
vision.SubscribeToVisionData(frontFlywheel.visionQueue);
}

Robot::~Robot() {}
Expand Down Expand Up @@ -197,16 +187,16 @@ void Robot::TeleopPeriodic() {
}
} else {
if (driveStick2.GetRawButtonPressed(1)) {
Shoot(FrontFlywheelConstants::kShootHighTarmac,
BackFlywheelConstants::kShootHighTarmac, true);
Shoot(FrontFlywheelConstants::kShootHighFender,
BackFlywheelConstants::kShootHighFender);
}
if (driveStick1.GetRawButtonPressed(1)) {
Shoot(FrontFlywheelConstants::kShootHighTarmac,
BackFlywheelConstants::kShootHighTarmac);
}
if (driveStick1.GetRawButtonPressed(4)) {
Shoot(FrontFlywheelConstants::kShootHighTarmac,
BackFlywheelConstants::kShootHighTarmac, false, true);
Shoot(FrontFlywheelConstants::kShootLow,
BackFlywheelConstants::kShootLow);
}
}

Expand Down Expand Up @@ -275,24 +265,16 @@ void Robot::ExpectAutonomousEndConds() {
bool Robot::IsShooting() const { return m_state != ShootingState::kIdle; }

void Robot::Shoot(units::radians_per_second_t frontSpeed,
units::radians_per_second_t backSpeed, bool visionAim,
bool shootWithRange) {
units::radians_per_second_t backSpeed) {
if (m_state == ShootingState::kIdle) {
frontFlywheel.SetGoal(frontSpeed);
backFlywheel.SetGoal(backSpeed);

m_shootTimer.Reset();
m_shootTimer.Stop();

m_visionAim = visionAim;
m_shootWithRange = shootWithRange;
if (!m_visionAim && m_shootWithRange) {
m_state = ShootingState::kVisionSpinUp;
} else if (m_visionAim && !m_shootWithRange) {
m_state = ShootingState::kVisionAim;
} else {
m_state = ShootingState::kSpinUp;
}

m_state = ShootingState::kSpinUp;
}
}

Expand All @@ -303,22 +285,6 @@ void Robot::RunShooterSM() {
switch (m_state) {
case ShootingState::kIdle:
break;
case ShootingState::kVisionAim:
drivetrain.AimWithVision();
m_state = ShootingState::kVisionSpinUp;
break;
case ShootingState::kVisionSpinUp:
if constexpr (IsSimulation()) {
m_state = ShootingState::kSpinUp;
} else {
if (vision.HaveTargets() ||
(m_shootWithRange && ReadyToShoot())) {
frontFlywheel.SetGoalFromRange(true);
backFlywheel.SetGoalFromRange(true);
m_state = ShootingState::kSpinUp;
}
}
break;
case ShootingState::kSpinUp:
if (frontFlywheel.IsReady() && backFlywheel.IsReady()) {
if ((m_visionAim && drivetrain.AtVisionTarget()) ||
Expand Down
25 changes: 0 additions & 25 deletions src/main/cpp/autonomous/AutoBackwards.cpp

This file was deleted.

125 changes: 0 additions & 125 deletions src/main/cpp/autonomous/AutoShootFour.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/cpp/autonomous/AutoShootOne.cpp

This file was deleted.

Loading

0 comments on commit 26ca45e

Please sign in to comment.