Commit Graph

97 Commits

Author SHA1 Message Date
Peter Johnson
f89c5e150f Use new NetworkTables across WPILib (C++ and Java).
Also make sure table listeners stop listening in their destructors.  This
might be better handled by moving the table itself into ITableListener and
providing cleanup functionality there.

A submodule is used to pull in ntcore.

Change-Id: I3031c1a768595cf0f8754c47e15cd423e2dbcce5
2015-09-18 06:09:36 -07:00
James Kuszmaul
cd4ebbd8a0 Tuned test constants for VelocityPID.
Also added a GetAvgError method to the PIDController
which averages the past n error values for use with
noisy sensor values (namely, for the velocity stuff).

Change-Id: I8a9cf40259dd56ef9093b36ed6891cc18b9131cf
2015-08-11 06:32:24 -07:00
Tyler Veness
d5922bb037 artf4127: Implemented velocity PID controller
Change-Id: I8c0f84422f7ca0ac5c50fddb282fb3452ee1d491
2015-08-11 01:05:45 -07:00
James Kuszmaul
7eb8550bdb Major formatting changes (breaks diffs). No code changes.
The changes made in this commit do not affect any actual code,
    they are purely aesthetic. I ran clang-format with google style
    over all .h/.cpp files in wpilibc that weren't in wpilibC++Sim
    or gtest, and the eclipse formatter over all of the Java files
    using the Google eclipse formatting configuration.

Change-Id: I9627bca0bc103c398ecc1c5ba17467193291ae63
2015-06-25 15:07:55 -04:00
Joseph
bd64d9a7ef Added and implemented GetInverted method.
Change-Id: I53bd51e41311e3ffcd3fa3ffbc4e72cfab530109
2015-06-25 14:55:18 -04:00
Patrick
0122086d23 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
2015-06-25 14:55:06 -04:00
James Kuszmaul
27e4509676 Add CANSpeedController interface in Java.
This helps to bring Java to parity with C++.

Change-Id: Ibc79fd788c5c3c11af5de49d0c87436ebf4ba710
2015-06-25 11:55:56 -04:00
James Kuszmaul
ee824680d2 Re-adjusted some PID values for the tests.
Change-Id: I95623307c2a0b86003acbbcd029768fae5d4689e
2015-06-23 11:27:25 -04:00
Joseph
e48edbebd3 Fixed BuiltInAccelerometer Tests, changed expected axis of gravity from the z-axis to the y-axis.
Change-Id: Ie88569009d809ba150358a7fa7c6d84726fb32f6
2015-06-15 14:52:21 -04:00
Patrick
675fbc032c Test bench fixes and updates. Attempting to make it possible to have a stable build again. Gyro test still seems a bit unreliable.
Change-Id: I0c140a5263048ff47ed1ec6b243e07baf43ec21e
2015-06-03 10:26:31 -04:00
Brad Miller (WPI)
9cda6e3ff8 Merge "Tuned some values in tests to account for hardware imperfections." 2015-06-03 05:49:39 -07:00
Brad Miller (WPI)
0853dc8e5d Merge "Fixed access issues and 'overridableParamatar' misspelling." 2015-06-03 05:45:38 -07:00
James Kuszmaul
1805968d78 Tuned some values in tests to account for hardware imperfections.
Messed with some gyro and CANJaguar tests.
Note: The encoder for the CANJaguar slips a great deal with the motor accelerates rapidly.

Change-Id: I09547f95b122eb48b4f97c0496f970cf1a77c5b2
2015-05-26 09:43:05 -04:00
Fredric Silberberg
1e4e0bacde Gradle Build
This adds gradle support for building wpilibj and wpilibc. At this
point, both of these libraries should be fully ready to go.

Gradle should give us a number of improvements, including less
dependencies for getting building up and running, and MUCH faster build
times. I'm noticing significantly faster build times already compared to
Maven, with neither system building the plugins. The changes here should
be pretty straight forward. The basic command for gradle is './gradlew'.
This is the gradle wrapper, and it will find and download the correct
gradle executable for your system. There is no need to install anything
yourself. To see every task available, run './gradlew tasks'. The
important tasks for us are listed under the WPILib header when the tasks
command is run. To generate unit test binaries, the
fRCUserProgramExecutable command will create the C++ tester, and the
wpilibjIntegrationTestJar command will create the Java tester. The Jenkins
deploy scripts have been modified to know the difference between maven
generated and gradle generated jars with an environment variable. Creating
the eclipse plugins still requires Maven, but gradle will handle calling
it correctly and generating the proper dependencies for it. Create the
plugins by calling ./gradlew eclipsePlugins.

