View
@@ -7,6 +7,8 @@
#include "AnalogPotentiometer.h"
+using namespace frc;
+
/**
* Common initialization code called by all constructors.
*/
View
@@ -11,6 +11,8 @@
#include "WPIErrors.h"
+using namespace frc;
+
/**
* Create an instance of a Digital Input class.
* Creates a digital input given a channel and uses the default module.
View
@@ -10,6 +10,8 @@
#include "LiveWindow/LiveWindow.h"
#include "WPIErrors.h"
+using namespace frc;
+
/**
* Constructor.
*
View
@@ -15,6 +15,8 @@
#include "WPIErrors.h"
#include "simulation/MainNode.h"
+using namespace frc;
+
const int DriverStation::kBatteryChannel;
const int DriverStation::kJoystickPorts;
const int DriverStation::kJoystickAxes;
View
@@ -12,6 +12,8 @@
#include "LiveWindow/LiveWindow.h"
#include "WPIErrors.h"
+using namespace frc;
+
/**
* Common initialization code for Encoders.
* This code allocates resources for Encoders and is common to all constructors.
View
@@ -17,6 +17,8 @@
#include <unistd.h>
#endif
+using namespace frc;
+
/**
* Provide an alternate "main loop" via StartCompetition().
*
View
@@ -9,6 +9,8 @@
#include "LiveWindow/LiveWindow.h"
+using namespace frc;
+
/**
* @param channel The PWM channel that the Jaguar is attached to.
*/
View
@@ -13,6 +13,8 @@
#include "DriverStation.h"
#include "WPIErrors.h"
+using namespace frc;
+
const int Joystick::kDefaultXAxis;
const int Joystick::kDefaultYAxis;
const int Joystick::kDefaultZAxis;
View
@@ -14,6 +14,8 @@
#include "Timer.h"
#include "WPIErrors.h"
+using namespace frc;
+
std::set<MotorSafetyHelper*> MotorSafetyHelper::m_helperList;
priority_recursive_mutex MotorSafetyHelper::m_listMutex;
View
@@ -11,6 +11,8 @@
#include "Utility.h"
#include "WPIErrors.h"
+using namespace frc;
+
std::list<Notifier*> Notifier::timerQueue;
priority_recursive_mutex Notifier::queueMutex;
std::atomic<int> Notifier::refcount{0};
View
@@ -13,6 +13,8 @@
#include "PIDOutput.h"
#include "PIDSource.h"
+using namespace frc;
+
static const std::string kP = "p";
static const std::string kI = "i";
static const std::string kD = "d";
View
@@ -12,6 +12,8 @@
#include "Utility.h"
#include "WPIErrors.h"
+using namespace frc;
+
const float PWM::kDefaultPwmPeriod = 5.05;
const float PWM::kDefaultPwmCenter = 1.5;
const int PWM::kDefaultPwmStepsDown = 1000;
View
@@ -13,6 +13,8 @@
#include "MotorSafetyHelper.h"
#include "WPIErrors.h"
+using namespace frc;
+
/**
* Relay constructor given a channel.
*
View
@@ -10,6 +10,8 @@
#include "RobotState.h"
#include "Utility.h"
+using namespace frc;
+
/**
* Constructor for a generic robot program.
*
View
@@ -16,6 +16,8 @@
#include "Utility.h"
#include "WPIErrors.h"
+using namespace frc;
+
const int RobotDrive::kMaxNumberOfMotors;
static auto make_shared_nodelete(SpeedController* ptr) {
View
@@ -10,6 +10,8 @@
#include <memory>
#include <sstream>
+using namespace frc;
+
/**
* Constructor for a SafePWM object taking a channel number.
*
View
@@ -21,6 +21,8 @@
void sleep(unsigned int milliseconds) { Sleep(milliseconds); }
#endif
+using namespace frc;
+
SampleRobot::SampleRobot() : m_robotMainOverridden(true) {}
/**
View
@@ -9,6 +9,8 @@
#include "WPIErrors.h"
+using namespace frc;
+
const int SensorBase::kDigitalChannels;
const int SensorBase::kAnalogInputs;
const int SensorBase::kSolenoidChannels;
View
@@ -13,6 +13,8 @@
#include "WPIErrors.h"
#include "simulation/simTime.h"
+using namespace frc;
+
/**
* Constructor.
*
View
@@ -9,6 +9,8 @@
#include "LiveWindow/LiveWindow.h"
+using namespace frc;
+
/**
* @param channel The PWM channel that the Talon is attached to.
*/
View
@@ -26,6 +26,8 @@ void time_callback(const msgs::ConstFloat64Ptr& msg) {
}
} // namespace wpilib
+namespace frc {
+
/**
* Pause the task for a specified time.
*
@@ -65,6 +67,10 @@ double GetTime() {
return Timer::GetFPGATimestamp(); // The epoch starts when Gazebo starts
}
+} // namespace frc
+
+using namespace frc;
+
// for compatibility with msvc12--see C2864
const double Timer::kRolloverTime = (1ll << 32) / 1e6;
/**
View
@@ -20,6 +20,8 @@
#include "Timer.h"
#include "simulation/simTime.h"
+using namespace frc;
+
static bool stackTraceEnabled = false;
static bool suspendOnAssertEnabled = false;
@@ -143,6 +145,8 @@ bool wpi_assertNotEqual_impl(int valueA, int valueB, const std::string& message,
return valueA != valueB;
}
+namespace frc {
+
/**
* Read the microsecond-resolution timer on the FPGA.
*
@@ -205,3 +209,5 @@ static std::string demangle(char const* mangledSymbol) {
}
std::string GetStackTrace(int offset) { return "no stack trace on windows"; }
#endif
+
+} // namespace frc
View
@@ -9,6 +9,8 @@
#include "LiveWindow/LiveWindow.h"
+using namespace frc;
+
/**
* @param channel The PWM channel that the Victor is attached to.
*/
View
@@ -9,6 +9,8 @@
#include "simulation/MainNode.h"
+using namespace frc;
+
SimContinuousOutput::SimContinuousOutput(std::string topic) {
pub = MainNode::Advertise<msgs::Float64>("~/simulator/" + topic);
std::cout << "Initialized ~/simulator/" + topic << std::endl;
View
@@ -9,6 +9,8 @@
#include "simulation/MainNode.h"
+using namespace frc;
+
SimDigitalInput::SimDigitalInput(std::string topic) {
sub = MainNode::Subscribe("~/simulator/" + topic, &SimDigitalInput::callback,
this);
View
@@ -9,6 +9,8 @@
#include "simulation/MainNode.h"
+using namespace frc;
+
SimEncoder::SimEncoder(std::string topic) {
commandPub =
MainNode::Advertise<msgs::GzString>("~/simulator/" + topic + "/control");
View
@@ -9,6 +9,8 @@
#include "simulation/MainNode.h"
+using namespace frc;
+
SimFloatInput::SimFloatInput(std::string topic) {
sub = MainNode::Subscribe("~/simulator/" + topic, &SimFloatInput::callback,
this);
View
@@ -9,6 +9,8 @@
#include "simulation/MainNode.h"
+using namespace frc;
+
SimGyro::SimGyro(std::string topic) {
commandPub =
MainNode::Advertise<msgs::GzString>("~/simulator/" + topic + "/control");
View
@@ -13,6 +13,7 @@ model {
targetPlatform 'arm'
binaries.all {
tasks.withType(CppCompile) {
+ cppCompiler.args "-DNAMESPACED_WPILIB"
addNiLibraryLinks(linker, targetPlatform)
addStaticNetworkTablesLibraryLinks(it, linker, targetPlatform)
}
View
@@ -9,6 +9,8 @@
#include <Commands/Command.h>
+namespace frc {
+
class MockCommand : public Command {
private:
int32_t m_initializeCount;
@@ -40,3 +42,5 @@ class MockCommand : public Command {
int32_t GetInterruptedCount() { return m_interruptedCount; }
bool HasInterrupted();
};
+
+} // namespace frc
View
@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kDelayTime = 0.01;
/**
View
@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kScale = 270.0;
static const double kAngle = 180.0;
View
@@ -10,6 +10,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static constexpr double kAccelerationTolerance = 0.1;
/**
* There's not much we can automatically test with the on-board accelerometer,
View
@@ -11,6 +11,8 @@
#include "gtest/gtest.h"
+using namespace frc;
+
static const std::array<double, 10> values = {
751.848, 766.366, 342.657, 234.252, 716.126,
132.344, 445.697, 22.727, 421.125, 799.913};
View
@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kMotorDelay = 2.5;
static const double kMaxPeriod = 2.0;
View
@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kCounterTime = 0.001;
static const double kDelayTime = 0.1;
View
@@ -12,6 +12,8 @@
#include "Encoder.h"
#include "gtest/gtest.h"
+using namespace frc;
+
/**
* Tests that configuring inputs to be filtered succeeds.
*
View
@@ -11,6 +11,8 @@
#include "Utility.h"
#include "gtest/gtest.h"
+using namespace frc;
+
constexpr double TIMER_TOLERANCE = 0.2;
constexpr int64_t TIMER_RUNTIME = 1000000; // 1 second
View
@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kDelayTime = 0.001;
class FakeEncoderTest : public testing::Test {
View
@@ -17,6 +17,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
+using namespace frc;
+
enum FilterNoiseTestType { TEST_SINGLE_POLE_IIR, TEST_MOVAVG };
std::ostream& operator<<(std::ostream& os, const FilterNoiseTestType& type) {
View
@@ -17,6 +17,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
+using namespace frc;
+
enum FilterOutputTestType { TEST_SINGLE_POLE_IIR, TEST_HIGH_PASS, TEST_MOVAVG };
std::ostream& operator<<(std::ostream& os, const FilterOutputTestType& type) {
View
@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
+using namespace frc;
+
enum MotorEncoderTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
std::ostream& operator<<(std::ostream& os, MotorEncoderTestType const& type) {
View
@@ -13,6 +13,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
+using namespace frc;
+
enum MotorInvertingTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
static const double motorSpeed = 0.15;
static const double delayTime = 0.5;
View
@@ -11,6 +11,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
unsigned notifierCounter;
void notifierHandler(void*) { notifierCounter++; }
View
@@ -15,6 +15,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
/* The PCM switches the compressor up to a couple seconds after the pressure
switch changes. */
static const double kCompressorDelayTime = 3.0;
View
@@ -12,6 +12,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
class PIDToleranceTest : public testing::Test {
protected:
const double setpoint = 50.0;
View
@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kMotorTime = 0.25;
class PowerDistributionPanelTest : public testing::Test {
View
@@ -14,6 +14,8 @@
#include "gtest/gtest.h"
#include "ntcore.h"
+using namespace frc;
+
static const char* kFileName = "networktables.ini";
static const double kSaveTime = 1.2;
View
@@ -12,6 +12,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kDelayTime = 0.01;
class RelayTest : public testing::Test {
View
@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
class TestEnvironment : public testing::Environment {
bool m_alreadySetUp = false;
View
@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static constexpr double kServoResetTime = 2.0;
static constexpr double kTestAngle = 90.0;
View
@@ -10,6 +10,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
+using namespace frc;
+
static const double kWaitTime = 0.5;
class TimerTest : public testing::Test {
View
@@ -14,6 +14,8 @@
#include "command/MockCommand.h"
#include "gtest/gtest.h"
+using namespace frc;
+
class CommandTest : public testing::Test {
protected:
void SetUp() override {
View
@@ -7,6 +7,8 @@
#include "command/MockCommand.h"
+using namespace frc;
+
MockCommand::MockCommand() {
m_initializeCount = 0;
m_executeCount = 0;