forked from CurtinFRC/2024-Crescendo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
338 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
#include "Robot.h" | ||
#include "Wombat.h" | ||
|
||
WOMBAT_ROBOT_MAIN(Robot); | ||
WOMBAT_ROBOT_MAIN(Robot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
// Copyright (c) 2023-2024 CurtinFRC | ||
// Open Source Software, you can modify it according to the terms | ||
// of the MIT License at the root of this project | ||
|
||
#pragma once | ||
|
||
#include "Wombat.h" | ||
#include "Climber.h" | ||
#include <frc/XboxController.h> | ||
|
||
#include "Climber.h" | ||
#include "Wombat.h" | ||
|
||
class ClimberManualControl : public behaviour::Behaviour { | ||
public: | ||
explicit ClimberManualControl(Climber *climber, frc::XboxController *codriver); | ||
void OnTick(units::second_t dt) override; | ||
private: | ||
Climber *_climber; | ||
frc::XboxController *_codriver; | ||
bool _rawControl = false; | ||
}; | ||
public: | ||
explicit ClimberManualControl(Climber* climber, frc::XboxController* codriver); | ||
void OnTick(units::second_t dt) override; | ||
|
||
private: | ||
Climber* _climber; | ||
frc::XboxController* _codriver; | ||
bool _rawControl = false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
// Copyright (c) 2023-2024 CurtinFRC | ||
// Open Source Software, you can modify it according to the terms | ||
// of the MIT License at the root of this project | ||
|
||
#pragma once | ||
|
||
#include "Wombat.h" | ||
#include <string> | ||
#include <memory> | ||
#include <string> | ||
|
||
#include "Wombat.h" | ||
|
||
struct ClimberConfig { | ||
wom::Gearbox climberGearbox; | ||
}; | ||
|
||
enum class ClimberState { | ||
kIdle, | ||
kRaw, | ||
kClimb, | ||
kHang | ||
}; | ||
enum class ClimberState { kIdle, kRaw, kClimb, kHang }; | ||
|
||
class Climber : public behaviour::HasBehaviour { | ||
public: | ||
explicit Climber(ClimberConfig config); | ||
|
||
void OnUpdate(units::second_t dt); | ||
void SetState(ClimberState state); | ||
void SetRaw(units::volt_t voltage); | ||
private: | ||
ClimberConfig _config; | ||
ClimberState _state = ClimberState::kIdle; | ||
units::volt_t _rawVoltage = 0_V; | ||
std::string _stringStateName = "error"; | ||
units::volt_t _setVoltage; | ||
std::shared_ptr<nt::NetworkTable> _table = nt::NetworkTableInstance::GetDefault().GetTable("Climber"); | ||
}; | ||
public: | ||
explicit Climber(ClimberConfig config); | ||
|
||
void OnUpdate(units::second_t dt); | ||
void SetState(ClimberState state); | ||
void SetRaw(units::volt_t voltage); | ||
|
||
private: | ||
ClimberConfig _config; | ||
ClimberState _state = ClimberState::kIdle; | ||
units::volt_t _rawVoltage = 0_V; | ||
std::string _stringStateName = "error"; | ||
units::volt_t _setVoltage; | ||
std::shared_ptr<nt::NetworkTable> _table = nt::NetworkTableInstance::GetDefault().GetTable("Climber"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.