Jenkins can now be modified to support the new build system. Unit tests
are run with ./gradlew test. Generating the integration tests uses the
above two commands, and then process proceeds exactly as it did before.
For publishing documentation, a new task has been created, ./gradlew
publishDocs, which handles putting the documentation where Jenkins expects
for publishing.

Change-Id: I9a260d391984f98ef9170993efe933e4026161dc
2015-05-20 16:22:17 -04:00
Colby Skeggs
569f02de89 Fixed access issues and 'overridableParamatar' misspelling.
interruptFired was package-private, which meant that it couldn't be
used... at all. Oops! Also, fixed obvious misspelling of
overridableParamatar, which probably won't hurt anyone because they
couldn't have used interruptFired anyway...

Change-Id: I6c57c015d04cde31f5be92265db1d1d9ba0760c9
2015-04-09 23:43:42 +00:00
Thomas Clark
f21e4a9da5 Miscellaneous AnalogTrigger fixes
AnalogTrigger.createOutput is now public.  It was mistakenly made
package local before.

The AnalogTriggerType enum now uses the same naming convension
as other enumerations in WPILib.  There's no way that this breaks
existing code, since AnalogTrigger.createOutput wasn't public before
this commit.

Change-Id: I9a2b921a996012f61dac0e395602f8cc429d7611
2015-01-08 00:31:36 -05:00
Brad Miller
a55f34646d Encoder/Counter Fixes
This fixes all encoder variants with the getRate and getPeriod methods.
The clock speed in the HAL was updated, as was the scaling factors for setting
the stall periods. A default of .5 seconds is now set for the max period.
Additionally, a long standing bug was fixed with Java 2x encoders.

Changed tests to take into account the increased default timeout on encoders

Change-Id: I8b54c07ea467154be94d7ae7e9ada1775933dee4
2014-12-23 20:13:41 -05:00
Brad Miller
d26059a4fb Change expected voltage on CAN tests
Change-Id: I8c4533c7bcc81e7904d10792316382d4c01a840a
2014-12-18 21:22:31 -05:00
Colby Skeggs
1c24096cc9 Resolved artf3579: robot can no longer be enabled until robotInit() finishes in IterativeRobot; similar options available by overriding prestart() for other base classes.
Change-Id: I07fde4b1bd2fae0c2e2a04336639b44ec715628a
2014-12-14 01:22:41 +00:00
Colby Skeggs
2ae8f40a58 Changed AnalogPotentiometer to use angle specification and rail voltage.
Change-Id: I98f2c1c16726496a69c86174cdb870c74e05822c
2014-12-05 23:40:20 +00:00
James Kuszmaul
5893d28f39 Added support for basic PID in java Talon SRX.
Tested analog PID in Java and C++.
Changed to default to controlEnabled.
Loosely wrapped a bunch of CanTalonSRX functions in Java.

Change-Id: I9da380e2368d9a72f08be4434ac63b5710a9f90f
2014-12-04 17:00:36 -05:00
James Kuszmaul
7b371f6d7c Added Omar's new CanTalonSRX code.
I also updated the C++ and Java code some. For C++, this meant making it
compile and adding in the framework for the closed-loop control of the
motor. For Java, I updated the JNI bindings with SWIG and created an
GetTemperature accessor function to demonstrate how to use the accessors
because swig does funny stuff with pass-by-reference functions.

Change-Id: If51bf61d0a9bc65a8d497f8d91a5be8d6ff4fdcc
2014-11-26 15:51:16 -05:00
James Kuszmaul
6ec2d262c8 Added nicer Java interface for Talon SRX -- throttle mode works.
Change-Id: Ia6f4997b4836826f56a3dd4c8f7f29a0bf62d94c
2014-11-26 14:02:20 -05:00
James Kuszmaul
28a41e4ac2 Added support for CAN Talon SRX in C++ and Java.
Currently, the JNI bindings are generated by Swig and, unfortunately,
  the interface available through Java is lower-level than that for C++
  (ie, direct access to the ctre code through the JNI bindings, rather
   than an interface on top of that), but it does work.
