mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Added tests for motor inversions.
This commit squashes all of Patrick's eleven commits into one so that things are a bit more sane. The original commit messages and change ids (for gerrit) can be found below. Testing Motor Inversion Feature (Java tests only so far) Change-Id: I44cd9b5a3fe066e1071316831dde14bff5ec3bd9 Test 2 of java testing for Motor Inverting Change-Id: I96cc0534bb1d28a70d10c582f0b40ea3a2d83cab Added another test to try to track down issue with InvertingMotor jaguar and Talon Change-Id: I9b5292315c93ec0d568d53a6bcdac5b998a6d857 More Testing on the Inverting motors with jaguars and talons. Change-Id: I896210a54903e3c0af68e8c41360c165cf9c3122 Added C++ integration Tests for the motor inversion. Change-Id: I81af5d4aab78d755340d99608b838046bf7ddda1 C++ tests for Motor Inversion now without crashing Change-Id: Ifdecdbfc1aeb18aafb2b4c63709b27636074a274 More testing of inverted motors (now with c++ tests) Talon seems not to be working on test rig Also added a CANJaguartest file in java since was missing Currently porting the CANJaguar tests from c++ to java Change-Id: Ib578d6ee1256ac31ddf20603aa6f24adde08065b Another attempt at adding java tests for can jaguar inversion. Change-Id: I971a886a4e555ada5bd15a814094da2a1eb5c8e1 Minor changes and attempt to rerun tests after yesterday's jenkins crash. Change-Id: I7ed0904d4243499c3246e9c39e5493d0d9c962c5 All motor inversion tests should be working now. Talon on the test rig has been fixed. Change-Id: I20bd6d7486b758ce1ce47ac799150475b3152b6f Updated Inversion tests again. Should work this time. (worked on the test rig prior) Change-Id: Ifdf222d5e5733fe802f29e7d939b72e84972e8da Added tests for motor inversions. This commit squashes all of Patrick's eleven commits into one so that things are a bit more sane. The original commit messages and change ids (for gerrit) can be found below. Testing Motor Inversion Feature (Java tests only so far) Change-Id: I44cd9b5a3fe066e1071316831dde14bff5ec3bd9 Test 2 of java testing for Motor Inverting Change-Id: I96cc0534bb1d28a70d10c582f0b40ea3a2d83cab Added another test to try to track down issue with InvertingMotor jaguar and Talon Change-Id: I9b5292315c93ec0d568d53a6bcdac5b998a6d857 More Testing on the Inverting motors with jaguars and talons. Change-Id: I896210a54903e3c0af68e8c41360c165cf9c3122 Added C++ integration Tests for the motor inversion. Change-Id: I81af5d4aab78d755340d99608b838046bf7ddda1 C++ tests for Motor Inversion now without crashing Change-Id: Ifdecdbfc1aeb18aafb2b4c63709b27636074a274 More testing of inverted motors (now with c++ tests) Talon seems not to be working on test rig Also added a CANJaguartest file in java since was missing Currently porting the CANJaguar tests from c++ to java Change-Id: Ib578d6ee1256ac31ddf20603aa6f24adde08065b Another attempt at adding java tests for can jaguar inversion. Change-Id: I971a886a4e555ada5bd15a814094da2a1eb5c8e1 Minor changes and attempt to rerun tests after yesterday's jenkins crash. Change-Id: I7ed0904d4243499c3246e9c39e5493d0d9c962c5 All motor inversion tests should be working now. Talon on the test rig has been fixed. Change-Id: I20bd6d7486b758ce1ce47ac799150475b3152b6f Updated Inversion tests again. Should work this time. (worked on the test rig prior) Change-Id: Ifdf222d5e5733fe802f29e7d939b72e84972e8da
This commit is contained in:
@@ -123,6 +123,8 @@ public:
|
||||
void GetDescription(char *desc) const override;
|
||||
uint8_t GetDeviceID() const;
|
||||
|
||||
//SpeedController overrides
|
||||
virtual void SetInverted(bool isInverted) override;
|
||||
protected:
|
||||
// Control mode helpers
|
||||
void SetSpeedReference(uint8_t reference);
|
||||
@@ -223,4 +225,5 @@ protected:
|
||||
|
||||
private:
|
||||
void InitCANJaguar();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -163,6 +163,7 @@ public:
|
||||
void InitTable(ITable *subTable) override;
|
||||
ITable * GetTable() const override;
|
||||
|
||||
virtual void SetInverted(bool isInverted) override;
|
||||
private:
|
||||
// Values for various modes as is sent in the CAN packets for the Talon.
|
||||
enum TalonControlMode {
|
||||
@@ -196,4 +197,5 @@ private:
|
||||
|
||||
// LiveWindow stuff.
|
||||
ITable *m_table;
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,8 @@ public:
|
||||
virtual void Disable();
|
||||
|
||||
virtual void PIDWrite(float output) override;
|
||||
|
||||
virtual void SetInverted(bool isInverted) override;
|
||||
private:
|
||||
void InitJaguar();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -84,8 +84,6 @@ protected:
|
||||
void RotateVector(double &x, double &y, double angle);
|
||||
|
||||
static const int32_t kMaxNumberOfMotors = 4;
|
||||
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors];
|
||||
float m_sensitivity;
|
||||
double m_maxOutput;
|
||||
bool m_deleteSpeedControllers;
|
||||
|
||||
@@ -17,17 +17,22 @@ public:
|
||||
virtual ~SpeedController() {}
|
||||
/**
|
||||
* Common interface for setting the speed of a speed controller.
|
||||
*
|
||||
*
|
||||
* @param speed The speed to set. Value should be between -1.0 and 1.0.
|
||||
* @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately.
|
||||
*/
|
||||
virtual void Set(float speed, uint8_t syncGroup = 0) = 0;
|
||||
/**
|
||||
* Common interface for getting the current set speed of a speed controller.
|
||||
*
|
||||
*
|
||||
* @return The current set speed. Value is between -1.0 and 1.0.
|
||||
*/
|
||||
virtual float Get() const = 0;
|
||||
/**
|
||||
* common interface for inverting direction of a speed controller
|
||||
* @param isInverted The state of inversion true is inverted
|
||||
*/
|
||||
virtual void SetInverted(bool isInverted) = 0;
|
||||
/**
|
||||
* Common interface for disabling a motor.
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,8 @@ public:
|
||||
virtual void Disable();
|
||||
|
||||
virtual void PIDWrite(float output) override;
|
||||
|
||||
virtual void SetInverted(bool isInverted) override;
|
||||
private:
|
||||
void InitTalon();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,9 @@ public:
|
||||
virtual void Disable() override;
|
||||
|
||||
virtual void PIDWrite(float output) override;
|
||||
virtual void SetInverted(bool isInverted) override;
|
||||
|
||||
private:
|
||||
void InitTalonSRX();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -26,6 +26,8 @@ public:
|
||||
|
||||
virtual void PIDWrite(float output) override;
|
||||
|
||||
virtual void SetInverted(bool isInverted);
|
||||
private:
|
||||
void InitVictor();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
@@ -23,6 +23,8 @@ public:
|
||||
|
||||
virtual void PIDWrite(float output) override;
|
||||
|
||||
virtual void SetInverted(bool isInverted);
|
||||
private:
|
||||
void InitVictorSP();
|
||||
bool m_isInverted;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user