diff --git a/src/deploy/autos/paths/fp_home_2 b/src/deploy/autos/paths/fp_home_2 new file mode 100644 index 0000000..78a70dc --- /dev/null +++ b/src/deploy/autos/paths/fp_home_2 @@ -0,0 +1 @@ +P,219.5,54,0,0 \ No newline at end of file diff --git a/src/deploy/autos/paths/fp_home_3 b/src/deploy/autos/paths/fp_home_3 new file mode 100644 index 0000000..1f4de86 --- /dev/null +++ b/src/deploy/autos/paths/fp_home_3 @@ -0,0 +1 @@ +P,214.5,58,0,0 \ No newline at end of file diff --git a/src/y2024/cpp/commands/basic/prepare_auto_shoot_async.cc b/src/y2024/cpp/commands/basic/prepare_auto_shoot_async.cc new file mode 100644 index 0000000..4c0368c --- /dev/null +++ b/src/y2024/cpp/commands/basic/prepare_auto_shoot_async.cc @@ -0,0 +1,27 @@ +#include "commands/basic/prepare_auto_shoot_async.h" + +PrepareAutoShootAsyncCommand::PrepareAutoShootAsyncCommand( + RobotContainer& container) + : frc846::robot::GenericCommand{ + 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; } \ No newline at end of file diff --git a/src/y2024/include/commands/basic/prepare_auto_shoot_async.h b/src/y2024/include/commands/basic/prepare_auto_shoot_async.h new file mode 100644 index 0000000..7004a3c --- /dev/null +++ b/src/y2024/include/commands/basic/prepare_auto_shoot_async.h @@ -0,0 +1,19 @@ +#pragma once + +#include "frc846/robot/GenericCommand.h" +#include "subsystems/robot_container.h" + +class PrepareAutoShootAsyncCommand + : public frc846::robot::GenericCommand { + public: + PrepareAutoShootAsyncCommand(RobotContainer& container); + + void OnInit() override; + + void Periodic() override; + + void OnEnd(bool interrupted) override; + + bool IsFinished() override; +};