See eclipse plugins for some short samples.
There are a couple of short unit tests as placeholders.
Still needs some cleaning up.

Change-Id: Iae2f74693ca6b80bf7d5aca0625c66aa6e0b7f85

Added quick samples for C++/Java CAN Talon stuff.

Change-Id: I3acb27d6fd5568d88931e0d678c09973d436735d
2014-11-26 11:55:37 -05:00
James Kuszmaul
91c70daf5b Tried to improve reliability of a couple of unit tests.
Change-Id: I45307da855808e85c8f9b9958c7590d60636f8e9
2014-11-20 16:39:32 -05:00
James Kuszmaul
05bb3cdd71 Upped the limits for the output on some PID tests.
We were having issues with intermittent PID tests because one of the
motors on the test stand was sticky and needed a bit of a push to start.

Change-Id: Ic75cd38de867a74be3e4e445bd0d02323dfc4df8
2014-11-06 14:05:35 -05:00
Jonathan Leitschuh
2d45cda74b Increases the runtime of the PID test to improve stability.
Change-Id: I852ac6115f0dfe4d39940fbecc34f1b52e6cc12a
2014-10-24 16:35:55 -04:00
Jonathan Leitschuh
e4d90c6cbe Decreases the amount of console spam during tests.
Change-Id: Ia2e3ac5850b4d2c184025779346118c8ac8a75b1
2014-10-24 16:31:55 -04:00
Jonathan Leitschuh
bc84c7ac7c Improves the general stability of the CANJaguarDefault tests
Adds a poling wait to all of the tests to accommodate the CANJaguar

Change-Id: I15a64a5fe901cb775bf03ef0b08c2f83429ef9b5
2014-10-23 13:03:49 -04:00
Jonathan Leitschuh
93925bc025 Fixes the GyroTest
Change-Id: Ia72fcb0533ea4e91b5f7e469e1a0b367eebda3b7
2014-10-22 18:39:27 -04:00
Jonathan Leitschuh
f7e8b95a24 Increases tolerances for the PID tests
The tolerance is now a little bit more loose but still demonstrates that the PID works correctly.

Change-Id: I9ca74e66fd096c49be7de61f218d5651b0ca0586
2014-10-22 14:04:41 -04:00
Thomas Clark
be30d3ab1d Fix CANJaguar brownout recovery in Java
In Java, CANJaguar didn't set up periodic status messages again after
a brownout

Change-Id: Iaedd844a7627dd44eb5d769a106b220648f35023
2014-10-22 10:56:25 -04:00
Thomas Clark
eca4d36a4b Disable CANJaguar current PID test
The hardware setup makes this test basically useless

Change-Id: I40287313a1928dda897c8e35922216d44ab089d2
2014-10-08 15:02:01 -04:00
Thomas Clark
7e9f183cf9 Update headers and .sos to v15 image + most API changes
Java still does not work

Change-Id: I172ac401a07b6703909068f82b7b6cc67e6075c0
2014-10-05 17:17:59 -04:00
Thomas Clark
b16a037759 Store preferences in a directory writable by lvuser
Change-Id: I1ed43968c2be76bfcb050a115f59517c398efff3
2014-09-10 14:05:51 -04:00
Jonathan Leitschuh
b1ace79379 Fixes the MotorEncoderTest sometimes failing because a counter registers movement from the jaguar after reset.
Change-Id: I65b24e59a902637b19b24c08f0a02b86621c5590
2014-08-29 16:46:08 -04:00
Jonathan Leitschuh
2a8ade093a Adds the ability to run test classes with --repeat rule.
Fixes a bug in several tests where --repeat wouldn't work due to multiple teardown calls.

Change-Id: I26f9350e9c7da6e9b0aefd1ecefb7e8d8975a641
2014-08-29 16:34:03 -04:00
Brad Miller (WPI)
21967fcb24 Merge "Fixes testing framework typos & adds rule to keep unix line endings for .sh" 2014-08-29 09:56:51 -07:00
Thomas Clark
9b896eab70 Make DoubleSolenoid work in Java [artf3457]
Make DoubleSolenoid and Solenoid use SolenoidBase, like in C++.

