Merge changes I6d1d354b,I280e7889,I225dfd9d,I50d6dac4
* changes:
Stop using deprecated std::random_shuffle
Add missing reference for newer clang
Add missing header to queue.cc for new clang
Remove reference to std::filesystem in starter_test
diff --git a/aos/starter/starter_test.cc b/aos/starter/starter_test.cc
index 3a61fe7..f434e84 100644
--- a/aos/starter/starter_test.cc
+++ b/aos/starter/starter_test.cc
@@ -1,5 +1,4 @@
#include <csignal>
-#include <experimental/filesystem>
#include <future>
#include <thread>
@@ -8,6 +7,7 @@
#include "aos/network/team_number.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
+#include "aos/util/file.h"
#include "gtest/gtest.h"
#include "starter_rpc_lib.h"
#include "starterd_lib.h"
@@ -23,7 +23,7 @@
FLAGS_shm_base = shm_dir_;
// Nuke the shm dir:
- std::experimental::filesystem::remove_all(shm_dir_);
+ aos::util::UnlinkRecursive(shm_dir_);
}
protected:
diff --git a/motors/usb/queue.cc b/motors/usb/queue.cc
index 82fa32f..270ad74 100644
--- a/motors/usb/queue.cc
+++ b/motors/usb/queue.cc
@@ -2,6 +2,8 @@
#include <string.h>
+#include <algorithm>
+
namespace frc971 {
namespace teensy {
diff --git a/y2019/vision/target_finder.cc b/y2019/vision/target_finder.cc
index 83d4a01..b16fba1 100644
--- a/y2019/vision/target_finder.cc
+++ b/y2019/vision/target_finder.cc
@@ -454,7 +454,7 @@
// direction vector.
::Eigen::Vector2f smallest_point = polygon.contour[0];
float smallest_value = outer_edge_vector.transpose() * smallest_point;
- for (const ::Eigen::Vector2f point : polygon.contour) {
+ for (const ::Eigen::Vector2f &point : polygon.contour) {
const float current_value = outer_edge_vector.transpose() * point;
if (current_value < smallest_value) {
smallest_value = current_value;
diff --git a/y2020/actors/shooter_tuning_actor.cc b/y2020/actors/shooter_tuning_actor.cc
index a6c8d88..d18c518 100644
--- a/y2020/actors/shooter_tuning_actor.cc
+++ b/y2020/actors/shooter_tuning_actor.cc
@@ -2,6 +2,7 @@
#include <cstdlib>
#include <ctime>
#include <fstream>
+#include <random>
#include <sstream>
#include <utility>
@@ -91,7 +92,9 @@
}
// Randomize the ordering of the velocities
std::srand(std::time(nullptr));
- std::random_shuffle(velocities_.begin(), velocities_.end());
+ std::random_device random_device;
+ std::mt19937 generator(random_device());
+ std::shuffle(velocities_.begin(), velocities_.end(), generator);
}
bool ShooterTuningActor::RunAction(