mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
HAND FIXES: Manual cleanup of namespaces
This commit is contained in:
committed by
Peter Johnson
parent
ad138270a8
commit
3f740894c9
@@ -24,7 +24,7 @@ VisionRunnerBase::VisionRunnerBase(cs::VideoSource videoSource)
|
||||
VisionRunnerBase::~VisionRunnerBase() = default;
|
||||
|
||||
void VisionRunnerBase::RunOnce() {
|
||||
auto csShared = wpi::vision::GetCameraServerShared();
|
||||
auto csShared = wpi::GetCameraServerShared();
|
||||
auto res = csShared->GetRobotMainThreadId();
|
||||
if (res.second && (std::this_thread::get_id() == res.first)) {
|
||||
csShared->SetVisionRunnerError(
|
||||
@@ -41,7 +41,7 @@ void VisionRunnerBase::RunOnce() {
|
||||
}
|
||||
|
||||
void VisionRunnerBase::RunForever() {
|
||||
auto csShared = wpi::vision::GetCameraServerShared();
|
||||
auto csShared = wpi::GetCameraServerShared();
|
||||
auto res = csShared->GetRobotMainThreadId();
|
||||
if (res.second && (std::this_thread::get_id() == res.first)) {
|
||||
csShared->SetVisionRunnerError(
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "wpi/commands2/CommandPtr.hpp"
|
||||
#include "wpi/math/filter/Debouncer.hpp"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi;
|
||||
using namespace wpi::cmd;
|
||||
|
||||
Trigger::Trigger(const Trigger& other) = default;
|
||||
|
||||
@@ -161,7 +161,7 @@ class DataLog {
|
||||
template <wpi::util::ProtobufSerializable T>
|
||||
void AddProtobufSchema(wpi::util::ProtobufMessage<T>& msg, int64_t timestamp = 0) {
|
||||
if (timestamp == 0) {
|
||||
timestamp = Now();
|
||||
timestamp = wpi::util::Now();
|
||||
}
|
||||
msg.ForEachProtobufDescriptor(
|
||||
[this](auto typeString) { return HasSchema(typeString); },
|
||||
@@ -182,7 +182,7 @@ class DataLog {
|
||||
requires wpi::util::StructSerializable<T, I...>
|
||||
void AddStructSchema(const I&... info, int64_t timestamp = 0) {
|
||||
if (timestamp == 0) {
|
||||
timestamp = Now();
|
||||
timestamp = wpi::util::Now();
|
||||
}
|
||||
wpi::util::ForEachStructSchema<T>(
|
||||
[this, timestamp](auto typeString, auto schema) {
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace wpi::romi {
|
||||
*
|
||||
* A general use PWM motor controller representing the motors on a Romi robot
|
||||
*/
|
||||
class RomiMotor : public PWMMotorController {
|
||||
class RomiMotor : public wpi::PWMMotorController {
|
||||
public:
|
||||
/**
|
||||
* Constructor for a RomiMotor.
|
||||
|
||||
@@ -612,9 +612,9 @@ void Analyzer::DisplayFeedbackGains() {
|
||||
sysid::CreateTooltip(
|
||||
"Gain presets represent how feedback gains are calculated for your "
|
||||
"specific feedback controller:\n\n"
|
||||
"Default, WPILib (2020-): For use with the new WPILib wpi::math::PIDController "
|
||||
"Default, WPILib (2020-): For use with the new WPILib PIDController "
|
||||
"class.\n"
|
||||
"WPILib (Pre-2020): For use with the old WPILib wpi::math::PIDController class.\n"
|
||||
"WPILib (Pre-2020): For use with the old WPILib PIDController class.\n"
|
||||
"CTRE: For use with CTRE units. These are the default units that ship "
|
||||
"with CTRE motor controllers.\n"
|
||||
"REV (Brushless): For use with NEO and NEO 550 motors on a SPARK MAX.\n"
|
||||
|
||||
@@ -25,7 +25,9 @@ namespace wpi {
|
||||
namespace log {
|
||||
class DataLogReaderEntry;
|
||||
} // namespace log
|
||||
class wpi::util::Logger;
|
||||
namespace util {
|
||||
class Logger;
|
||||
}
|
||||
} // namespace wpi
|
||||
|
||||
namespace sysid {
|
||||
|
||||
@@ -25,7 +25,9 @@ namespace log {
|
||||
class DataLogReaderEntry;
|
||||
class DataLogReaderThread;
|
||||
} // namespace log
|
||||
class wpi::util::Logger;
|
||||
namespace util {
|
||||
class Logger;
|
||||
}
|
||||
} // namespace wpi
|
||||
|
||||
namespace sysid {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "wpi/sysid/analysis/FilteringUtils.hpp"
|
||||
#include "wpi/sysid/analysis/Storage.hpp"
|
||||
|
||||
TEST(FilterTest, wpi::math::MedianFilter) {
|
||||
TEST(FilterTest, MedianFilter) {
|
||||
std::vector<sysid::PreparedData> testData{
|
||||
sysid::PreparedData{0_s, 0, 0, 0}, sysid::PreparedData{0_s, 0, 0, 1},
|
||||
sysid::PreparedData{0_s, 0, 0, 10}, sysid::PreparedData{0_s, 0, 0, 5},
|
||||
|
||||
@@ -288,7 +288,7 @@ compose_r_core(// output
|
||||
|
||||
Described here:
|
||||
|
||||
Altmann, Simon L. "Hamilton, Rodrigues, and the wpi::math::Quaternion Scandal."
|
||||
Altmann, Simon L. "Hamilton, Rodrigues, and the Quaternion Scandal."
|
||||
Mathematics Magazine, vol. 62, no. 5, 1989, pp. 291–308
|
||||
|
||||
Available here:
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "wpi/util/Color8Bit.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
MechanismRoot2d::MechanismRoot2d(std::string_view name, double x, double y,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "wpi/event/BooleanEvent.hpp"
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
class BooleanSubscriber;
|
||||
class BooleanTopic;
|
||||
class NetworkTable;
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
#include "wpi/util/SmallVector.hpp"
|
||||
#include "wpi/util/mutex.hpp"
|
||||
|
||||
namespace wpi::math {
|
||||
class Trajectory;
|
||||
}
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class Field2d;
|
||||
class wpi::math::Trajectory;
|
||||
|
||||
/**
|
||||
* Game field object on a Field2d.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "wpi/nt/NetworkTableEntry.hpp"
|
||||
#include "wpi/nt/NetworkTableValue.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
class Sendable;
|
||||
} // namespace wpi
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ classes:
|
||||
wpi::sim::DifferentialDrivetrainSim:
|
||||
typealias:
|
||||
- wpi::math::DCMotor
|
||||
- template <int S, int I, int O> using wpi::math::LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int S, int I, int O> using LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
methods:
|
||||
DifferentialDrivetrainSim:
|
||||
overloads:
|
||||
|
||||
@@ -2,8 +2,8 @@ classes:
|
||||
wpi::sim::ElevatorSim:
|
||||
typealias:
|
||||
- wpi::math::DCMotor
|
||||
- template <int S, int I, int O> using wpi::math::LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using wpi::math::Vectord = wpi::math::Vectord<I>
|
||||
- template <int S, int I, int O> using LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using Vectord = wpi::math::Vectord<I>
|
||||
methods:
|
||||
ElevatorSim:
|
||||
overloads:
|
||||
|
||||
@@ -2,7 +2,7 @@ classes:
|
||||
wpi::sim::FlywheelSim:
|
||||
typealias:
|
||||
- wpi::math::DCMotor
|
||||
- template <int S, int I, int O> using wpi::math::LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int S, int I, int O> using LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
methods:
|
||||
FlywheelSim:
|
||||
overloads:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
classes:
|
||||
wpi::sim::LinearSystemSim:
|
||||
typealias:
|
||||
- template <int S, int I, int O> using wpi::math::LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using wpi::math::Vectord = wpi::math::Vectord<I>
|
||||
- template <int S, int I, int O> using LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using Vectord = wpi::math::Vectord<I>
|
||||
template_params:
|
||||
- int States
|
||||
- int Inputs
|
||||
|
||||
@@ -2,8 +2,8 @@ classes:
|
||||
wpi::sim::SingleJointedArmSim:
|
||||
typealias:
|
||||
- wpi::math::DCMotor
|
||||
- template <int S, int I, int O> using wpi::math::LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using wpi::math::Vectord = wpi::math::Vectord<I>
|
||||
- template <int S, int I, int O> using LinearSystem = wpi::math::LinearSystem<S, I, O>
|
||||
- template <int I> using Vectord = wpi::math::Vectord<I>
|
||||
methods:
|
||||
SingleJointedArmSim:
|
||||
overloads:
|
||||
|
||||
@@ -8,14 +8,14 @@ void ResetSmartDashboardInstance();
|
||||
void ResetMotorSafety();
|
||||
} // namespace wpi::impl
|
||||
|
||||
namespace wpi::impl {
|
||||
namespace wpi::util::impl {
|
||||
void ResetSendableRegistry();
|
||||
} // namespace wpi::impl
|
||||
|
||||
void resetWpilibSimulationData() {
|
||||
wpi::impl::ResetSmartDashboardInstance();
|
||||
wpi::impl::ResetMotorSafety();
|
||||
wpi::impl::ResetSendableRegistry();
|
||||
wpi::util::impl::ResetSendableRegistry();
|
||||
}
|
||||
|
||||
void resetMotorSafety() {
|
||||
|
||||
@@ -271,7 +271,7 @@ public final class DataLogManager {
|
||||
return filenameOverride;
|
||||
}
|
||||
Random rnd = new Random();
|
||||
StringBuilder filename = new StringBuilder();
|
||||
StringBuilder filename = new StringBuilder(18);
|
||||
filename.append("FRC_TBD_");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
filename.append(String.format("%04x", rnd.nextInt(0x10000)));
|
||||
|
||||
@@ -87,7 +87,7 @@ using namespace wpi::units::torque;
|
||||
using namespace wpi::units::velocity;
|
||||
using namespace wpi::units::voltage;
|
||||
using namespace wpi::units::volume;
|
||||
using namespace units;
|
||||
using namespace wpi::units;
|
||||
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1800
|
||||
using namespace wpi::units::literals;
|
||||
|
||||
4
wpinet/robotpy_pybind_build_info.bzl
generated
4
wpinet/robotpy_pybind_build_info.bzl
generated
@@ -13,7 +13,7 @@ def wpinet_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ
|
||||
header_file = "$(execpath :robotpy-native-wpinet.copy_headers)/wpi/net/PortForwarder.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::PortForwarder", "wpi__PortForwarder.hpp"),
|
||||
("wpi::net::PortForwarder", "wpi__net__PortForwarder.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
@@ -23,7 +23,7 @@ def wpinet_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ
|
||||
header_file = "$(execpath :robotpy-native-wpinet.copy_headers)/wpi/net/WebServer.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::WebServer", "wpi__WebServer.hpp"),
|
||||
("wpi::net::WebServer", "wpi__net__WebServer.hpp"),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
|
||||
#include "wpi/util/Signal.h"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
namespace uv {
|
||||
class Loop;
|
||||
class Tcp;
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
#include "wpi/net/HttpParser.hpp"
|
||||
#include "wpi/net/uv/Stream.hpp"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class raw_ostream;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
class HttpServerConnection {
|
||||
public:
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
|
||||
#include "wpi/net/uv/Timer.hpp"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
namespace uv {
|
||||
class GetAddrInfoReq;
|
||||
class Loop;
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
#include "wpi/util/SmallVector.hpp"
|
||||
#include "wpi/util/mutex.hpp"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
class UDPClient {
|
||||
int m_lsd;
|
||||
int m_port;
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace wpi::net {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
std::string GetHostname();
|
||||
std::string_view GetHostname(wpi::util::SmallVectorImpl<char>& name);
|
||||
} // namespace wpi::net
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "wpi/net/uv/Loop.hpp"
|
||||
#include "wpi/util/Signal.h"
|
||||
|
||||
namespace wpi::net {
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
} // namespace wpi::net
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ void ResolverThread::RemoveServiceRefInThread(DNSServiceRef serviceRef) {
|
||||
WPI_EventHandle ResolverThread::RemoveServiceRefOutsideThread(
|
||||
DNSServiceRef serviceRef) {
|
||||
std::scoped_lock lock{serviceRefMutex};
|
||||
WPI_EventHandle handle = CreateEvent(true);
|
||||
WPI_EventHandle handle = wpi::util::CreateEvent(true);
|
||||
serviceRefsToRemove.push_back({serviceRef, handle});
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
#include "wpi/net/NetworkAcceptor.hpp"
|
||||
#include "wpi/net/TCPStream.h"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
class TCPAcceptor : public NetworkAcceptor {
|
||||
int m_lsd;
|
||||
int m_port;
|
||||
|
||||
@@ -30,10 +30,11 @@
|
||||
|
||||
#include "wpi/net/NetworkStream.hpp"
|
||||
|
||||
namespace wpi::net {
|
||||
|
||||
namespace wpi::util {
|
||||
class Logger;
|
||||
}
|
||||
|
||||
namespace wpi::net {
|
||||
class TCPConnector {
|
||||
public:
|
||||
static std::unique_ptr<NetworkStream> connect(const char* server, int port,
|
||||
|
||||
@@ -36,8 +36,8 @@ TEST(WorkerThreadTest, FutureVoid) {
|
||||
}
|
||||
|
||||
TEST(WorkerThreadTest, Loop) {
|
||||
mutex m;
|
||||
condition_variable cv;
|
||||
wpi::util::mutex m;
|
||||
wpi::util::condition_variable cv;
|
||||
int callbacks = 0;
|
||||
|
||||
WorkerThread<int(bool)> worker;
|
||||
@@ -60,8 +60,8 @@ TEST(WorkerThreadTest, Loop) {
|
||||
}
|
||||
|
||||
TEST(WorkerThreadTest, LoopVoid) {
|
||||
mutex m;
|
||||
condition_variable cv;
|
||||
wpi::util::mutex m;
|
||||
wpi::util::condition_variable cv;
|
||||
int callbacks = 0;
|
||||
|
||||
WorkerThread<void(bool)> worker;
|
||||
|
||||
6
wpiutil/robotpy_pybind_build_info.bzl
generated
6
wpiutil/robotpy_pybind_build_info.bzl
generated
@@ -38,7 +38,7 @@ def wpiutil_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], inclu
|
||||
header_file = "$(execpath :robotpy-native-wpiutil.copy_headers)/wpi/util/sendable/Sendable.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::Sendable", "wpi__Sendable.hpp"),
|
||||
("wpi::util::Sendable", "wpi__util__Sendable.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
@@ -48,7 +48,7 @@ def wpiutil_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], inclu
|
||||
header_file = "$(execpath :robotpy-native-wpiutil.copy_headers)/wpi/util/sendable/SendableBuilder.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::SendableBuilder", "wpi__SendableBuilder.hpp"),
|
||||
("wpi::util::SendableBuilder", "wpi__util__SendableBuilder.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
@@ -58,7 +58,7 @@ def wpiutil_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], inclu
|
||||
header_file = "$(execpath :robotpy-native-wpiutil.copy_headers)/wpi/util/sendable/SendableRegistry.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::SendableRegistry", "wpi__SendableRegistry.hpp"),
|
||||
("wpi::util::SendableRegistry", "wpi__util__SendableRegistry.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
|
||||
template <typename F>
|
||||
class scope_exit {
|
||||
@@ -34,4 +34,4 @@ class scope_exit {
|
||||
bool m_active = true;
|
||||
};
|
||||
|
||||
} // namespace wpi
|
||||
} // namespace wpi::util
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
|
||||
#ifndef WPI_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
|
||||
#define WPI_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
namespace detail_expected {
|
||||
template <class T>
|
||||
struct is_trivially_copy_constructible
|
||||
@@ -91,11 +91,11 @@ template <class T, class A>
|
||||
struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
|
||||
#endif
|
||||
} // namespace detail_expected
|
||||
} // namespace wpi
|
||||
} // namespace wpi::util
|
||||
#endif
|
||||
|
||||
#define WPI_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
|
||||
wpi::detail_expected::is_trivially_copy_constructible<T>
|
||||
wpi::util::detail_expected::is_trivially_copy_constructible<T>
|
||||
#define WPI_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
|
||||
std::is_trivially_copy_assignable<T>
|
||||
#define WPI_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
|
||||
@@ -126,7 +126,7 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
|
||||
#define WPI_EXPECTED_11_CONSTEXPR constexpr
|
||||
#endif
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <class T, class E> class expected;
|
||||
|
||||
#ifndef WPI_MONOSTATE_INPLACE_MUTEX
|
||||
@@ -388,7 +388,7 @@ struct is_nothrow_swappable
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Trait for checking if a type is a wpi::expected
|
||||
// Trait for checking if a type is a wpi::util::expected
|
||||
template <class T> struct is_expected_impl : std::false_type {};
|
||||
template <class T, class E>
|
||||
struct is_expected_impl<expected<T, E>> : std::true_type {};
|
||||
@@ -2439,6 +2439,6 @@ void swap(expected<T, E> &lhs,
|
||||
expected<T, E> &rhs) noexcept(noexcept(lhs.swap(rhs))) {
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
} // namespace wpi
|
||||
} // namespace wpi::util
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user