Add an integration tests for double solenoids.

Change-Id: I9a7ff562d65a564c5adabfa73f85f23ad466215b
2014-08-29 12:50:44 -04:00
Jonathan Leitschuh
67cb854676 Fixes testing framework typos & adds rule to keep unix line endings for .sh
Change-Id: I33826b879ba2dce7da88aa399d37f711a6612d86
2014-08-29 11:40:03 -04:00
Jonathan Leitschuh
47169e0ce1 Adds test scripts to deploy, run and retrieve results from integration tests.
Adds a simple script for jenkins to run to retrieve the test results from.
Adds a script that allows developers to download and run tests from a specific language easily.
Adds a script that allows the tests to be run from within an ssh session on the roborio.

Change-Id: Ibe6ddc4e1dcbb8192e6552c3901e96f6907a8020
2014-08-26 11:20:02 -04:00
Jonathan Leitschuh
f9ab84d912 Integration tests now run with the Ant Junit test framework.
Removes TestNG as it wasn't reporting all of the tests correctly. Adds Ant as a dependency and uses it to run the JUnit tests so that tests are output in a way that Jenkins understands.

Change-Id: Ie98358476cebe94f233e687195a0fced8723a878
2014-08-21 15:29:17 -04:00
Jonathan Leitschuh
8ba0eada17 Adds interrupts to Java
Implements the JNI bindings for java
Adds integration tests for Digital Inputs and AnalogTriggers.
Adds the ability to get the value and message from errno in java using the HALUtil JNI class.

Change-Id: I853529fdab9744ce95ee15d4cc73dc3953265552
2014-08-20 16:10:40 -04:00
Thomas Clark
4215d1c79b Fix Java IT build
The Java ITs should have jcommander as a dependency

Change-Id: Ide03fb245d21b21643bf7a9de6248db12dc54460
2014-08-18 15:52:13 -04:00
Thomas Clark
687bc44ae5 Add new CTRE classes and update PDP tests
Change-Id: I489091c5b8b0f1f9890e5104bf01e40ae53cf6ce
2014-08-18 10:32:26 -04:00
Thomas Clark
6d89974016 Make Java tests run with TestNG
TestNG generates xml reports that Jenkins can use, JUnit does not without
Ant or Maven.

To run the tests, deploy the Jar and run:
    /usr/local/frc/JRE/bin/java -jar wpilibJavaIntegrationTests-0.1.0-SNAPSHOT.jar -junit -testclass edu.wpi.first.wpilibj.test.TestSuite

Change-Id: I9e8a7dcab775f9c5ad1905afa798cd9191e25438
2014-08-15 16:40:56 -04:00
Jonathan Leitschuh
54439e7198 Refactors the CANJaguar tests to be more straightforward.
Adds a brownout test from C++ (Ignored)

Change-Id: I81e04e20fb08cd9da7401d9c0e9fa6faf1fff0de
2014-08-08 12:10:56 -04:00
Kevin O'Connor
59473ab7a7 Move PWM allocation to HAL to allow for checking against DIO allocation
Re-number MXP DIO to match pinout (include SPI and I2C pins) (fixes artf2664)
Change PWM MXP mapping to accommodate DIO re-mapping
This re-implementation also fixes artf2668 for C++ and Java
Change the test bench to reflect this change also

Change-Id: If30bd6a85a9f1f619fbde06a4ecd595a15fd28f7
2014-08-07 10:43:50 -04:00
Thomas Clark
f817f6d041 Added version numbers to maven plugins
The version numbers for several maven plugins were unspecified before, which
caused a bunch of warnings before.

Change-Id: I7e2e05ccf3e2f10b24010576eb78192e9d891120
2014-08-05 13:29:01 -04:00
Thomas Clark
43c566bd86 Gyro deadband defaults to 0
The gyro class no longer attempts to set a default deadband, but it still
has an optional SetDeadband() method.

The gyro integration tests were modified and still pass consistently.

Change-Id: I08a97b00b98b49b0a3c63306fcc809857523af2b
2014-08-05 10:25:42 -04:00