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.
started pid (oliver kingsley add a remote from this)
- Loading branch information
Showing
47 changed files
with
662 additions
and
656 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 +1,6 @@ | ||
* text=auto | ||
*.sh text eol=lf | ||
*.bat text eol=crlf | ||
*.gradle text eol=lf | ||
*.java text eol=lf | ||
*.json text eol=lf | ||
|
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,4 +1,3 @@ | ||
|
||
cppHeaderFileInclude { | ||
\.h$ | ||
\.hpp$ | ||
|
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// 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 | ||
|
||
#include "AlphaArm.h" | ||
|
||
AlphaArm::AlphaArm(AlphaArmConfig config) : _config(config) {} | ||
|
||
AlphaArmConfig AlphaArm::GetConfig() { | ||
return _config; | ||
} | ||
|
||
void AlphaArm::OnUpdate(units::second_t dt) { | ||
switch (_state) { | ||
case AlphaArmState::kIdle: | ||
|
||
// _config.alphaArmGearbox.motorController->SetVoltage(0_V); | ||
// _config.wristGearbox.motorController->SetVoltage(0_V); | ||
_setAlphaArmVoltage = 0_V; | ||
_setWristVoltage = 0_V; | ||
|
||
break; | ||
case AlphaArmState::kRaw: | ||
_setAlphaArmVoltage = _rawArmVoltage; | ||
_setWristVoltage = _rawWristVoltage; | ||
_config.alphaArmGearbox.motorController->SetVoltage(_rawArmVoltage); | ||
_config.wristGearbox.motorController->SetVoltage(_rawWristVoltage); | ||
|
||
break; | ||
case AlphaArmState::kForwardWrist: | ||
_config.wristGearbox.motorController->SetVoltage(3_V); | ||
_setWristVoltage = 3_V; | ||
|
||
case AlphaArmState::kReverseWrist: | ||
_config.wristGearbox.motorController->SetVoltage(-3_V); | ||
_setWristVoltage = -3_V; | ||
default: | ||
std::cout << "oops, wrong state" << std::endl; | ||
break; | ||
} | ||
// transmission translate | ||
// _config.armGearBox.motorController->SetVoltage(setAlphaArmVoltage); | ||
// _config.alphaArmGearbox.motorController->SetVoltage(setAlphaArmVoltage); | ||
// _config.wristGearbox.motorController->SetVoltage(setWristVoltage); | ||
_config.alphaArmGearbox.motorController->SetVoltage(_setAlphaArmVoltage); | ||
_config.wristGearbox.motorController->SetVoltage(_setWristVoltage); | ||
|
||
// _config.wristGearbox.motorController->SetVoltage(_setVoltage); | ||
} | ||
|
||
void AlphaArm::SetState(AlphaArmState state) { | ||
_state = state; | ||
} | ||
|
||
// void AlphaArm::SetRaw(units::volt_t voltage){ | ||
// _rawArmVoltage = voltage; | ||
// _rawWristVoltage = voltage; | ||
// } | ||
|
||
void AlphaArm::SetArmRaw(units::volt_t voltage) { | ||
_rawArmVoltage = voltage; | ||
} | ||
|
||
void AlphaArm::setWristRaw(units::volt_t voltage) { | ||
_rawWristVoltage = voltage; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// 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 | ||
|
||
#include "AlphaArmBehaviour.h" | ||
|
||
#include <frc/XboxController.h> | ||
|
||
AlphaArmManualControl::AlphaArmManualControl(AlphaArm* alphaArm, frc::XboxController* codriver) | ||
: _alphaArm(alphaArm), _codriver(codriver) { | ||
Controls(alphaArm); | ||
} | ||
|
||
void AlphaArmManualControl::OnTick(units::second_t dt) { | ||
if (_codriver->GetXButtonPressed()) { | ||
if (_rawControl == true) { | ||
_rawControl = false; | ||
} else { | ||
_rawControl = true; | ||
} | ||
} | ||
|
||
if (_rawControl) { | ||
_alphaArm->SetState(AlphaArmState::kRaw); | ||
_alphaArm->SetArmRaw(_codriver->GetRightY() * 6_V); | ||
_alphaArm->setWristRaw(_codriver->GetLeftY() * -6_V); | ||
} else { | ||
if (_codriver->GetRightBumperPressed()) { | ||
_alphaArm->SetState(AlphaArmState::kForwardWrist); | ||
} | ||
if (_codriver->GetLeftBumperPressed()) { | ||
_alphaArm->SetState(AlphaArmState::kReverseWrist); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.