fixed shoot_action timeout stuff
diff --git a/frc971/actions/action.h b/frc971/actions/action.h
index 9ae31e8..b9aaba6 100644
--- a/frc971/actions/action.h
+++ b/frc971/actions/action.h
@@ -73,7 +73,8 @@
abort_ = false;
return true;
}
- if (::aos::time::Time::Now() >= end_time) {
+ if (end_time != ::aos::time::Time(0, 0) &&
+ ::aos::time::Time::Now() >= end_time) {
LOG(INFO, "WaitUntil timed out\n");
return true;
}
diff --git a/frc971/actions/action_client.h b/frc971/actions/action_client.h
index 2a7d65f..4b3e048 100644
--- a/frc971/actions/action_client.h
+++ b/frc971/actions/action_client.h
@@ -80,6 +80,9 @@
if (has_started_) {
queue_group_->status.FetchNextBlocking();
} else {
+ if (queue_group_->status->running) {
+ has_started_ = true;
+ }
queue_group_->status.FetchNextBlocking();
if (queue_group_->status->running) {
// Wait until it reports that it is running to start.
diff --git a/frc971/actions/shoot_action.cc b/frc971/actions/shoot_action.cc
index 3e73b67..fa0e791 100644
--- a/frc971/actions/shoot_action.cc
+++ b/frc971/actions/shoot_action.cc
@@ -15,7 +15,6 @@
constexpr double ShootAction::kOffsetRadians;
constexpr double ShootAction::kClawShootingSeparation;
constexpr double ShootAction::kClawShootingSeparationGoal;
-constexpr ::aos::time::Time ShootAction::kTimeout;
ShootAction::ShootAction(actions::ShootActionQueueGroup* s)
: actions::ActionBase<actions::ShootActionQueueGroup>(s) {}
@@ -49,10 +48,9 @@
void ShootAction::InnerRunAction() {
LOG(INFO, "Shooting at the current angle and power.\n");
- const ::aos::time::Time end_time = ::aos::time::Time::Now() + kTimeout;
// wait for claw to be ready
- if (WaitUntil(::std::bind(&ShootAction::DoneSetupShot, this), end_time)) {
+ if (WaitUntil(::std::bind(&ShootAction::DoneSetupShot, this))) {
return;
}
@@ -87,7 +85,7 @@
}
// wait for record of shot having been fired
- if (WaitUntil(::std::bind(&ShootAction::DoneShot, this), end_time)) return;
+ if (WaitUntil(::std::bind(&ShootAction::DoneShot, this))) return;
// Turn the intake off.
control_loops::claw_queue_group.goal.FetchLatest();
diff --git a/frc971/actions/shoot_action.h b/frc971/actions/shoot_action.h
index c5ebb07..cc44bee 100644
--- a/frc971/actions/shoot_action.h
+++ b/frc971/actions/shoot_action.h
@@ -25,9 +25,6 @@
static constexpr double kOffsetRadians = 0.4;
static constexpr double kClawShootingSeparation = 0.10;
static constexpr double kClawShootingSeparationGoal = 0.10;
- // If we don't get to actually shooting within this amount of time, we stop to
- // avoid firing unexpectedly after a long delay.
- static constexpr ::aos::time::Time kTimeout = ::aos::time::Time::InSeconds(1);
protected:
// completed shot