Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
move motors when priming cata to get full extension
Browse files Browse the repository at this point in the history
  • Loading branch information
max-49 committed Apr 4, 2024
1 parent 4b5335b commit 1ebdf3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/cata/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const double intake_drop_seconds = 0.5;

// Cata Params
const double cata_target_charge = 22;
const double cata_target_extension = 65;
const double done_firing_angle = 50;

const double intake_drop_seconds_until_enable = 0.25;
Expand Down
8 changes: 7 additions & 1 deletion src/cata/cata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ class PrimeClimb : public CataOnlySys::State {
};

CataOnlySys::MaybeMessage work(CataOnlySys &sys) override {
double ang = sys.pot.angle(vex::deg);

if(ang < cata_target_extension)
sys.mot.spin(vex::directionType::fwd, 12, vex::volt);
else
sys.mot.stop(vex::brakeType::hold);

return {};
};
Expand Down Expand Up @@ -186,7 +192,7 @@ CataOnlySys::State *WaitingForDrop::respond(CataOnlySys &sys, CataOnlyMessage m)
// Ignore other messages
return this;
}

CataOnlySys::State *Reloading::respond(CataOnlySys &sys, CataOnlyMessage m) {
if (m == CataOnlyMessage::DoneReloading) {
return new ReadyToFire();
Expand Down

0 comments on commit 1ebdf3f

Please sign in to comment.