Remove global .frc971.control_loops.drivetrain_queue object
Change-Id: I424f09dcc8bc210e49cbdc805d1a423a72332617
diff --git a/y2018/actors/autonomous_actor.cc b/y2018/actors/autonomous_actor.cc
index 5b4bda8..80cdbe9 100644
--- a/y2018/actors/autonomous_actor.cc
+++ b/y2018/actors/autonomous_actor.cc
@@ -16,12 +16,13 @@
using ::frc971::ProfileParameters;
using ::aos::monotonic_clock;
-using ::frc971::control_loops::drivetrain_queue;
namespace chrono = ::std::chrono;
namespace this_thread = ::std::this_thread;
namespace {
+namespace arm = ::y2018::control_loops::superstructure::arm;
+
const ProfileParameters kFinalSwitchDrive = {0.5, 1.5};
const ProfileParameters kDrive = {5.0, 2.5};
const ProfileParameters kThirdBoxDrive = {3.0, 2.5};
diff --git a/y2018/actors/autonomous_actor.h b/y2018/actors/autonomous_actor.h
index 1b20190..4cedff3 100644
--- a/y2018/actors/autonomous_actor.h
+++ b/y2018/actors/autonomous_actor.h
@@ -15,9 +15,6 @@
namespace y2018 {
namespace actors {
-using ::frc971::control_loops::drivetrain_queue;
-
-namespace arm = ::y2018::control_loops::superstructure::arm;
class AutonomousActor : public ::frc971::autonomous::BaseAutonomousActor {
public:
@@ -31,7 +28,8 @@
roller_voltage_ = 0.0;
left_intake_angle_ = -3.2;
right_intake_angle_ = -3.2;
- arm_goal_position_ = arm::NeutralIndex();
+ arm_goal_position_ =
+ ::y2018::control_loops::superstructure::arm::NeutralIndex();
grab_box_ = false;
open_claw_ = false;
close_claw_ = false;
@@ -50,7 +48,8 @@
double roller_voltage_ = 0.0;
double left_intake_angle_ = -3.2;
double right_intake_angle_ = -3.2;
- uint32_t arm_goal_position_ = arm::NeutralIndex();
+ uint32_t arm_goal_position_ =
+ ::y2018::control_loops::superstructure::arm::NeutralIndex();
bool grab_box_ = false;
bool open_claw_ = false;
bool close_claw_ = false;
@@ -125,22 +124,22 @@
}
superstructure_status_fetcher_.Fetch();
- drivetrain_queue.status.FetchLatest();
- if (drivetrain_queue.status.get() &&
+ drivetrain_status_fetcher_.Fetch();
+ if (drivetrain_status_fetcher_.get() &&
superstructure_status_fetcher_.get()) {
const double left_profile_error =
(initial_drivetrain_.left -
- drivetrain_queue.status->profiled_left_position_goal);
+ drivetrain_status_fetcher_->profiled_left_position_goal);
const double right_profile_error =
(initial_drivetrain_.right -
- drivetrain_queue.status->profiled_right_position_goal);
+ drivetrain_status_fetcher_->profiled_right_position_goal);
const double left_error =
(initial_drivetrain_.left -
- drivetrain_queue.status->estimated_left_position);
+ drivetrain_status_fetcher_->estimated_left_position);
const double right_error =
(initial_drivetrain_.right -
- drivetrain_queue.status->estimated_right_position);
+ drivetrain_status_fetcher_->estimated_right_position);
const double profile_distance_to_go =
(left_profile_error + right_profile_error) / 2.0;