Skip to content

Commit

Permalink
add a simple scheduling example
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Feb 11, 2024
1 parent 02cd628 commit ebec657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <frc/controller/RamseteController.h>
#include <frc/Timer.h>
#include "behaviour/HasBehaviour.h"
#include "drivetrain/behaviours/SwerveBehaviours.h"

static units::second_t lastPeriodic;

Expand Down Expand Up @@ -143,10 +144,8 @@ void Robot::TeleopInit() {
// alphaArm->OnStart();
sched->InterruptAll();

// frontLeft->SetVoltage(4_V);
// frontRight->SetVoltage(4_V);
// backLeft->SetVoltage(4_V);
// backRight->SetVoltage(4_V);
robotmap.controllers.triggerDriver->XButton()->SetTrueBehaviour(
wom::make<wom::DrivebasePoseBehaviour>(_swerveDrive, frc::Pose2d(1_m, 0_m, frc::Rotation2d(0_rad))));
}
void Robot::TeleopPeriodic() {}

Expand Down
2 changes: 2 additions & 0 deletions src/main/include/RobotMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Intake.h"
#include "Shooter.h"
#include "Wombat.h"
#include "behaviour/TriggerXboxController.h"
#include "utils/Encoder.h"
#include "utils/PID.h"

Expand All @@ -33,6 +34,7 @@ struct RobotMap {
frc::XboxController driver = frc::XboxController(0);
frc::XboxController codriver = frc::XboxController(1);
frc::XboxController testController = frc::XboxController(2);
wom::TriggerXboxController* triggerDriver = new wom::TriggerXboxController(0);
};
Controllers controllers;

Expand Down

0 comments on commit ebec657

Please sign in to comment.