Skip to content

Commit

Permalink
fix remaining lining
Browse files Browse the repository at this point in the history
  • Loading branch information
legoguy1000 committed Oct 28, 2024
1 parent 8d3e236 commit dfca4e0
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
23 changes: 14 additions & 9 deletions src/main/java/frc/lib/sim/SimulatedArena.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ private static class ShotNote {
/**
* Shooting Note
*
* @param startPose
* @param yaw
* @param pitch
* @param velocity
* @param startPose Starting Pose
* @param yaw Yaw
* @param pitch Pitch
* @param velocity Velocity
*/
public ShotNote(Pose3d startPose, Rotation2d yaw, Rotation2d pitch, double velocity) {
this.pose = startPose;
Expand Down Expand Up @@ -81,6 +81,11 @@ public void update(double dt) {
.collect(Collectors.toList());
public List<ShotNote> shotNotes = new ArrayList<>();

/**
* Create a new simulated robot
*
* @return Simulated Robot
*/
public SimulatedPumbaa newPumbaa() {
SimulatedPumbaa dt = new SimulatedPumbaa(this.id++);
robots.add(dt);
Expand All @@ -90,7 +95,7 @@ public SimulatedPumbaa newPumbaa() {
/**
* Update Viz
*
* @param dt
* @param dt Chnage in time

Check failure on line 98 in src/main/java/frc/lib/sim/SimulatedArena.java

View workflow job for this annotation

GitHub Actions / Spell Check

Chnage ==> Change
*/
public void update(double dt) {
robots: for (SimulatedPumbaa robot : this.robots) {
Expand Down Expand Up @@ -127,10 +132,10 @@ public void update(double dt) {
/**
* Shoot note
*
* @param pose
* @param yaw
* @param pitch
* @param velocity
* @param pose Shooting Pose
* @param yaw Shooting Yaw
* @param pitch Shooting Pitch
* @param velocity Shooting Velocity
*/
void shootNote(Pose3d pose, Rotation2d yaw, Rotation2d pitch, double velocity) {
this.shotNotes.add(new ShotNote(pose, yaw, pitch, velocity));
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/frc/lib/sim/SimulatedPumbaa.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public void intakeOneNote() {
this.hasNote = true;
}

/**
* Get Shot Pose
*
* @return Pose shooting from
*/
public Pose3d getShootFrom() {
Translation3d t = new Translation3d(
this.getPose().getX() + SHOOTER_FRONT * this.getPose().getRotation().getCos(),
Expand All @@ -80,6 +85,12 @@ public Pose3d getShootFrom() {
return new Pose3d(t, r);
}

/**
* Advance Note
*
* @param dt Change in time
* @param arena Simulated Arena
*/
public void advanceNote(double dt, SimulatedArena arena) {
Rotation2d yaw = this.getPose().getRotation();
Rotation2d pitch = this.wristAngle;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/frc/lib/util/photon/PhotonIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ public Optional<Matrix<N5, N1>> getDistCoeffs() {
protected final String name;
protected final String ip;

/**
* Photon IO
*
* @param name Camera Name
* @param ip Camera IP
*/
public PhotonIO(String name, String ip) {
this.name = name;
this.ip = ip;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/frc/lib/util/photon/PhotonReal.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public PhotonPipelineResultIntermediate unpack(Packet packet) {

}

/**
* Upload Settings
*
* @param ip Camera IP
* @param file Camera settings file
*/
public boolean uploadSettings(String ip, File file) throws IOException {
try (final CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost postReq = new HttpPost("http://" + ip + "/api/settings");
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/frc/lib/viz/PumbaaViz.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ public static enum NoteLocation {
* Set Note Location
*/
public void setNoteLocation(NoteLocation location) {
if (sim != null)
if (sim != null) {
return;
}
switch (location) {
case Intake:
this.notePose = intake_pose;
Expand All @@ -116,7 +117,7 @@ public void setNoteLocation(NoteLocation location) {
/**
* Get Shotting Position
*
* @return
* @return Shooting Pose
*/
public Pose3d getShootFrom() {
Translation3d t = new Translation3d(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Intake extends SubsystemBase {
* Intake Subsystem
*
* @param io IO Layer
* @param viz Sim Vizualization
* @param viz Sim Visualization
*/
public Intake(IntakeIO io, PumbaaViz viz) {
this.io = io;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/intake/IntakeIOSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class IntakeIOSim implements IntakeIO {

/**
* Intake IO Layer with simulated motors and sensors
*
*
* @param pumbaa Simulated Robot Viz
*/
public IntakeIOSim(SimulatedPumbaa pumbaa) {
Expand Down

0 comments on commit dfca4e0

Please sign in to comment.