-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/actual claw #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat/actual claw #37
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
17d2885
added hardware files
b8d2f6e
changed names of motors
b64846a
defined
d0d54e7
labeled buttons
2a914ec
arm sw, hw, cpp, and IO
ce32b48
changed file names
AbbeySieg dcc6c2d
renamed more files
AbbeySieg e277766
added swerve drive to branch
AbbeySieg 72adfe6
changed hw, actua, and sen names
7db2094
changed names
e9bf872
it's being weird
db16ef7
test commit
X-EX3-X 91016a4
functions added I think
X-EX3-X c15cb65
last changes for 1-21-23, added parameter,util
X-EX3-X b7b9314
I update the hardware and software interfaces
8e06a1e
I changed the software and hardware interfaces and I defined function…
c102f34
Merge branch 'feat/actual_claw' of https://github.com/Team-OKC-Roboti…
d43dd10
fleshed out claw subsystem
df6ec31
Merge branch 'master' into feat/actual_claw
f8333d7
IT WORKSSSS EVERYTHING WORKSSSSSSSSSSSSSSS
b2d58fb
fixed include error, added Reset() to claw
69e94f8
The changes Justin asked for
X-EX3-X 4fa5a99
final changes i think
X-EX3-X 3e6ad25
fixed errors
X-EX3-X 9203b9e
Merge branch 'master' into feat/actual_claw
X-EX3-X 0ee8017
final changes hopefully
X-EX3-X dfabc38
changing the #include
X-EX3-X b705eca
solving the case errors
X-EX3-X 3a3b2f5
removed claw files for fix
X-EX3-X b3e2f7a
added files back
X-EX3-X ec4a031
change backwards slash to a forwards slash because maybe that's makin…
danielbrownmsm 4ae2d05
fix backward->forward slash in ClawIO.cpp
danielbrownmsm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ namespace TeamOKC { | |
| return true; | ||
| } | ||
| } // namespace TeamOKC | ||
|
|
||
This file contains hidden or 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,30 @@ | ||
|
|
||
| #include "io/ClawIO.h" | ||
|
|
||
| void ClawIO::Periodic() { | ||
| // Process all the inputs and outputs to/from high level software. | ||
| VOKC_CALL(ProcessIO()); | ||
| } | ||
|
|
||
| void ClawIO::SimulationPeriodic() { | ||
| // SimulationPeriodic | ||
| } | ||
|
|
||
| bool ClawIO::ProcessIO() { | ||
| OKC_CHECK(sw_interface_ != nullptr); | ||
| OKC_CHECK(hw_interface_ != nullptr); | ||
| OKC_CHECK(hw_interface_->claw_open_and_close_encoder != nullptr); | ||
|
|
||
| // Set the software outputs | ||
| // If the encoder should be reset, reset it | ||
| if (sw_interface_->reset_claw_open_and_close) { | ||
| hw_interface_->claw_open_and_close_encoder->SetPosition (0); | ||
| // Lower the encoder reset flag | ||
| sw_interface_->reset_claw_open_and_close = false; | ||
| } | ||
| hw_interface_->claw_open_and_close_motor->Set(sw_interface_->claw_open_and_close_power); | ||
| sw_interface_->encoder_reading = hw_interface_->claw_open_and_close_encoder->GetPosition(); | ||
|
|
||
| return true; | ||
| } | ||
|
|
This file contains hidden or 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,27 @@ | ||
| #include "subsystems/Claw.h" | ||
|
|
||
| bool Claw::Init(){ | ||
| return true; | ||
| } | ||
|
|
||
| bool Claw::ResetPositionEncoder(){ | ||
| return true; | ||
| } | ||
| bool Claw::ResetPositionPID(){ | ||
| return true; | ||
| } | ||
| bool Claw::SetPosition(){ | ||
| // SetPosition (30); //cone | ||
| // SetPosition (0); //close | ||
| // SetPosition (50);//cube | ||
| return true; | ||
| } | ||
| bool Claw::Reset(){ | ||
| return true; | ||
| } | ||
| void Claw::Periodic(){ | ||
| return; | ||
| } | ||
| void Claw::SimulationPeriodic(){ | ||
| return; | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -26,3 +26,4 @@ namespace RobotParams { | |
| return true; | ||
| } | ||
| } // namespace RobotParams | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,6 +1,5 @@ | ||
| #pragma once | ||
|
|
||
|
|
||
| #include <frc/motorcontrol/MotorControllerGroup.h> | ||
|
|
||
| #include "hardware/Actuators.h" | ||
|
|
||
This file contains hidden or 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 hidden or 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,52 @@ | ||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| #include <frc/motorcontrol/MotorControllerGroup.h> | ||
| #include <frc2/command/SubsystemBase.h> | ||
| #include <frc/DigitalInput.h> | ||
| #include <rev/CANSparkMax.h> | ||
|
|
||
| #include "Utils.h" | ||
|
|
||
|
|
||
| typedef struct claw_config_t { | ||
|
|
||
| } ClawConfig; | ||
|
|
||
| typedef struct claw_hardware_interface_t { | ||
| rev::CANSparkMax *const claw_open_and_close_motor; | ||
| rev::SparkMaxRelativeEncoder *const claw_open_and_close_encoder; | ||
| } ClawHardware; | ||
|
|
||
| typedef struct claw_software_interface_t { | ||
|
|
||
| // actuator outputs | ||
| double claw_open_and_close_power; | ||
| double encoder_reading; | ||
| bool reset_claw_open_and_close; | ||
| } ClawSoftware; | ||
|
|
||
| class ClawIO : public frc2::SubsystemBase { | ||
| public: | ||
| ClawIO(ClawHardware *hw_interface, | ||
| ClawSoftware *sw_interface) | ||
| : hw_interface_(hw_interface), sw_interface_(sw_interface) {} | ||
|
|
||
| /** | ||
| * Will be called periodically whenever the CommandScheduler runs. | ||
| */ | ||
| void Periodic() override; | ||
|
|
||
| /** | ||
| * Will be called periodically whenever the CommandScheduler runs during | ||
| * simulation. | ||
| */ | ||
| void SimulationPeriodic() override; | ||
|
|
||
| bool ProcessIO(); | ||
|
|
||
| private: | ||
| ClawHardware *const hw_interface_; | ||
| ClawSoftware *const sw_interface_; | ||
| }; |
This file contains hidden or 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,39 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <frc2/command/SubsystemBase.h> | ||
|
|
||
| class Claw : public frc2::SubsystemBase { | ||
| public: | ||
| Claw(); | ||
| ~Claw(); | ||
|
|
||
| bool Init(); | ||
|
|
||
| bool ResetPositionEncoder(); | ||
| bool ResetPositionPID(); | ||
|
|
||
| bool SetPosition(); | ||
| bool Reset(); | ||
|
|
||
| /** | ||
| * Will be called periodically whenever the CommandScheduler runs. | ||
| */ | ||
| void Periodic() override; | ||
|
|
||
| /** | ||
| * Will be called periodically whenever the CommandScheduler runs during | ||
| * simulation. | ||
| */ | ||
| void SimulationPeriodic() override; | ||
|
|
||
| private: | ||
| // Components (e.g. motor controllers and sensors) should generally be | ||
| // declared private and exposed only through public methods. | ||
|
|
||
| }; | ||
|
|
||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, really this PR has no functionality, but at least getting the framework is something