mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Cleaned up integer type usage in wpilibc (#92)
Replaced all unsigned types to signed and int32_t with int in wpilibc
This commit is contained in:
committed by
Peter Johnson
parent
ff93050b31
commit
0cd05d1a42
@@ -29,13 +29,13 @@ class AnalogModule;
|
||||
*/
|
||||
class AnalogGyro : public GyroBase {
|
||||
public:
|
||||
static const uint32_t kOversampleBits;
|
||||
static const uint32_t kAverageBits;
|
||||
static const int kOversampleBits;
|
||||
static const int kAverageBits;
|
||||
static const float kSamplesPerSecond;
|
||||
static const float kCalibrationSampleTime;
|
||||
static const float kDefaultVoltsPerDegreePerSecond;
|
||||
|
||||
explicit AnalogGyro(uint32_t channel);
|
||||
explicit AnalogGyro(int channel);
|
||||
virtual ~AnalogGyro() = default;
|
||||
float GetAngle() const;
|
||||
void Calibrate() override;
|
||||
|
||||
@@ -31,17 +31,17 @@ class AnalogInput : public SensorBase,
|
||||
public PIDSource,
|
||||
public LiveWindowSendable {
|
||||
public:
|
||||
static const uint8_t kAccumulatorModuleNumber = 1;
|
||||
static const uint32_t kAccumulatorNumChannels = 2;
|
||||
static const uint32_t kAccumulatorChannels[kAccumulatorNumChannels];
|
||||
static const int kAccumulatorModuleNumber = 1;
|
||||
static const int kAccumulatorNumChannels = 2;
|
||||
static const int kAccumulatorChannels[kAccumulatorNumChannels];
|
||||
|
||||
explicit AnalogInput(uint32_t channel);
|
||||
explicit AnalogInput(int channel);
|
||||
virtual ~AnalogInput() = default;
|
||||
|
||||
float GetVoltage() const;
|
||||
float GetAverageVoltage() const;
|
||||
|
||||
uint32_t GetChannel() const;
|
||||
int GetChannel() const;
|
||||
|
||||
double PIDGet() override;
|
||||
|
||||
@@ -53,7 +53,7 @@ class AnalogInput : public SensorBase,
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
int m_channel;
|
||||
SimFloatInput* m_impl;
|
||||
int64_t m_accumulatorOffset;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Counter : public SensorBase,
|
||||
public LiveWindowSendable {
|
||||
public:
|
||||
explicit Counter(Mode mode = kTwoPulse);
|
||||
explicit Counter(uint32_t channel);
|
||||
explicit Counter(int channel);
|
||||
// TODO: [Not Supported] explicit Counter(DigitalSource *source);
|
||||
// TODO: [Not Supported] explicit Counter(DigitalSource &source);
|
||||
// TODO: [Not Supported] explicit Counter(AnalogTrigger *source);
|
||||
@@ -38,7 +38,7 @@ class Counter : public SensorBase,
|
||||
// *upSource, DigitalSource *downSource, bool inverted);
|
||||
virtual ~Counter();
|
||||
|
||||
void SetUpSource(uint32_t channel);
|
||||
void SetUpSource(int channel);
|
||||
// TODO: [Not Supported] void SetUpSource(AnalogTrigger *analogTrigger,
|
||||
// AnalogTriggerType triggerType);
|
||||
// TODO: [Not Supported] void SetUpSource(AnalogTrigger &analogTrigger,
|
||||
@@ -48,7 +48,7 @@ class Counter : public SensorBase,
|
||||
void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
|
||||
void ClearUpSource();
|
||||
|
||||
void SetDownSource(uint32_t channel);
|
||||
void SetDownSource(int channel);
|
||||
// TODO: [Not Supported] void SetDownSource(AnalogTrigger *analogTrigger,
|
||||
// AnalogTriggerType triggerType);
|
||||
// TODO: [Not Supported] void SetDownSource(AnalogTrigger &analogTrigger,
|
||||
@@ -66,7 +66,7 @@ class Counter : public SensorBase,
|
||||
void SetReverseDirection(bool reverseDirection);
|
||||
|
||||
// CounterBase interface
|
||||
int32_t Get() const override;
|
||||
int Get() const override;
|
||||
void Reset() override;
|
||||
double GetPeriod() const override;
|
||||
void SetMaxPeriod(double maxPeriod) override;
|
||||
@@ -76,7 +76,7 @@ class Counter : public SensorBase,
|
||||
|
||||
void SetSamplesToAverage(int samplesToAverage);
|
||||
int GetSamplesToAverage() const;
|
||||
uint32_t GetFPGAIndex() const { return m_index; }
|
||||
int GetFPGAIndex() const { return m_index; }
|
||||
|
||||
void UpdateTable() override;
|
||||
void StartLiveWindowMode() override;
|
||||
@@ -94,7 +94,7 @@ class Counter : public SensorBase,
|
||||
private:
|
||||
bool m_allocatedUpSource; ///< Was the upSource allocated locally?
|
||||
bool m_allocatedDownSource; ///< Was the downSource allocated locally?
|
||||
uint32_t m_index; ///< The index of this counter.
|
||||
int m_index; ///< The index of this counter.
|
||||
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ class CounterBase {
|
||||
enum EncodingType { k1X, k2X, k4X };
|
||||
|
||||
virtual ~CounterBase() = default;
|
||||
virtual int32_t Get() const = 0;
|
||||
virtual int Get() const = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual double GetPeriod() const = 0;
|
||||
virtual void SetMaxPeriod(double maxPeriod) = 0;
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
*/
|
||||
class DigitalInput : public LiveWindowSendable {
|
||||
public:
|
||||
explicit DigitalInput(uint32_t channel);
|
||||
explicit DigitalInput(int channel);
|
||||
virtual ~DigitalInput() = default;
|
||||
uint32_t Get() const;
|
||||
uint32_t GetChannel() const;
|
||||
int Get() const;
|
||||
int GetChannel() const;
|
||||
|
||||
void UpdateTable() override;
|
||||
void StartLiveWindowMode() override;
|
||||
@@ -37,7 +37,7 @@ class DigitalInput : public LiveWindowSendable {
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
int m_channel;
|
||||
bool m_lastValue;
|
||||
SimDigitalInput* m_impl;
|
||||
|
||||
|
||||
@@ -25,9 +25,8 @@ class DoubleSolenoid : public LiveWindowSendable, public ITableListener {
|
||||
public:
|
||||
enum Value { kOff, kForward, kReverse };
|
||||
|
||||
explicit DoubleSolenoid(uint32_t forwardChannel, uint32_t reverseChannel);
|
||||
DoubleSolenoid(uint8_t moduleNumber, uint32_t forwardChannel,
|
||||
uint32_t reverseChannel);
|
||||
explicit DoubleSolenoid(int forwardChannel, int reverseChannel);
|
||||
DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel);
|
||||
virtual ~DoubleSolenoid();
|
||||
virtual void Set(Value value);
|
||||
virtual Value Get() const;
|
||||
|
||||
@@ -40,22 +40,22 @@ class DriverStation : public SensorBase, public RobotStateInterface {
|
||||
static DriverStation& GetInstance();
|
||||
static void ReportError(std::string error);
|
||||
static void ReportWarning(std::string error);
|
||||
static void ReportError(bool is_error, int32_t code, const std::string& error,
|
||||
static void ReportError(bool is_error, int code, const std::string& error,
|
||||
const std::string& location,
|
||||
const std::string& stack);
|
||||
|
||||
static const uint32_t kBatteryChannel = 7;
|
||||
static const uint32_t kJoystickPorts = 4;
|
||||
static const uint32_t kJoystickAxes = 6;
|
||||
static const int kBatteryChannel = 7;
|
||||
static const int kJoystickPorts = 4;
|
||||
static const int kJoystickAxes = 6;
|
||||
|
||||
float GetStickAxis(uint32_t stick, uint32_t axis);
|
||||
bool GetStickButton(uint32_t stick, uint32_t button);
|
||||
int16_t GetStickButtons(uint32_t stick);
|
||||
float GetStickAxis(int stick, int axis);
|
||||
bool GetStickButton(int stick, int button);
|
||||
int16_t GetStickButtons(int stick);
|
||||
|
||||
float GetAnalogIn(uint32_t channel);
|
||||
bool GetDigitalIn(uint32_t channel);
|
||||
void SetDigitalOut(uint32_t channel, bool value);
|
||||
bool GetDigitalOut(uint32_t channel);
|
||||
float GetAnalogIn(int channel);
|
||||
bool GetDigitalIn(int channel);
|
||||
void SetDigitalOut(int channel, bool value);
|
||||
bool GetDigitalOut(int channel);
|
||||
|
||||
bool IsEnabled() const;
|
||||
bool IsDisabled() const;
|
||||
@@ -64,9 +64,9 @@ class DriverStation : public SensorBase, public RobotStateInterface {
|
||||
bool IsTest() const;
|
||||
bool IsFMSAttached() const;
|
||||
|
||||
uint32_t GetPacketNumber() const;
|
||||
int GetPacketNumber() const;
|
||||
Alliance GetAlliance() const;
|
||||
uint32_t GetLocation() const;
|
||||
int GetLocation() const;
|
||||
void WaitForData();
|
||||
double GetMatchTime() const;
|
||||
float GetBatteryVoltage() const;
|
||||
@@ -112,7 +112,7 @@ class DriverStation : public SensorBase, public RobotStateInterface {
|
||||
private:
|
||||
static void InitTask(DriverStation* ds);
|
||||
static DriverStation* m_instance;
|
||||
static uint8_t m_updateNumber;
|
||||
static int m_updateNumber;
|
||||
///< TODO: Get rid of this and use the semaphore signaling
|
||||
static const float kUpdatePeriod;
|
||||
|
||||
@@ -125,7 +125,7 @@ class DriverStation : public SensorBase, public RobotStateInterface {
|
||||
void joystickCallback4(const msgs::ConstFRCJoystickPtr& msg);
|
||||
void joystickCallback5(const msgs::ConstFRCJoystickPtr& msg);
|
||||
|
||||
uint8_t m_digitalOut = 0;
|
||||
int m_digitalOut = 0;
|
||||
std::condition_variable m_waitForDataCond;
|
||||
std::mutex m_waitForDataMutex;
|
||||
mutable std::recursive_mutex m_stateMutex;
|
||||
|
||||
@@ -38,7 +38,7 @@ class Encoder : public SensorBase,
|
||||
public PIDSource,
|
||||
public LiveWindowSendable {
|
||||
public:
|
||||
Encoder(uint32_t aChannel, uint32_t bChannel, bool reverseDirection = false,
|
||||
Encoder(int aChannel, int bChannel, bool reverseDirection = false,
|
||||
EncodingType encodingType = k4X);
|
||||
// TODO: [Not Supported] Encoder(DigitalSource *aSource, DigitalSource
|
||||
// *bSource, bool reverseDirection=false, EncodingType encodingType = k4X);
|
||||
@@ -47,9 +47,9 @@ class Encoder : public SensorBase,
|
||||
virtual ~Encoder() = default;
|
||||
|
||||
// CounterBase interface
|
||||
int32_t Get() const override;
|
||||
int32_t GetRaw() const;
|
||||
int32_t GetEncodingScale() const;
|
||||
int Get() const override;
|
||||
int GetRaw() const;
|
||||
int GetEncodingScale() const;
|
||||
void Reset() override;
|
||||
double GetPeriod() const override;
|
||||
void SetMaxPeriod(double maxPeriod) override;
|
||||
@@ -73,7 +73,7 @@ class Encoder : public SensorBase,
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
int32_t FPGAEncoderIndex() const { return 0; }
|
||||
int FPGAEncoderIndex() const { return 0; }
|
||||
|
||||
private:
|
||||
void InitEncoder(int channelA, int channelB, bool _reverseDirection,
|
||||
@@ -91,7 +91,7 @@ class Encoder : public SensorBase,
|
||||
int channelA, channelB;
|
||||
double m_distancePerPulse; // distance of travel for each encoder tick
|
||||
EncodingType m_encodingType; // Encoding type
|
||||
int32_t m_encodingScale; // 1x, 2x, or 4x, per the encodingType
|
||||
int m_encodingScale; // 1x, 2x, or 4x, per the encodingType
|
||||
bool m_reverseDirection;
|
||||
SimEncoder* impl;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
class Jaguar : public SafePWM, public SpeedController {
|
||||
public:
|
||||
explicit Jaguar(uint32_t channel);
|
||||
explicit Jaguar(int channel);
|
||||
virtual ~Jaguar() = default;
|
||||
virtual void Set(float value);
|
||||
virtual float Get() const;
|
||||
|
||||
@@ -23,11 +23,11 @@ class DriverStation;
|
||||
*/
|
||||
class Joystick : public GenericHID, public ErrorBase {
|
||||
public:
|
||||
static const uint32_t kDefaultXAxis = 1;
|
||||
static const uint32_t kDefaultYAxis = 2;
|
||||
static const uint32_t kDefaultZAxis = 3;
|
||||
static const uint32_t kDefaultTwistAxis = 4;
|
||||
static const uint32_t kDefaultThrottleAxis = 3;
|
||||
static const int kDefaultXAxis = 1;
|
||||
static const int kDefaultYAxis = 2;
|
||||
static const int kDefaultZAxis = 3;
|
||||
static const int kDefaultTwistAxis = 4;
|
||||
static const int kDefaultThrottleAxis = 3;
|
||||
typedef enum {
|
||||
kXAxis,
|
||||
kYAxis,
|
||||
@@ -36,19 +36,19 @@ class Joystick : public GenericHID, public ErrorBase {
|
||||
kThrottleAxis,
|
||||
kNumAxisTypes
|
||||
} AxisType;
|
||||
static const uint32_t kDefaultTriggerButton = 1;
|
||||
static const uint32_t kDefaultTopButton = 2;
|
||||
static const int kDefaultTriggerButton = 1;
|
||||
static const int kDefaultTopButton = 2;
|
||||
typedef enum { kTriggerButton, kTopButton, kNumButtonTypes } ButtonType;
|
||||
|
||||
explicit Joystick(uint32_t port);
|
||||
Joystick(uint32_t port, uint32_t numAxisTypes, uint32_t numButtonTypes);
|
||||
explicit Joystick(int port);
|
||||
Joystick(int port, int numAxisTypes, int numButtonTypes);
|
||||
virtual ~Joystick() = default;
|
||||
|
||||
Joystick(const Joystick&) = delete;
|
||||
Joystick& operator=(const Joystick&) = delete;
|
||||
|
||||
uint32_t GetAxisChannel(AxisType axis);
|
||||
void SetAxisChannel(AxisType axis, uint32_t channel);
|
||||
int GetAxisChannel(AxisType axis);
|
||||
void SetAxisChannel(AxisType axis, int channel);
|
||||
|
||||
float GetX(JoystickHand hand = kRightHand) const override;
|
||||
float GetY(JoystickHand hand = kRightHand) const override;
|
||||
@@ -56,15 +56,15 @@ class Joystick : public GenericHID, public ErrorBase {
|
||||
float GetTwist() const override;
|
||||
float GetThrottle() const override;
|
||||
virtual float GetAxis(AxisType axis) const;
|
||||
float GetRawAxis(uint32_t axis) const override;
|
||||
float GetRawAxis(int axis) const override;
|
||||
|
||||
bool GetTrigger(JoystickHand hand = kRightHand) const override;
|
||||
bool GetTop(JoystickHand hand = kRightHand) const override;
|
||||
bool GetBumper(JoystickHand hand = kRightHand) const override;
|
||||
bool GetRawButton(uint32_t button) const override;
|
||||
int GetPOV(uint32_t pov = 1) const override;
|
||||
bool GetRawButton(int button) const override;
|
||||
int GetPOV(int pov = 1) const override;
|
||||
bool GetButton(ButtonType button) const;
|
||||
static Joystick* GetStickForPort(uint32_t port);
|
||||
static Joystick* GetStickForPort(int port);
|
||||
|
||||
virtual float GetMagnitude() const;
|
||||
virtual float GetDirectionRadians() const;
|
||||
@@ -72,7 +72,7 @@ class Joystick : public GenericHID, public ErrorBase {
|
||||
|
||||
private:
|
||||
DriverStation& m_ds;
|
||||
uint32_t m_port;
|
||||
std::unique_ptr<uint32_t[]> m_axes;
|
||||
std::unique_ptr<uint32_t[]> m_buttons;
|
||||
int m_port;
|
||||
std::unique_ptr<int[]> m_axes;
|
||||
std::unique_ptr<int[]> m_buttons;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ class Notifier : public ErrorBase {
|
||||
static std::atomic<int> refcount;
|
||||
|
||||
// Process the timer queue on a timer event
|
||||
static void ProcessQueue(uint32_t mask, void* params);
|
||||
static void ProcessQueue(int mask, void* params);
|
||||
|
||||
// Update the FPGA alarm since the queue has changed
|
||||
static void UpdateAlarm();
|
||||
|
||||
@@ -42,16 +42,16 @@ class PWM : public SensorBase,
|
||||
kPeriodMultiplier_4X = 4
|
||||
};
|
||||
|
||||
explicit PWM(uint32_t channel);
|
||||
explicit PWM(int channel);
|
||||
virtual ~PWM();
|
||||
virtual void SetRaw(uint16_t value);
|
||||
void SetPeriodMultiplier(PeriodMultiplier mult);
|
||||
void EnableDeadbandElimination(bool eliminateDeadband);
|
||||
void SetBounds(int32_t max, int32_t deadbandMax, int32_t center,
|
||||
int32_t deadbandMin, int32_t min);
|
||||
void SetBounds(int max, int deadbandMax, int center, int deadbandMin,
|
||||
int min);
|
||||
void SetBounds(double max, double deadbandMax, double center,
|
||||
double deadbandMin, double min);
|
||||
uint32_t GetChannel() const { return m_channel; }
|
||||
int GetChannel() const { return m_channel; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
@@ -80,8 +80,8 @@ class PWM : public SensorBase,
|
||||
/**
|
||||
* kDefaultPWMStepsDown is the number of PWM steps below the centerpoint
|
||||
*/
|
||||
static const int32_t kDefaultPwmStepsDown;
|
||||
static const int32_t kPwmDisabled;
|
||||
static const int kDefaultPwmStepsDown;
|
||||
static const int kPwmDisabled;
|
||||
|
||||
virtual void SetPosition(float pos);
|
||||
virtual float GetPosition() const;
|
||||
@@ -89,7 +89,7 @@ class PWM : public SensorBase,
|
||||
virtual float GetSpeed() const;
|
||||
|
||||
bool m_eliminateDeadband;
|
||||
int32_t m_centerPwm;
|
||||
int m_centerPwm;
|
||||
|
||||
void ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value, bool isNew) override;
|
||||
@@ -103,6 +103,6 @@ class PWM : public SensorBase,
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
int m_channel;
|
||||
SimContinuousOutput* impl;
|
||||
};
|
||||
|
||||
@@ -40,12 +40,12 @@ class Relay : public MotorSafety,
|
||||
enum Value { kOff, kOn, kForward, kReverse };
|
||||
enum Direction { kBothDirections, kForwardOnly, kReverseOnly };
|
||||
|
||||
explicit Relay(uint32_t channel, Direction direction = kBothDirections);
|
||||
explicit Relay(int channel, Direction direction = kBothDirections);
|
||||
virtual ~Relay();
|
||||
|
||||
void Set(Value value);
|
||||
Value Get() const;
|
||||
uint32_t GetChannel() const;
|
||||
int GetChannel() const;
|
||||
|
||||
void SetExpiration(float timeout) override;
|
||||
float GetExpiration() const override;
|
||||
@@ -67,7 +67,7 @@ class Relay : public MotorSafety,
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
int m_channel;
|
||||
Direction m_direction;
|
||||
std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
|
||||
SimContinuousOutput* impl;
|
||||
|
||||
@@ -38,9 +38,9 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
kRearRightMotor = 3
|
||||
};
|
||||
|
||||
RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel);
|
||||
RobotDrive(uint32_t frontLeftMotorChannel, uint32_t rearLeftMotorChannel,
|
||||
uint32_t frontRightMotorChannel, uint32_t rearRightMotorChannel);
|
||||
RobotDrive(int leftMotorChannel, int rightMotorChannel);
|
||||
RobotDrive(int frontLeftMotorChannel, int rearLeftMotorChannel,
|
||||
int frontRightMotorChannel, int rearRightMotorChannel);
|
||||
RobotDrive(SpeedController* leftMotor, SpeedController* rightMotor);
|
||||
RobotDrive(SpeedController& leftMotor, SpeedController& rightMotor);
|
||||
RobotDrive(std::shared_ptr<SpeedController> leftMotor,
|
||||
@@ -63,20 +63,18 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
bool squaredInputs = true);
|
||||
void TankDrive(GenericHID& leftStick, GenericHID& rightStick,
|
||||
bool squaredInputs = true);
|
||||
void TankDrive(GenericHID* leftStick, uint32_t leftAxis,
|
||||
GenericHID* rightStick, uint32_t rightAxis,
|
||||
bool squaredInputs = true);
|
||||
void TankDrive(GenericHID& leftStick, uint32_t leftAxis,
|
||||
GenericHID& rightStick, uint32_t rightAxis,
|
||||
bool squaredInputs = true);
|
||||
void TankDrive(GenericHID* leftStick, int leftAxis, GenericHID* rightStick,
|
||||
int rightAxis, bool squaredInputs = true);
|
||||
void TankDrive(GenericHID& leftStick, int leftAxis, GenericHID& rightStick,
|
||||
int rightAxis, bool squaredInputs = true);
|
||||
void TankDrive(float leftValue, float rightValue, bool squaredInputs = true);
|
||||
void ArcadeDrive(GenericHID* stick, bool squaredInputs = true);
|
||||
void ArcadeDrive(GenericHID& stick, bool squaredInputs = true);
|
||||
void ArcadeDrive(GenericHID* moveStick, uint32_t moveChannel,
|
||||
GenericHID* rotateStick, uint32_t rotateChannel,
|
||||
void ArcadeDrive(GenericHID* moveStick, int moveChannel,
|
||||
GenericHID* rotateStick, int rotateChannel,
|
||||
bool squaredInputs = true);
|
||||
void ArcadeDrive(GenericHID& moveStick, uint32_t moveChannel,
|
||||
GenericHID& rotateStick, uint32_t rotateChannel,
|
||||
void ArcadeDrive(GenericHID& moveStick, int moveChannel,
|
||||
GenericHID& rotateStick, int rotateChannel,
|
||||
bool squaredInputs = true);
|
||||
void ArcadeDrive(float moveValue, float rotateValue,
|
||||
bool squaredInputs = true);
|
||||
@@ -103,9 +101,9 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
void Normalize(double* wheelSpeeds);
|
||||
void RotateVector(double& x, double& y, double angle);
|
||||
|
||||
static const int32_t kMaxNumberOfMotors = 4;
|
||||
static const int kMaxNumberOfMotors = 4;
|
||||
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors] = {1, 1, 1, 1};
|
||||
int m_invertedMotors[kMaxNumberOfMotors] = {1, 1, 1, 1};
|
||||
float m_sensitivity = 0.5;
|
||||
double m_maxOutput = 1.0;
|
||||
bool m_deleteSpeedControllers;
|
||||
@@ -116,7 +114,7 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
// FIXME: MotorSafetyHelper *m_safetyHelper;
|
||||
|
||||
private:
|
||||
int32_t GetNumMotors() {
|
||||
int GetNumMotors() {
|
||||
int motors = 0;
|
||||
if (m_frontLeftMotor) motors++;
|
||||
if (m_frontRightMotor) motors++;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
class SafePWM : public PWM, public MotorSafety {
|
||||
public:
|
||||
explicit SafePWM(uint32_t channel);
|
||||
explicit SafePWM(int channel);
|
||||
virtual ~SafePWM() = default;
|
||||
|
||||
void SetExpiration(float timeout);
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
*/
|
||||
class Solenoid : public LiveWindowSendable, public ITableListener {
|
||||
public:
|
||||
explicit Solenoid(uint32_t channel);
|
||||
Solenoid(uint8_t moduleNumber, uint32_t channel);
|
||||
explicit Solenoid(int channel);
|
||||
Solenoid(int moduleNumber, int channel);
|
||||
virtual ~Solenoid();
|
||||
virtual void Set(bool on);
|
||||
virtual bool Get() const;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
class Talon : public SafePWM, public SpeedController {
|
||||
public:
|
||||
explicit Talon(uint32_t channel);
|
||||
explicit Talon(int channel);
|
||||
virtual ~Talon() = default;
|
||||
virtual void Set(float value);
|
||||
virtual float Get() const;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
class Victor : public SafePWM, public SpeedController {
|
||||
public:
|
||||
explicit Victor(uint32_t channel);
|
||||
explicit Victor(int channel);
|
||||
virtual ~Victor() = default;
|
||||
virtual void Set(float value);
|
||||
virtual float Get() const;
|
||||
|
||||
@@ -25,7 +25,7 @@ class MainNode {
|
||||
|
||||
template <typename M>
|
||||
static transport::PublisherPtr Advertise(const std::string& topic,
|
||||
unsigned int _queueLimit = 10,
|
||||
int _queueLimit = 10,
|
||||
bool _latch = false) {
|
||||
return GetInstance()->main->Advertise<M>(topic, _queueLimit, _latch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user