Move aos/input and aos/robot_state to frc971/input
Neither folder makes any sense as part of aos/.
Change-Id: I10e0532da4e688c18a9354012b783c43566fd2a1
diff --git a/y2016/BUILD b/y2016/BUILD
index ae12689..9fcab25 100644
--- a/y2016/BUILD
+++ b/y2016/BUILD
@@ -33,7 +33,7 @@
":constants",
"//aos:init",
"//aos/actions:action_lib",
- "//aos/input:action_joystick_input",
+ "//frc971/input:action_joystick_input",
"//aos/logging",
"//aos/time",
"//aos/util:log_interval",
@@ -96,7 +96,7 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/robot_state:config",
+ "//frc971/input:config",
"//frc971/autonomous:config",
"//frc971/control_loops/drivetrain:config",
"//frc971/wpilib:config",
@@ -116,7 +116,7 @@
"//aos:math",
"//aos/controls:control_loop",
"//aos/logging",
- "//aos/robot_state:robot_state_fbs",
+ "//frc971/input:robot_state_fbs",
"//aos/stl_mutex",
"//aos/time",
"//aos/util:log_interval",
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index 09ff112..7a2ce81 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -1,19 +1,18 @@
+#include <math.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include <math.h>
#include "aos/actions/actions.h"
#include "aos/init.h"
-#include "aos/input/action_joystick_input.h"
-#include "aos/input/driver_station_data.h"
#include "aos/logging/logging.h"
#include "aos/time/time.h"
#include "aos/util/log_interval.h"
-
#include "frc971/autonomous/auto_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_status_generated.h"
+#include "frc971/input/action_joystick_input.h"
+#include "frc971/input/driver_station_data.h"
#include "y2016/actors/autonomous_actor.h"
#include "y2016/actors/superstructure_actor.h"
#include "y2016/actors/vision_align_actor.h"
@@ -26,10 +25,10 @@
#include "y2016/queues/ball_detector_generated.h"
#include "y2016/vision/vision_generated.h"
-using ::aos::input::driver_station::ButtonLocation;
-using ::aos::input::driver_station::ControlBit;
-using ::aos::input::driver_station::JoystickAxis;
-using ::aos::input::driver_station::POVLocation;
+using ::frc971::input::driver_station::ButtonLocation;
+using ::frc971::input::driver_station::ControlBit;
+using ::frc971::input::driver_station::JoystickAxis;
+using ::frc971::input::driver_station::POVLocation;
namespace y2016 {
namespace input {
@@ -66,15 +65,15 @@
const ButtonLocation kExpand(3, 6);
const ButtonLocation kWinch(3, 5);
-class Reader : public ::aos::input::ActionJoystickInput {
+class Reader : public ::frc971::input::ActionJoystickInput {
public:
Reader(::aos::EventLoop *event_loop)
- : ::aos::input::ActionJoystickInput(
+ : ::frc971::input::ActionJoystickInput(
event_loop, control_loops::drivetrain::GetDrivetrainConfig(),
- ::aos::input::DrivetrainInputReader::InputType::kSteeringWheel, {}),
+ ::frc971::input::DrivetrainInputReader::InputType::kSteeringWheel,
+ {}),
vision_status_fetcher_(
- event_loop->MakeFetcher<::y2016::vision::VisionStatus>(
- "/vision")),
+ event_loop->MakeFetcher<::y2016::vision::VisionStatus>("/vision")),
ball_detector_fetcher_(
event_loop->MakeFetcher<::y2016::sensors::BallDetector>(
"/superstructure")),
@@ -103,13 +102,14 @@
actors::VisionAlignActor::MakeFactory(event_loop)),
superstructure_action_factory_(
actors::SuperstructureActor::MakeFactory(event_loop)) {
- set_vision_align_fn([this](const ::aos::input::driver_station::Data &data) {
- return VisionAlign(data);
- });
+ set_vision_align_fn(
+ [this](const ::frc971::input::driver_station::Data &data) {
+ return VisionAlign(data);
+ });
}
// Returns true when we are vision aligning
- bool VisionAlign(const ::aos::input::driver_station::Data &data) {
+ bool VisionAlign(const ::frc971::input::driver_station::Data &data) {
vision_valid_ = false;
vision_status_fetcher_.Fetch();
@@ -143,7 +143,7 @@
return vision_action_running_;
}
- void HandleTeleop(const ::aos::input::driver_station::Data &data) {
+ void HandleTeleop(const ::frc971::input::driver_station::Data &data) {
if (!data.GetControlBit(ControlBit::kEnabled)) {
// If we are not enabled, reset the waiting for zero bit.
AOS_LOG(DEBUG, "Waiting for zero.\n");
@@ -408,8 +408,7 @@
private:
::aos::Fetcher<::y2016::vision::VisionStatus> vision_status_fetcher_;
::aos::Fetcher<::y2016::sensors::BallDetector> ball_detector_fetcher_;
- ::aos::Sender<::y2016::control_loops::shooter::Goal>
- shooter_goal_sender_;
+ ::aos::Sender<::y2016::control_loops::shooter::Goal> shooter_goal_sender_;
::aos::Fetcher<::y2016::control_loops::superstructure::Status>
superstructure_status_fetcher_;
::aos::Sender<::y2016::control_loops::superstructure::Goal>
diff --git a/y2016/wpilib_interface.cc b/y2016/wpilib_interface.cc
index 5c2fcd6..8ff345d 100644
--- a/y2016/wpilib_interface.cc
+++ b/y2016/wpilib_interface.cc
@@ -23,7 +23,6 @@
#include "aos/events/shm_event_loop.h"
#include "aos/logging/logging.h"
#include "aos/make_unique.h"
-#include "aos/robot_state/robot_state_generated.h"
#include "aos/stl_mutex/stl_mutex.h"
#include "aos/time/time.h"
#include "aos/util/log_interval.h"
@@ -32,6 +31,7 @@
#include "frc971/autonomous/auto_mode_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_output_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_position_generated.h"
+#include "frc971/input/robot_state_generated.h"
#include "frc971/wpilib/ADIS16448.h"
#include "frc971/wpilib/buffered_pcm.h"
#include "frc971/wpilib/buffered_solenoid.h"
diff --git a/y2016/y2016.json b/y2016/y2016.json
index 9ad4f20..a880370 100644
--- a/y2016/y2016.json
+++ b/y2016/y2016.json
@@ -81,7 +81,7 @@
}
],
"imports": [
- "../aos/robot_state/robot_state_config.json",
+ "../frc971/input/robot_state_config.json",
"../frc971/control_loops/drivetrain/drivetrain_config.json",
"../frc971/autonomous/autonomous_config.json",
"../frc971/wpilib/wpilib_config.json"