Skip to content
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

Superstructure #2

Merged
merged 22 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ java {
targetCompatibility = JavaVersion.VERSION_17
}

def ROBOT_MAIN_CLASS = "org.ghrobotics.frc2024"
def ROBOT_MAIN_CLASS = "org.ghrobotics.frc2024.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployUtils.
Expand Down
1 change: 1 addition & 0 deletions networktables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
92 changes: 92 additions & 0 deletions simgui-ds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"keyboardJoysticks": [
{
"axisConfig": [
{
"decKey": 65,
"incKey": 68
},
{
"decKey": 87,
"incKey": 83
},
{
"decKey": 69,
"decayRate": 0.0,
"incKey": 82,
"keyRate": 0.009999999776482582
}
],
"axisCount": 3,
"buttonCount": 4,
"buttonKeys": [
90,
88,
67,
86
],
"povConfig": [
{
"key0": 328,
"key135": 323,
"key180": 322,
"key225": 321,
"key270": 324,
"key315": 327,
"key45": 329,
"key90": 326
}
],
"povCount": 1
},
{
"axisConfig": [
{
"decKey": 74,
"incKey": 76
},
{
"decKey": 73,
"incKey": 75
}
],
"axisCount": 2,
"buttonCount": 4,
"buttonKeys": [
77,
44,
46,
47
],
"povCount": 0
},
{
"axisConfig": [
{
"decKey": 263,
"incKey": 262
},
{
"decKey": 265,
"incKey": 264
}
],
"axisCount": 2,
"buttonCount": 6,
"buttonKeys": [
260,
268,
266,
261,
269,
267
],
"povCount": 0
},
{
"axisCount": 0,
"buttonCount": 0,
"povCount": 0
}
]
}
10 changes: 10 additions & 0 deletions simgui.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"NTProvider": {
"types": {
"/FMSInfo": "FMSInfo"
}
},
"NetworkTables Info": {
"visible": true
}
}
2 changes: 2 additions & 0 deletions src/main/java/org/ghrobotics/frc2024/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

package org.ghrobotics.frc2024;


import edu.wpi.first.wpilibj.TimedRobot;


/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the name of this class or
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/ghrobotics/frc2024/Superstructure.java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.ghrobotics.frc2024;

public class Superstructure {

}
37 changes: 37 additions & 0 deletions src/main/java/org/ghrobotics/frc2024/commands/ArmToPosition.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.ghrobotics.frc2024.commands;

import edu.wpi.first.wpilibj2.command.Command;
import org.ghrobotics.frc2024.subsystems.Arm;

public class ArmToPosition extends Command {
// Subsystems
private final Arm arm_;

// Position
private final double position_;

// Constructor
public ArmToPosition(Arm arm, double position) {
// Assign member variables
arm_ = arm;
position_ = position;

// Add subsystem requirements
addRequirements(arm_);
}

@Override
public void initialize() {
arm_.setAngle(position_);
}

@Override
public boolean isFinished() {
return Math.abs(arm_.getAngle() - position_) < Constants.kTolerance;
}

// Constants
private static final class Constants {
public static final double kTolerance = 0; // NEED TO UPDATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final double kTolerance = 0; // NEED TO UPDATE
public static final double kTolerance = 0.5; // NEED TO UPDATE

}
}
Loading
Loading