Skip to content

Commit

Permalink
Red side works
Browse files Browse the repository at this point in the history
  • Loading branch information
VyaasBaskar committed Oct 22, 2024
1 parent 913296e commit 6857c42
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/deploy/autos/paths/fp_home_2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
P,219.5,54,0,0
1 change: 1 addition & 0 deletions src/deploy/autos/paths/fp_home_3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
P,214.5,58,0,0
27 changes: 27 additions & 0 deletions src/y2024/cpp/commands/basic/prepare_auto_shoot_async.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "commands/basic/prepare_auto_shoot_async.h"

PrepareAutoShootAsyncCommand::PrepareAutoShootAsyncCommand(
RobotContainer& container)
: frc846::robot::GenericCommand<RobotContainer,
PrepareAutoShootAsyncCommand>{
container, "prepare_auto_shoot_async_command"} {
AddRequirements({&container_.super_structure_, &container_.intake_,
&container_.shooter_});
}

void PrepareAutoShootAsyncCommand::OnInit() { Periodic(); }

void PrepareAutoShootAsyncCommand::Periodic() {
auto defaultShootSetpoint{container_.super_structure_.getAutoShootSetpoint()};

container_.intake_.SetTarget({IntakeState::kHold});
container_.shooter_.SetTarget({ShooterState::kRun});

defaultShootSetpoint.wrist += defaultShootSetpoint.pivot;

container_.super_structure_.SetTargetSetpoint(defaultShootSetpoint);
}

void PrepareAutoShootAsyncCommand::OnEnd(bool interrupted) {}

bool PrepareAutoShootAsyncCommand::IsFinished() { return true; }
19 changes: 19 additions & 0 deletions src/y2024/include/commands/basic/prepare_auto_shoot_async.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include "frc846/robot/GenericCommand.h"
#include "subsystems/robot_container.h"

class PrepareAutoShootAsyncCommand
: public frc846::robot::GenericCommand<RobotContainer,
PrepareAutoShootAsyncCommand> {
public:
PrepareAutoShootAsyncCommand(RobotContainer& container);

void OnInit() override;

void Periodic() override;

void OnEnd(bool interrupted) override;

bool IsFinished() override;
};

0 comments on commit 6857c42

Please sign in to comment.