Move PDP values out to a separate queue so the timestamps make sense etc
Change-Id: Iad5303c3446dc29f339f02af9c9c99dd7c75d8e0
diff --git a/y2015/wpilib/wpilib_interface.cc b/y2015/wpilib/wpilib_interface.cc
index e70c92f..c2250bb 100644
--- a/y2015/wpilib/wpilib_interface.cc
+++ b/y2015/wpilib/wpilib_interface.cc
@@ -126,8 +126,7 @@
class SensorReader {
public:
- SensorReader(::frc971::wpilib::PDPFetcher *pdp_fetcher)
- : pdp_fetcher_(pdp_fetcher) {
+ SensorReader() {
// Set it to filter out anything shorter than 1/4 of the minimum pulse width
// we should ever see.
filter_.SetPeriodNanoSeconds(
@@ -260,7 +259,7 @@
}
void RunIteration() {
- ::frc971::wpilib::SendRobotState(my_pid_, ds_, pdp_fetcher_);
+ ::frc971::wpilib::SendRobotState(my_pid_, ds_);
{
auto drivetrain_message = drivetrain_queue.position.MakeMessage();
@@ -314,7 +313,6 @@
private:
int32_t my_pid_;
DriverStation *ds_;
- ::frc971::wpilib::PDPFetcher *const pdp_fetcher_;
void CopyPotAndIndexPosition(
const DMAEncoderAndPotentiometer &encoder, PotAndIndexPosition *position,
@@ -663,7 +661,7 @@
::frc971::wpilib::PDPFetcher pdp_fetcher;
::std::thread pdp_fetcher_thread(::std::ref(pdp_fetcher));
- SensorReader reader(&pdp_fetcher);
+ SensorReader reader;
reader.set_arm_left_encoder(encoder(1));
reader.set_arm_left_index(make_unique<DigitalInput>(1));
reader.set_arm_left_potentiometer(make_unique<AnalogInput>(1));