Skip to content

Commit

Permalink
Hotfix: Made that one thing our robot does work
Browse files Browse the repository at this point in the history
  • Loading branch information
sentientspud committed Jul 18, 2015
1 parent febbd29 commit 4341f51
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
25 changes: 15 additions & 10 deletions config/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ $Restack:
time: 0.25
- ShuttlePositionUnload
- FingersRelease
- ShuttleHoldRestack
- ShuttleDownRestack
- ShuttleRampDown
- ShuttleClampOpen
Expand All @@ -182,16 +183,18 @@ ShuttleClamp:
ShuttleDown:
- name: Restack
ticks: 50
tolerance: 10
speed: 0.25
- name: Bottom
ticks: -3
tolerance: 3
ticks: 0
speed: .4

ShuttleHold:
speed: -.4
time: .5
- name: Restack
speed: -.2
time: .25
- name: Unstack
speed: -.4
time: .5

$ShuttleInit:
- FingersRelease
Expand All @@ -211,7 +214,7 @@ ShuttleRamp:
rampDistance: 150
- name: Down
ticks: 0
rampFactor: .2
rampFactor: .3
rampDistance: 150

$StackTote:
Expand All @@ -231,7 +234,7 @@ $StackTote:
ToteDictator:
samples:
bottom: 13
shuttle: 6
shuttle: 10

$Unstack:
- ShuttleClampOpen
Expand All @@ -241,7 +244,7 @@ $Unstack:
time: 0.25
- ShuttleRampUp
- FingersRelease
- ShuttleHold
- ShuttleHoldUnstack
- ShuttleDownRestack
- ShuttleRampDown
- ShuttleClampOpen
Expand Down Expand Up @@ -303,7 +306,7 @@ ClawToHeight:
speed: 1.0
requiredAngle: front
- name: Top
height: 238
height: 238.5
ramp: {distance: 20.0, factor: .25}
speed: 1.0
requiredAngle: neither
Expand Down Expand Up @@ -398,7 +401,7 @@ HoldBottomTote:
fast: 0.5

IntakeTotes:
flapperSpeed: 1.0
flapperSpeed: 0.85

RecieveBottomTote:
flapperSpeed: 0.35
Expand Down Expand Up @@ -443,6 +446,8 @@ $AutoPlatformBinSequence:
$Auto3:
- ResetAngle
- $AutoPlatformBinSequence
# - name: WaitCommand
# time: 3.0
- DriveStraightAuto3_1
- name: WaitCommand
time: 0.25
Expand Down
11 changes: 5 additions & 6 deletions src/Commands/Shuttle/ShuttleDown.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class ShuttleDown: public CommandBase {
public:
ShuttleDown(std::string name, YAML::Node config) :
CommandBase(name) {
targetTicks = config["ticks"].as<int>();
tolerance = config["tolerance"].as<int>();
ticks = config["ticks"].as<int>();
speed = config["speed"].as<double>();
Requires(shuttle);
}
Expand All @@ -36,22 +35,22 @@ class ShuttleDown: public CommandBase {
}

bool IsFinished() override {
return abs(shuttle->GetEncoderTicks() - targetTicks) <= tolerance
return shuttle->GetEncoderTicks() <= ticks
|| shuttle->GetLimit() == Shuttle::kLower;
}

void End() override {
shuttle->SetShuttleSpeed(0);
shuttle->SetShuttleSpeed(Shuttle::Speed::kHold);
CommandBase::End();
}

void Interrupted() override {
shuttle->SetShuttleSpeed(0);
shuttle->SetShuttleSpeed(Shuttle::Speed::kHold);
CommandBase::Interrupted();
}

private:
int targetTicks, tolerance;
int ticks;
double speed;
};

Expand Down

0 comments on commit 4341f51

Please sign in to comment.