Commit Graph

75 Commits

Author SHA1 Message Date
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
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
Thomas Clark
6f4d6ed998 Add support for vision in C++
Add IMAQdx and its dependencies

Change-Id: I6befa563e96db224db83fb90985c86eb3e8d4f3e

Add a "CameraServer" class for C++

This class allows the driver station's camera viewer to interact with
a C++ program.  It includes both an automatic mode to send images from
a webcam to the dashboard in a background thread, and an option to
manually feed it IMAQ images.

Change-Id: I54fdb164c00dce165859c22f435be647dc9927cc
2014-11-16 13:06:49 -05:00
James Kuszmaul
f1476be276 Reverted accidental commits
Change-Id: Ieee3600da11df698f1025c85972acd979e486aa0
2014-11-14 15:28:48 -05:00
James Kuszmaul
9be6ee4712 CANTalon throttle works.
Fleshed out CANTalon interface; it currently works just to write a
throttle. The firmware doesn't fully support everything yet, so we are
still significantly limited.

Change-Id: I2868c4c168a8cb42cda754589777beef31ffd354
2014-11-14 15:21:12 -05:00
Thomas Clark
9050ea7e3d Generalize CANJaguar and CANTalon with a CANSpeedController interface in C++
CANSpeedController is a subinterface of SpeedController that adds method
prototypes and enums for all of the common smart speed controller features.

CANJaguar implements this interfaces.  CANTalon does too, but
most methods are stubs right now.

Change-Id: I67e0177d91e45444657280502a247d787ad5c74c
2014-11-14 15:21:12 -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
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
Patrick Plenefisch
037d3b2fb5 void* -> void by creating proxy fuction
Change-Id: I903c3d98f3210d1969b9aed6c84f5ccaa803a9ed
2014-10-07 17:19:32 -04:00
Patrick Plenefisch
b6475d0503 Renaming and merging WPILibC++ into Devices and simulator files
Change-Id: I6f4b94d1f2cbf4196ebcef8bc45799a97bcde1d8
2014-09-25 20:36:59 -04:00
Patrick Plenefisch
ebd9667ba6 Expose and fix error where old subsystems were being referended after use in tests
Change-Id: I50e66b3d61f5c70dee653ab3e9899f2286f3741c
2014-09-20 23:08:44 -04:00
Thomas Clark
b16a037759 Store preferences in a directory writable by lvuser
Change-Id: I1ed43968c2be76bfcb050a115f59517c398efff3
2014-09-10 14:05:51 -04:00
Patrick Plenefisch
dc970d9a6b require pthread and rt lib for Itests
Fixing simulation flags

Change-Id: I33dcd07096bf7a4813248bb9dd809144661a78fd
2014-08-31 15:42:57 -04:00
Thomas Clark
1f27d36884 Fix PIDError property
Change-Id: I3ea040ae4e0520a231bab95390746eba4315fd8d
2014-08-18 16:29:41 -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
d466d17edd Add delays to make C++ ITs more reliable
Also disable PCM tests until it's actually wired right

Change-Id: I431031f66aaaa87fa201e577fedef5a1952c1bb4
2014-08-15 11:22:01 -04:00
Kacper Puczydlowski
f4d542b212 Add FakeEncoderTest for C++
Change-Id: Ic030a1d055a03f5b245e19e6466af05e72dd7deb
2014-08-11 11:15:42 -04:00
Alex Henning
7c8124d76c Allowed sharing of common C++ code between RoboRIO and Simulation.
Change-Id: I8bf2bda9df389c13ae0567a62dbf0ca931ceb6f8
2014-08-08 18:36:03 -04:00
Thomas Clark
4db634b342 Fix PCM channel indexes
The channels are fixed to correspond with the little-endian beta firmware

Change-Id: I1de0588c74a0e070c647fc2e5e629e47df3b663d
2014-08-07 13:20:39 -04:00
Thomas Clark (WPI)
57e670c18d Merge "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" 2014-08-07 07:45:28 -07: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
Jonathan Leitschuh (WPI)
d1d4c75210 Merge "Fixed interrupt freeing in C++" 2014-08-06 06:57:11 -07:00
Thomas Clark
2356008d8c Fixed interrupt freeing in C++
When interrupts are cancelled on any interruptable class, the resource is now
freed.  Previously, the resource was only freed if the object is destructed
before CancelInterrupts() is called, so it was impossible to create and
destruct more than 8 interrupts.

The interrupts resource object is now in InterruptableSensorBase instead of
SensorBase.

A synchronous interrupt integration test was added.

Change-Id: I0806176340cecd4c1480dd8f043474cc05919f24
2014-08-06 09:46:50 -04:00
Thomas Clark
deb335d96d Fixed DoubleSolenoid, added a double solenoid test
Change-Id: I161337c8b528be7662650889d6ab7bcd2bbe2704

Fixed double solenoid, added a C++ test

Change-Id: Ib0821155efce85be87d354fc8e197fcc4deabd7c
2014-08-05 15:29:02 -04:00
Thomas Clark
f4ace4a36d Cleaned up C++ compiler warnings
All C++ projects now build without warnings with -Wall and -Wextra

Change-Id: Idb6cf8b78274a30453e98c1e8edabcfb2a7fffb6
2014-08-05 11:51:00 -04:00
Jonathan Leitschuh (WPI)
0216d1b336 Merge "Gyro deadband defaults to 0" 2014-08-05 07:31:29 -07: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
Thomas Clark
b86c747226 Only set up once in the C++ tests
TestEnvironment::SetUp() will only initialize the first time it's called.
This allows the --gtest_repeat flag to be used to automatically repeat
the tests.

Change-Id: I20c857a37a88f48114d74ae68518d4a9d724d012
2014-08-05 09:29:07 -04:00
Thomas Clark
d521eb79b9 Analog interrupts in C++
Analog interrupts now work in C++.

The interrupts Resource was moved from a global in DigitalInput
to a static member of SensorBase.

An analog interrupt IT was added, and the digital interrupt one modified
to prevent a linker error.

Change-Id: I9a300daafed15e9666a4ccb405a509615e3dbb06
2014-08-04 13:45:16 -04:00
Jonathan Leitschuh (WPI)
c27da3587d Merge "Added an interrupt test for C++" 2014-08-04 07:25:30 -07:00
Thomas Clark
b91b681430 Added an interrupt test for C++
Change-Id: Ib2f3c575907848082c5d382144bb0462efa64107
2014-08-01 18:11:02 -04:00
Thomas Clark
b26667f866 Fixed the PCM test solenoid numbers
The numbering of the PCM channels is different in the latest firmware

Change-Id: Ib7cb5e69f7b6f076a424358ff61653a4c8ad33af
2014-08-01 17:18:46 -04:00
Thomas Clark
ba4e74d299 AnalogTrigger support in Java
Analog triggers now work in Java.

Integration tests for analog triggers are included.

A message in the C++ analog trigger IT was fixed.

Change-Id: I50007c6901b8391d32c0e81becdbe18e48a7840f
2014-08-01 12:39:19 -04:00
Thomas Clark (WPI)
45e43b627f Merge "Changes the name of the AccelerometerTest to BuiltInAccelerometerTest" 2014-07-31 13:03:48 -07:00
Jonathan Leitschuh
e837d9083a Changes the name of the AccelerometerTest to BuiltInAccelerometerTest
Change-Id: Iabbfa8c4f3688a126443993b861018068f1969c4
2014-07-31 16:03:11 -04:00
Thomas Clark
8fe888dbc9 Accumulators wait for the next sample after reset
Analog accumulators now wait for the amount of time a full sample
(including oversampling and averaging) lasts after
AnalogInput::ResetAccumulator() is called, so they don't return
old values after being reset.

This delay should be microseconds long and will only happen
when an accumulator is reset.

A new test is is the C++ TiltPanCameraTest that tests this behavior
with the Gyro class.

Change-Id: I1b3ffdeec187959f95c5e637a6d428c9a4bc2cf4
2014-07-31 15:46:14 -04:00
Thomas Clark (WPI)
f018689d0e Merge "Completed artf2662: removed Start()/Stop() in Encoders and Counters." 2014-07-31 07:32:35 -07:00
Colby Skeggs
0bb13d86ea Completed artf2662: removed Start()/Stop() in Encoders and Counters.
Change-Id: I11954bb5f66e54461455637d79013c1071f5d00f
2014-07-31 10:31:36 -04:00
Thomas Clark
d8da3e5f1f Added a C++ Preferences test
Change-Id: I6c210535dcfad7c75ff4c04ee6446147efb2fc57
2014-07-30 17:33:26 -04:00
Thomas Clark
386dc1f16b Added AnalogTrigger tests
Change-Id: I60c3e576e100632635278e80743975daf238e904
2014-07-29 16:48:28 -04:00
Thomas Clark
30c0cc0561 Minor updates to the C++ CANJaguar ITs
Some tests are more explicitly named now, and negative values are
tested with both voltage and current control.

Change-Id: I316ccfb7670a341e2f13f4ed3a514f283625409e
2014-07-29 15:47:45 -04:00
Thomas Clark
89fe909ae6 Added stack traces and better error reporting in C++
When an error is reported or an assertion fails in C++, a line is now
printed with information about where the error occured, and a stack trace
is printed.

The stacktrace isn't implemented in the HAL because it's not
hardware-dependent, so StackTrace.hpp and StackTrace.cpp are gone.

The Eclipse project template is modified to include "-export-dynamic" in
the linker options, which is necessary for stack traces.

Change-Id: Ie86c14185b13ed603d0fe6467e87ba4f731b1913
2014-07-28 16:35:45 -04:00
thomasclark
f958b65ba6 CANJaguar can be disabled [artf2647]
The CANJaguar class now stores a controlEnabled flag.  When disabled, it
won't verify the control mode, which involves sending enable messages.

Change-Id: I8baa48eec31de6b4d3fee2b5a074320542a1bbef
2014-07-25 12:59:47 -04:00
thomasclark
fdbe750d3d A few small changes to the C++ ITs
A PDP channel number is correct now, the deploy script was changed to
kill Java programs before running and ignore useless messages,
the "Waiting for enable" message is only printed once, and the accelerometer
test is more robust.

Change-Id: I2226140d8c3e44c452e039c27f4f1cf11c952c42
2014-07-24 18:22:31 -04:00
thomasclark
202bfb2959 Added a Jaguar brownout test in C++, cleaned up some C++ tests
Change-Id: I8fe26c0c3fab35bf783f6c5dfe0c16a991ec06cd
2014-07-23 15:24:39 -04:00
thomasclark
5eddb69aa0 Updated the C++ TiltPanCameraTest
The gyro sensitivity is fixed, the Accelerometer interface is
now used, and some tolerances are adjusted.

Change-Id: Iac1f3c4fbae3be923bd97692684ff72cd2f623f9
2014-07-23 09:36:27 -04:00
Jonathan Leitschuh
f27e16735f Adds resource tracking to CANJaguar in C++
Change-Id: I0d562af5e9f4f50f79d61db15ff25eaf4dae00d5
2014-07-21 14:36:43 -04:00
Jonathan Leitschuh (WPI)
be106b3527 Merge "Added a C++ built-in accelerometer class" 2014-07-21 06:11:59 -07:00