Compare commits

...

1832 Commits

Author SHA1 Message Date
Thad House
02336fc478 Makes FMS data never be a null string. (#900)
Fixes #895
2018-01-19 23:49:34 -08:00
Thad House
c00848c060 Fixes indexed classed handle resource (#899)
Nothing in WPILib uses it, so it was not tested
2018-01-19 22:31:59 -08:00
Dustin Spicuzza
738a1c015c PIDController: setContinuous should only check input range if continuous is true (#896) 2018-01-19 22:31:08 -08:00
Thad House
48ae6c954a Publishes match specific data and other FMS info to NT (#874)
This is so products like SB can present the current setup.
2018-01-18 23:17:28 -08:00
Thad House
07f70cf784 Fixes control data packet delay (#875)
Because of an expected change in 2018 that didn't happen, we had a race
condition causing a 1 packet delay on all DS values. This fixes that.
2018-01-18 21:54:33 -08:00
sciencewhiz
e4e1eab413 Fix cancel of inner commands in ConditionalCommands (#858) 2018-01-18 20:04:33 -08:00
Nic Hodlofski
0e8ff4663d SpeedControllerGroup: Call set() from pidWrite()
This means pidWrite() now takes m_isInverted into account.
Fixes #887.
2018-01-18 20:03:13 -08:00
HeroCC
54a0a7654a Link to replacements for RobotDrive in JavaDocs (#879)
In smart IDEs, this will allow users to easily view source for these two classes by linking to it
2018-01-11 22:17:33 -08:00
Rohit Vighne
59f938b584 Invert when getting motor speed in SpeedControllerGroup (#886) 2018-01-11 22:16:42 -08:00
sciencewhiz
5513888457 Fix PIDController with Continous and no Input Range set. (#883) 2018-01-11 21:06:25 -08:00
Peter Johnson
02b6615042 RobotController: Make getBatteryVoltage() static. (#869) 2018-01-04 23:12:13 -06:00
Tyler Veness
1f4822f332 Replaced Talon motor controller in DifferentialDrive class docs with Spark (#868) 2018-01-03 20:27:34 -06:00
Peter Johnson
bb38ef5642 DifferentialDrive: Invert right motor in LiveWindow. (#867) 2018-01-02 21:15:15 -06:00
PJ Reiniger
ca36d1dce6 Adding callbacks for notifying when the distance per pulse changes (#861) 2018-01-02 16:53:39 -06:00
Sam Carlberg
ee33296e1f SmartDashboard override .name entry in putData(String, Sendable) (#866)
Fixes #865
2018-01-02 16:39:16 -06:00
Tyler Veness
0ef9803363 Update copyright year to 2018 (#864)
Also fix a few files with incorrect line endings.
2018-01-02 11:20:21 -06:00
Tyler Veness
eedb8910c3 Removed extra newlines from beginning of Java classes (#859)
The content of this PR was generated by styleguide#111.
2018-01-02 11:17:46 -06:00
Sam Carlberg
8346caed9c Move subsystem command metadata to metadata key format (#863) 2018-01-01 17:05:03 -05:00
PJ Reiniger
55b6764d50 Fix bugs in simulation libraries (#853)
Some thing got broken in the past couple of weeks with updates to the
HAL.
2017-12-31 14:37:14 -06:00
Thad House
2c4faee667 Fixes -Og compile and strip binaries (#838) 2017-12-29 22:18:35 -06:00
Jaci R
8d1dee16be Add DriverStation NetworkTables HAL Extension (#829) 2017-12-29 21:55:31 -06:00
Jaci R
76b182600a Add Low Fidelity NetworkTables simulation extension (#823) 2017-12-29 21:54:18 -06:00
sciencewhiz
c647a801ad Add Encoder Index as a child (#857) 2017-12-29 21:48:39 -06:00
sciencewhiz
02131639bc Add Digilent DMC 60 Speed Controller (#855) 2017-12-28 21:42:19 -06:00
Noah Gleason
566e283694 Make setDefaultCommand public (#854) 2017-12-28 12:48:15 -06:00
Peter Johnson
40eb6dfc9b Fix SmartDashboard PutData to hook setters. (#851)
* Fix SmartDashboard PutData to hook setters.

Also update all PutData values in main periodic loop (same as LiveWindow).

* Improve SmartDashboard.putData() repeat call handling.
2017-12-26 18:18:02 -05:00
Dustin Spicuzza
a3e5378d14 SPI: Check for null (#850) 2017-12-25 22:03:22 -06:00
Thad House
691741cfcb Fixes non public static methods in RobotController. (#852) 2017-12-25 20:26:05 -06:00
Thad House
166d9e01bf Add PWMVictorSPX (#842) 2017-12-17 19:59:30 -08:00
Thad House
7eab4371f4 Adds TriState DIO functionality to the HAL (#835)
Adds a function to raw set the DIO direction. Also adds a C++ unsafe
function to enable fast setting of DIO direction.
2017-12-14 00:17:29 -08:00
Peter Johnson
de134a5c60 Add deprecated shims for LiveWindowSendable and NamedSendable. (#834)
This will help prevent old code from breaking (not all cases, but should help).
2017-12-13 23:45:12 -08:00
Peter Johnson
7f074563d0 Add support for automatic SPI transfer engine. (#836)
The SPI Accumulator functions have been moved from HAL to wpilib and rewritten
to use the automatic transfer engine.
2017-12-13 23:41:37 -08:00
Thad House
d3dd586362 Revert "Fixes SPI bad chip select (#818)" (#822)
This is no longer required for image 2018v16.

This reverts commit b42285fddd.
2017-12-12 11:31:20 -08:00
Thad House
9c85105591 Update to image 2018v16 (#833) 2017-12-12 11:03:53 -08:00
Peter Johnson
86ac70a125 Fix wpilibcIntegrationTests RobotController warnings. (#832) 2017-12-11 22:15:29 -08:00
Austin Shalit
3c3a448d47 Deprecate SampleRobot (#472)
Suggest TimedRobot as an alternative.

Remove -Werror from examples to avoid breaking build.
2017-12-11 22:06:01 -08:00
Thad House
8744511f1d Fixes some methods in RobotController not being static. (#831) 2017-12-11 11:48:54 -08:00
Thad House
7729dd972f Fixes JNI symbol check (#830)
setErrorData symbol was missing. However, its been deprecated at the
netcomm level for years, and wasn't exposed in wpilibj. And it would
have been crashing since forever, so safe to remove.
2017-12-11 11:48:39 -08:00
Thad House
8b7aa61091 Adds RobotController class (#828)
Unifies random functionality from other classes
Deprecates all old functions.
2017-12-10 21:52:49 -08:00
Peter Johnson
88a6b4ac38 PIDController::InitSendable(): Use double, not bool for double values. (#827) 2017-12-10 20:58:29 -08:00
Peter Johnson
217b1a2259 VisionRunner: Add stop() function to stop a runForever() loop. (#826)
This was previously possible in Java with Thread.interrupt(), but provide
the same function in both C++ and Java.

Fixes #444.
2017-12-10 20:58:14 -08:00
Thad House
d2e7a90f41 Removes statics from hal sim (#825)
Based off of #824, the equivelent in sim.
2017-12-10 19:38:53 -08:00
Thad House
8bd48d6c34 Switches HAL to manual instead of static initialization (#824)
Only athena.

Will fix a whole lot of init issues.
2017-12-10 18:02:07 -08:00
Thad House
1fa0adb091 Removes MSVC and GCC old version workarounds (#821) 2017-12-08 23:40:35 -08:00
Thad House
f615e68a43 Require GCC 5 for wpilib build (#820)
Will help in season with teams not upgrading their GCC. Will have a
better error message.
2017-12-08 22:48:01 -08:00
Thad House
aa4f0ef4f8 Start using the new FRC compiler define (#797)
Remove all definitions from the MockData headers when in simulation mode.
Add a constexpr IsReal and IsSimulation in RobotBase.
2017-12-08 22:47:21 -08:00
Thad House
b42285fddd Fixes SPI bad chip select (#818)
Temporary workaround for 2018v13 image.
2017-12-08 21:42:30 -08:00
Thad House
8106fbdbea Removes custom CONFIG_ATHENA compiler directive (#796)
In roborio GCC 5.5, __FRC_ROBORIO__ has been added directly to the
compiler. So we can instead use that to detect if we are build for the
roborio, and in a much more reliable way.
2017-12-08 21:40:11 -08:00
Tyler Veness
942ba51765 Reclassified NetworkTables headers as "other library" (#775) 2017-12-07 23:34:29 -08:00
PJ Reiniger
33a08d5b34 Add halsim unit tests (#783)
Also adds function that can register all the callbacks at once.
Since all of the callbacks issue a string identifier, it makes it
possible and easy to have one function callback, and differentiate the
path to take based on the string.  Hooking up all the callbacks at once
makes it easier for the simulator developer to know when something was
added to wpilib rather than looking at the commits.
2017-12-07 22:42:20 -08:00
Thad House
4e3af0756d Removes workarounds for issues in image 10 (#816) 2017-12-06 21:20:03 -08:00
Thad House
5078f6c92a Update to image 2018v13 (#815) 2017-12-06 21:02:36 -08:00
Peter Johnson
899892c119 Change Utility to use Twine. 2017-12-05 00:17:56 -08:00
Peter Johnson
54326311ad Use Twine in error checks. 2017-12-05 00:17:56 -08:00
Peter Johnson
fe53dd2f28 Use Twine for error message inputs. 2017-12-05 00:17:56 -08:00
Peter Johnson
ab137abab5 Use llvm::Twine across C++ Command structure. 2017-12-05 00:17:56 -08:00
Peter Johnson
001dedf3b2 SmartDashboard: Use magic static for static initialization. (#812)
It's possible for SmartDashboard functions to be called from static
initializers in user code, so use a magic static to force initialization
order.
2017-12-04 23:50:27 -08:00
Peter Johnson
f9bece2ffb Update LiveWindow to provide continuous telemetry. (#771)
LiveWindow.updateValues() is now called from IterativeRobotBase on every
loop iteration.  Telemetry for all WPILib classes is enabled by default;
it can be disabled for specific classes using LiveWindow.disableTelemetry(),
or all telemetry can be disabled using LiveWindow.disableAllTelemetry().

This necessitated changing the hook methodology into other classes to
be more property-based rather than each class providing multiple functions.
This had the benefit of reducing boilerplate and increasing consistency.

- Remove NamedSendable, add name to Sendable.

- Provide SendableBase abstract class.

- Deprecate LiveWindow addSensor/addActuator interfaces.

- Add LiveWindow support to drive classes.

- Add addChild() helper functions to Subsystem.

- Fix inheritance hierarchy.  Now only sensors inherit from SensorBase.
  Other devices inherit from some combination of SendableBase, ErrorBase, or
  nothing.
2017-12-04 23:28:33 -08:00
Tyler Veness
3befc7015b Make MotorEncoderTest use LinearDigitalFilter's reference overload (#811) 2017-12-04 22:37:06 -08:00
Tyler Veness
de63e1c8a1 Fixed race condition between PIDController enable/disable and PIDWrite() call
To make this work in PIDController.java, the use of synchronized had to be
replaced with ReentrantLock and try-catch blocks. The locking in
PIDController.java was made equivalent to PIDController.cpp and some existing
race conditions in PIDController.java were fixed in the process.

Fixes #30.
2017-12-04 20:42:33 -08:00
Tyler Veness
a76b1aa800 Reduced scope of PIDController's critical sections
m_pidInput and m_pidOutput are considered constant after their construction.
Setting the input range, output range, tolerance, or continuous mode locks the
controller. m_error and m_result are held in temp variables and set at the end
of the calculation.

Getters of P, I, D, F, m_error, m_setpoint, m_result, and m_enabled lock the
critical section. P, I, D, F, and m_setpoint are retrieved at the beginning of
Calculate().

Fixes #40.
2017-12-04 20:42:33 -08:00
Tyler Veness
350b741adc Cleaned up SampleRobot template and added warning about disabling motor safety (#766) 2017-12-04 20:28:31 -08:00
Thad House
64bfdc1a69 Bail out of the integration tests if enable fails (#792)
A failure is much better then an infinite loop.
2017-12-04 20:24:26 -08:00
Tyler Veness
65cc85f68d Add reference constructors/factory methods to LinearDigitalFilter (#810)
Composition is less verbose with references than with smart pointers.
2017-12-04 20:12:06 -08:00
sciencewhiz
6a00dc7976 Re-Add PacGoat java example (#802) 2017-12-04 20:09:02 -08:00
Tyler Veness
e9e407a87d Replace C identifier lists with (void) (#809)
These changes were generated by wpilibsuite/styleguide#106.
2017-12-04 20:05:51 -08:00
Tyler Veness
59c4984ed6 Deprecated internal filter of PID controller (#746)
This was replaced with an external LinearDigitalFilter.
2017-12-04 20:05:02 -08:00
Peter Johnson
b428d1e4b3 Remove CANSpeedController interface. (#806)
CANJaguar is no longer supported, and CANTalon no longer uses this interface.
2017-12-04 20:03:07 -08:00
Thad House
0994364591 Fixes cross module base class statics (#779) 2017-12-03 00:05:05 -08:00
sciencewhiz
0b8d3f0260 Update SampleRobot template to match comments (#768) 2017-12-02 23:28:52 -08:00
sciencewhiz
52eba45c51 Add missing documentation for squaredInputs for RobotDrive (#805) 2017-12-02 22:31:51 -08:00
Thad House
9090a82ef5 Fixes halsim sources and headers zips (#804) 2017-12-02 22:30:54 -08:00
Peter Johnson
2a69a4c7dc Revert #780 (don't kill FRC_NetCommDaemon). (#795)
This commit reverts commit 0f3f5218ad.
2017-12-01 23:47:01 -08:00
Thad House
9d2393f97e Waits 10 seconds between running the C++ and Java test (#798)
Potentially will fix java tests not enabling.
2017-12-01 23:45:49 -08:00
Peter Johnson
dae619b006 Add error reporting to AbstractComsSetup test initialization. (#800) 2017-12-01 23:44:11 -08:00
Thad House
9c06d2878b Update to latest native plugin (#799)
This is what prints warnings to console.
2017-12-01 16:23:30 -08:00
Peter Johnson
e3a2abdf97 HAL_SetDigitalPWMRate(): Use same logic as LabView. (#794) 2017-12-01 10:26:40 -08:00
Peter Johnson
7867e906e9 NidecBrushless: Have disable() call PWM.setDisabled(). (#763)
This provides a way to stop motor operation even if the DIO is disconnected.

Also change Set() to enable the PWM instead of having the constructor do it.

Provide an explicit Enable() call to re-enable after Disable() is called.
This is different from the other motor controllers (which automatically
re-enable when Set() is called) due to the dual-wiring of this motor
controller.

Motor safety results in disabling the motor only until the next Set() call.
2017-12-01 00:43:11 -08:00
Peter Johnson
65a044f633 Fix HAL_CleanNotifier race. (#793)
This race was caused by holding a lock while calling into FRC_ChipObject,
which was waiting for the callback to exit before returning, and our
callback wanted to grab the same lock.
2017-11-30 20:45:40 -08:00
sciencewhiz
cbd08a1e11 Add tests for equivilance of RobotDrive and DifferentialDrive/MecanumDrive (#732)
Add documentation for how to get same results as RobotDrive and improve
RobotDrive documentation
2017-11-29 21:41:00 -08:00
sciencewhiz
e308dd28f3 Fix javadoc link in Solenoid.java (#789) 2017-11-29 21:33:29 -08:00
Thad House
fa0b4428e9 Runs DS enabled loop in process (#785)
Solves mutex issues, and other issues with the existing teststand
software. And simplifies the unit test structure.
2017-11-28 19:12:05 -08:00
Tyler Veness
26a36779a6 Performed cleanup of Timer's free functions (#776)
* GetClock() is now officially deprecated since its comment already informally
  did so and the function just forwards to Timer::GetFPGATimestamp().
* The declaration of GetPPCTimestamp() is missing a definition and has been
  removed.
* std::this_thread::sleep_for() returns immediately when given a negative
  duration, so the check for that was removed from Wait().
2017-11-27 21:59:00 -08:00
Tyler Veness
dfc0656e5c Fix wpilibj FilterOutputTest null pointer exception (#778) 2017-11-27 12:28:25 -08:00
Peter Johnson
0f3f5218ad Kill FRC_NetCommDaemon as well as robot programs. (#780)
Also use flock on Jenkins side to prevent multiple simultaneous runs, instead of using teststand mutex.
2017-11-27 12:24:46 -08:00
Tyler Veness
34c44b7ae9 Improved Drive docs and fix implementation bugs (#774)
I also found some inconsistencies in MecanumDrive and KilloughDrive and fixed
them.

Drive now uses the NED axes convention. Therefore, the positive X axis points
ahead, the positive Y axis points to the right, and the positive Z axis points
down.

Translation in X assumes forward is positive. Translation in Y assumes right is
positive. Rotation rate assumes clockwise is positive. Angles are measured
clockwise from the positive X axis.

Based on the angle origin convention, DrivePolar() for both Mecanum and Killough
needed the normalization removed, sine used to compute the Y component, and
cosine used to compute the X component.

The vector rotation done in DriveCartesian() needs to rotate by a negative angle
instead of positive to undo the robot's rotation. RobotDrive assumed a clockwise
angle and sensors returned counter-clockwise angles, which is why it used a
positive angle for rotation.
2017-11-26 18:36:51 -08:00
sciencewhiz
7a250a1b93 Implement PCM One Shot feature. Fixes artf4731 (#539) 2017-11-26 12:55:21 -08:00
Caleb Smith
a338ee8be0 Add PIDController Wrapping (#601) 2017-11-25 21:15:33 -08:00
sciencewhiz
c9d440f338 Fix Java Compressor test. Make limits same as C++. (#772) 2017-11-24 20:14:36 -08:00
Tyler Veness
a00b2449db Removed unused includes and replaced Ultrasonic's std::set with std::vector (#767) 2017-11-23 20:46:24 -08:00
Tyler Veness
5c659fdcdf Deprecated PIDController::SetTolerance() (#764)
PIDController::SetPercentTolerance() behaves identically to it, so removing
SetTolerance() leaves one obvious way to do absolute or percent tolerance.
2017-11-23 01:21:36 -08:00
Thad House
d36d72bd4f Fixes MotorSafetyHelper locking and race conditions (#762)
Closes #760
2017-11-23 00:36:57 -08:00
sciencewhiz
614093c0c4 Fix documentation for getMatchTime in Timer class to match DriverStation (#761) 2017-11-23 00:19:05 -08:00
PJ Reiniger
12c4418bda Added callbacks for CAN (#757)
Added callback scheme for a pass through to something higher
level.  Since the ID is embedded into the arbitration ID, and some
devices can use different schemes whether it is plugged in through a
device or put into the daisy chain (pigeonImu), I made one "internal
data object" for max reusability.
2017-11-22 19:48:32 -08:00
Caleb Smith
0431cf97ff Cleanup PIDController (#597) 2017-11-22 18:56:35 -08:00
Tyler Veness
ba879f4663 Cleaned up variable names for std::lock_guard and their associated mutexes (#759) 2017-11-22 17:10:21 -08:00
Tyler Veness
96de0b5b11 Variable name fixes (#758) 2017-11-22 17:06:57 -08:00
Tyler Veness
85157a56c3 CircularBuffer now uses an idiomatic interface in C++ and Java (#421) 2017-11-22 17:04:57 -08:00
Tyler Veness
029246ed28 Replaced extra constructors in LinearDigitalFilter with llvm::ArrayRef<> (#755)
llvm::ArrayRef<> replaces both the std::initializer_list<> and std::vector<>
constructor overloads.
2017-11-20 21:23:00 -08:00
sciencewhiz
6377ab774d Allow deprecated warnings for tests (#756) 2017-11-20 21:21:50 -08:00
Tyler Veness
05e581f409 Fixed crash in wpilibj SampleRobot (#753)
robotInit() and HAL.observeUserProgramStarting() should be called in
startCompetition() rather than the constructor.

Fixes #752.
2017-11-19 22:47:39 -08:00
Peter Johnson
c73dd807e1 ErrorBase: Remove last use of sstream and iostream. (#750) 2017-11-19 20:16:42 -08:00
Tyler Veness
7a0dd9baa9 Add return-to-zero test for LinearDigitalFilter moving average (#751)
Ensures LinearDigitalFilter moving average returns to zero after non-zero
values are inserted.

Tests for issue #642
2017-11-19 20:16:09 -08:00
Tyler Veness
11f37683c3 Added constructor to PIDController that takes references instead of pointers (#745) 2017-11-19 19:06:00 -08:00
Tyler Veness
5af0c9c101 Replaced const variables with constexpr (#731) 2017-11-19 19:04:28 -08:00
Tyler Veness
259461aee9 Added PIDController::GetAvgError() back in (#749)
It got removed during the LinearDigitalFilter change (#38) instead of deprecated
by mistake.
2017-11-19 18:23:48 -08:00
Peter Johnson
d214b36786 Change HAL notifier to polling. (#627)
This moves the thread code to the WPILib layer, fixing various potential
races and significantly simplifying the HAL implementation.
2017-11-19 17:58:40 -08:00
Tyler Veness
4a07f0380f PIDController class now uses LinearDigitalFilter for filtering velocity instead of internal queue (#38) 2017-11-19 15:58:30 -08:00
Peter Johnson
7f46b50b21 Unify WPI_Now and HAL_GetFPGATime. (#743)
Depends on wpilibsuite/wpiutil#56.
2017-11-19 12:33:36 -08:00
PJ Reiniger
303c259b89 Simulate ADX* family of accelerometers and gyros (#688) 2017-11-18 12:31:51 -08:00
Thad House
cd1dbb1e3a Adds a const buffer listener (#742)
Replaces need for const_cast in SPI and I2C functions
2017-11-17 10:01:49 -08:00
Peter Johnson
a20474bfc7 Update sensors to not use direct byte buffers. 2017-11-17 09:36:57 -08:00
Peter Johnson
479d0beb5a SerialPort: Use byte[] instead of ByteBuffer in JNI. 2017-11-17 09:36:57 -08:00
Peter Johnson
b93aa176d6 AnalogInput: Remove byte buffer usage. 2017-11-17 09:36:57 -08:00
Peter Johnson
9021b37fd2 I2C: Provide byte[] JNI interfaces.
This avoids a direct byte buffer allocation on every read/write/transaction
on the byte[] variants.

Changes HAL I2C interfaces to use const for dataToSend.
2017-11-17 09:36:57 -08:00
Peter Johnson
6307d41002 SPI: Provide byte[] JNI interfaces.
This avoids a direct byte buffer allocation on every read/write/transaction
for the byte[] variants.

Also change spiGetAccumulatorOutput() to directly set the AccumulatorResult
object, avoiding a ByteBuffer allocation.

Changes HAL SPI interfaces to use const for dataToSend.

Fixes #733.
2017-11-17 09:36:57 -08:00
Peter Johnson
df7c1389de Remove ni-libraries libi2c and libspi. 2017-11-16 23:01:28 -08:00
Peter Johnson
6accc31ee7 HAL: implement I2C and SPI directly instead of using i2clib and spilib.
This reduces library dependencies, improves error handling, and makes
future enhancements easier.
2017-11-16 23:01:28 -08:00
Thad House
f56ec10bcf Only return lower 32 bits of FPGA time (#741)
Works around an NI bug in image 10.
2017-11-16 20:52:50 -08:00
Tyler Veness
e5e6d6a193 Ran formatter based on styleguide#95 (#737) 2017-11-16 01:05:20 -08:00
Tyler Veness
c663d7cd16 Reflowed comments and removed commented out code (#735) 2017-11-16 00:33:51 -08:00
Tyler Veness
1e8d18b328 Upgrade Travis CI Python version to 3.5 (#740) 2017-11-16 00:19:16 -08:00
Peter Johnson
c2d95db3ab Fix PreferencesTest. (#739) 2017-11-15 23:56:17 -08:00
Thad House
dd7563376b Force load OpenCV and cscore libraries on program initialization (#716)
Fixes bugs where Mat's are initialized before anything cscore was
called.
2017-11-14 22:04:53 -08:00
Tyler Veness
14fcf3f2f0 Simplified PIDController integration logic (#645)
A clamp() helper function was written based on C++17's std::clamp().
2017-11-13 22:28:55 -08:00
Peter Johnson
020ee227d2 Move ctre headers to hal/src so they aren't user-visible. (#728)
Also removes ctre_frames.h entirely since it's not used.

Fixes #683.
2017-11-13 22:23:18 -08:00
Peter Johnson
4d559f3856 Use wpi::mutex instead of std::mutex. (#730)
This uses a priority-aware mutex on Linux platforms.

Fixes #729.
2017-11-13 09:51:48 -08:00
Thad House
35d68d2a34 Adds ability to simulate joysticks and event info (#727)
Thanks @pjreiniger for the initiali implementation and work on this.
2017-11-12 19:33:43 -08:00
Peter Johnson
7007725d9f SerialHelper: Check error_code to prevent infinite loop. (#725) 2017-11-11 22:13:59 -08:00
Tyler Veness
0c83cad70c Upgraded clang-format to 5.0 (#431) 2017-11-11 22:09:51 -08:00
sciencewhiz
0001047b8b Add NidecBrushless to WPILib.h (#724) 2017-11-11 16:35:43 -08:00
Thad House
c885251367 Fixes HALSim_Print build to be the standardized pattern (#721)
Now publishes in zips, and with proper artifacts.

The code files just moved, and no changes.
2017-11-10 19:26:33 -08:00
Tyler Veness
42096fac3f Ran formatter (#722) 2017-11-10 18:29:27 -08:00
sciencewhiz
6be9e69d13 Switch Command Templates to TimedRobot (#719) 2017-11-09 20:08:41 -08:00
Thad House
7bbd13d914 Adds match specific calls to Java and C++ (#720)
Uses caching, matching the joystick calls.
2017-11-09 19:59:29 -08:00
Thad House
2225c4fee2 Fixes warnings for casts in sim interrupt functions (#718) 2017-11-09 14:01:24 -08:00
Tyler Veness
7efab4c43a Replaced ternary operators with if statements (#346)
Instances of the ternary operator were replaced with if statements to make the code base more consistent.
2017-11-08 23:44:03 -08:00
Thad House
c8e44256ef Uses NI provided function for SetOccurDataRef rather then importing the symbol ourselves. (#714) 2017-11-08 23:41:16 -08:00
Peter Johnson
f3cd883c5c Add Nidec Brushless motor. (#705) 2017-11-08 23:40:01 -08:00
Thad House
f34c736fb2 Adds warning prints to native library builds (#710)
Can be disabled with -PskipWarningPrints
2017-11-08 23:14:21 -08:00
Tyler Veness
1276489961 Removed uses of deprecated functions (#709) 2017-11-08 21:29:29 -08:00
Tyler Veness
8b2e656bde Fixed Java velocity PID not calculating result when P = 0 (#717) 2017-11-08 21:28:09 -08:00
Thad House
6e9d1f55c6 Updates image to 2018 v10 image (#713) 2017-11-08 11:26:11 -08:00
Thad House
f4dce9e608 Fixes receive size in Java I2C (#715)
Allows underrun, which matches c++ behavior.

Fixes #711
2017-11-07 18:43:23 -08:00
Thad House
b9aabc71b0 Fixes publishing basenames for examples to make combiner script work. (#712) 2017-11-07 14:54:17 -08:00
Jaci R
0d54772362 Add IDEA plugin to root project (#707) 2017-11-05 19:57:53 -08:00
Tyler Veness
faf134a674 C++ examples no longer use deprecated APIs (#703) 2017-11-05 19:39:47 -08:00
Thad House
c24e755409 Fixes java example publishing and xml file (#706) 2017-11-04 10:09:41 -07:00
Thad House
bee9f1cb17 Adds header task to print out all headers (#704)
Will be used to create a generator for IDE's to get include paths.
2017-11-03 22:50:06 -07:00
Tyler Veness
45d48d6b5a Cleaned up C++ examples (#672) 2017-11-03 13:22:56 -07:00
Peter Johnson
6401aa1fde SerialHelper: Use llvm path functions instead of popen. (#702)
This avoids a fork that causes an out-of-memory error in Java.

Depends on wpilibsuite/wpiutil#43
2017-11-03 12:30:56 -07:00
Thad House
6af4940c22 Adds HAL calls for match data from DS (#691) 2017-11-01 21:58:44 -07:00
Sam Carlberg
237b2df82f Add .type metadata to preferences table (#701)
Allows shuffleboard to automatically discover the type, instead of inflexibly hardcoding it
2017-10-30 21:50:49 -07:00
Peter Johnson
a70687aaec Improve error reporting for the new TCP netconsole. (#700)
Fixes #695.
2017-10-30 21:50:14 -07:00
sciencewhiz
fbfe85568b Fix preferences test (#699) 2017-10-29 21:30:50 -07:00
Tyler Veness
595b1df380 Fixed minimum number of joystick axes (#696) 2017-10-29 17:21:50 -07:00
Thad House
efc7770e9b Fixes NPE in DriverStation initialization (#694)
Introduced by #626.
2017-10-27 23:16:42 -07:00
Tyler Veness
21585f70a8 Added functions for detecting button press and release events (#626)
I also shuffled around the HID interfaces to be more intuitive, deprecated some
Joystick and XboxController member functions, and deprecated the JoystickBase
and GamepadBase classes.

Supersedes #89.
2017-10-27 21:45:56 -07:00
Tyler Veness
c33fca34e9 Added TimedRobot template (#673) 2017-10-27 21:33:04 -07:00
PJ Reiniger
de95f08a10 Adding call to notify program started (#692)
Causes the HALSIM_WaitForProgramStart loop to break, essentially
notifying simulators the robot is good to go.
2017-10-27 21:00:52 -07:00
Thad House
90f99dc571 Adds PWM to LoopTiming and CycleStart HAL calls (#693) 2017-10-27 19:44:40 -07:00
Thad House
f34332643a Uses new FPGA calls to get 64 bit FPGA time and 64 bit PWM cycle start time. (#687) 2017-10-27 18:03:10 -07:00
Tyler Veness
4ab095e9c9 Fix formatting in CameraServer.cpp (#689)
A PR didn't rerun the formatter before merging.
2017-10-27 11:35:57 -07:00
Thad House
541753c814 Updates to 2018 v9 image (#686) 2017-10-27 00:47:56 -07:00
Jeremy White
f02bb058bd Set the llvm standard output stream to be unbuffered. (#678)
This is particularly useful for the simulation when invokved
inside Eclipse.  Otherwise, you won't see the robot starting
message.
2017-10-27 00:46:56 -07:00
sciencewhiz
12e96c6f13 Add usage reporting to CameraServer (#682) 2017-10-27 00:45:54 -07:00
Austin Shalit
b65447b6f5 Fix spelling typos (#595) 2017-10-27 00:44:51 -07:00
Tyler Veness
9945a5b3c6 Ran formatter (#681) 2017-10-26 19:28:59 -07:00
Thad House
ce4c9edd1f Fixes halsim_print to not try and build when the 'onlyAthena' flag has been set (#685)
Building a non-athena library in athena only is not possible.
2017-10-25 10:52:35 -07:00
PJ Reiniger
a6e6ae41b9 Add function that can register all the HAL callbacks at once (#646)
Since all of the callbacks issue a string identifier, it makes it
possible and easy to have one function callback, and differentiate the
path to take based on the string.  Hooking up all the callbacks at once
makes it easier for the simulator developer to know when something was
added to wpilib rather than looking at the commits.
2017-10-21 22:45:41 -07:00
Austin Shalit
f4e2e41aaf Remove leading '*' from license and rename to LICENSE.txt (#596) 2017-10-21 16:04:57 -07:00
Thad House
1e528669ff Adds publishing for examples and templates so they can be grabbed from eclipse (#674) 2017-10-21 15:33:42 -07:00
Thad House
a1ea448406 Adds JNI call to get CANStatus (#677)
Call already existed in the HAL.
2017-10-21 15:32:05 -07:00
Tyler Veness
9dc1de1d09 Specified angle units for Vector2d rotate() function. (#679)
Fixes #676.
2017-10-21 15:29:39 -07:00
Tyler Veness
0521d85048 Moved comment after include line so include order is determined properly (#680) 2017-10-21 15:28:46 -07:00
PJ Reiniger
3c842d8234 SPI and I2C simulator (#662)
* Creating SPI and I2C simulation abilities

* Update the callback helpers to support different function callback
types
* Create callback type that uses a buffer
* Created I2C/SPI data classes that manage the callbacks and don't do
much of anything else

* Ran format, cleaned up some issues
2017-10-18 23:01:58 -07:00
Jeremy White
be77f9cb26 Pull request for the Extensions interface only (#655)
* Modify halsim to be able to load extension libraries if they are available.

It will read the list of libraries to try from the HALSIM_EXTENSIONS
environment variable.  Multiple libraries can be given if separated
by ';' (Windows) or ':' (Unix).

The library must have an 'HALSIM_InitExtension' method that returns >= 0 on success.

The library is expected to use the interface expressed by
  hal/src/src/main/native/include/MockData

* Add a simple halsim library that just prints robot values.

This makes a good test bed for cross platform purposes,
and provides the ultimate in light weight simulators.

This initial version only prints PWM values.
2017-10-18 00:27:55 -07:00
Austin Shalit
2fc60680f4 Remove RedundantModifiers (#578) 2017-10-17 21:47:55 -07:00
Tyler Veness
0291a95f68 Add cpp examples (#659)
* Added C++ robot project examples and set up sub .clang-format for them

* Ran formatter
2017-10-17 21:37:58 -07:00
Austin Shalit
66002d6cac [WIP] Move examples to allwpilib (Java) (#569)
* Move examples to allwpilib

* Add checkstyle config to examples project

* Ran wpiformat

* Run checkstyle on examples

* Change maximum line length for examples to 80 chars

This number was chosen based on testing of the number of characters shown by default in Eclipse done by @Kevin-OConnor: 51 chars by default on an E09 @ 1024x600 (which has the welcome window open on the right), 71 with welcome closed, 95 with the right-hand outline pane closed

* Add mavenCentral repository

* Rename subproject & error on deprecated API use

* Remove deprecated API usage
2017-10-16 22:30:21 -07:00
Tyler Veness
a7e9ac1062 Fix capitalization of class names in PIDToleranceTest.cpp (#588) 2017-10-16 21:16:33 -07:00
Thad House
434d60592c Adds HAL_Initialize to ErrorBase constructor, and makes HAL_Initialize properly reentrant (#668)
Partial fix to #663, and most likely the best we are going to be able to
get.
2017-10-16 20:00:32 -07:00
Thad House
ee20747255 Adds WPILib JNI shared debug file publish. (#671) 2017-10-16 19:59:05 -07:00
Tyler Veness
f4779379c3 Added brace comments (#670)
Enforced by wpilibsuite/styleguide#80.
2017-10-16 19:56:08 -07:00
Austin Shalit
877a9eae1f Add SpeedControllerGroup (#362) 2017-10-16 19:54:36 -07:00
Thad House
24752a9751 Removes OpenCV dependency from wpilibJNI (#667)
Not exactly sure why it was there in the first place. Closes #664
2017-10-12 18:25:17 -07:00
Thad House
e1dc099517 Updates to the 2018v5 image (#665) 2017-10-12 18:24:39 -07:00
Sam Carlberg
f0cc623241 Change metadata format to dotfile, make certain entries metadata (#666)
Sendable's "Name" is now ".name"
Sendable's "Subsystem" is now ".subsystem"
Command's "name" is now ".name"
Command's "isParented" is now ".isParented"
2017-10-11 20:27:49 -07:00
Jacob Caporuscio
ba3a85d0cc Changes TalonSRX to PWMTalonSRX in wpilibj and wpilibc. (#656)
Also brings the java kResourceType list up-to-date with the cpp list.
2017-10-11 12:01:50 -07:00
Thad House
79919a5f1c Moves wpilibc link script into shared folder (#660) 2017-10-08 10:42:09 -07:00
Thad House
94ea5bfb06 Move published wpilibj JNI shared artifact into shared/ subfolder (#658)
Makes eclipse easier.
2017-10-07 15:31:36 -07:00
Thad House
24680bbd53 Change link script artifact id (#657) 2017-10-07 12:08:53 -07:00
Peter Johnson
7fab0e0ef2 Depend on wpiutil 3.+, ntcore 4.+, cscore 1.+ rather than just +. (#651)
Also update to wpilib-version-plugin 2.0.
2017-10-01 10:57:03 -07:00
Tyler Veness
dd66b23845 Remove priority mutex (#644)
* Removed hal::priority_condition_variable

* Replaced uses of priority mutexes with std::mutex and std::recursive_mutex

This allowed replacing a use of std::condition_variable_any with
std::condition_variable.

* Replaced all uses of std::recursive_mutex with std::mutex equivalents
2017-09-28 23:32:35 -07:00
Tyler Veness
19addb04cf Split RobotDrive class into a class for each drive type (#552)
DiffDrive.CurvatureDrive (aka CheesyDrive) and KilloughDrive were also added.
This reorganization paves the way for SwerveDrive.
2017-09-28 23:30:00 -07:00
pjreiniger
abb66d3e4b Replace FRC_NetworkCommunication CAN in wpilibj with HAL CAN (#650) 2017-09-28 22:40:04 -07:00
pjreiniger
db4981f166 Java now asks the HAL if it is a simulation or not (#647) 2017-09-23 07:56:53 -07:00
Tyler Veness
6e1be897de Ran formatter (#643) 2017-09-19 21:55:36 -07:00
sciencewhiz
423d8f6860 Add missing usage reporting. (#639)
Compressor C++/Java
Servo C++
2017-09-19 21:17:27 -07:00
Jeremy White
eb38204d1a Update the README to note the need for gcc 5+ and Visual Studio (#640)
Update the build requirements in the README.  Add a note about
Visual Studio, the need for gcc 5, and remove the style guide;
it is mentioned further down, and it is not a requirement for building.
2017-09-19 21:14:53 -07:00
Tyler Veness
1711291cd8 Fix Travis build (#641)
Travis now installs pip3 explicitly.
2017-09-19 21:13:03 -07:00
Peter Johnson
57ba58917d PreferencesTest: Use new NetworkTables API. (#636)
This avoids deprecated warnings from the old API.
2017-09-07 22:40:18 -07:00
Thad House
2249a8bac0 Adds a HAL wrapper around the CAN API's (#623)
Can someday be added to the simulator. Removes the last use case for the
ni headers directly.
2017-09-07 21:40:30 -07:00
Thad House
c572e6a307 Adds the rest of the data needed for a publish on jenkins (#628) 2017-09-07 21:07:01 -07:00
Tyler Veness
e444b6015c Updated remaining .styleguide files to new config file format (#635) 2017-09-07 21:02:52 -07:00
Tyler Veness
38dbed8e09 .styleguide now uses generalized config file format (#621)
Requires styleguide#66.
2017-09-06 23:00:10 -07:00
Peter Johnson
34c18ef000 Remove getTable from wpilibj Sendable interface.
This allows nearly all m_table member variables to be removed.
2017-09-06 22:29:04 -07:00
Peter Johnson
0d4fde17e0 Remove GetTable from wpilibc Sendable interface.
This allows nearly all m_table member variables to be removed.
2017-09-06 22:29:04 -07:00
Peter Johnson
040a8c6bcc Update wpilibc to use new NetworkTables package and interfaces. 2017-09-06 22:29:04 -07:00
Peter Johnson
4e80570c4c Update wpilibj to use new NetworkTables package and interfaces.
This may be breaking to CANSpeedController implementations.
2017-09-06 22:29:04 -07:00
Peter Johnson
91529cc435 Update NetworkTables for new API.
This fixes breakages due to the JNI move.

Depends on: https://github.com/wpilibsuite/ntcore/pull/204
2017-09-06 22:29:04 -07:00
Peter Johnson
ef3267833f Fix IterativeRobot/TimedRobot RobotInit(). (#633)
In C++, it's not legal to call a virtual function from within a constructor,
so the user override was never called (the base function is always called).

See https://isocpp.org/wiki/faq/strange-inheritance#calling-virtuals-from-ctors

While this is technically allowed in Java, also change Java for consistency.
2017-09-05 23:57:26 -07:00
sciencewhiz
a5ef50c9e7 Add documentation for PeriodMultiplier (#632) 2017-09-04 22:03:02 -07:00
sciencewhiz
6eee457898 Renable javadoc fail on error (#631)
Remove reference check and fix HTML error
2017-09-03 14:10:40 -07:00
Thad House
fb6d7b3470 Fixes javadocs (#630) 2017-09-02 21:29:30 -07:00
sciencewhiz
2d78fdabb8 Fix recieve typo in JNI names. (#629)
Fixes #594
2017-09-01 22:48:33 -07:00
Thad House
94c31ceeb1 Gets wpilib compiling with skipAthena and onlyAthena flags (#625) 2017-08-31 21:29:35 -07:00
Peter Johnson
67d4da51ee Restore travis support. (#608)
Travis no longer builds athena, as we no longer support 14.04 as a build
platform.  It also does not build the dev or test executables due to
system library symbol differences on 14.04.
2017-08-27 02:14:33 -07:00
Tyler Veness
6e4f66cc8b Classify other libraries' headers properly and fix committed formatting issues (#620) 2017-08-27 00:11:52 -07:00
Tyler Veness
a4e781a231 Fixed spacing and comment annotations around namespace and extern declarations (#587) 2017-08-24 00:07:46 -05:00
Tyler Veness
f151892db5 Contents of copyright line now has more standard ordering (#585) 2017-08-24 00:06:13 -05:00
Austin Shalit
c45fb73f36 Convert for loops to foreach loops (#592) 2017-08-24 00:00:55 -05:00
sciencewhiz
848280d1f1 Improve C++ Compressor documentation based on Java's docs. (#607) 2017-08-23 23:58:21 -05:00
Peter Johnson
f7016b359f HALUtil: Update to new GetJavaStackTrace function. 2017-08-22 23:09:28 -05:00
Peter Johnson
be58a279a5 Cross-platform JNI sometimes has jlong != int64. 2017-08-22 23:09:28 -05:00
Peter Johnson
909e6c4857 Error.cpp: Use llvm path function instead of OS basename.
This fixes an issue with the mac build.
2017-08-21 17:20:43 -05:00
Peter Johnson
5c0b08f4f5 Turn off -Wunused-const-variable on Mac. 2017-08-21 17:20:43 -05:00
Peter Johnson
05d1cfa276 Add "override" qualifier to several headers.
clang on Mac generates warnings for these.
2017-08-21 17:20:43 -05:00
Peter Johnson
ae675ae4e1 DriverStation: Work around missing pthread_local on Mac. 2017-08-21 17:20:43 -05:00
Peter Johnson
d3b636d073 fpga_clock: Don't use constexpr for time_points.
These are not constexpr on some compilers.
2017-08-21 17:20:43 -05:00
Peter Johnson
8b460f5944 sim DriverStation: Fix missing includes. 2017-08-21 17:20:43 -05:00
Tyler Veness
bdfa32876b Fixed Gradle test task name (#617) 2017-08-21 17:15:38 -05:00
Tyler Veness
4a3472ebb2 Removed unused include in PIDCommand.cpp (#616) 2017-08-20 17:09:13 -07:00
Thad House
9c804c1351 Fixes builds with skipAthena and onlyAthena, and mac builds (#613)
Did these in cscore and the other repos, but forgot about some of the
oddities jenkins has.
2017-08-19 22:15:52 -07:00
Tyler Veness
2a9c454baa Cleaned up and updated .styleguide for new build system file locations and ran wpiformat (#612) 2017-08-19 22:14:34 -07:00
Thad House
1a9a6c3678 Fixes HalSimStaticDeps config and publishing (#610) 2017-08-19 11:32:49 -07:00
Thad House
e1195e8b9d Update to 2018_v4 image and new build system. (#598)
* Revert "Force OpenCV to 3.1.0 (#602)"

This reverts commit 50ed55e8e2.

* Removes Simulation

* Removes old build system

* Removes old gtest

* Adds new gmock and gtest

* Updates to new ni-libraries

* removes MyRobot (to be replaced)

* moves files to new location

* Adds new sim backend and new test executables

* updates .styleguide and .gitignore

* Changes cpp WPILibVersion to a function

MSVC throws an AV with the old version.

* Disables USBCamera on all systems except for linux

* 2018 NI Libraries

* New build system
2017-08-18 21:35:53 -07:00
Thad House
50ed55e8e2 Force OpenCV to 3.1.0 (#602)
Will break otherwise when I push a new version
2017-08-13 21:41:45 -07:00
Tyler Veness
d682295ccd Miscellaneous cleanups for HAL, wpilibc, and wpilibj JNI (#589)
* Static functions in the HAL implementation were placed in the hal namespace
* "using namespace" declarations in HAL/cpp/Log.h and Timer.cpp were replaced
  with "using" declarations for std::chrono
* An extra include was removed from AnalogGyro.cpp
* InterruptableSensorBase's constructor was defaulted
* Newlines were added to some wpilibc integration tests for grouping
* A variable in HALUtil.h was renamed to follow the style guide

Supersedes #586
2017-08-07 17:36:34 -07:00
Austin Shalit
5e19c1881f Use diamond operator 2017-08-07 17:31:16 -07:00
Austin Shalit
617ff52f18 Use generics 2017-08-07 17:31:16 -07:00
Peter Johnson
5d3af62c0e Remove use of std::chrono_literals (C++14 feature). (#574) 2017-08-04 20:44:33 -05:00
Austin Shalit
ddd5aeba19 Checkstyle 8.1 (#584)
Added a few checks too:
- SimplifyBooleanExpression
- SimplifyBooleanReturn
- StringLiteralEquality
- UnnecessaryParentheses
2017-07-28 22:24:05 -07:00
Peter Johnson
3cfcbe9a95 Remove Scheduler.java from the sim path. (#564)
This is an old version and is duplicative of the shared Scheduler.java.
2017-07-27 00:41:56 -07:00
Tyler Veness
6bc793505d Suppress MultipleTopLevelClasses warning (#581) 2017-07-26 23:15:00 -07:00
Austin Shalit
3b44160cff Rearrange some method calls so methods fail faster (#583) 2017-07-26 23:14:35 -07:00
Thad House
d9586c8d38 Fixes JNI aliasing issues involving ControlWord and AllianceStation (#575) 2017-07-26 20:59:40 -07:00
Austin Shalit
74df3fac4e Require non null (#580)
* Replace null checks with Objects.requireNonNull()

* Use PMD rule instead of checkstyle rule
2017-07-18 20:32:08 -07:00
Austin Shalit
06321b8e87 Fix encoder sourceA null check (#579) 2017-07-18 19:34:45 -07:00
Thad House
f3efb948fe Switches CANJNI to use byte[] rather then ByteBuffer, and throws exceptions for invalid platforms (#571)
Fixes #567
2017-07-10 20:33:34 -07:00
Tyler Veness
432c03bf63 Updated Gradle to 4.0.1 (#573)
New PMD checks required modifying PIDController
2017-07-10 20:31:20 -07:00
Austin Shalit
bfd224278b Fix Java MyRobot linting (#572) 2017-07-10 20:29:52 -07:00
Tyler Veness
822ea6abc8 Made SpeedController class organization consistent between languages (#568) 2017-07-09 19:43:56 -07:00
Tyler Veness
97437ee58b Miscellaneous formatting and style fixes for integration tests (#570)
Added newline before comment block and replaced angle brackets around includes
with quotation marks. All other integration tests use quotation marks for WPILib
includes.
2017-07-09 19:27:43 -07:00
Thad House
aa7fe0db29 Fixes unused buffer warning on platforms other then athena (#566) 2017-07-09 08:59:26 -07:00
Thad House
237685d4a5 Fixes static initialization of HAL handles (#565) 2017-07-08 22:04:01 -07:00
Thad House
abbe630274 Gets WPILib building on windows and C++11 vs C++1y (#561) 2017-07-08 14:17:21 -07:00
Tyler Veness
89d3b08e77 Added TimedRobot (#520) 2017-07-08 07:50:56 -07:00
Thad House
f826216a28 Gets JNI compiling on all platforms (#563) 2017-07-08 07:48:27 -07:00
Austin Shalit
aa0a874ad0 Add periodic method to subsystems (#528)
Fixes #526.
2017-07-02 23:02:41 -07:00
Thad House
2da26c0579 Make HAL_Initialize timeout configurable, makes result a bool, and makes Java an exception rather than assert. (#557) 2017-07-01 00:43:06 -07:00
Tyler Veness
d34c844900 Fixed function ordering in robot base classes (#553) 2017-06-30 22:12:28 -07:00
Tyler Veness
68b63632c4 Removed functions that have been deprecated for at least one year (#551) 2017-06-30 22:05:33 -07:00
Chris Gregory
d2de94778e Remove memory leak in ConditionalCommand (#537)
This also properly handles nullptrs passed into ConditionalCommand
instead of having Undefined Behavior or NullPointerExceptions.
2017-06-30 22:01:21 -07:00
Austin Shalit
4fd4a50d41 Update Preferences to not use deprecated APIs (#555) 2017-06-30 19:38:32 -07:00
Tyler Veness
9d93820717 Replaced STL streams with LLVM's raw_ostream (#344)
std::cout and std::printf were replaced with llvm::outs() and std::cerr was replaced with llvm::errs().
2017-06-30 19:33:43 -07:00
Thad House
c57a7f0a41 Switches all notifiers created with the external API to be threaded (#546)
Testing showed this wasn't an issue with timing, and allows for more
safety in user code making mistakes. Places where the extra thread
wouldn't help have been kept non threaded, using a new internal API.
2017-06-30 18:58:58 -07:00
Thad House
1d15fcd072 Prints error when HAL_GetFPGATime call fails in fpga_clock. (#558) 2017-06-30 18:46:50 -07:00
Thad House
e824b1129e Adds way to reset and version all HAL handles (#545)
Useful in the sim to force a full reset. On roboRIO, the information is
still created and added, but is not checked because of speed
considerations.
2017-06-30 16:28:28 -07:00
Tyler Veness
0cd03c66e3 Remove deprecated Task class (#550) 2017-06-30 16:12:19 -07:00
Thad House
462b231dac Adds function to HAL to free malloc'd joystick name (#543)
No safe way to do this with interop, so a function is needed.
2017-06-30 16:11:16 -07:00
Tyler Veness
e4a918850f Fixed return value of SendableChooser<T>::GetSelected() for non-pointer T's (#512)
Fixed undefined behavior when returning nullptr for T = std::string. Also added
support for smart pointers. T = std::unique_ptr<U> returns U* and T =
std::shared_ptr<U> returns std::weak_ptr<U>.
2017-06-30 15:37:22 -07:00
Thad House
d472af3517 Removes CAN.h from the HAL (#556)
I can't find where the actual code is implemented, and I get errors if I
try to link or compile to any of its functions. Even CANJaguar doesn't
use them, nor did the old impl of CANTalon. Plus looking at the API it
makes no sense anyway, since it doesn't do any buffers , so I think its
worth it to remove it.

Removes CAN.h from the JNI header
2017-06-30 15:13:51 -07:00
Tyler Veness
98a587a347 Removed unused includes and added missing stdint.h includes (#549) 2017-06-25 09:05:49 -07:00
Aaron Pinto
5fd996876b Fixed a typo (#547) 2017-06-04 00:34:11 -04:00
Tyler Veness
b433d98c02 Replace std::stringstream with llvm::raw_svector_ostream (#345)
A few locations were changed to use std::ostringstream.
2017-05-15 23:10:40 -07:00
Thad House
7006672b06 Fixes hal shim from alias to using item (#538)
Fixes #536
2017-05-12 17:02:54 -07:00
Thad House
efec0c5cc3 Moves the HAL priority_ custom types to the hal namespace (#532)
There is a shim for backwards compatibility, just like the frc namespace.
As with the frc namespace, the library compiles without the shim.
2017-05-11 21:25:22 -07:00
Thad House
16e71eac43 Fixes assertions to not crash StringRef (#534)
We can't read [0] on an empty StringRef or the StringRef itself asserts
(this may crash in non-debug mode as an empty StringRef is not guaranteed to have a valid pointer).
Instead, we can just check if the StringRef is not empty.

Closes #502
2017-05-10 20:14:14 -07:00
Thad House
68b62abb52 Adds chrono wrapper around fpga time (#527)
Useful for some of the scenarios in C++ where using the chrono wrappers
might be very helpful.
2017-05-09 20:29:29 -07:00
Thad House
b2f3479692 Switches SPI and I2C to use enums in the HAL for ports (#531)
Closes #397
2017-05-09 12:12:46 -07:00
Tyler Veness
67d62ba164 Travis now passes the current year to wpiformat (#438)
See also styleguide#41.
2017-05-08 21:56:35 -07:00
Thad House
e1fc60b8dd SolenoidBase functions are now static (#530)
Instance methods were kept around for backwards compat in Java. In C++,
the instance methods were changed to match Java. Also some cleanup to
the JNI layer to match updated variable types we missed.

Closes #416
2017-05-08 21:55:11 -07:00
sciencewhiz
f32e696fef Fix exception when getting a relay in kReverse Direction. Fixes #458 (#525)
Add additional tests that would have caught this previously.
2017-05-08 21:54:03 -07:00
Thad House
fc81298fac Switches DS to use Occur callback rather than internal netcomm semaphore (#510)
Allows us to control multithreaded access and spurious wakeups easier.
closes #509

Switches DS to use new waitForData functionality

Adds a few new functions
2017-05-08 20:21:47 -07:00
Thad House
5987cfeaaf Fix SPIs to not set CS DIO pins into DIO mode (#504)
HAL_GetPort both allocates the DIO and sets the DIO into DIO mode.  The DIO setting was overriding the SPI setting on the port, so SPI chip selects were broken if you had more than one.  Instead use CreatePortHandleForSPI, which is a special function that only allocates the DIO handle, but doesn't actually set the DIO into DIO mode.
2017-05-08 20:04:41 -07:00
Thad House
cd0ece4511 Removes the semaphore class (#529)
Its been deprecated, and its going to interfere with fixing #459
2017-05-08 19:42:28 -07:00
sciencewhiz
dc9f85ebb9 Fix comment refering to old _val enum values (#524) 2017-05-07 17:10:52 -07:00
sciencewhiz
35a2055cda Improve documentation for WaitCommand and TimedCommand. (#494) 2017-05-07 13:29:11 -07:00
Austin Shalit
a1066776a5 Make SmartDashboard methods static (#523) 2017-05-07 10:32:40 -07:00
Austin Shalit
4dae747343 Refactor RobotDrive squaring (#390) 2017-05-07 09:40:48 -07:00
Thad House
d348a5b947 Fixes WaitForInterrupt to return values matching enum (#503) 2017-05-07 09:07:14 -07:00
Austin Shalit
f0c413f40d Relay stores nt value in enum (#460) 2017-05-07 09:05:15 -07:00
Austin Shalit
846eee2f6c HashMap -> LinkedHashMap (#492) 2017-05-06 23:38:10 -07:00
Austin Shalit
0b9ff68da1 StartLiveWindowMode ITables use lambdas (#461) 2017-05-06 23:26:18 -07:00
Austin Shalit
7187e005d4 Add Checkstyle WhitespaceAfter check (#466) 2017-05-06 23:22:16 -07:00
Chris Gregory
a5cd24e7ea Reduce scope of for loop variables to for loop initializer (#517) 2017-05-06 23:15:34 -07:00
Jonathan Leitschuh
dbe821baee Change the wrapper to use the all distribution with the sources (#498) 2017-05-06 21:34:15 -07:00
Peter Johnson
04486c6472 CameraServer: Always update addresses when updating stream values. (#496)
This should prevent (as currently happens) occassionally getting just the
mDNS address in the stream value.
2017-05-06 21:31:45 -07:00
Austin Shalit
2ee8ba9361 SafePWM: Rename Feed to feed (#463)
Add a deprecated shim to avoid breaking any user code using Feed.
2017-05-06 21:31:02 -07:00
Thad House
b07782cd89 Removes StatusIsFatal checks from PDP (#493)
The exceptions were removed from Java because these fail more often then
not. Teams are noticing this in C++ as well. In addition for some reason
ClearErrors() is causing about 0.5 seconds of lag. That's another issue,
but this will match Java and solve that issue for users.
2017-05-06 21:29:32 -07:00
Austin Shalit
305450b6e4 Remove 'value' from PIDSourceType (#464) 2017-05-06 21:27:07 -07:00
Thad House
fdd0b853ed Fixes Base.h to work properly with MSVC 2015 and above (#513) 2017-05-06 21:23:33 -07:00
Max Narvaez
1d025204e7 Fixed Spelling Mistakes in SmartDashboard.java (#506)
Fixed comment spelling.
2017-04-30 00:29:27 -07:00
Tyler Veness
12f759860e Corrects assumptions about return values from i2c-lib (#484)
Fixes #478
2017-02-17 00:05:54 -08:00
Austin Shalit
1bdbb5ddcc Remove usages of isEnable() (#483) 2017-02-14 01:16:36 -08:00
Paul Friederichsen
b573fb6555 Fix param order in RobotDrive docs (#481)
Fix Javadoc @param order in RobotDrive and fix order of params in C++ docs
2017-02-14 01:14:56 -08:00
Thad House
b50a7bdbee Fixes memory leak for SPI reads (#474)
Adds a stack allocation for most use cases.
2017-02-14 01:14:08 -08:00
Thad House
5a5f10dfc8 Fixes I2C read change size of pointer (#479)
Fixes #477
2017-02-10 15:21:59 -08:00
Peter Johnson
e375b4a9ff CameraServer: auto-increment startAutomaticCapture(). (#468)
Also add GetServer() functions so the automatically created VideoSink can
be retrieved by user code if desired.
2017-01-20 01:07:37 -07:00
Thad House
ff141ab1ff Fixes exception on camera creation without plugged in camera (#470)
Would throw if the camera was disconnected. We handle this properly at
the JNI level to not have this crash the entire program, but the error
is still kind of annoying, and not really an error.
2017-01-20 01:02:27 -07:00
Peter Johnson
b8537be219 CameraServer: Remove NT-driven settings. (#467)
Unfortunately, due to the way NT synchronization is currently performed,
this has unexpected and undesirable behavior: when a dashboard (or any other
NT client) is left running between code restarts, when it reconnects, any
code settings will be overwritten by the NT synchronization process.  As
fixing this will require a fairly major NT change (and likely a user-visible
one), it's not desirable to do at this point in the year.

Instead, disable NT driven settings entirely (e.g. make the NT interface
publish only).  To emphasize the read-only nature of the NT values, attempts
to change the NT values will be immediately overridden by CameraServer.

To better inform users about the actual property names (e.g. for use in their
code), the "raw_" settings no longer have "raw_" removed from their names
(they are still placed in the "RawProperty" subtable).

This change also contains a couple of Java fixes:

* Make getInstance() thread-safe

* Properly synchronize access to m_tables between multiple threads.

* Use Hashtable instead of HashMap.
2017-01-19 12:30:07 -07:00
Austin Shalit
8f1b034b2f Fix typo in JavaDoc (#462) 2017-01-16 22:57:28 -07:00
Thad House
71d0a07e0a Fixes solenoid allocation error message (#455)
The error was NO_AVAILABLE_RESOURCES, which is not the proper error to
return. Instead,  just return the error directly from the allocation.
2017-01-14 23:59:05 -07:00
sciencewhiz
d322342494 Remove comments about Blue DS (#450)
It's unlikely that anyone is still using the Blue Kwikbyte DS from 2009,
and the reference is confusing to people who weren't around then.
2017-01-14 23:52:48 -07:00
Peter Johnson
bc7ab17692 CameraServer updates (#446)
* CameraServer: Add properties and video mode NT interchange.

* Automatically serve Axis cameras so they're accessible via USB.
2017-01-05 02:51:55 -08:00
Tyler Veness
7a049c29bd Added a conditional command that chooses 1 of 2 commands (#435)
Tests and documentation for ConditionalCommand were also added. This is a fixed version of #9, so it doesn't support lambdas.

Closes #9
2017-01-04 23:48:13 -08:00
Thad House
1fc375b31a Updates the gradle wrapper to version 3.3 (#445) 2017-01-04 22:08:48 -08:00
Austin Shalit
eee7f3991c Allow VisionRunner to stop (#442) 2017-01-04 19:41:07 -08:00
Thad House
2e3503517d Add OS level serial port (#426) 2017-01-04 19:38:17 -08:00
Austin Shalit
15e58acc76 Java SendableChooser no longer sets a default on addObject (#441) 2017-01-03 19:13:45 -08:00
Austin Shalit
5aa5e3e09e SendableChooser generic value (#433)
* Java SendableChooser now decorates with type (non-breaking change)

* C++ SendableChooser now is templated on the type instead of using void* and stores values (breaking change)

* C++ SendableChooser now uses llvm::StringMap instead of std::map
2017-01-03 14:40:31 -08:00
Tyler Veness
25ae7b2c2b Upgraded Doxygen gradle plugin to 0.3 (#440) 2017-01-02 10:03:37 -08:00
Tyler Veness
4b6dc9583a Corrected order of access specifiers in MockCommand class (#436) 2017-01-02 00:44:35 -08:00
Thad House
64eab1f7b3 Fixes missing Extern "C" from HAL Threads (#437)
Also fixes incorrect return value during set
2017-01-02 00:43:12 -08:00
Thad House
182f57216f Adds project and classpath ignores (#425)
VsCode now supports Java, but it creates these files, and there is no
way to turn it off. Will be adding this to a few other repos too.
2017-01-01 00:08:13 -08:00
Tyler Veness
65b091a39a Call SmartDashboard::init() in RobotBase constructor. (#428)
Fixes #427
2017-01-01 00:07:22 -08:00
Austin Shalit
ed1a94531a Update license headers to 2017 (#434) 2017-01-01 00:05:57 -08:00
Fred Silberberg
4e12ffb0ae Update the wpilib version plugin (#423) 2016-12-25 23:01:03 -08:00
Peter Johnson
4800c201e4 Add Axis camera creation functions and Http camera NT publishing. (#420) 2016-12-24 21:05:08 -06:00
Thad House
dc9a9e5d96 Fixes typo in SensorBase error message (#422) 2016-12-24 21:04:32 -06:00
Thad House
6844f05c3d Adds SetAllSolenoids function to CTRE PCM code (#419)
Closes #417.
2016-12-23 14:35:45 -06:00
Austin Shalit
8f67f2c24c Remove unused code and add pmd check (#395) 2016-12-23 13:20:13 -06:00
Thad House
cc246bb9ac Switches JNI to use new jni_util methods (#404)
* Uses WPIUtil string objects in JNI

* Switches JNI to use new jni_util classes
2016-12-23 13:13:17 -06:00
Sam Carlberg
bf9f0a9e6d Add vision pipeline API to make it easier to run OpenCV pipelines (#388) 2016-12-23 10:48:56 -06:00
Austin Shalit
c3160bad44 Update SendableChooser to use HashMap (#394) 2016-12-22 15:56:23 -08:00
Thad House
94b8ac42ca Adds CPP version of vision pipeline (#399) 2016-12-21 23:58:42 -06:00
Thad House
a03e3d7eb9 Fixes HAL to build without all headers included in HAL.h (#418) 2016-12-21 23:55:31 -06:00
Jaci R
a42ec08d16 Fix RoboRIO Cross-Toolchain GCC Status (#405)
* Dedicated RoboRIO Toolchain, allow Toolchain Path to change

* Add cCompiler Tool to correctly discover RoboRIO GCC on Mac

* Add @333fred requests for GString and ToolChainPath

* Add Toolchain Path option to README
2016-12-21 19:56:28 -08:00
Thad House
fddb6cd9d8 Fixes SPI Accumulator averages (#415) 2016-12-21 20:17:53 -06:00
Thad House
841f016017 Fixes SerialHelper when used with OS serial ports. (#411)
Also makes the SerialHelper API public so it can be used externally.
2016-12-21 00:16:05 -06:00
Thad House
8e4afc95c7 Switches C++ strings to StringRef (#336) 2016-12-21 00:08:24 -06:00
Tyler Veness
8cec948699 Fix typos (#409) 2016-12-19 22:06:39 -06:00
Tyler Veness
31ae7c942c Fixed signatures of deleted assignment operators (#408)
While it technically doesn't matter what the return type of the assignment operator is since it's deleted, assignment operators should return a reference instead of a value.
2016-12-19 11:24:23 -08:00
Tyler Veness
d0900626da Removed format.py shim (#393)
Now that our formatter is a Python package (wpiformat), the format.py shim for invoking it is no longer necessary. styleguide#29 should be merged before this patch.
2016-12-18 19:46:20 -08:00
Peter Johnson
0ee4cadca0 CameraServer: Workaround LabVIEW dashboard OpenCV compatibility. (#406)
The current LabVIEW dashboard (Beta 4) requires the source type to be either
"usb:" or "ip:" and does not support "cv:".  To work around this, use a source
type of "usb:" for OpenCV sources as well.

Workaround for #407.
2016-12-18 13:36:44 -08:00
Thad House
24b5a9c389 Adds UsageReporting include when using the LabVIEW shim (#401) 2016-12-16 22:42:45 -08:00
Austin Shalit
626220e9f3 Fix javadoc typo (#403) 2016-12-15 19:46:42 -08:00
Thad House
323d68d460 Fixes multiple initialization of HAL_BaseInitialize (#400) 2016-12-13 12:31:44 -08:00
Thad House
db2091dd94 Adds safe serial port write methods (#396)
The old method had a fairly large risk of undefined behavior, and the way the docs
were written could cause users to get confused.
Deprecate the old method and add StringRef method as preferred approach.
2016-12-10 22:40:44 -08:00
Thad House
8216d85e52 Adds check for PWM overallocation (#392) 2016-12-09 21:23:54 -08:00
Austin Shalit
a705eb1c61 Add PMD and solve issues (#389) 2016-12-07 21:24:44 -08:00
Thad House
77f664a6b1 Fixes simulator HAL builds (#391) 2016-12-06 19:56:31 -08:00
Austin Shalit
c30057e923 Remove unused imports (#387) 2016-12-05 21:36:52 -08:00
Peter Johnson
06108b9479 Update CameraServer support. (#386)
* Follow MixedCase rename.

* Add GetVideo function to get cameras by name.
2016-12-04 00:26:08 -08:00
sciencewhiz
16181523c9 Put language in version string (#377) 2016-12-02 20:36:22 -08:00
Jacob Caporuscio
7e0706cf83 Updated Usage Reporting for 2017 v8 Image (#385) 2016-12-02 18:16:49 -08:00
Thad House
bff67887fd Adds capabilities to support certain HAL functionality from LabVIEW (#382)
They can only include HAL/LV/HAL.h, HAL/cpp/*.h, and HAL/handles/*.h.
Nothing else will work properly.
2016-12-02 00:32:01 -08:00
Thad House
351ff5eb48 Adds new Threads API for priority setting while using std::thread (#379)
Also adds Java API for doing the same to Java threads (standard Java Thread.setPriority only works
when Java is run as root, even if the process has the right privileges).
2016-12-01 21:06:19 -08:00
Thad House
051df14046 Updates ni patch task to automatically switch all files to LF (#381)
Still requires manual intervention to make files not readonly, but
that's easier.
2016-11-29 20:20:49 -08:00
Thad House
ee0318f697 Updates NI Libraries to image 8 (#380) 2016-11-29 19:56:30 -08:00
Thad House
a6fb1efcbe Switches internal joystick errors to take StringRef (#378)
Previously this would have allocated the std::string every time, even if
the message wasn't printed. Now takes a StringRef, and only converts to
std::string when the message actually gets printed.
2016-11-26 21:22:39 -08:00
sciencewhiz
31fecc28a4 Check for NaN motor speed. Fixes artf5467. (#376) 2016-11-26 21:04:40 -08:00
Thad House
30b1efc354 Adds check to ensure all JNI symbols have been defined properly (#373) 2016-11-25 17:07:36 -08:00
Thad House
7d721eb569 Fixes memory leak in SerialHelper VISA (#366) 2016-11-25 15:52:21 -08:00
Fred Silberberg
d48aac5beb Gradle Update (#372)
This does a major cleanup on our gradle files, primarily converting all instances of manual dependency downloading to use the correct configuration-based method, which has the advantage of being both less code and more safe.
2016-11-24 23:44:35 -08:00
Fred Silberberg
14b56db99e Gradle 3.2.1 (#369)
Updated to gradle 3.2.1. This also moves all of the task graph listeners for dependency setup to use the gradle model, making it both safer and reducing line count.
2016-11-24 22:15:54 -08:00
Thad House
bfe429de51 Switches handles back to std::array (#367)
The binary size is being increased much less then when we originally
tried this. Using static arrays save a pointer indirection and will help
with cache in real time cases.
2016-11-24 21:55:20 -08:00
Thad House
57ef5cfd07 Splits out SerialHelper to allow using OS or VISA resources (#365)
Also removes regex and uses simple splits instead
2016-11-24 21:53:04 -08:00
Fred Silberberg
4bbb7c0bcc Fixed javadoc generation to actually download cscore and ntcore and include the source in its output. (#368) 2016-11-24 21:51:01 -08:00
Thad House
4de70bff5e Adds missing JNI method definitions (#371) 2016-11-24 21:49:34 -08:00
Peter Johnson
687f0c7dc0 Use const parameters in std::sort lambda. (#364)
This is more correct, and non-const fails on gcc 4.8.
2016-11-22 22:30:58 -08:00
Thad House
f3d66e92ec Searches for USB serial devices to get the correct VISA object (#363)
Fix was made in LabVIEW, and this matches what was done there.
2016-11-22 21:51:47 -08:00
Thad House
9a91ae54d6 Fixes incorrectly changed Java enums (#360)
Some enums need a specific value when they get passed to JNI
2016-11-20 20:32:52 -08:00
Tyler Veness
69422dc063 Replaced floats with doubles (#355)
This makes our APIs more consistent. With optimizations enabled, doubles are just as efficient as floats on ARMv7, so we should take advantage of the extra precision.
2016-11-20 07:25:03 -08:00
Dustin Spicuzza
7bcd243ec3 Reorder the HAL handle types (#357) 2016-11-20 00:01:24 -08:00
Thad House
8f70bea899 Fixes Athena Runtime build not including ntcore (#356) 2016-11-19 23:58:29 -08:00
Thad House
948c4275ad Fixes the wpilibj jar not getting updated during every build (#359) 2016-11-19 23:52:19 -08:00
Peter Johnson
03a1159915 Java CameraServer: Fix type cast exception. (#358)
Also fixes an unchecked warning.
2016-11-19 22:45:45 -08:00
Tyler Veness
1c8fb298b4 Ran formatter (#354) 2016-11-19 00:39:32 -08:00
Tyler Veness
b25a7cb370 Command::IsFinished() must be overriden by subclasses again (#353)
Documentation was added for InstantCommand and TimedCommand.
2016-11-19 00:26:22 -08:00
Tyler Veness
140c365e4b Added XboxController class (#140)
Joystick and Gamepad functionality was separated into cleaner interfaces.
2016-11-18 23:05:37 -08:00
Peter Johnson
8c93ceb728 Add cscore-based CameraServer. (#352)
Not fully functional yet, but implements basic functionality required for LabView dashboard interoperability.
2016-11-18 22:30:22 -08:00
Thad House
ac50d7cf8a Removes NiVision from allwpilib (#305) 2016-11-18 20:04:21 -08:00
Thad House
ecb873ff45 Fixes myRobotJava zipping before Java gets built (#351) 2016-11-18 19:44:13 -08:00
Thad House
78baa04ecc Adds OpenCV to myRobotJava (#350) 2016-11-18 16:20:30 -08:00
Krypton Cougars
b78f580d47 Adds default methods for Commands (#238) (#238)
Closes #235
2016-11-18 14:42:40 -08:00
Thad House
b115c75226 Adds SPI DIO to WPILib (#256) 2016-11-18 14:15:53 -08:00
Thad House
6bc092f3ae Updates SPI device pin (#348) 2016-11-18 14:14:51 -08:00
Thad House
f99a266ce4 Adds CsCore dependency to myRobotCpp (#349) 2016-11-18 14:14:11 -08:00
Fred Silberberg
1f724d58e0 Made the test scripts executable to fix -dirty on the version numbers. (#347) 2016-11-14 21:16:51 -08:00
Thad House
de4a246bb4 Adds OpenCV Loading to wpilib program startup (#338) 2016-11-11 22:32:13 -08:00
rrossbach
412b80da30 Fixes joystick button handling HAL JNI layer (buttons are in an (#341)
int, not a byte)
2016-11-10 20:21:54 -08:00
Thad House
47319960a5 Fixes a missed change to unique_ptr in the HAL (#337) 2016-11-08 16:53:17 -08:00
Thad House
b22d218236 Removes CANJaguar specific constants from JNI files (#339) 2016-11-08 16:52:24 -08:00
Thad House
6eb82bc314 Exclude genlinks.bat from HAL zip (#333) 2016-11-06 21:47:34 -08:00
Thad House
a06dd25d56 Adds cscore and opencv to wpilib (#332)
Unit tests now run using shared wpilib as well, since we had to add a ton
of sharedl ibraries anyway. Test scripts also updated to work properly.
2016-11-06 21:47:18 -08:00
Thad House
e1bb05bc52 Updates to the 2017 v7 image (#329) 2016-11-05 23:20:40 -07:00
Tyler Veness
8694a020ac Removed entries from .styleguide that are included in .gitignore (#331)
format.py now considers files that match patterns in .gitignore to be modifiable files. Therefore, listing them in .styleguide is redundant.
2016-11-05 08:39:46 -07:00
Thad House
1efb2e4d3d Deprecates Task and Semaphore, and changes other deprecations to use wpiutil version (#330) 2016-11-05 00:23:52 -07:00
Thad House
861726cefa Adds gradle task to fix NI libraries whenever new ones are added. (#325)
Generates genlinks, and modifies headers to make them self contained
2016-11-04 15:17:17 -07:00
Thad House
81212d80c6 Fixes ultrasonic declaration (#328)
Also adds test to ensure this doens't happen again
2016-11-04 15:02:29 -07:00
Thad House
2235a809c4 Fixes a missed change from the ni-libraries location change (#326) 2016-11-04 13:26:34 -07:00
Thad House
3fe0f49ac0 Moves NI headers to their own folder in the repo (#324) 2016-11-04 01:22:28 -07:00
Thad House
03d8f9193b Moves using namespace from ChipObject.h into hal namespace (#323) 2016-11-03 23:01:13 -07:00
Thad House
5e54969f6b Adds Task back into WPILibC (#320)
Note that deprecation has not been added yet, since we need to add the
deprecation API's for MSVC and GCC < 4.9.
2016-11-02 22:17:40 -07:00
Thad House
18ef5eb1bf C++ and Java tests for the new build system (#309) 2016-11-01 23:41:05 -07:00
Tyler Veness
b5e3d92e9d Remove errant "using namespace" in global namespace (#318) 2016-11-01 23:40:28 -07:00
Tyler Veness
ba8761e39e "using" directives are no longer used in global namespaces (#219) 2016-11-01 23:09:51 -07:00
Thad House
78f0b1562c Removes Task.h from wpilib.h header (#317) 2016-11-01 23:08:57 -07:00
Thad House
5c28b30028 Removes NetworkTables from Java executable jar (#303) 2016-11-01 22:34:52 -07:00
Peter Johnson
59267da72b Namespace all wpilibc functions/classes into "frc" namespace. (#311)
Base.h provides a backwards compatibility shim (enabled unless
NAMESPACED_WPILIB is defined) that does a "using namespace frc".
However, as some header files do not include Base.h, this may
be a breaking change in some corner cases (with an easy fix).

Fixes #218.
2016-11-01 22:33:12 -07:00
Dustin Spicuzza
36ad45c07d Delete .gitreview (#316) 2016-11-01 22:31:53 -07:00
Thad House
ecb2add791 Removes additional references to CANTalon from the library. (#312) 2016-11-01 20:13:26 -07:00
Thad House
9bbdaf300b Removes the task class from wpilib (#314)
Was required back on the cRIO, but there are much better alternatives
nowadays.
2016-11-01 20:12:08 -07:00
Thad House
bc492bb40e Removes the REAL definition from wpilib.h (#315)
Interferes with OpenCV, and is heavy namespace polution anyway.
2016-11-01 19:23:59 -07:00
Thad House
81221c4874 Moves JNI internal utility methods to frc namespace (#310) 2016-10-31 23:04:49 -07:00
Thad House
137b3d81fb Fixes JNI file not being copied to output directory for integration tests (#308) 2016-10-30 23:14:19 -07:00
Fred Silberberg
6741f47ef1 Update version plugin (#307) 2016-10-30 01:18:18 -07:00
Thad House
e75e9092a8 Fixes athena runtime zip not being built at the correct times (#306) 2016-10-27 22:01:28 -07:00
Thad House
247cef5ec2 Removes CANJaguar from wpilib (#300)
Now located at https://github.com/wpilibsuite/CANJaguar.
2016-10-27 10:54:52 -07:00
Thad House
29f999e2b2 Adds new handle structure and type for vendors (#297) 2016-10-26 23:09:33 -07:00
Thad House
5e3755493d Linking and maven publish location rewrite (#298)
* Links HAL shared instead of static, and doesn't include library in jar

* Strips shared object files, and includes debug in releases

* Zips the HAL libraries into a separate maven artifact

* Switches to shared wpiutil

* Switches wpilibc to shared

* Moves maven artifacts

wpilibc now in edu.wpi.first.wpilibc:athena
wpilibj now in edu.wpi.first.wpilibj:athena
wpilibj jni not in edu.wpi.first.wpilibj:athena-jni
hal now in edu.wpi.first.wpilib:hal
athena runtime added (hal, ntcore, wpiutil) edu.wpi.first.wpilib:athena-runtime

Changes made where wpilibc does NOT include all required artifacts anymore. Dependent on hal, wpiutil and ntcore packages to work correctly.
JNI does NOT include all required artifacts anymore. Dependent on hal and wpiutil packages to work correctly.
2016-10-25 20:46:09 -07:00
Thad House
70343c0b3f Fixes missing function for Timer::GetMatchTime() (#299) 2016-10-25 19:01:18 -07:00
Thad House
60e199b0bd Fixes format.py on windows (#293) 2016-10-24 22:17:02 -07:00
Thad House
1071686d81 Replaces C++ IsNewControlData semaphore with atomic bool, and Java code with AtomicBool (#187) 2016-10-24 20:32:43 -07:00
Tyler Veness
fdebdd520a Added format.py to Travis config (#236) 2016-10-23 21:37:43 -07:00
Tyler Veness
5ca5583fc3 Removed unnecessary set of parentheses and ran formatter (#290) 2016-10-23 16:34:00 -07:00
Thad House
75463a249f Implements threaded notifiers and interrupts in the HAL (#281) 2016-10-23 14:34:43 -07:00
Thad House
7280d241f0 Fixes DIO not erroring with too high of DIO number (#288) 2016-10-23 14:21:14 -07:00
Austin Shalit
963391cf39 Cleanup SolenoidBase, Solenoid, and DoubleSolenoid (#271) 2016-10-23 14:20:28 -07:00
Thad House
4f4c52d6d5 Switches JNI to use SafeThread from WPIUtil (#282) 2016-10-23 14:18:46 -07:00
Fred Silberberg
499da6d08d Updated the wpilib version plugin to 1.2. Fixes issues with submodules. (#289) 2016-10-23 14:17:59 -07:00
Austin Shalit
39e4d11f8e Remove .pullapprove.yml (#287) 2016-10-23 11:20:29 -07:00
Thad House
df4a2c07f0 Checks for system initialization in functions that can be called before creating handle based objects (#285) 2016-10-23 10:00:34 -07:00
Thad House
c46c490376 Adds wpiUtil to HAL and JNI (#280) 2016-10-23 09:51:30 -07:00
Thad House
f2751db5c2 Adds NI Libraries symbolic link (#286) 2016-10-22 14:21:26 -07:00
Thad House
2bff276adb Fixes a missed formatting issue (#283) 2016-10-21 08:30:49 -07:00
Fred Silberberg
e5e1a1a4d1 Moved version generation to the WPILib versioning plugin. (#277)
* Moved version generation to the WPILib versioning plugin. This also moves ntcore and wpilib to the latest available version.

* Fixed description string.

* Gave full path for ignored files.
2016-10-20 23:54:04 -07:00
Austin Shalit
0613f1d182 Cleanup encoder class (#272) 2016-10-19 22:39:47 -07:00
Austin Shalit
8b94e0933a Update README (#261)
Update the README to include instructions on how to image the test bench roboRIO.
2016-10-19 22:37:43 -07:00
Austin Shalit
23ef57561d Cleanup PowerDistributionPanel (#275) 2016-10-19 22:34:57 -07:00
Austin Shalit
33b95816ee Cleanup SensorBase class (#273) 2016-10-19 22:33:36 -07:00
Thad House
4c1e4fd80c Updates image to v6 (#278)
Added exports of the environment variables set in the frcRunRobot script to prevent fork calls.
2016-10-19 22:30:29 -07:00
Fred Silberberg
3784b665de Updated version for beta 1 (#270) 2016-10-13 18:50:39 -07:00
Kevin-OConnor
567ea1d58d Remove CAN TalonSRX from WPILib (moving to external library) (#268) 2016-10-13 18:50:20 -07:00
Austin Shalit
55346e28d0 DoubleSolenoid free reverse port handle instead of channel (#274) 2016-10-13 12:41:36 -07:00
Fred Silberberg
49b8c4ba78 Fixes the gradle dependencies for building (#269) 2016-10-12 21:06:33 -07:00
Thad House
f1c2b66569 Reverts the 2017 Image for Beta 1 (#264)
* Revert "Updated the rpath to point to the correct location for the Java integration tests. (#262)"

This reverts commit c313dde03a.

* Revert "Update image 2017 v5 (#254)"

This reverts commit 8d1c51b7e9.
2016-10-12 19:52:49 -07:00
Austin Shalit
27bf94fd06 Remove kDefaultPeriod from IterativeRobot (#232)
* Remove kDefaultPeriod from IterativeRobot

* Remove period

* Remove NextPeriodReady
2016-10-09 13:58:30 -07:00
Thad House
4896a77c86 Fixes guarantees for waitForData (#252)
As discussed in #234, we now check for the timeout case and handle a
timeout correctly.
2016-10-09 11:46:01 -07:00
Austin Shalit
d1d3f049f2 Solve scp file not found (#263)
Solves the scp file not found bug after installing a new image on the test bench.
2016-10-09 11:45:26 -07:00
Fred Silberberg
c313dde03a Updated the rpath to point to the correct location for the Java integration tests. (#262) 2016-10-08 13:08:26 -07:00
Fred Silberberg
8d1c51b7e9 Update image 2017 v5 (#254)
* Updated the image version and dependent libraries to 2017 v5.

* Updated version for beta 1

* Some additional library updates, task updates, and rpath updates
2016-10-08 00:13:31 -07:00
Thad House
a59e00e901 Adds a test to make sure WaitForData is properly waiting (#258) 2016-10-06 11:18:47 -07:00
Tyler Veness
7070162b98 Fixed lint errors (#259) 2016-10-06 11:05:09 -07:00
Thad House
9859c14ca1 Fixes status parameter in wrong location for initialization range functions (#260) 2016-10-06 11:04:38 -07:00
Thad House
64ebe7f5e5 Updates SmartDashboard with new NetworkTables3 functions (#162) 2016-10-03 09:59:18 -07:00
Thad House
8b2345a706 Removes an unnecessary function from HAL Power (#237)
Was not declared in header, so never used anywhere
2016-10-03 09:52:47 -07:00
Thad House
e65f9908d7 Makes IterativeRobot not double check for new control data (#253)
Previously could cause a race condition. Also moves wait to the top of
the loop in order to avoid having an initial loop be ran before data can
be check.

Sim is handled in #232, except that needs to be updated as well to move
the wait to the top of the loop.
2016-10-02 09:05:32 -07:00
Tyler Veness
fd52912d74 Fixed return value propagation of format.py (#251) 2016-10-02 08:10:22 -07:00
Fred Silberberg
9e7993905f Remove slack integration (#257)
Slack integration is useless noise that no one reads. This removes it.
2016-10-02 01:11:09 -07:00
Thad House
a656207220 Forces exceptions to throw on HAL handle creation functions (#209)
Fixes #199
2016-09-29 20:18:40 -07:00
Peter Johnson
81e63ea3a5 Fix simulation build with latest ntcore/wpiutil. (#250) 2016-09-28 20:45:03 -07:00
Tyler Veness
5dfae8d6bd Fixed include order (#245)
See wpilibsuite/styleguide (#11).
2016-09-25 16:50:13 -07:00
Peter Johnson
107a4cc1e2 Add wpiutil dependency. (#190) 2016-09-25 16:47:49 -07:00
Tyler Veness
35d51d68f7 Made a comment use more professional language (#249) 2016-09-23 22:16:33 -07:00
Tyler Veness
049fec470b Fixed compilation with GCC 6 (#248)
Since newer versions of GCC emit more warnings and errors, I tried building WPILib with GCC 6.2.0. This patch fixes compilation errors that occurred.
2016-09-23 20:27:11 -07:00
Tyler Veness
659dbef751 Ran format.py after writing unit tests for and fixing bugs in it (#239) 2016-09-21 23:48:54 -07:00
Tyler Veness
ac9b6f7b18 Implemented CircularBuffer resizing (#224) 2016-09-20 19:43:34 -07:00
Tyler Veness
425ed464ed Removed leading underscores from variable names (#246) 2016-09-20 12:41:42 -07:00
Austin Shalit
2c15bb247e Remove delay from periodic methods. (#243) 2016-09-20 12:34:17 -07:00
Austin Shalit
28e178b1a8 Update Compressor documentation (#244) 2016-09-20 12:31:16 -07:00
sciencewhiz
5d2a08443b Fix Typos. Fixes artf4853 (#242) 2016-09-18 08:43:22 -07:00
Tyler Veness
087eeec760 C standard library functions and types are now prefixed with std:: (#227) 2016-09-14 20:52:06 -07:00
Thad House
dbe03afb9a Fixes error in driver station control word cache (#222) 2016-09-13 21:22:25 -07:00
Thad House
2ecb939b35 Add a method to detect the HAL runtime version (#228) 2016-09-13 21:21:57 -07:00
Austin Shalit
1416fb8f67 Update Periodic JavaDoc (#231) 2016-09-13 21:21:25 -07:00
Tyler Veness
aeb6c4889b Added license template file (#225) 2016-09-13 20:28:07 -07:00
Thad House
c2fc6711d8 Switches enums to use a fixed size for their base (#230) 2016-09-13 20:27:38 -07:00
Thad House
f271185cbc Adds a RobotPeriodic method to IterativeRobot (#226)
Called globally during each IterativeRobot loop
2016-09-13 20:25:18 -07:00
Thad House
4fc7daedc9 Fixes incorrect deadband value being passed over PWM (#223) 2016-09-09 15:58:38 -07:00
Tyler Veness
6bfc008673 Replaced snake case variable names with mixed case (#221) 2016-09-06 19:43:24 -07:00
Tyler Veness
2c94d0ba2f Cleaned up integer type usage in the HAL (#192)
Replaced all uses of built-in types except char with stdint.h typedefs and all unsigned types with signed in the HAL
2016-09-06 19:39:28 -07:00
Tyler Veness
0cd05d1a42 Cleaned up integer type usage in wpilibc (#92)
Replaced all unsigned types to signed and int32_t with int in wpilibc
2016-09-06 00:01:45 -07:00
Tyler Veness
ff93050b31 Remove static_assert for sizeof(uint32_t) <= sizeof(void*) (#220)
According to #192, we don't cast integers to pointers anymore. The size static_assert is unnecessary.
2016-09-05 23:31:58 -07:00
Tyler Veness
05626cfafe Fixed cpplint.py warnings (#215)
* Fixed cpplint.py [build/include_order] and [build/include_what_you_use] warnings
* Fixed cpplint.py [readability/casting] warnings
* Updated .styleguide format
* Fixed cpplint.py [build/header_guard] warnings
2016-09-05 13:55:31 -07:00
Thad House
59ec54887d Switches notifier to use a typedef for the callback, and prepends HAL_ to InterruptHandlerFunction (#216) 2016-09-05 07:31:51 -07:00
Tyler Veness
028efff50d Ran format.py (#217) 2016-09-05 07:31:02 -07:00
Tyler Veness
2499771cf4 Added extensions to .styleguide (#214)
wpilibsuite/styleguide is going to use extensions specified in .styleguide instead of hardcoded extensions. This patch should be merged first to maintain correct operation.
2016-09-01 20:31:38 -07:00
Fred Silberberg
c989ae808b Updated gradle to 3.0 (#208) 2016-09-01 20:30:37 -07:00
Tyler Veness
93b486b6ba Replaced C-style casts found by GCC in HAL, wpilibc, and JNI (#211) 2016-08-24 21:39:16 -07:00
Thad House
2ec6132fcb Switches compiler from -O0 to -Og (#197)
Should be a heavy increase in performance
2016-08-21 19:15:58 -07:00
Thad House
8aba2b2850 Adds .vscode to styleguide ignore files (#210) 2016-08-21 12:35:58 -07:00
Tyler Veness
32c95fa0da Moved style guide documents and scripts to wpilibsuite/styleguide (#207) 2016-08-21 10:31:43 -07:00
Thad House
40365faeda Adds a static mutex to notifiers to stop destructor race condition (#204) 2016-08-15 19:56:32 -07:00
Thad House
776cb915bc Revert "PIDController queue now stores inputs instead of errors (#138)" (#205)
This reverts commit 7501ae65a1.
2016-08-13 23:49:31 -07:00
Thad House
5e9fe2f5cb Adds an ignore for Visual Studio Code files (#203) 2016-08-13 14:44:10 -07:00
Tyler Veness
7501ae65a1 PIDController queue now stores inputs instead of errors (#138)
Closes #29.
2016-08-12 22:04:44 -07:00
Peter Johnson
63469c00c4 run-tests-on-robot.sh: Save coredump on crash. (#201) 2016-08-12 19:18:48 -07:00
Fred Silberberg
3df257cdbb Set duplicate strategy for all jars and zips to prevent duplicates from occurring (#191) 2016-08-12 13:45:58 -07:00
Tyler Veness
45b8e9ab4f Renamed "pin" to "channel" and variables with underscores now use mixed case (#194) 2016-08-12 13:45:28 -07:00
Tyler Veness
227fdc1a60 Updated C++ style guide (#196)
include guard section now requires #pragma once, enumerators now exclusively use constant naming, and a mention of format.py was added to the "Formatting" section and CONTRIBUTING.md.
2016-08-12 07:14:49 -07:00
Tyler Veness
d347cebf67 Cleaned up odd formatting from static_cast by using "u" integer literal (#200) 2016-08-12 06:08:57 -07:00
Tyler Veness
3819cd0768 Updated cpplint.py and fixed its regexes for C-style casts (#193)
Additional C-style cast warnings thrown were also fixed.
2016-08-11 23:38:45 -07:00
Tyler Veness
e8f1fdda44 format.py now emits warnings for modified generated files (#195) 2016-08-11 23:10:10 -07:00
Tyler Veness
fd4719cb87 Fixed Doxygen comments for LinearDigitalFilter (#198) 2016-08-11 22:47:51 -07:00
Tyler Veness
6ef4745d86 Added Joystick::GetAxisType() (#98) 2016-08-07 10:19:19 -05:00
Thad House
62a980d3c8 Fixes Relay Constant Test (#189) 2016-07-26 13:53:45 -07:00
Thad House
866046edd1 Some general cleanups in the HAL (#188)
AnalogTrigger initialization checks are now in the correct order. Plus
frees no longer grab the structure if it is not needed.
2016-07-25 23:26:34 -07:00
Fredric Silberberg
8ac7e44f19 Updates gradle to 2.14.1 (#186) 2016-07-25 21:21:34 -07:00
Thad House
a831978cce Uses the fixed SensorBase functionality in the WPILib (#185) 2016-07-21 23:24:06 -07:00
Thad House
8da577b56f Moves FRCDriverStation to athena folder (#184) 2016-07-21 23:22:02 -07:00
Thad House
512ecf6490 Makes SensorBase checks use HAL check methods (#182) 2016-07-20 22:47:29 -07:00
Thad House
0901ae0808 Switches the HAL structs to use unique_ptr (#183) 2016-07-20 22:05:17 -07:00
Thad House
1ca291f20b Fixes a missed HAL_Bool change from int32 (#181) 2016-07-17 20:54:39 -07:00
Thad House
75eabfee1c Moves DriverStation HAL code to its own header and definition (#179)
To allow for future use as a plugin for the HAL simulator.
2016-07-17 19:42:33 -07:00
Tyler Veness
f7c3f13a7f Improve CircularBuffer documentation (#180) 2016-07-16 20:50:19 -07:00
Tyler Veness
57efd13f7f Replaced PIDController::Initialize() with delegating constructors (#178) 2016-07-16 12:50:17 -07:00
Thad House
7ddc153623 Fixes analog gyro casting to float then returning double (#177) 2016-07-15 18:13:51 -07:00
Tyler Veness
f9ebd3bde6 Fixed PIDController::GetError() for continuous inputs (#169)
Closes #31
2016-07-15 13:44:04 -07:00
Thad House
2c911b0f7a Adds a maximum time based cache to HALControlWord data (#158)
This is one of the calls with the delayed IPC. In the past, teams have
called an IsMode function so much that their code would start lagging.
This adds a cache, so the data is updated either when new data arrives
and we are notified of it, or after 50ms has passes since the last time
the cache was checked and updated.
2016-07-15 13:39:26 -07:00
Tyler Veness
1bf2d58db1 Reordered DriverStation functions in wpilibc and wpilibj to match wpilibc header (#166) 2016-07-14 20:50:38 -07:00
Tyler Veness
c93b5bedf9 Miscellaneous cleanups for wpilibc PID controller (#175)
* Reorder wpilibc PIDController's SetAbsoluteTolerance() and SetPercentTolerance() implementations to be consistent with header and wpilibj

* Added std:: prefix to fabs() calls in wpilibc PIDController
2016-07-14 13:51:32 -07:00
Thad House
dffaa0abb9 Moves HAL cpp headers from root to HAL directory (#174)
Could not include the ctre and NetComm folders, as those would require
changing ctre dependancies. Also removes a duplicated FRCComm header
that was not needed.
2016-07-14 00:17:29 -07:00
Tyler Veness
20c6525b1d Cleaned up wpilibj enums (#167)
* Converted enumerated constants in wpilibj to enums and made their implementation more consistent

* Reflowed text in JNI calls and updated JNI signatures
2016-07-13 23:39:58 -07:00
Fredric Silberberg
fe7165a8f7 Removed double-add of shared classpath. Fixes #157. (#164) 2016-07-13 22:20:30 -07:00
Thad House
d2aa168f66 Implements Better Error Messages from the HAL (#172)
* Makes the HAL provide a better error message for certain things.

* Makes Java error messages better

* Updates C++ errors.

* Moves handles header folder to HAL directory
2016-07-13 20:29:28 -07:00
Thad House
05c00430b3 Fixes CPP lint errors added to HAL. (#173) 2016-07-13 20:16:45 -07:00
Thad House
5305087162 Fixes a missed float to double change in the HAL. (#176) 2016-07-13 19:25:57 -07:00
Tyler Veness
6251697f60 Added Lint task and parallelized format.py (#161) 2016-07-12 21:59:09 -07:00
Thad House
ea1a1e6bc3 Makes the CANJaguar error status messages more useful (#165)
The previous version would just return the class name for the
DigitalOutput port. Now it actually gets the dio port value for better
readability.
2016-07-12 21:53:51 -07:00
Thad House
edf5ecd4a0 Changes HAL Headers to be C compliant. (#171) 2016-07-12 21:53:06 -07:00
Tyler Veness
1b1ee7f9f3 Renamed spiGetSemaphore() to spiGetMutex() (#170) 2016-07-12 15:11:41 -07:00
Tyler Veness
3fade171f9 Fixed inconsistencies in documentation (#168) 2016-07-12 10:50:21 -07:00
Tyler Veness
c99e89dfca Fixed the remaining cpplint.py warnings (#160)
Replaced std::sprintf in BaeUtilities.cpp with std::stringstream and marked GetVisionErrorText() in FrcError.cpp as NOLINT
2016-07-12 10:46:34 -07:00
Thad House
b51e85ae26 Switches HAL to fixed length signed integers, and adds our own HAL_Bool Type (#155)
* Switches HAL to fixed length signed integers, and adds our own HAL_Bool type

* Replaces HAL Floats with Doubles

Doubles are just as fast as floats with optimizations turned on, so
switches to all doubles. All made doubles for consistency.

* Prepends HAL/ to HAL include files. Also fixes some range errors
2016-07-12 10:45:14 -07:00
Thad House
4a98e68815 Moves the DS new data wait calls down to the HAL. (#156) 2016-07-10 23:10:05 -07:00
Tyler Veness
0cb288ffba Fixes warnings thrown by cpplint.py (#154)
* Fixed cpplint.py [runtime/int] warnings

* Fixed cpplint.py [readability/casting] warnings

* Fixed cpplint.py [readability/namespace] warnings

* Fixed cpplint.py [readability/braces] warnings

* Fixed cpplint.py [whitespace/braces] warnings

* Fixed cpplint.py [runtime/explicit] warnings

* Fixed cpplint.py [runtime/printf] warnings

* Fixed cpplint.py [readability/inheritance] warnings

* Fixed cpplint.py [whitespace/tab] warnings

* Fixed cpplint.py [build/storage_class] warnings

* Fixed cpplint.py [readability/multiline_comment] warnings

* Fixed cpplint.py [whitespace/semicolon] warnings

* Fixed cpplint.py [readability/check] warnings

* Fixed cpplint.py [runtime/arrays] warnings

* Ran format.py
2016-07-10 17:47:44 -07:00
Tyler Veness
e44a6e227a Refactored wpilibj HAL JNI to simplify generating it from HAL headers (#109)
wpilibj FRCNetworkCommunication.java is now generated from HAL headers and was renamed to FRCNetComm.java
2016-07-10 16:24:57 -07:00
Tyler Veness
aafca4ed7f Reduced duplication between formatting scripts with Task base class (#80)
Also added scripts for EOF newline management and for removing trailing whitespace. configure.bat was rewritten to use CRLF line endings. Documentation for the existing scripts was also improved.
2016-07-10 08:33:27 -07:00
Thad House
ea6876e81f Some general HAL cleanups (#153) 2016-07-09 17:38:18 -07:00
Tyler Veness
aa9c2b2c92 Made Log.h use std::chrono (#136) 2016-07-09 16:58:31 -07:00
Thad House
43a2eccdc9 Finishes Prefix Renames (#152) 2016-07-09 01:12:37 -07:00
Thad House
b637b9ee4c Prepends all HAL functions with HAL_ (#146) 2016-07-09 00:24:26 -07:00
Thad House
5ad28d58ec Switches PWMs to do scaling at the HAL level. (#143) 2016-07-08 21:29:29 -07:00
Thad House
be2647d44e Switches Java to use HAL Constants (#145) 2016-07-08 00:08:07 -07:00
Thad House
4a3e3a6324 Changes DigitalSource API for HAL ease of use (#144) 2016-07-07 21:43:55 -07:00
Thad House
7597e3c274 Switches handle resources to dynamic arrays (#142) 2016-07-07 21:32:41 -07:00
Thad House
0a983eeeb8 Moves Gyros to the HAL (#131) 2016-07-07 21:31:45 -07:00
Austin Shalit
b036bf2e34 Add method to get the port number of a Joystick (#137) 2016-07-04 09:18:28 -07:00
Tyler Veness
73602e6cb4 Added missing include for robot startup macro (#135) 2016-07-03 23:24:56 -07:00
Thad House
72455280a9 Removes unneeded resource includes from WPILibC files (#134) 2016-07-03 23:18:45 -07:00
Thad House
ea95bb85aa Adds Constants from new constants class to encoders (#133) 2016-07-03 21:52:49 -07:00
Thad House
fb865d3ee7 Adds a special exception and status message for a handle error (#127) 2016-07-03 17:27:06 -07:00
Thad House
36ac37db8c Moves Encoders to Handles and Moves WPILib Encoders to HAL (#124) 2016-07-03 15:22:22 -07:00
Thad House
b45e0917ae Adds port constants to the HAL (#130) 2016-07-02 23:19:14 -07:00
Thad House
0e127679c1 Removes some unused variables from DigitalInternal (#128) 2016-07-02 16:33:19 -07:00
Fredric Silberberg
2f36d508c4 Gradle 2.14 (#118)
Updates the gradle version to 2.14. In doing so, some model elements have changed. Additionally, some redundant elements have been removed from the gradle scripts.
2016-07-02 16:32:14 -07:00
Thad House
cf29d4560b Moves HAL PCM objects to header and HAL namespace (#129) 2016-07-02 11:58:49 -07:00
Thad House
8c4ad62422 Switches Solenoids to Handles (#126) 2016-07-02 09:24:54 -07:00
Thad House
62c217cd01 Switches compressor to handles (#125) 2016-07-02 08:22:44 -07:00
Thad House
0f105a26f7 Switches Counters to Handles (#123) 2016-07-01 00:29:08 -07:00
Thad House
47694ef810 Switches DigitalPWM to Handles (#121) 2016-06-30 23:43:00 -07:00
Thad House
f77a976fbb Switches resource errors to AllocationExceptions in JNI (#122) 2016-06-30 21:39:55 -07:00
Thad House
3593ecb17e Switches PWM and DIO to Handles (#120) 2016-06-30 21:39:09 -07:00
Thad House
9b2af0d090 Switches relays to handles (#119) 2016-06-29 19:58:14 -06:00
Thad House
e8e052712e Switches AnalogInputs and AnalogTriggers to Handles (#117)
Results in a breaking change to AnalogTrigger int constructor. If a user wants
multiple AnalogTriggers, they must use the AnalogInput constructor.
2016-06-27 21:32:30 -07:00
Thad House
77a1af44c4 Removes freePort from the HAL (#116)
It was a no-op, and most likely in the future it will be that way too.
Removing to clean up the API.
2016-06-27 13:38:33 -07:00
Thad House
5e2a76147c Moves handle definitions to main handle header (#115) 2016-06-27 13:36:38 -07:00
Thad House
e1d4845ccd Move Analog Outputs to Handles (#112) 2016-06-27 11:32:40 -07:00
PatrickPenguinTurtle
95d40ed01f Fixed issue with digital outputs used as pwm on mxp (#14)
When a digital output object that was tied to an mxp pin had enable pwm called on it
it would pwm on a pin 6 lower
 (although if this wasn't an mxp pin it wouldn't do anything at all.)
Fixed in Digital.cpp by adding 6 if it is an MXP pin in setPWMOutputChannel()
This should fix the CanJaguar test because when digitalOutputs used as PWM
were freed, the PWM generator was set to the number of pins, which meant it
was actually outputing on pin 20.

Change-Id: Ib48db3e6e3bf78659622145969d24011cc231ea6

Updated Hal to include some documentation about swaping mxp pins.

Cannot find NI related documentation as to the pin numbers being wrong though

Change-Id: I71d84431dc9bc7bf22aa29b6633e49723311b5f7

fixed formatting on changed files

Change-Id: I5b7c16cd798132b6b20c1d03f334a95b42d2ee11
2016-06-24 19:46:43 -07:00
Tyler Veness
aa22d4c33b Clarified that PID controller runs in discrete time (#107)
This was added to explain the apparent oversight with respect to controller behavior with different sample rates.
2016-06-20 23:25:23 -07:00
Thad House
046e043c4e Moves Interrupts over to Handles instead of pointers (#99) 2016-06-20 23:22:48 -07:00
Thad House
74fc10999b Fixes preferences formatting (#108) 2016-06-20 22:17:40 -07:00
Tyler Veness
cee9b2609d Added std:: prefix to more C standard library uses (#106) 2016-06-19 00:19:45 -07:00
Tyler Veness
daa0260a4e Deduplicated UsageReporting definitions (#104) 2016-06-19 00:15:57 -07:00
Tyler Veness
d66c61a36e Cleaned up robot startup and cleanup/shutdown code (#77)
Cleaned up RobotBase, removed singleton list from SensorBase, and removed unused typedefs and NULL_TASK macro from HAL's Task.hpp. Making the robot class instance static fixed non-POD statics used by the instance during destruction from being destroyed first.
2016-06-19 00:13:18 -07:00
Tyler Veness
ecc210f99a Rename Notifier::m_handlerMutex to Notifier::m_notifyMutex (#105)
A month ago, we discussed renaming this mutex to better reflect its current use, and this commit does that. The inline comment was also updated.
2016-06-18 02:20:29 -07:00
Thad House
3cacc2aba6 Switches indexed handles to shared_ptr (#101)
As discussed, the old method of was going to have issues, and was not
going to help in the case of the structs containing pointers. I think we
are just going to have to be careful, as guarenteeing the internal
pointers are const is going to be very difficult.
2016-06-18 00:59:53 -07:00
Peter Johnson
085c47b671 Unbreak wpilibc WritePreferencesToFile test. (#103)
ntcore recently changed GlobalDeleteAll() to not delete persistent values.
This test was relying on the old behavior to provide a clean slate.
2016-06-18 00:58:22 -07:00
Thad House
039515082a Fixes formatting in error.cpp (#102) 2016-06-17 21:35:00 -07:00
Thad House
c3908660b1 Switches all HAL Handle errors to be zero (#100)
As discussed, we don't really need the error checking specifically, as
we are just going to throw exceptions anyway, so this will make sure you
can check for 0 and be sure you catch any handle errors.
2016-06-17 20:21:25 -07:00
Thad House
fc515f4572 Changes HAL Port from a pointer to a handle (#93)
HAL Port is using a special handle, where the module and pin are bit
shifted straight into the handle. This is one of the few special cases
we have, but for the way port is used it is much cleaner and uses much
less memory.  Plus it is generic and not specific to one type.
2016-06-05 15:23:58 -07:00
Tyler Veness
5a82f73d9b Replaced .h C headers with c-prefixed version and added std:: prefix to C standard library usage (#90)
This was not done to stdint.h for brevity in type names. Also removed "using namespace std;".
2016-06-05 07:33:37 -07:00
Thad House
776a991d61 Moves Notifier over to handles (#97)
Internally, the linked list now uses shared_ptrs instead of raw
pointers. In addition, in the WPILib the notifier handle is now made
atomic. Then before the class is destructed, the handle is now set to 0.
This should help solve one of the existing race conditions. A 0 handle
is correctly handled down at the HAL level.
2016-06-05 07:29:47 -07:00
Thad House
8527f2c2a1 Fixes HandleResource classes (#95)
Issues were found when adding unit testing. The classes should now work
properly.
2016-06-03 11:24:58 -07:00
Thad House
c85b72b952 Fixes a few bugs in the initial handle implementation (#94)
Failure to check for invalid type on handle creation, and handle type
check was broken.
2016-06-01 20:12:50 -07:00
Peter Johnson
f0d9e19b5c ErrorBase: change to ostringstream. (#66)
This fixes a snprintf issue on 64-bit platforms by avoiding the use
of snprintf.
2016-06-01 00:12:55 -07:00
Tyler Veness
c7c011813f Made include ordering/organization more explicit in style guide (#86) 2016-05-31 23:46:44 -07:00
Thad House
d76f0d4022 Adds support for Handles to the HAL (#91)
Handles will be replacing opaque pointers in the HAL for better compatibility and easier error checking. This commits adds the initial resource manangement and definition for handles.
2016-05-31 23:45:47 -07:00
Peter Mitrano
de7678f2fc remove author requirement for now (#84)
waiting on a fix from pullapprove
2016-05-30 11:02:37 -04:00
Tyler Veness
2f7eff7091 Removed @author from comments (#88)
Keeping @author lines in the comments serves no functional purpose.
2016-05-29 09:24:04 -07:00
Tyler Veness
7a402b4170 Replaced "RoboRIO" with "roboRIO" in comments (#87) 2016-05-29 09:19:43 -07:00
Peter Johnson
10b4814e60 VisionAPI.cpp: Remove non-UTF8 characters. (#85) 2016-05-29 09:17:01 -07:00
Tyler Veness
613309c0a2 Replaced wpilibj class Init() methods with delegating constructors (#79) 2016-05-27 00:06:47 -07:00
Thad House
c622c03eff Places while loop around DS wait condition. (#83)
In case of Spontaneous wake ups, we should be checking a condition
variable as well.

Note that we can not use the existing m_newControlData, as that has a
possible race condition with existing user code that it does not look
like we could work around.
2016-05-26 23:05:08 -07:00
Thad House
ed7d2d6aa6 Splits the HAL Analog Implementation Files (#82) 2016-05-26 22:14:25 -07:00
Tyler Veness
51ff9e9f69 Classes which use I2C or SPI now do so via composition rather than inheritance (#72) 2016-05-26 21:37:23 -07:00
Tyler Veness
9f2f301fa4 Deduplicated FRC network communication headers (#71)
The network communication headers were moved to the include directory of the HAL and their copies were removed from wpilibc. Also, symModuleLink.h was removed because the function which it prototypes hasn't been used in WPILib since the roboRIO switch.
2016-05-26 20:20:58 -07:00
Tyler Veness
fa8bb3fa91 Remove obsolete timer functions and replace with std::chrono (#64)
Removed delayTicks(), delayMillis(), delaySeconds(), HAL_NO_WAIT, HAL_WAIT_FOREVER,
niTimestamp32(), and niTimestamp64().

Replaced clock_gettime() and usleep() with std::chrono.
2016-05-26 20:19:23 -07:00
Jonathan Leitschuh
4af0bbddee Add Travis Badge to ReadMe (#81)
This provides a quick navigation link to our travis build.
Additionally, it makes it so that the master build status can be confirmed quickly.
2016-05-26 15:54:12 -07:00
Tyler Veness
4aca3c2022 Removed extraneous curly braces around std::lock_guards in PIDController class (#78) 2016-05-26 12:59:34 -07:00
Tyler Veness
753ab85efb Removed commented out includes and imports (#76) 2016-05-26 12:59:01 -07:00
Thad House
da6b8c7ae1 Split HAL Digital Implementation files (#59)
Split to match the new headers. Uses a namespace 'hal' for internal functions and globals.
SPIAccumulator merged back into SPI header, as it was not a good split. Analog
accumulator will move back to analog input when the analog split is done.
2016-05-26 12:56:39 -07:00
Tyler Veness
305ab08f1c Renamed DriverStation::IsSysBrownedOut() to DriverStation::IsBrownedOut() to match the Java version. This changes the external API. (#67) 2016-05-25 23:09:24 -07:00
Tyler Veness
e9718fc7bf Replaced NULL with nullptr in C++ source files (#70) 2016-05-25 23:07:45 -07:00
Tyler Veness
8566878af4 Fixed C++ simulation build with Boost 1.60 (#49) 2016-05-25 22:41:58 -07:00
Tyler Veness
62812faf62 Clean up include guards and EOF newlines (#65)
* Replaced include guards with #pragma once

* All source files now have exactly one newline appended

Some files had either two newlines at the end or none (which isn't POSIX compliant). This patch fixes that.
2016-05-25 22:40:15 -07:00
Tyler Veness
d82635bbe1 Reordered headers according to the style guide (#58)
Subsections are alphabetized according to lexographic ordering. Also, HAL includes were moved from headers to source files where possible. This change may cause user code which uses HAL functionality and does not include the relevant HAL header (since it may have been provided by another WPILib header) to fail to compile.
2016-05-25 22:38:11 -07:00
Tyler Veness
a598e2d09b format.py: add missing 'sys' import (#69) 2016-05-25 21:11:43 -07:00
Tyler Veness
b5b2f0c7d8 Fixed typo in LinearDigitalFilter documentation (#62) 2016-05-25 20:27:34 -07:00
Tyler Veness
e6f6d24780 Removed empty default constructors and destructors from Gazebo plugins (#63) 2016-05-25 20:26:01 -07:00
Tyler Veness
21b2aabf18 Removed unused DS_LOG() macro (#61) 2016-05-25 20:25:06 -07:00
Tyler Veness
74f9da9da1 artf2612: Added Python script for updating license in source files (#57)
This is a follow-up of 3cd1253. A C++ program was written to automate the license update originally. That program was translated to Python so it can be kept in the repository and run when needed. It has been tested on Windows using the standard Python 3 installation and on Linux.

The original version skipped files that had "//" at the beginning since most were files that should be excluded. The relevant files are now in an exclusion list and the rest are processed normally. The .hpp file extension has been added as well. The script rewrote CompressorJNI.cpp to remove the carriage returns from its line endings.
2016-05-25 20:23:37 -07:00
Peter Johnson
e63830ed21 format.py: Fix running from styleguide directory on Windows. (#55) 2016-05-24 22:33:13 -07:00
Peter Johnson
eb51de65e5 format.py: Error out if no files found to format. (#56)
This can happen if the script is run from a directory other than the
project root or styleguide.
2016-05-24 22:16:53 -07:00
Peter Johnson
565a125dad Reformat for recent commits (#54) 2016-05-24 22:16:21 -07:00
Peter Johnson
3af8e7e9fd ControllerPower.cpp: Use quoted include instead of bracket for HAL. (#53)
This is consistent with all other source files.
2016-05-24 20:59:33 -07:00
Peter Mitrano
e3eae023da Cleanup of gazebo plugins (#46)
* Upgraded plugins for gazebo 7
* Fixed documentation on sensors
2016-05-24 20:27:24 -07:00
Thad House
6d9b3b0aaa Splits HAL Digital and Analog Headers into multiple headers (#52)
The Digital and Analog headers (and the implementations, but that will
be moved over later) are just too big and congested. This splits those
headers, and then changes the few things that needed to be changed in
WPILib to get the code working again. No function changes were made in
this commit.
2016-05-24 00:58:10 -07:00
Tyler Veness
9e99df1cf7 Removed sync group from SpeedController interface (#51)
CANJaguar is the only motor controller using sync groups, so that feature doesn't belong in an interface used by all motor controllers. If teams want to use sync groups, they should cast to the appropriate motor controller type themselves.
2016-05-23 20:42:58 -07:00
Thad House
e842ff7ad5 Explicitly stop the PIDController Notifier in the destructor (#48)
This helps reduce the probability of a PID Controller Segmentation Fault.
2016-05-22 23:24:10 -07:00
Peter Johnson
21b1e39b2a HAL Notifier: Use freelist to avoid use-after-free race. (#50)
As the notifierMutex is unlocked while the callback is being called in
alarmCallback(), it's possible for next to be invalidated due to a
cleanNotifier() call.  Now, instead of deleting the notifier immediately,
add it to a freelist to be cleaned up at the tail end of alarmCallback.
2016-05-22 23:21:45 -07:00
Thad House
8fc55c80a9 Renames all our .hpp HAL files to .h (#44)
Adds consistency, as the HAL was .hpp however all other code was .h.
2016-05-22 21:41:22 -07:00
Tyler Veness
248ca0c4a0 Added verbose flag to format.py (#47)
Making the "Processing" lines only print with a verbose option keeps the output clean.
2016-05-22 21:40:30 -07:00
Tyler Veness
0d655d7cec Ran formatter again (#45)
The previous wpilibc reformat missed an issue with CANTalon.h, and a patch merged since then didn't run the formatter.
2016-05-22 21:39:33 -07:00
Peter Mitrano
e71f454b9d Renamed folders for consistency, using sim/athena/shared schema (#27)
Rename the following folders:
hal/lib/Athena -> hal/lib/athena
hal/lib/Desktop -> hal/lib/sim
hal/lib/Shared -> hal/lib/shared
wpilibc/Athena -> wpilibc/athena
wpilibc/simulation -> wpilibc/sim

Windows users may need to run gradlew clean after updating.
2016-05-22 14:55:51 -07:00
Thad House
54092378e9 Changes HAL to return -1 to 1 for joysticks (#35)
First part of the HAL changes. Returns -1 to 1 for joysticks instead of
-128 to 127. Implemented by replacing the old structure with a new
structure that uses floats instead of shorts.
2016-05-21 01:42:16 -07:00
Thad House
a4f0c4fbe0 Implements locking in C++ DriverStation, and adds double buffering to DS Thread (#25)
Currently, about 5ms of every 20ms loop the DS thread would hold
the mutex, while grabbing data. During this time, and call to grab
joystick data would be blocked. This change grabs the joystick data
to a cache, and then grabs the mutex and moves the data references
around. This is much more efficient then the old code, and gives
teams more of their teleop loop time back for use.

Another major change this does is use preallocated arrays when entering
the JNI. Previously every JNI DS call would allocate an entire new array.
With a GC'd language where those arrays go on the heap, thats a problem,
and creates tons of garbage. That garbage is no longer created anymore,
as all arrays and byte buffers sent to JNI in the DS are preallocated.

In addition, GetJoystickName was always returning joystick 0 data, which
this fixes.
2016-05-21 00:41:15 -07:00
Omar Zrien
0965d60a71 Fixed a bug where using the two parameter constructor for CANTalon could cause invert-direction to not be initialized. (#26)
Original fix from Jacob Caporuscio
2016-05-20 23:08:35 -07:00
Peter Mitrano
f2d601d834 Use interrupt() in our interrupt exceptions (#24) 2016-05-20 23:06:07 -07:00
Tyler Veness
e14e45da76 Add format script which invokes clang-format on the C++ source code (#41)
On Windows machines, clang-format.exe must be in the PATH environment variable.
2016-05-20 17:30:37 -07:00
Peter Mitrano
68690643d2 Fix travis configuration to include compiling sim (#28) 2016-05-20 18:58:49 -04:00
Jonathan Leitschuh
00b2902102 Converts non hardware dependent tests to unit tests (#10) 2016-05-20 12:15:14 -07:00
Jonathan Leitschuh
975568c774 Adds Error Prone as compile time check to java projects (#13) 2016-05-20 10:48:41 -07:00
Jonathan Leitschuh
a834fff7b2 Applies Google Styleguide to Java parts of the library (#23)
This was partially applied to simulation but
simulation is a bit of a mess and has a lot of duplicated code.
2016-05-20 09:07:40 -07:00
Jonathan Leitschuh
64ab6e51fe Create .pullapprove.yml (#42) 2016-05-19 14:33:48 -04:00
PatrickPenguinTurtle
05a2089816 Fixed PCM tests by raising tolerance slightly (#15)
The PCM tests recently were failing by being slightly higher than voltage than expected. raised the tolerance to account for this.
Voltage was still clearly less than the on state while in the off state.

Change-Id: I8ac28867024f3ce7b4104fc03622e6133ac2b80f
2016-05-14 16:09:32 -04:00
Jonathan Leitschuh
b827f484be Add Slack Notification from Travis (#11) 2016-05-12 18:05:02 -04:00
Jonathan Leitschuh
000a98f193 Fix apt-get update -q causing build to fail (#20)
`sudo apt-get update -q` can fail a site doesn't respond.
This is the solution proposed here:
Related https://github.com/travis-ci/travis-ci/issues/5221
2016-05-12 17:51:57 -04:00
Fredric Silberberg
bb64dd3546 Updated README, and added in CONTRIBUTING. This adds tables of contents,
as well as fixing a few other issues.
2016-05-12 14:20:20 -04:00
Jonathan Leitschuh
d0c40b5ce2 Fixes indentation in .travis.yml 2016-05-11 15:06:06 -04:00
Jonathan Leitschuh
6794ff9ce8 Add Travis Build Configuration 2016-05-11 14:57:22 -04:00
Tyler Veness
083362bd86 Removed {@inheritDoc} from C++ sources and readded .inc files to Doxygen extension mapping
{@inheritDoc} doesn't exist in Doxygen, so I removed instances of it from the C++ source. It isn't needed anyway because Doxygen automatically fills in base class documentation for member functions in derived classes if no documentation is given. The extension mapping for .inc files was accidentally removed during the build system changes so this commit adds it back in.

Change-Id: I599e3bdafd76ee7d78a66090d81707cda5a399d7
2016-05-11 02:11:00 -07:00
Thad House
0f228e7b7d Implements a common PWMSpeedController base class
There was a lot of duplicated code between all 7 PWM speed controllers.
This moves all the duplicated code down to a base class, that will make
it easier to add speed controllers in future years if needed again. Also
if we need to add a method to all speed controllers, we only have to do
it in 1 place, and not 7.

Change-Id: I25eb1d097c0f5f7dbd7656db2f4a30d006d50f98
2016-05-11 01:01:31 -07:00
Tyler Veness
686f5d9fef Fix incorrect comments in the HAL I2C functions and incorrect return values for some I2C class member functions.
These issues were found and fixed while interfacing with an ITG3200 gyroscope. Fixes artf4173.

Change-Id: Id3c6b34aa707650480e90605e98ae1b44d7a7b98
2016-05-11 00:24:15 -07:00
Tyler Veness
ad8763fc8d Removed unused pcre.h header. If regexes are needed in the future, use C++11's regex header.
Change-Id: I0284943f3f09bbe9184885da6a486b82f73fd089
2016-05-10 23:12:36 -07:00
Thad House
1011b56b4c Fixes notifier restart error when last notifier is deleted
This actually isn't a large issue, since the HAL automatically creates a
notifier at the beginning to handle the time rollover, but during
testing without that, I noticed that deleting the last notifier would
disable notifiers for the entire lifetime of the program. This seemed to
be caused by the CLOSEST_TRIGGER static variable not being reset, and
causing new notifiers to never be added to the queue. This fixes that.
Not a bug that can be seen normally, but still a bug.

Change-Id: I6ac61c632918c90972cd0664aa833e3bc9e8c535
2016-05-10 23:06:13 -07:00
Peter Johnson
5904314a75 Improve ADXRS450 error detection.
Ensure the POR, PWR, and CST error bits are not set when reading the sample.

Reported by: Jared Russell, Austin Schuh

Change-Id: Ib38178d6b51880480aee86e13c16f9ba89a80693
2016-05-10 23:04:54 -07:00
Thad House
e852547344 Makes Java Timer timing more accurate
Java was using integer division for calulating Timer values, which
was causing Timer values to be concatinated, and only accurate
to the nearest millisecond. This changes it to use double division,
which matches C++ and makes timing much more accurate

Change-Id: I61b893f4ad5791bf4dfdd767ee4346c1ed4ea418
2016-05-10 23:02:35 -07:00
Peter Johnson
fa8b68419f Make Java AnalogGyro.getAngle() thread-safe.
In the Java implementation, "result" is an instance variable (to avoid
needing to perform a memory allocation on each call to getAngle).  However,
this means that calls to getAngle() from multiple threads can step on each
other.  Synchronize the method to avoid this issue.

Reported by: Jackson Gray (http://www.chiefdelphi.com/forums/showthread.php?threadid=145124)

Note this does not synchronize accesses between configuration methods such
as calibrate() and accessor methods such as getAngle().

Change-Id: I9ecc962d4fba66f6134fd801cfd607f155b41fe5
2016-05-09 20:36:36 -07:00
Fredric Silberberg
ec13d00b18 Fixed gradle build issue where files were not getting added to the wpilib java jar correctly.
Change-Id: I6c3cdd9906a94ff2d00340eb060a629d26c39a4a
2016-05-09 12:53:29 -07:00
Peter Johnson (294)
36447d86d8 Merge "Clear error buffer total when clearing the buffer contents" 2016-05-05 23:30:50 -07:00
Joe Ross
1e14403b3b Update POV documentation with examples of POV angles
Change-Id: If0f5b75366785b94a97b02694667fc00f8bfe196
2016-03-19 14:06:38 -07:00
Dustin Spicuzza
bee507eda8 Clear error buffer total when clearing the buffer contents
- Reported by Eli Barnett
- See http://www.chiefdelphi.com/forums/showthread.php?p=1559160`

Change-Id: I0efa4584452940bdfab3cc57c1823a8b33d387ff
2016-03-17 21:27:44 -04:00
Fredric Silberberg
16343bbe71 Updated release to version 5. 2016-03-01 15:55:19 -05:00
Peter Johnson
623a5fcf8d Fix C++ CameraServer request handling.
The request is not guaranteed to be in a single packet, so it may be necessary
to perform multiple reads to get the complete request.  The previous code
could unpredictably fail as it only performed a single read.

Fixes artf4817.

Change-Id: I7734a12e1a2542f5d7ca0889453c387f0bb30538
2016-02-24 00:18:59 -08:00
Fredric Silberberg
6bd1654b80 Updated release number for the new release
Change-Id: Ib05f1db442cd1eacd77653c0e0984a5337609f7b
2016-02-11 16:12:35 -05:00
Fredric Silberberg
952ebb11ad This adds StopMotor() to the SpeedController interface for C++ and Java.
For Java, this is as simple as just adding it, as all motors already
have an implementation from MotorSafety that is correctly resolved. For
C++, I had to override StopMotor in the classes that descend from
SafePWM and explicitly call the SafePWM version. RobotDrive now calls
StopMotor on each of its SpeedControllers, instead of calling Disable or
setting the motor to 0.0 as it was doing previously.

Additional small formatting corrections to the previous commit starting
this were added.

Change-Id: Ie94565394927a910ce74bc628670ac3d658d8df9
2016-02-11 12:19:52 -08:00
Brad Miller (WPI)
91c5db06db Merge "More updates to the Gyro test fixing potential null pointer exception" 2016-02-11 11:17:06 -08:00
Omar Zrien
df33a78221 Added Config routine to allow enabling/disabling of limit switch and soft limits. This improves upon the ConfigLimitMode routine, which does not allow certain combinations of enable/disabled limit features.
Also keeps parity with LV and Java.

Change-Id: Id2f4c9f169effc6bc3ea48529e8f04f387609ddc
2016-02-11 09:11:30 -08:00
Brad Miller (WPI)
a33076ab9a Merge "Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically." 2016-02-10 08:33:39 -08:00
Kevin O'Connor
d567bd0bca Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically.
Change-Id: Ib1c0e5d0ddd55343d83039acbc46c0f9c4e451a1
2016-02-08 18:13:57 -05:00
Patrick
f436b33d79 More updates to the Gyro test fixing potential null pointer exception
also retuned the deviation over time test to make it pass more reliably.
Ran sucessfully 40/40 times run including several run with the entire wpilibj

Change-Id: I2e42c368fdb81f9206e15ce39878ea105da1e405
2016-02-08 15:03:51 -05:00
Peter Johnson
3c3b2c75c0 Rate-limit duplicate error messages to avoid flooding console.
Fixes artf4809.

In both C++ and Java, error messages are being sent to both the console
(via stdout/stderr) and being reported via the HAL.  We don't want to
remove the stdout/stderr reporting at present because users debugging only
via netconsole (e.g. using riolog) won't see the HAL-reported errors.  Until
there's an alternative means to getting the HAL-reported errors to those
users, instead store the previous 5 error messages and don't duplicate them
more often than once per second.

Changes the error reporting from setErrorData() to sendError(), which
improves driver station error reporting.  The "location" in C++ is given as
the immediate caller (e.g. the WPILib function).  The "location" in Java is
given as the first user function in the call stack.  Note the full call stack
is provided in both instances.

Change-Id: I590dd63dcb66825301ebb260aff00cd8d7d501ed
2016-02-08 01:14:56 -08:00
Brad Miller (WPI)
f17d27aacf Merge "artf4818: Fix CAN Talon JNI references with underscores." 2016-02-06 09:38:26 -08:00
Brad Miller (WPI)
94629bcb78 Merge "Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now." 2016-02-06 08:45:44 -08:00
Patrick
4a6f55b61d Fixed the gyro deviation over time test
Also modified the testgyroCalibratedParameters to reduce code duplication.

Change-Id: I356562df4e9da1848d84e82ee82c5fbfc47d7d31
2016-02-02 13:38:51 -05:00
Joe Ross
fdfedd12fc artf4818: Fix CAN Talon JNI references with underscores.
Add test to verify bindings are correct

Change-Id: I766f2d7ff32a1bee2289974e331a4d8d5d563a35
2016-01-31 20:30:37 -08:00
Brad Miller (WPI)
ae1171d1be Merge "Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs." 2016-01-31 09:48:51 -08:00
Patrick
6b356020f3 Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now.
Change-Id: I84b2f168b27d07b444e223ae225013b6e97edde3
2016-01-29 14:49:58 -05:00
Patrick
7041cbc5eb Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs.
Change-Id: I5bf23dbbdab996c582e1035fc2b2f36dd5f52417
2016-01-28 14:47:15 -05:00
Peter_Mitrano
f24c8b1b8d Fixed robot drive for C++ Simulation
initial values for m_invertedMotors is now 1
previously it was done in some of the constructors, but not all of them.

Change-Id: I2c1ce8d8a67f82d02c4c51f1c4d1aaad143f3112
2016-01-25 12:03:48 -05:00
Fred Silberberg (WPI)
d62256156e Merge "Update version number for Release 3 Print distinctive message on robot program startup Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405" 2016-01-24 16:07:23 -08:00
Brad Miller
61dbd43664 Update version number for Release 3
Print distinctive message on robot program startup
Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405
2016-01-24 18:31:23 -05:00
Brad Miller (WPI)
f913b5de8c Merge "Removed publishing of java sim jar" 2016-01-24 15:27:54 -08:00
Omar Zrien
bd3e068f3b PDP Classes should support any PDP address
Change-Id: I3a8586e099559ee51449185734b89aaa6cd075d6
2016-01-22 23:53:49 -05:00
Fred Silberberg (WPI)
c6ff69079a Merge "Remove maven local as a possible search location" 2016-01-21 15:40:44 -08:00
Omar Zrien
5d3ac3ea71 Another improvement to HAL-joy getting to ensure it works in future RIO image updates.
Change-Id: I1f396b151e42dfd2b31de1fabde24b2988e8b599
2016-01-21 14:52:51 -08:00
Peter_Mitrano
f9e87f0cce Removed publishing of java sim jar
This causes the name of the jar to change, and thus fail to be included
in the simulation zip. There is no need to publish java sim jar.
Also added dependency on jar being built before zipping it

Change-Id: I1fa3dcf405d7da78a8d112381ecc3bfb2d6d367b
2016-01-20 15:15:02 -05:00
Peter Johnson
8801568325 DriverStation::GetJoystickName(): Make work for stick>0.
Change-Id: I1c62742cf8b80c81d21c2198f966c8151a758a01
2016-01-15 10:45:20 -08:00
Peter_Mitrano
75a91e24ef Remove maven local as a possible search location
maven caches are not stored in maven local, and searching here can
cause problems for building simulation.

Change-Id: Id106e80cfb9129431fd43500b06f879e7c682115
2016-01-15 11:56:35 -05:00
Brad Miller (WPI)
6adf4c48cd Merge "Fix HALGetJoystickDescriptor()." 2016-01-15 08:44:03 -08:00
Brad Miller (WPI)
026c427a2b Merge "Fixed Simulation C++ API" 2016-01-15 08:43:31 -08:00
Peter_Mitrano
63878d8ab7 Fixed Simulation C++ API
Fixed API in the following classes:
 - RobotDrive
 - AnalogGyro

moved some files from Athena the shared that are independant of platform
Renamed Gyro to AnalogGyro
added smart pointer constructors to RobotDrive

Change-Id: If8a1bde5aed77fd60869d1993c302dd519bc8848
2016-01-15 11:26:16 -05:00
Peter Johnson
83f902f2f6 Fix HALGetJoystickDescriptor().
This reverts the previous commit instead fixing it at the root
HALGetJoystickDescriptor function, which also fixes use of that function
by the C++ DriverStation class.

Change-Id: I1f203a015d8f10d119c61635def2822bf124754c
2016-01-14 21:49:50 -08:00
Thad House
f79ed1ab44 Artf4800: Fixes HALGetJoystick*** Segfault
The HALGetJoystick*** methods were not initializing the descriptor
variable properly. This was causing a SegFault if joysticks were moved
around while one of these methods were running.

Change-Id: If804c7ea724b10381765068e4d6fad75fad69ecb
2016-01-14 11:19:51 -08:00
Brad Miller (WPI)
bf89762e82 Merge "fix sim_ds launch script" 2016-01-13 10:19:40 -08:00
Brad Miller (WPI)
bd1e091629 Merge "Added build dir specification for sim javadoc to not overwrite athena javadoc" 2016-01-13 10:17:15 -08:00
Fredric Silberberg
2662a7ab0d Initialized the m_sensors variable to fix artf4798.
Change-Id: Iab7b76c0e36b3a8e5ab764f7dcd6772a2058bd0f
2016-01-12 16:27:34 -05:00
Fredric Silberberg
713d54fd2f Added build dir specification for sim javadoc to not overwrite athena javadoc
Change-Id: Idcc1303628134dd37c6c178b0bd66cfe2d24f928
2016-01-11 22:26:25 -05:00
Peter_Mitrano
75a07fc3e4 fix sim_ds launch script
It seems the tilde character doesn't always resolve to the home
directory

Change-Id: I69ecbab266901b271a16ce81b60a8bf7873f8a20
2016-01-08 01:31:01 -05:00
Peter Johnson
6b740e87b3 Fix C++ PIDController SetToleranceBuffer and OnTarget locking.
Also implement OnTarget fix in simulation PIDController.

Change-Id: Ic4b452759f80aa769a721f22cb6e732c2a9a213a
2016-01-07 20:55:10 -08:00
Brad Miller (WPI)
ac27f4b644 Merge "Fix onTarget() so that it returns false until there are any values retrieved" 2016-01-07 09:25:52 -08:00
Brad Miller
99b6000a65 Fix onTarget() so that it returns false until there are any values retrieved
The onTarget() method uses the average error and there might not be a valid value
until the PIDController runs once. This is causing commands to bail out early in
simulation.

Change-Id: I7bac9ecb847cbe4f378385b1a6998bba10147554
2016-01-07 12:03:17 -05:00
Peter Johnson
628811ed03 Correctly set smart dashboard type for AnalogGyro and ADXRS450_Gyro.
The GetSmartDashboardType() function defined by GyroBase was returning the
correct "Gyro", but the overrides in AnalogGyro and ADXRS450_Gyro were
incorrectly changing this, resulting in SmartDashboard not recognizing these
as being gyros.

Additionally, AddSensor in the C++ AnalogGyro was setting the name to Gyro
rather than AnalogGyro.

Change-Id: Ib2e31cd2712cc2bc26c8082ed760175d0ee80fb6
2016-01-06 20:45:47 -08:00
Brad Miller (WPI)
c57e749a94 Merge "Fixed sim_ds script library path" 2016-01-06 14:41:44 -08:00
Brad Miller (WPI)
3350926d26 Merge "PIDController feed forward term can now be calculated by the end user" 2016-01-06 14:38:59 -08:00
Peter_Mitrano
4dec393c2d Fixed sim_ds script library path
Change-Id: I12fe435ea397cbcaf5da5b214c36ef5f76eb88cb
2016-01-06 00:14:11 -05:00
Brad Miller (WPI)
0e9f07d1c2 Merge "Fixing install script... again" 2016-01-05 19:30:43 -08:00
Peter Johnson
5765b13976 Use absolute path for NT persistent storage.
Fixes artf4782.

Change-Id: I34c142b3e17e2ba26cff429ceb771e30196f9bfd
2016-01-05 19:20:16 -08:00
Peter_Mitrano
2d43048807 Fixing install script... again
apparently `ln -sf` does not overwrite existing symlinks
so we use `rm -f` first, then use `ls -s`

Change-Id: I033839e50b942cc3508004c84837e9090f1b4f5c
2016-01-05 16:45:22 -05:00
Tyler Veness
e3ce991f18 PIDController feed forward term can now be calculated by the end user
The current feed forward calculation is only useful for velocity PID controllers where F, the feed forward constant, is 1 over the maximum setpoint for the output. For motion profiles which use position PID controllers, the appropriate calculation for velocity and acceleration feed forwards is different. This change allows the user to provide their own feed forward implementation without having to rewrite the entire Calculate() function.

Both default feed forward calculations are velocity feed forwards. Suggestions for sensible feed forward constants are included in the inline comments.

Change-Id: Id175786f26bd342de52a1fae89595cbeba5dfc93
2016-01-05 10:52:25 -08:00
Tyler Veness
3cd1253977 artf2612: Update license in source files.
Years update, references to WIND_BASE were removed, and WPILib license was
moved to the root directory of the project.

If there was already a comment block, a year range through 2016 was created
using the first year in the comment. If there was no comment block, a block
with just the year 2016 was added.

Comments were not added to files from external sources (NI, CTRE).

Change-Id: Iff4f098ab908b90b8d929902dea903de2f596acc
2016-01-05 00:35:05 -08:00
Peter Johnson (294)
008fb2e382 Merge "Removed gz_msgs from wpilibcSim" 2016-01-04 23:22:07 -08:00
Tyler Veness
887f220fe7 Ultrasonic: replace linked list with std::set.
Also remove m_mutex.  It's no longer necessary because we ensure the automatic
thread is stopped while the set is being accessed.

Change-Id: I5994bbeba022a2ebd9e166fca369ebc8c229975c
2016-01-04 22:52:35 -08:00
Peter_Mitrano
dd19778152 Removed gz_msgs from wpilibcSim
it's not directly required to link at this time, and if you want to use a different
version of protobuf on the end-user's computer then linking their robot programs
will fail

Change-Id: I9ad7c07a17b7a332b4027adbe71be605e415bc2d
2016-01-04 22:50:21 -05:00
Peter Johnson (294)
7a2be548a7 Merge "Replaced linked list in Notifier with std::list" 2016-01-04 19:49:55 -08:00
Peter Johnson (294)
5f93009661 Merge "Renamed Gyro to AnalogGyro to match athena API" 2016-01-04 19:33:40 -08:00
Tyler Veness
d77f5c8019 Replaced linked list in Notifier with std::list
Change-Id: I3bcb1195102d792db994dba98adc7425767b16e8
2016-01-04 19:13:52 -08:00
Peter_Mitrano
6faa51ff48 Renamed Gyro to AnalogGyro to match athena API
Removed references to HAL classes, enabling moving of these classes into
shared.

Change-Id: I8d9053e1046d6fc2a60e13fb29410fd2c95180d2
2016-01-04 19:09:51 -08:00
Peter Johnson (294)
ce2245110b Merge "Adds CANTalon to LiveWindow" 2016-01-04 14:38:31 -08:00
Brad Miller (WPI)
dfba97a540 Merge "Fixing the frcsim installer script" 2016-01-04 13:41:20 -08:00
Thad House
99b2b65148 Adds CANTalon to LiveWindow
CANTalon was not being added to the LiveWindow list.

Change-Id: I732bb65a899f11bb9b1ef0a7320f0f0cc78233f7
2016-01-04 12:28:27 -08:00
Peter Johnson (294)
5976baec02 Merge "Fixes CAN devices in C++ library not showing in the livewindow" 2016-01-04 12:08:49 -08:00
Peter Johnson
932ec8e302 Merge "HAL: Use extern "C" in implementation files." 2016-01-04 11:58:44 -08:00
Sam Carlberg
1c6fe85a7b Fixes CAN devices in C++ library not showing in the livewindow
Change-Id: I47a9d6370b4b2573272881258d4bb46aa149bed0
2016-01-04 11:48:31 -08:00
Tyler Veness
e15ca5a414 Added linear digital filters
Linear digital filter class based on code from FRC team 341

Change-Id: I4c5198e36a089e08a6d054bf1bf80392def27e23
2016-01-03 23:05:49 -08:00
Peter_Mitrano
70bc630f1f Fixing the frcsim installer script
URL for simulation zip changed as of gerrit 1264
script argument name changed from INSTALLER to INSTALL
fixed jar and logo paths for sim_ds

to use the script, it's now simply:
./frcsim-installer.sh INSTALL

You can optionally supply a promotion status from which to install, such as
./frcsim-installer.sh INSTALL beta
./frcsim-installer.sh INSTALL development

Also added some information to the README

Also allow any type of file install-resources since it may contain
libraries and jars

Change-Id: Ie876a05c88d3d48b8592f1800959988ae66edd04
2016-01-03 02:05:22 -05:00
Brad Miller (WPI)
6c89f34e44 Merge "Default bufLength for PIDController in Java should be 1" 2016-01-02 19:09:58 -08:00
Peter Johnson (294)
d542fe4293 Merge "Adds WaitResult to Java waitForInterrupt" 2016-01-02 09:54:57 -08:00
Peter Johnson
351e8599ac HAL: Use extern "C" in implementation files.
This turns accidental parameter mismatches between header and implementation
into compiler errors.

Change-Id: Ic26fabb82b2fd5f79407a11435cdbd35348af15f
2016-01-02 09:49:35 -08:00
Dustin Spicuzza
31a39b4e59 Default bufLength for PIDController in Java should be 1
- cpp version defaults to 1
- Documentation in getAvgError() says it defaults to 1

Change-Id: Id45f345f048f4c02709745ec1fb97744b7af7715
2016-01-02 12:00:40 -05:00
Peter Johnson
e2ec34090a Keep track of FPGA time rollovers with 64-bit time.
This allows both greater than 72 minute (2^32 * 1 us) timeouts and also
gracefully handles notifiers across the FPGA time counter rollover.

Change-Id: Ibde0b903155f60b618b0ca4d5f8f6dd49f90b020
2016-01-02 06:29:59 -08:00
Brad Miller (WPI)
063925e737 Merge "Change C++ Notifier to allow std::function callback." 2016-01-02 06:29:20 -08:00
Brad Miller (WPI)
de4708cbdb Merge "Rewrite C++ Notifier to use HAL multi-notifier support." 2016-01-02 06:28:40 -08:00
Brad Miller (WPI)
8bbc1d43bb Merge "Rewrite Java Notifier and update Interrupt JNI." 2016-01-02 06:27:44 -08:00
Peter Johnson (294)
c01146eb02 Merge "Readded styleguide accidentally removed in the reorg" 2016-01-01 20:09:33 -08:00
Peter Johnson (294)
3e71573c51 Merge "Artf4179: Allow alternate I2C addresses for ADXL345_I2C" 2016-01-01 19:34:47 -08:00
Fredric Silberberg
5bc6e1378c Readded styleguide accidentally removed in the reorg
Change-Id: I240516c2c62d056e6ea4c31026918f5414c6a710
2016-01-01 19:32:33 -08:00
Tyler Veness
5cee85f921 Fixed some typos in the comments of MotorEncoderFixture.java, a method name in CANMotorEncoderFixture.java, and the README files
Change-Id: I87d982068f3e7cdcce6e5b06c34a7ef326f5eae0
2016-01-01 16:19:53 -08:00
Thad House
951c81f5b7 Adds WaitResult to Java waitForInterrupt
WaitResult gets returned from C++ and the JNI, so should probably be returned
in Java as well.

Adds WaitResult tests to Java AbstractInterruptTest

Change-Id: Ic3cb2919652696c458c39006b2f716301c0736f4
2016-01-01 11:20:59 -08:00
Joe Ross
75d1891a57 Artf4177: Use read byte count for ReadString
Change-Id: Id27a60553792bf668b5c653b889449e695aebdc6
2015-12-31 19:44:53 -08:00
Joe Ross
376fc6be6f Artf4179: Allow alternate I2C addresses for ADXL345_I2C
Change-Id: I43e65251b4a7a5b90afb698b753b86672110e837
2015-12-31 17:51:16 -08:00
Peter Johnson
91a451f87a Change C++ Notifier to allow std::function callback.
Also provide templated varags constructor for backwards compatibility and
ease of use.

Update PIDController to use new constructor, eliminating static function
CallCalculate().

Change-Id: Iaeae95aa5953f294f5debc5fc569ef6d4684f223
2015-12-29 18:33:29 -08:00
Peter Johnson
b0de0b7386 Rewrite C++ Notifier to use HAL multi-notifier support.
This removes redundant queue code from the C++ library.

The old queue code is still needed by simulation, and as the delta between
the simulation and athena headers has grown significantly, this splits the
header into two separate files.

Change-Id: Ia76b38337a25eb9d4890b3eb9bd76b1cbda7f285
2015-12-29 18:33:29 -08:00
Peter Johnson
5dc5ed83b3 Rewrite Java Notifier and update Interrupt JNI.
Notifier takes advantage of the multi-notifier support now in HAL.

Each Notifier is now handled by a separate thread at the JNI level, so
one notifier taking longer to process (or being breakpointed) does not
stop the other notifiers from running.  These threads are configured as
daemon threads.

In both Notifier and Interrupt JNI, the JNI thread attachment no longer
repeatedly calls AttachCurrentThread().  This improves performance but more
importantly avoids impacting the Eclipse debugger, which attempts to
track each call to AttachCurrentThread() as a separate Java thread.

Note: There is currently no way to free an interrupt handler.  Repeatedly
calling attachInterruptHandler() will result in leaking previous handlers.

Change-Id: Ib12e3df88943c03e0269d3906e5b153767139391
2015-12-29 18:33:22 -08:00
Brad Miller (WPI)
fe01096e7a Merge "finishing up FRCSim installer" 2015-12-29 14:25:28 -08:00
Peter_Mitrano
acc7fbbf01 finishing up FRCSim installer
adds build of gz_msgs on end-user computer
This means we don't need to provide different zips for different
versions of ubuntu.
The problem was that gazebo on 14.04 comes with protobuf 2.5 but gazebo on 15.10 comes with 2.6
added a few other fixes to the install script as well

also fix dependency between simluation publishing and libwpilibcsim
building

Change-Id: I57d5a26ed7795bc61a25402e2986c6023d1d78ac
2015-12-29 13:48:59 -05:00
Peter Johnson (294)
416a238bed Merge "Artf4776 Fixes First DIO PWM usage errors" 2015-12-29 08:23:56 -08:00
Peter Johnson (294)
3d2b54a1c0 Merge "Artf4774 Fixes HAL getHALErrorMessage missing error" 2015-12-28 18:39:44 -08:00
Brad Miller (WPI)
ae99eb6761 Merge "Prevent double free in DigitalGlitchFilter" 2015-12-28 18:33:36 -08:00
Brad Miller (WPI)
e2fb1c6d46 Merge "Set correct error message" 2015-12-28 18:30:08 -08:00
Dustin Spicuzza
4881795a92 Prevent double free in DigitalGlitchFilter
Change-Id: Icf9660762c78054895bf8e86a6dfae0615288de6
2015-12-28 21:11:29 -05:00
Peter_Mitrano
17b363f3b4 working on install process for FRCSim 2016
To publish the simulation zip, run ./gradlew publish -PmakeSim

Targeting Ubuntu 14.04 and 15.10 for now, with 14.04 being the
currently best supported.
Two scripts have been drafted for installing, for 14.04 and 15.10
It currently publishes to ~/releases/maven/development/simulation

There is a known bug that gz_msgs for 15.10 must be built using
protobuf 2.6, which is not the default on 14.04.

Change-Id: I6cccd601671553d30fd05bbbc79c2b7dc1efbf1d
2015-12-28 16:42:24 -05:00
Brad Miller (WPI)
85c3e6a4fd Merge "This commit adds documentation generation, including grabbing ntcore sources, for both Java and C++. This will need changes made in the wpilib promotion tasks to copy the generatd documentation to the correct places." 2015-12-25 20:45:12 -08:00
Peter_Mitrano
2c04cf135b Improved READMEs
fixed a few incorrect statements
added structure and organization to main README to help people find
stuff when they're first starting

Change-Id: I6148f2e9bc63cbeaf5f2e40566bf9d274ed36aaa
2015-12-25 21:16:00 -05:00
thouse
dbba4a1036 Artf4776 Fixes First DIO PWM usage errors
Adds Java and C++ integration tests for testing DIO PWM

Change-Id: Iae32b57636a9648b92e8e0520f6cbba4c3c377ca
2015-12-25 08:34:43 -08:00
Brad Miller
083c90d377 Added libnipalu to make vision programs link properly
Change-Id: Ib45dbc2944f80bba1063cbd7c7875d3cf215584b
2015-12-24 21:35:31 -05:00
Fredric Silberberg
729545809e This commit adds documentation generation,
including grabbing ntcore sources, for both
Java and C++. This will need changes made in
the wpilib promotion tasks to copy the generatd
documentation to the correct places.

Change-Id: I64590b5eda001da2cc8ae498b2b1c0fd298da284
2015-12-24 14:43:51 -05:00
Dustin Spicuzza
842aba97b8 Set correct error message
Change-Id: Ieed132ec95568b4c01dce9c59feaa36eda4c56dc
2015-12-24 01:05:08 -05:00
thouse
d3f4400035 Artf4774 Fixes HAL getHALErrorMessage missing error
Change-Id: Ie0686363939f4be389f1dc284bb2a68f2783836d
2015-12-23 11:00:20 -08:00
Peter_Mitrano
20749ed6e9 Condition java sim build on -PmakeSim flag
This prevents issues building wpilib if you have ntcore but haven't
built desktop
If you want to build sim, use -PmakeSim
This will require the desktop build of ntcore, which can be done with:
./gradlew build publish -PmakeDesktop

Change-Id: I20f379267a226dbdfcff8fe6223670257725965a
2015-12-23 10:38:51 -08:00
Peter Johnson (294)
684da8d89f Merge "Add SPARK and SD540 motor controllers" 2015-12-21 10:24:05 -08:00
Austin Schuh
13496c75b4 Fixed double free of DriverStation.
DriverStation was being added to the singletons and also as a const
member variable.  This made it so that on program exit, it was
getting double freed.

Change-Id: I87f8260615dc31d57ce7c7204c1dfde22973ad51
2015-12-20 16:15:24 -08:00
Peter_Mitrano
d69803804f Repaired simulation build on linux
Reverted to old driverstation and joystick code because we're not ready
for windows drive station yet

updated paths to reflect new wpilib organization
fixed name of gazebo topic (if you want /gazebo/frc/time use ~/time)
included network tables in wpilibJavaSim
Added ds script, and improved frcsim script
always start gazebo with verbose

Change-Id: I3c54b7000019a5985079a88200896a8069e69b86
2015-12-19 14:42:43 -05:00
Peter_Mitrano
0d062fba3a Add Cmake wrappers and unzip desktop ntcore builds
the task allcsim will build everything
requires ntcore desktop to be built
also fixed Driverstation to match non-sim C++ API

Conflicts:
	wpilibc/simulation/CMakeLists.txt

Change-Id: Id38141a5b48ed7fe064c7e6c8d2f618481b7e298
2015-12-18 22:29:57 -05:00
Kevin O'Connor
fa903dd9ce Add SPARK and SD540 motor controllers
Change-Id: I33f9c588b6d535b1f274d211563ef146f34439b1
2015-12-17 16:28:05 -05:00
Brad Miller (WPI)
9316933454 Merge changes I55ce71c6,I803680c1
* changes:
  Rewrite CANTalon JNI layer.
  Last feature addition for CANTalon java/C++ user-facing API.
2015-12-17 10:56:37 -08:00
Brad Miller (WPI)
31e1041ba3 Merge "Remove broken and unused HALLibrary.java." 2015-12-16 09:33:27 -08:00
Peter Johnson
1b03f818ad Rewrite CANTalon JNI layer.
Also update C++ and C functions from generator script output.

Change-Id: I55ce71c609ba5f5811db2ae78786ab7013a04b69
2015-12-16 00:02:13 -08:00
Omar Zrien
cd5765559a Last feature addition for CANTalon java/C++ user-facing API.
- CANJaguar also touched up to report it can't do the new control mode (just like with follower).
- New third optional param for talon c'tor to speed up enable control frame.
- The pulse width routines have been moved to where the script generator puts them.  No actual changes there but should help Peter integrate the latest code generator.

Last feature additions for TalonSRX HAL for FRC2015-FRC-2016 season.

-HAL driver uses control_5 frame if firmware supports it.  This allows teams to see/confirm control settings taking effect before enabling the robot.
  For example selecting the sensor type and going to web-dash to check sensor values now works without having to enable the robot.
-Motion profile HAL routines added.  Tested on Single-Speed Double reduction (with slave Talon too).
-Start moving ctre frame defs into a new common header (better then shoving a bunch of struct defs at top of module).
-New child class in CANTalonSRX for buffering motion profile points.  Not sure it would be best to leave it as is or make another module.  It's trivial now so I thought that was acceptable, (in future it will likely possess compression strategies => no longer trivial).

Change-Id: I803680c1a6669ca3f5157d7875942def6f75b540
2015-12-16 00:02:01 -08:00
Peter Johnson
4b04073389 Remove broken and unused HALLibrary.java.
Change-Id: Iec501cdf2f05fcdee115471e5fa1ce2a6dfb6d57
2015-12-15 20:56:34 -08:00
Peter Johnson
0a06fdb523 Clean up FRCNetworkCommunicationsLibrary JNI.
Change-Id: I37031c1593c7cb902cec33d4dc787daa9ba9765c
2015-12-15 20:48:55 -08:00
Peter Johnson
c2ecffe708 Update to latest UsageReporting.h.
Also fix DigitalGlitchFilter usage reporting for C++ (only report on
construction rather than on each call) and add for Java.

Change-Id: I73758b16d81c40442c4acec43e0aa6804b2ba250
2015-12-15 20:47:21 -08:00
Kevin O'Connor
ec69c6a866 Fix Solenoid Resource object creation. Fixes artf4758.
Change-Id: I8b40d6606d7091fa6e8bf95b75f820e6b524ae06
2015-12-15 20:02:59 -08:00
Peter Johnson
bc0c895619 Take 2 on usage reporting.
The previous commit missed the MindsensorsSD540 value.

Remove wpilibc/Athena/include/NetworkCommunication/UsageReporting.h copy; it
was not actually used (all references except the one in DriverStation.cpp
had been commented out), and has been superseded by the one in HAL.hpp.

Change-Id: I51e2eafa85ee5e40050d702aa0bf69171e887a60
2015-12-14 21:15:47 -08:00
Peter Johnson
9e18330586 Report usage for ADXL362 and ADRXS450.
Change-Id: I31c6b76923923606ea2838f346b24375b97b01ef
2015-12-13 17:52:10 -08:00
Fredric Silberberg
82d89d3b70 Updated to NI image v18
Change-Id: If120eee63c7815bfcf2f05fdf48a0399497a645d
2015-12-11 18:24:01 -05:00
Brad Miller (WPI)
7ba89306ca Merge "Make C++ Analog Potentiometer test work." 2015-12-10 22:13:08 -08:00
Peter Johnson
c70e710caf Remove raw pointer deprecation warnings.
See discussion in 2016 beta forums for rationale.

Change-Id: I86a4c1bd61655f4895e2fe0e935f25dc8a89d830
2015-12-10 21:54:31 -08:00
Peter Johnson
bafe4e56a7 Notifier: Change back to constructor from ATOMIC_VAR_INIT.
Change-Id: Ia0addacee57f03e12f2ca12f7b5a1ba29d913ac4
2015-12-09 20:24:39 -08:00
Peter Johnson
bd2a28f597 Add ADXRS450_Gyro.
This is a digital gyro interfaced via SPI.  Uses the HAL SPI accumulator.

Basic code function successfully tested on a ADXRS453.

Change-Id: Ibc0c7db9964c041fb1e04af4db17e3310ea83c04
2015-12-09 20:24:39 -08:00
Brad Miller (WPI)
6851dee3f6 Merge "Gyro: Add support for fixed calibration (artf4124)." 2015-12-09 06:54:52 -08:00
Peter Johnson
de219055f0 HAL: Add software-based accumulator for SPI devices.
Change-Id: I154c4c8f438163edf3ebc2c38f67a976d8cfbfd7
2015-12-09 06:50:36 -08:00
Brad Miller (WPI)
530ce310a6 Merge "HAL: Add support for multiple Notifiers." 2015-12-09 06:50:00 -08:00
Peter_Mitrano
8b0f19a0fb Updated Notifier to match changes in gerrit 1171
some changes were ommitted because they don't exist in sim

Change-Id: I6901998635f73c14efc894c408d2b5fd98e4d94c
2015-12-07 12:12:54 -05:00
Fredric Silberberg
d0c01ac30d Updates wpilib to use different repos for the different build versions, instead of using classifiers
Change-Id: Ic4cd1f1f93ae1036834cdcf1d0f1499fc946a429
2015-12-06 16:38:57 -05:00
James Kuszmaul
6a8fcbc407 Make C++ Analog Potentiometer test work.
Previously, the AnalogOutput simulating a potentiometer was setting
the output voltage assuming a supply votlage of 5V. Now it uses
the actual "5V" that is being output. The Java test was already
doing this correctly.

Change-Id: Icbba89f9bc14ebe0005416de55dcac3a2727bf21
2015-12-03 16:18:51 -05:00
Peter_Mitrano
5c82146549 comment out halDesktop
HalDesktop is not nessecary right now, and it breaks the mac build
This will be revisited once the NI Driverstation is needed for sim

Change-Id: I2c665d0abfaeee3b9d20d4d8aad8d4eed8a7b38b
2015-12-03 02:22:26 -05:00
Peter Johnson
f5fe5cfcf1 JNIWrapper: Fall back to system library if not found in .jar.
This is useful primarily for debugging purposes (as the temporary file
written by the loader can't be easily loaded by gdb).

Change-Id: Ic4ea22ef88363c5ff998980b0352844645766fd9
2015-12-02 06:35:38 -08:00
Brad Miller (WPI)
10e51f0261 Merge "HAL: Increase safety during program termination." 2015-12-02 06:23:32 -08:00
Brad Miller (WPI)
b71cea69c8 Merge "DigitalInput: Don't crash on Get() of invalid channel." 2015-12-02 06:18:24 -08:00
Brad Miller (WPI)
01b64b5bd5 Merge "Add support for ADXL362 SPI accelerometer." 2015-12-02 06:14:35 -08:00
Brad Miller (WPI)
e9f98b28cc Merge "Reduce overhead of setErrorX() calls." 2015-12-02 05:55:40 -08:00
jmanning
cd47030651 artf4160
This fixes the java version of the addressOnly() function.

Change-Id: Iec308c76f7699729c628f230d366b34626afccd8
2015-12-01 21:30:41 -08:00
Peter Johnson (294)
4f535fb77b Merge "Re-enable C++ Pressure Switch Test." 2015-12-01 20:01:28 -08:00
James Kuszmaul
d34ba8866b Re-enable C++ Pressure Switch Test.
Also, the pressure switch test is wired correctly now,
  so it should be working again in Java as well.

Change-Id: I066bc969c2e946d79df7c967cd000acfe840dd04
2015-12-01 17:37:14 -05:00
Austin Schuh
b3b03c43c8 artf4700: Added DigitalGlitchFilter
Initial Java support from Tyler Veness.
Final java support done by Jerry Morrison.

Change-Id: I1f85eb555f9ea4c0250c4c6729d7c51a76f5bef4
2015-12-01 01:30:42 -08:00
Joseph
375a19563e Gyro: Add support for fixed calibration (artf4124).
Testing added for Gyro constructors, getters, and setters.

Change-Id: Id3ba2656bfdb286e01fbd95dff95115a3446c92e
2015-11-30 23:43:32 -08:00
Peter Johnson (294)
6d00b77ef3 Merge "artf4175: Fixes FakeEncoderFixture encoder type error" 2015-11-30 23:10:12 -08:00
Peter Johnson
93b65aad36 DigitalInput: Don't crash on Get() of invalid channel.
The constructor sets m_channel to UINT32_MAX and reports an error if the
channel index is out of range (or CheckDigitalChannel fails for some other
reason).  A Get() following this would result in a crash because it wasn't
checking StatusIsFatal().

The new behavior now checks StatusIsFatal() and simply returns false.

Change-Id: I15529401294e4ccd1e09df834e02cca367fab67c
2015-11-30 22:44:48 -08:00
Joe Ross
c3c35c604c fix javadoc warnings/errors
Change-Id: I079699631185f986952bbf4cbb23661f9f9d123d
2015-11-30 22:30:26 -08:00
Peter Johnson
03c43a46d7 HAL: Add support for multiple Notifiers.
This is a poor man's version of the multi-instance Notifier support in
the higher level languages.  It's intended primarily so that notifiers
can be created internal to the HAL.

One benefit of this change is that the current FPGA timestamp is passed
as the first parameter to the ProcessQueue function (rather than the
useless interrupt mask).

Caution for other languages wrapping the HAL: this adds a parameter to
initializeNotifier().

An atexit hook is used for safe cleanup at program termination.

Change-Id: I782b3a74c10215588ae9b7191906fb4186a81028
2015-11-30 22:00:19 -08:00
Peter Johnson
07be45af80 HAL: Increase safety during program termination.
- Add an atexit hook to set global and watchdog to nullptr.
- Add checks to HAL functions for these nullptrs (also good checks if they
are called prior to HALInitialize).

Change-Id: I138657e8279ed9289648a91c91091ea6a1eb5dcc
2015-11-30 22:00:19 -08:00
Thad House
2f8562c238 artf4175: Fixes FakeEncoderFixture encoder type error
Change-Id: Icb2f472acdc7ef9144f96677c84cdcc3128030cd
2015-11-28 17:11:04 -08:00
Peter Johnson
a66eaa4348 Reduce overhead of setErrorX() calls.
Checking the status code in the macro before "context" is used avoids
significant overhead (string processing) in the common case when the code
is zero.

Change-Id: I69b8b220187ac1ab905cdf56dde5c4b6c61101b7
2015-11-28 11:44:26 -08:00
Austin Schuh
61760c839a Removed unnecessary ::std::string calls.
All the Error and assert calls were using const ::std::string & arguments.
When provided with a char*, the compiler was creating a temporary string
object to pass in.  This was triggering mallocs everywhere, even in the
fast paths.

Change-Id: Ie0ad1f240334de677618086bddd64113c56aae6e
2015-11-28 11:44:09 -08:00
Tyler Veness
055ee09825 Fixed current and potential bugs caught by Coverity
Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
2015-11-28 11:08:12 -08:00
Peter Johnson (294)
b0fec4089b Merge "Added README, deleted old obsolete building instructions" 2015-11-28 10:58:56 -08:00
Joe Ross
906fe65e39 Optimize Solenoid Gets. Fixes artf4730.
Implement GetAllSolenoids in the HAL so that SolenoidBase doesn't have to
read each solenoid individually.

Change-Id: I85559565949f7a7119ead410187235636a63f0ed
2015-11-28 03:29:03 -08:00
Brad Miller (WPI)
84ca2ab0f5 Merge "Prevent PID tests from hanging." 2015-11-28 03:11:45 -08:00
Peter Johnson (294)
d998e53f9a Merge "Moved gyro calibration into a separate function so teams can recalibrate at any time after construction" 2015-11-27 22:44:43 -08:00
Thad House
2f2184e8ce Makes HALSetDataSem take a MULTIWAIT_ID rather then a NATIVE_MULTIWAIT_ID
Having the HAL take a NATIVE_MULTIWAIT_ID without any way to get that
structure from extern "C" code is a problem. This makes it so it just
takes a MULTIWAIT_ID, and then grabs the native handle inside the HAL.

Change-Id: I06da18ba34adcea2f16e4e53da672f38be79e28e
Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
2015-11-27 22:33:28 -08:00
Thad House
de39877efb artf4153 Adds HAL structure memory management
In the current HAL, once the port structures were created, there was no
way to free the structures. The way the C++ libraries were written this
wasn't a problem, since it grabbed a copy of each and stored them in an
array on bootup. However java does not do this, and grabs new ports
every time an object is created. This causes memory leaks if an object
is ever disposed in java. The same thing looks to be happening in
python, and C# does it too currently, but that would change if this gets
merged.

Adds java memory management fixes

Adds memory management to AnalogInput and Analog Output C++

SolenoidPorts and Digital Ports are all hold static arrays with their
port pointers (although solenoid overwrites them if a new solenoid on
the same module is created), however analog always grabbed new pointers.
I would fix the solenoid one, but I don't know what the ideal way to do
it would be.

Silently ignores free(null) calls by checking passed parameter is non-null.

Change-Id: Id32993b57b53f896e46e55c97541d3bd90b52648
2015-11-27 22:02:02 -08:00
James Kuszmaul
e3191b0bfd Prevent PID tests from hanging.
For the previous couple of months, the PID tests have been hanging.

The reason that the tests have been hanging lies with the Notifier,
not the PID controller. Basically, a deadlock was occuring during
Notifier destruction when the notifier destructor was called while
the notifier interrupt handler was being called. Because the low-level
interrupt manager waits for the interrupt handler to finish executing before
disabling itself, the notifier destructor would not exit until the
ProcessQueue function finished. However, at the same time, the handler
was attempting to lock the queueMutex before continuing; the Notifier
destructor had locked the queueMutex while wrapping things up, meaning
that the last run of the handler would not complete until the destructor
did, resulting in a deadlock.

In order to repair this, I reduced the scope of the lock on the queueMutex
in the destructor so that it only locks when absolutely necessary. This
should work now.

This bug was likely introduced over the summer when we updated to stl
mutexes and locks, which may have messed up the original lock structure.

This likely did not affect any teams, as it can only occur if you are actively
destroying every* Notifier object present and if the destructor happens to be
called while the handler is being run.
*Note: the component of the destructor causing issues only ran if the last
  Notifier object is being destroyed.

Change-Id: I38ba4e60816a2a8d523e927c25378390a0755444
2015-11-27 21:37:10 -08:00
Peter Johnson
e162e4d1c0 Merge "Fix HALGetJoystickAxisType() definition to match header." 2015-11-27 21:08:49 -08:00
Fredric Silberberg
5080e5b77b Added README, deleted old obsolete building instructions
Change-Id: I9f774caa7b9729ed1fdd2a50117c7d67e65044e4
2015-11-27 12:01:39 -08:00
Tyler Veness
9b4dd268b0 Moved gyro calibration into a separate function so teams can recalibrate at any time after construction
Change-Id: I6c43af3ad8e21dcc82dded61f0cd0ae2ddbe0965
2015-11-27 10:33:22 -08:00
Peter Johnson (294)
aa95a8c299 Merge "artf4162: Fixes multiple solenoid creations in java" 2015-11-26 23:50:31 -08:00
Peter Johnson (294)
c935ae2d94 Merge "Adds new CanTalon HAL Functions to C library" 2015-11-26 22:31:48 -08:00
Brad Miller (WPI)
8ad1c07a2d Merge "Remove temporary batch file." 2015-11-26 20:35:56 -08:00
Thad House
966e4be36a artf4162: Fixes multiple solenoid creations in java
Change-Id: Iff1d6cb608c1c95723fa3121fd6c24629952f4dd
2015-11-26 17:10:52 -08:00
Thad House
66b28e95a7 Adds new CanTalon HAL Functions to C library
New functions were added to CanTalonSRX in the HAL, however they were
not added to the C side of the library.

Change-Id: I15197e5dce5db0f5ff207d1318c21be485c90741
2015-11-26 02:21:33 -08:00
Peter Johnson
f36e36424f Fix HALGetJoystickAxisType() definition to match header.
Change-Id: Ie68546930dd1cd07d39f8796f855e8ee26ccd317
2015-11-26 00:03:55 -08:00
Peter Johnson (294)
752f5fb4e4 Merge "Update PCM test to check Solenoid get methods also" 2015-11-25 22:55:32 -08:00
Peter Johnson (294)
68bb074165 Merge "Arguments to Task are now forwarded to std::thread more correctly" 2015-11-25 22:48:10 -08:00
Peter Johnson
03ce0a1b92 Remove temporary batch file.
Change-Id: If696f5833907fab9c9406a8bfb72167edc74fbec
2015-11-25 20:37:24 -08:00
Joe Ross
ab90e7aa2a Update PCM test to check Solenoid get methods also
Change-Id: Ib66973875b9289d06ab356757c6f7c574c87c8bd
2015-11-25 14:27:11 -08:00
Brad Miller (WPI)
ad64c0b025 Merge "spiSetBitsPerWord doesn't exist; remove from headers." 2015-11-25 06:09:03 -08:00
Brad Miller (WPI)
fec7f3a5e1 Merge "Make PDP parameters consistent with other HAL functions." 2015-11-25 06:07:55 -08:00
Peter Johnson
c59e08ee9f Add support for ADXL362 SPI accelerometer.
Tested with hardware on both C++ and Java.

Change-Id: I52f95fc77fffe4efae0c8332007cd683835023ab
2015-11-24 23:48:53 -08:00
Tyler Veness
d59016be35 Arguments to Task are now forwarded to std::thread more correctly
Change-Id: I81a934a6fac4ead30c67010e9968e46ad2f86571
2015-11-24 01:14:42 -08:00
Peter Johnson
2cd7bc83c8 Update .gitignore for new tree structure.
Change-Id: I9e0e3e791c31a3f390b6cf7550c4acdb049bf452
2015-11-23 23:53:35 -08:00
Peter Johnson
964b243619 Make PDP parameters consistent with other HAL functions.
All other HAL functions have status as the last parameter, only PDP did not.
This changes makes the PDP parameter order consistent with the rest of the HAL.

Change-Id: I725e33f75deab34e6a83b7048b2d6c365fa56a21
2015-11-23 23:31:57 -08:00
Peter Johnson
51a35daed7 spiSetBitsPerWord doesn't exist; remove from headers.
Change-Id: I4899ec92a5198199699e7d840c9e0801cccdb861
2015-11-23 23:01:55 -08:00
Tyler Veness
84e793503d std::shared_ptr doesn't need to be initialized with nullptr. The C++ standard already guarantees it will behave as if it is.
Change-Id: I160567e9fb2857f8d7ac4acbe093c4100a7421eb
2015-11-23 18:41:56 -08:00
Fredric Silberberg
6d854afb0e WPILib Reorganization
This is a major restructuring of the WPILib repository to simply build
procedures and remove the remnants of Maven from everything except the
eclipse plugins. Gradle files have been largely simplified or rewritten,
taking advantage of splitting up parts of the build into separate build
files for ease of reading.

The eclipse plugins are now in a separate project, as is ntcore. All
dependencies are resolved via Maven dependencies, with the
Jenkins-maintained WPILib repo. Project structures have also been
simplified: we no longer have separate subprojects inside wpilibc and
wpilibj. Where possible, these changes hav been done with git renames,
to make sure we still have full history for all repositories. Other
unrelated subprojects have also been broken out: OutlineViewer is now a
separate project.

Change-Id: Ib4e2a6e1a2f66427a14f16612b0e0d69ed661878
2015-11-21 18:26:49 -05:00
Peter Johnson
c20d34c2b6 Rename Gyro to AnalogGyro and make Gyro an interface.
Refactor common implementation parts of AnalogGyro into GyroBase.

This will make it possible to add digital gyros in a similar way to how
digital accelerometers were added.

Change-Id: I437ef259e9ecb81f18a91a95c5a58b6607db5e15
2015-11-18 21:25:30 -08:00
Peter Johnson
e2a4556669 Add ByteBuffer interfaces to I2C and SPI.
Use these interfaces in ADXL345_I2C and ADXL345_SPI.

Change-Id: I62d37e80eb71cec9019dd095f3721e0e5d60bf3f
2015-11-18 21:23:02 -08:00
Dustin Spicuzza
af3facd1c2 Merge "Notify the Driver Station that code is ready after robotInit is called" 2015-11-15 21:08:35 -08:00
Colby Skeggs
d690974ad0 Improved error handling in HAL Digital and Solenoid systems.
Change-Id: Iafd68c5bd143e9ee87ecf714bccb2c77e599b649
2015-11-15 20:59:35 -08:00
Tyler Veness
76756048c4 Notify the Driver Station that code is ready after robotInit is called
Change-Id: Id833a2a945c14bcbb4761d4fe463c6c9f7c4430c
2015-11-15 20:36:47 -08:00
Dustin Spicuzza
91891081b9 Merge "Update docs to reflect that PDP can now be at any address." 2015-11-15 20:20:12 -08:00
Dustin Spicuzza
ff4abd63f1 Merge "JNI: Don't call HALInitialize() within an assert()." 2015-11-15 20:15:22 -08:00
Joe Ross
511c4a4d3b Update docs to reflect that PDP can now be at any address.
Change-Id: Ia6bba4c72588e261ec313fbc7bd62b83a61fb00b
2015-11-14 09:27:24 -08:00
Brad Miller
28f55802b5 Reverted RobotBase debugging changes from Peter.
Change-Id: I336b63bae0f751fe846a13d702e01c80e53831cf
2015-11-07 12:01:44 -05:00
Peter Johnson
06372cb143 JNI: Don't call HALInitialize() within an assert().
If built without asserts enabled (e.g. -DNDEBUG), HALInitialize won't get
called.  Instead call outside the assert and then do the assert.

Change-Id: I51546b9f9fc9a74f8a3a732c4b754257d9697e46
2015-11-06 20:46:29 -08:00
Peter Johnson
7023013c4b Simplify JNI interfaces.
These changes both simplify the Java code and improve performance across the
JNI boundary.

This also fixes the AnalogCrossConnectTest by adding delays to
setInterruptHigh() and setInterruptLow() to ensure the change in voltage has
time to propagate and extends the timeouts in AbstractInterruptTest.

Detailed changes:

Hoisted status checks to C.  This avoids the need to create direct byte
buffers (expensive) and significantly simplifies the Java code.  The C code
now directly generates the exception or reports the error to the DS.

The JVM pointer is now a global across the JNI, initialized by the OnLoad
function, avoiding the need for some of the class-specific initializers to
get this pointer for callbacks.

Opaque pointers (such as ports) are now passed as long values rather than
with a ByteBuffer wrapper.

Added extern "C" to source files.  This allows earlier detection of JNI
definition mismatches to the Java source headers.

Changed JNI signatures to more closely match HAL signatures (in particular,
boolean is now universally used instead of byte for HAL bool, which cleans
up mapping back and forth to 1/0 from true/false).

Change-Id: I4ea0032cabb0871cd74106a3a70d947258c29d2d
2015-11-06 09:04:22 -08:00
Fredric Silberberg
927400a43c Added classifiers for networktables to to the pom
Change-Id: I9bfef83aba55b62268d08e39f07b3e4bd7c09bdc
2015-11-04 19:20:43 -05:00
Brad Miller
2f228380f4 Updated the ntcore reference and updated the build.gradle file to build with the most recent ntcore commit.
Change-Id: Icc7f795efdd97169ce9f837ad22b3de57d5d2d05
2015-11-04 17:45:06 -05:00
Brad Miller
44bd52c44d Update the image version to 15
Change-Id: I82c81dff64d933a1a7a5e0a1c12256833fc2a387
2015-11-04 14:41:10 -08:00
Brad Miller (WPI)
21124e0174 Merge "Revert "Added work around for the missing path on the frc_console_tee command in frcRunRobot"" 2015-11-04 14:40:52 -08:00
Brad Miller (WPI)
09962a7c87 Revert "Added work around for the missing path on the frc_console_tee command in frcRunRobot"
This reverts commit 97a7716a23.

Change-Id: I7d9e40acc192ad33d24bc32ea9fb9499f8609983
2015-11-04 14:26:05 -08:00
Tyler Veness
beeefa2356 kFramework_Simple was renamed to match the corresponding robot framework's name
Change-Id: I0123e71e0bb56526fe187cd17cb71a8278739cd5
2015-11-03 10:38:19 -08:00
Brad Miller (WPI)
26f1bd6a1c Merge "Fixed documentation generation for .inc files" 2015-11-03 08:29:33 -08:00
Brad Miller (WPI)
a34f3f238b Merge "HALUsageReporting::kFramework_Simple was renamed to match the corresponding robot framework's name" 2015-11-03 08:10:14 -08:00
Tyler Veness
231178c26a HALUsageReporting::kFramework_Simple was renamed to match the corresponding robot framework's name
Change-Id: I2ad0f8d48cabe5f6c1adf622cf5377eb5be362f7
2015-11-02 23:23:57 -08:00
Brad Miller (WPI)
bb52c2441e Merge "Update the library version string for the driver station (artf4708)" 2015-11-02 12:20:06 -08:00
Brad Miller
042e3a3237 Update the library version string for the driver station (artf4708) 2015-11-01 15:08:55 -05:00
Tyler Veness
520d946f63 Fixed documentation generation for .inc files
Change-Id: I2ba5cb335b2e29968069bd362793532de607679c
2015-11-01 01:17:26 -07:00
Peter Johnson
ad3424a693 Fix RobotDrive constructor (4 SpeedControllers).
Previously this was not initializing maxOutput.

Fixes artf4699.

Patch provided by: rossbach.ron@gmail.com

Change-Id: I8de5e4a508412d3ca51c58ea87e490916c3bd67c
2015-10-28 22:10:46 -07:00
Brad Miller
97a7716a23 Added work around for the missing path on the frc_console_tee command in frcRunRobot 2015-10-23 19:33:21 -06:00
Kevin O'Connor
fc0a94af2a Update image version to v14
Change-Id: I49a55fd35d3eb33f8909590340422d24ec145eda
2015-10-23 16:00:30 -04:00
Kevin O'Connor
4da09db20b Revert "Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI"
This reverts commit 4972480b23.
2015-10-23 15:29:38 -04:00
Omar Zrien
a0cc45a8f0 Format and style changes.
Rebuilt last SRX-related commit with latest checkout.

Change-Id: I9f10418580275dae5cd07d740d401d45ee44e276

C++: Added Magnetic Encoder sensor types
C++: API for changing status frame rates updated to use paramEnums.
C++: Added Setting nominal and peak outputs for closed loop modes.
C++: Added current-closed loop
C++: added vcomp mode
C++: Added unit scaling (rotations and rpm)
C++ Added allowableclosedlooperr
C++: Added auto zero position on index pin
C++: Added pulse width decoder API
C++: Added multiplicands in status frames, increasing the max reported pos and max rpm.
C++: Added SetClosedLoopOutputDirection() for reversing slave output and reversing single-direction closed loopoutput.
C++: Added generic ConfigSet and ConfigGet for future flexibility/features.
C++: Added IsSensorPresent
Java: Added Magnetic Encoder sensor types
Java: Added unit scaling (rotations and rpm)
Java: Added current-closed loop
Java: added vcomp mode
Java Added allowableclosedlooperr
Java: Added auto zero position on index pin
Java: Added pulse width decoder API
Java: setForwardSoftLimit and setReverseSoftLimit takes double instead of int so underneath we can support rotations instead of native units.
Java: Added generic SetParam and GetParam for future flexibility/features.
Java Added isSensorPresent

Change-Id: I800251510e411624dce5ee10272606c31764b8ab
2015-10-16 11:27:57 -07:00
Brad Miller (WPI)
a3b6535fe9 Merge "Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI" 2015-10-16 11:26:58 -07:00
Brad Miller (WPI)
29299079fa Merge "Updated roborio version numbers" 2015-10-16 11:26:44 -07:00
Brad Miller (WPI)
06dea34ff3 Merge "DO NOT ACCEPT THIS COMMIT UNTIL IMAGE CONTAINS netconsole-host: Don't overwrite system netconsole on deploy" 2015-10-16 11:26:29 -07:00
Brad Miller
4972480b23 Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI 2015-10-16 13:51:38 -04:00
Brad Miller
e73d873df9 Updated roborio version numbers 2015-10-16 13:50:40 -04:00
Brad Miller (WPI)
4eadd99d2c Merge "Removed simluation eclipse plugin" 2015-10-16 09:25:18 -07:00
Sam Carlberg
1316deaf5b Added LiveWindow support for PID control for CAN speed controllers.
Change-Id: Id32e27ee7074ffa23824d5d8c0e9509059001284
2015-10-14 16:47:13 -04:00
Brad Miller
64c8f1b487 Reupdated the ntcore version
Change-Id: I13124b7b75c1514c3c8f0f66821e37ad3010e306
2015-10-08 18:56:56 -04:00
Brad Miller (WPI)
39c40a9b86 Merge "Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"" 2015-10-08 13:55:00 -07:00
Brad Miller
fbbb8dab72 update the version 12 image number
Change-Id: If609ff0924ab72ca08e53d38a45c9f7a91b659ce
2015-10-08 16:29:28 -04:00
Brad Miller (WPI)
e449362131 Merge "Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"" 2015-10-08 13:21:59 -07:00
Brad Miller (WPI)
b4761f8f93 Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"
This reverts commit 490c88a9bd.

Change-Id: Id50af75bbe2385eddaf12aad2914a9032c8487e7
2015-10-08 13:20:42 -07:00
Patrick Plenefisch
298bc80373 DO NOT ACCEPT THIS COMMIT UNTIL IMAGE CONTAINS netconsole-host: Don't overwrite system netconsole on deploy
This reverts commit bff8eb366b.

Change-Id: I4c52f1a2c86aef9fb2f56aa3109df41d4426d29f
2015-10-08 12:35:35 -04:00
Patrick Plenefisch
bff8eb366b Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"
This reverts commit 490c88a9bd.
2015-10-08 12:33:50 -04:00
Brad Miller (WPI)
763d81653b Merge "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)" 2015-10-08 07:53:42 -07:00
Brad Miller (WPI)
4036ddf552 Merge "Fixed miscellaneous typos" 2015-10-08 01:05:02 -07:00
Tyler Veness
32af49dbb8 Fixed miscellaneous typos
Renamed RelayCrossConnectFxiture to RelayCrossConnectFixture and fixed spelling of variable in PIDCommand class prototype

Change-Id: I2e0970c9b14f58b7fa5ad70024b29e7a54524f0c
2015-10-07 21:35:25 -07:00
Peter Johnson
c01d057d7b Counter: Explicitly call mode constructor.
This is a compiler bug workaround.  On gcc 4.8.2, the default argument to
the Counter(Mode) constructor is not recognized as a valid delegating
constructor to use.

Change-Id: I616453567c45ce523e14345bd667ea893bf219a3
2015-10-07 20:59:42 -07:00
Patrick Plenefisch
490c88a9bd Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)
Change-Id: I7aa115be1bff2bdf1077c2fa53a0a3de958033e8
2015-10-07 19:29:56 -04:00
Patrick Plenefisch
6fc3f1d3d9 Update netconsole-host binaries (TODO: make part of build)
Change-Id: If7920c467281ea67763c9eebc317a2f11e312089
2015-10-06 17:27:37 -04:00
Sam Carlberg
1309533a48 Updated eclipse plugins to check for the 2016v10 image instead of 2015v23.
This should really be moved to a top-level config file later

Change-Id: I28b26a4be02a0bd2fe74a416c96db13f522e4b8e
2015-10-06 14:32:44 -04:00
Patrick Plenefisch
29e54a9899 Adding path back in for OS X toolchains because of Apple lockdown
Change-Id: Ia7a76172b8d5d3996556328a00ecc73ca84f5774
2015-10-05 11:09:01 -04:00
Patrick Plenefisch
c384fc97d5 Fixing up rpath libstdc++ for all versions
Change-Id: Ic67b18f27ebeb0a6bdfd67c75f12e6bb4626c944
2015-10-04 18:22:21 -04:00
Brad Miller (WPI)
9c1ab69871 Merge "Automatically set persistent on new Preferences keys." 2015-10-04 15:09:14 -07:00
Brad Miller (WPI)
d9e9712b07 Merge "Update ntcore to latest version." 2015-10-04 14:34:33 -07:00
Brad Miller (WPI)
e281437c4b Merge "Replaced instances of std::unique_lock with std::lock_guard where possible" 2015-10-04 14:17:00 -07:00
Brad Miller (WPI)
f8c0fb1059 Merge "Fix typo in Preferences Test name" 2015-10-04 14:00:29 -07:00
Peter Johnson
87fc49c66d Automatically set persistent on new Preferences keys.
This improves interoperability with old dashboards as it enables new
Preferences keys to be added from an old dashboard and still be
automatically saved.

Change-Id: I51e988006f8fa4fd780fac34f47633a9727f31e0
2015-10-04 13:21:16 -07:00
Peter Johnson
f93bf82fa9 Update ntcore to latest version.
The latest version provdes more extensive listener features and fixes a
handful of bugs.

Change-Id: Ie59c3d879ac12dd5172c2aebd901bdee55570fa2
2015-10-04 13:20:34 -07:00
Tyler Veness
c0ecde302f Replaced instances of std::unique_lock with std::lock_guard where possible
If a lock is used with a mutex that doesn't need to be unlocked again before the lock is destroyed, std::lock_guard can be more efficient than std::unique_lock due to less overhead.

This commit also removes a redundant set of curly braces in PIDController.cpp intended to constrain a lock's scope.

Change-Id: Idd692ce439528ddb319a4c62c40c7351a664eb97
2015-10-04 13:20:11 -07:00
Joe Ross
c2f5bcc04e Fix typo in Preferences Test name
Change-Id: If1cfc3a63e0731fc764b535fd66ed7a1511de199
2015-10-04 13:19:58 -07:00
Peter Johnson
38e0cd6963 Provide compatibility shim for std::make_unique().
make_unique is C++14 only.  This provides a shim for C++11-only compilers.

Change-Id: Ibaa79822a7a6cfa8020c201c2edea1754650f570
2015-10-04 13:19:46 -07:00
Peter Johnson
f64b055499 Provide DEPRECATED macro as portable version of [[deprecated]].
The [[deprecated]] attribute is a C++14 feature not supported by MSVC or
GCC < 4.9, but can be simulated on both of these compilers through the
use of alternative (compiler-specific) attribute methods.

Change-Id: I34aed5705db2407c592f7cabd5274358c48d34fe
2015-10-03 13:17:53 -07:00
peter mitrano
a480cc65e3 Removed simluation eclipse plugin
Plugins will be delivered through a seperate installer
models will be delivered through the online gazebo model repository

Change-Id: Id9df358837460ae3956657327dbfeb6414b033c2

Conflicts:
	eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/site.xml
2015-10-03 13:08:27 -07:00
Fredric Silberberg
ef3fa53fc3 Fixed solenoid allocation bug exposed by adding status pointer initialization
Change-Id: Ibabdf2f1716554b85fd1056c6f1bbe614fa97f4e
2015-10-03 15:43:03 -04:00
Peter Johnson
049be6870c Always initialize status to 0 when calling HAL from JNI.
The HAL functions often call NI functions that may expect status to be
initialized on entry.  Java does not guarantee direct pointer allocation
memory to be initialized, although that may have been occurring by accident.

Change-Id: I5e3a553f3a7be8de3716ccfc13e6ca1cb4f2a552
2015-09-30 19:20:02 -07:00
Brad Miller
c0c91c414a Modified the test scripts to run as admin rather than lvuser until we have the passwd issue resolved
Change-Id: I943a17c7f872faf69e845b61423eb0ae7044cca5
2015-09-30 11:18:54 -04:00
Patrick Plenefisch
9f859234fb Update for latest image, not sure about ctre folder so leaving
Change-Id: If2218df082bca93d25b88088696d6c2897732efd

Adding FRC Local new mdns name

Change-Id: I53d206879663b96009ba3a12de161b7a425ffd10

Adding rpath for new libstdc++

Change-Id: I0c022efb0b15f094d153b44f60215ca00d5f1924
2015-09-30 06:03:56 -07:00
Peter Johnson
89ae8f214e Initialize status in HALInitialize.
Change-Id: If6230f949ba0dc1061186b1877aaf34a4dd8a987
tGlobal::create() expects the incoming status to be 0.
2015-09-29 23:27:25 -07:00
Fredric Silberberg
3c4b96024c Reverted task dependency changes that do not work
Change-Id: I5935a149a30e10164ddcd254e06f5a89a993b82c
2015-09-25 22:04:00 -04:00
peter mitrano
75d9228f33 Fixed networktables build
using findAll form instead off whenAdded
fixed instances of network tables versions from 0.1.0 to 3.0.0

Change-Id: I01054d727259ea5dbf3ba8fae49764337d4f6cf9
2015-09-24 21:58:28 -04:00
Fredric Silberberg
00f797a327 NetworkTables updates for beta
This commit does a few things. First, we publish ntcore as a maven
artifact so the plugins can build with new networktables, and java
programs will depend on the correct version when compiled. We also revert
the changes to OutlineViewer for now. I got an exception when attempting
to start a server with the new network tables in OutlineViewer on Windows,
I will create a bug for this. Also, since we don't have the binaries
integrating properly yet and won't for the first beta, we need to be using
the platform agnostic version anyway.

Change-Id: I9960f25bc3f2b30bb59fce665eb914ef5e661c9c
2015-09-21 18:14:18 -04:00
Tyler Veness
525f88ae17 artf4115: Added MotorSafety to Relays
Change-Id: Ia8d9ecfa21bb8102e73d91ec44791bd5141a0b4b
2015-09-19 15:58:35 -07:00
jmanning
c21c47f546 artf4000
A fix contributed by James Ward to fix the restriction on the read/write sizes in I2C.

Change-Id: Iddc48dc55ff9cea37d8dcfaba5e63f0d14e4c7d0
2015-09-19 15:24:07 -07:00
Fredric Silberberg
3635299fde Updated Gradle Version
This updates our Gradle wrapper to version 2.5. The Gradle update
requires no changes to developer systems.

Change-Id: Ia2846600579b182c1a8e12889cdcaa8ffd82a812
2015-09-19 17:40:32 -04:00
Tyler Veness
a7feaddd6b Fixed some warnings printed during wpilibC++Sim build
Change-Id: I11eea8a577af7c37c61978edd721ca16e4e41748
2015-09-19 14:23:49 -07:00
Brad Miller (WPI)
771b5807f4 Merge "Updated C++ documentation" 2015-09-19 14:16:21 -07:00
Brad Miller (WPI)
c248ce7948 Merge "PIDSubsystem.cpp: Use make_shared instead of make_unique." 2015-09-19 13:57:36 -07:00
Peter Johnson
6db58a2cc0 PIDSubsystem.cpp: Use make_shared instead of make_unique.
m_controller is a std::shared_ptr, so make_shared should be used.

Change-Id: I77c855a3055a372ab3feba1a1d8e5c4bac42157f
2015-09-19 12:45:50 -07:00
Peter Johnson
d904dfce71 Include the ARM JDK JNI headers.
These are GPL-licensed.  This removes the dependency on the ARM JDK being
installed in order to build wpilibj.

Change-Id: I6ea89f601a2e8210acaf9ae257ddc289c548d7f3
2015-09-19 09:14:24 -07:00
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
f65e697107 Revert changes preventing old user code from compiling.
I'm not 100% sure whether we want these, but they are a quick
find and replace to do.

Basically, there are two primary things that we have done
this summer that break existing user code:
-Changing GetInstance() calls to return references instead
 of pointers. This forces users to change from doing something
 like LiveWindow::GetInstance()->AddSensor() to LiveWindow::GetInstance().AddSensor().
-Making PIDGet() and related calls const, forcing users to change
 the function signatures wherever they override them.

The GetInstance() calls don't really matter to me either way,
especially since there are no real ownership issues going on there,
unlike the rest of the smart pointer-related changes.

For the const stuff, it is certainly more correct to mandate that
user PIDGet() functions be const and the such, but at the same time,
I'm not sure that there is any strong need for it, and the errors
generated are not the most helpful. While this wouldn't necessarily
be an issue for more experienced teams or completely new teams (who
don't have any old code to be reusing), it may cause issues for more
average teams who aren't familiar with the intricacies of C++ anything.

Change-Id: I6e7007982069292ea70e6d0fc8ca40203340df1b
2015-09-16 19:10:01 -04:00
Brad Miller (WPI)
ef1e81f93e Merge "Create a WPILib Style guide." 2015-09-11 08:29:32 -07:00
Tyler Veness (3512)
5d1ab0e820 Merge "Unbreak cmake build." 2015-09-01 20:38:49 -07:00
Tyler Veness
af01ff3001 Updated C++ documentation
Fixed incorrect documentation for Task class, improved documentation for RobotDrive's drive() function (thanks to FRC Team 4579), and ran doxygen -u on cpp.doxy to remove deprecated XML_SCHEMA and XML_DTD tags

Change-Id: I2f3fa4018d69b84e67376a5feb0eca43d5fa7623
2015-09-01 17:46:55 -07:00
peter mitrano
4514e4489a refactored HAL library
builds two libraries, Athena  and Desktop.
Simulation should use Desktop, Robots should use Athena

Also:
 - copied Driverstation and Joystick from Devices into Sim
 - Descreased dependency of pthreads in JNI.
 - removed Simulation ifdef from non simulation
 - added missing decprecated attribute for msvc
 - removed usage reporting from sim
 - removed unused pom.xml and constexpr

Change-Id: If8eb540f9434dce17c77a245fda6985713e80b2d
2015-08-20 11:22:42 -04:00
peter mitrano
43960b9bca changed windows file separator to unix file separator
Change-Id: I7e57bde57c1f735d9bd70b26141fb562be392b4f
2015-08-18 12:05:30 -04:00
peter mitrano
29d029fa61 merged from frcsim branch
verified to work on real robots
adds sim eclipse plugins, fixed JavaGazebo, made wpilibC++Sim build on windows
 - Java and C++ simulation robot programs run on windows
 - simulation eclipse plugin delivers models and gazebo plugins
 - Java Gazebo now respects GAZEBO_IP variables and can work across networks
 - hal and network tables win32 hacked to work on windows
 - smart dashboard broken on windows due to network tables hacks
 - wpilibC++Sim, gz_msgs, and frcsim_gazebo_plugins build with CMake
 - removed constexpr for cross platform compatibility
 - msgs generated using .protos as a part of build process
 - some spare and unused cmake/pom files deleted
 - simulation ubuntu debians removed entirely
 - refactored CMake project flags and macros
 - updated to match non-sim C++ API
 - fixed and updated documentation
 - servo added to simulation

Change-Id: Ia702ff0f1fee10d77f543810ad88f56696443b05
2015-08-18 10:39:25 -04:00
Peter Johnson
738881099f Unbreak cmake build.
Several ctre headers were in source directories but were required by other
headers in include directories.  This worked in gradle but not in cmake.

Change-Id: I806c76031b396d1694a18b8e30c705e92f617a66
2015-08-14 08:01:59 -07:00
Brad Miller (WPI)
4e46692191 Merge "Fixed wpilibJavaSim build" 2015-08-14 07:46:03 -07:00
Brad Miller (WPI)
8056aaa0aa Merge "Accelerometer classes no longer use PIMPL pattern" 2015-08-14 07:42:47 -07:00
Tyler Veness
93b0dab7e4 Accelerometer classes no longer use PIMPL pattern
Change-Id: I792ac05e7080190ce268818a2bb94dacbeba274c
2015-08-13 15:16:00 -07:00
Tyler Veness
099056789e Fixed wpilibJavaSim build
Recent changes in master broke the build of wpilibJavaSim. Since the build server doesn't build the plugins after the library, this wasn't caught.

Change-Id: Ibd4a2ba9f359ddbc395ba0654fccada10ca78c78
2015-08-13 13:54:38 -07:00
Tyler Veness
f96b61ef11 artf4106: ISO C++ forbids variable-size array
C++14 changed the definition of VLAs, so the previous usage was no longer valid ISO C++. GCC 5.1.0 actually enforces this definition, so this commit fixes the build under GCC 5.1.0. This also builds under GCC 4.9.1.

Change-Id: Ib5ae2c49b4c4c21455b722b6633d7841066b4872
2015-08-13 12:26:46 -07:00
James Kuszmaul
b5695581c3 artf4170: Make CANTalon disable on destruction.
This both disables the CANTalon in the CANTalon class (which
should be redundant) and stops sending control signals in the
CanTalonSRX hal class.

Change-Id: I63d6a9d016c221e385d5d5a3679d854882ac6650
2015-08-13 11:42:30 -07:00
Tyler Veness
2bf3b6bed4 Replaced WPILib.h includes in integration tests with the minimum required subheaders to improve compilation times
I ran the benchmark in a tmpfs with an Intel Core i5-2430M. I ran it three times for each combination of build invokation and source tree.

First, I tested "make". For master (eb7d55f), I measured an average of 42.751s with a standard deviation of 0.372s. For this commit, I measured an average of 33.394s with a standard deviation of 0.140s. There was a 9.356s, or 22%, improvement with a total error of 1.3%.

Second, I tested "make -j4". For master (eb7d55f), I measured an average of 21.723s with a standard deviation of 0.158s. For this commit, I measured an average of 16.823s with a standard deviation of 0.340s. There was a 4.900s, or 23%, improvement with a total error of 2.7%.

Change-Id: Idb3adce62ed8ef449360c6583896b6da3565cf58
2015-08-13 11:31:46 -07:00
James Kuszmaul
e017f93f16 Fixed examples to build/run with new WPILib versions.
Also added some references/smart pointers to a couple places
that seemed convenient to the user.

I haven't updated the constructors for RobotDrive() related
examples, pending the results of gerrit change https://usfirst.collab.net/gerrit/#/c/960/

A few things that we are noticing:
--It might be nice if ReturnPIDInput() didn't have to be const;
  when people try to override it, they have to remember to put
  the const in and if they don't, then the compiler error isn't the
  most obvious (especially since this is a change). This would also
  apply to PIDGet() in the PIDSource interface.
--SendableChooser still takes raw pointers. This could lead to an
  issue I had to debug briefly where you accidentally call
  GetSelected() on autoChooser and put the resulting raw pointer
  into a unique_ptr, which destroys the pointer when it goes out of
  scope. Specifically, I was testing the PacGoat example and
  I ended up with a situation where if auto mode was run once, it
  was fine, but if it was run twice, the selected command would
  have been destroyed by the unique_ptr. I believe that this
  just requires updating SendableChosser to take shared_ptr.
--When the samples are compiled with -pedantic, it points out that
  START_ROBOT_CLASS macro expansion results in a redundant semicolon.

Change-Id: Ib4c025a61263d0d2780d4253faa31713e15333a5
2015-08-13 11:26:28 -07:00
Brad Miller (WPI)
4f8c1dff2f Merge changes I8a9cf402,I8c0f8442
* changes:
  Tuned test constants for VelocityPID.
  artf4127: Implemented velocity PID controller
2015-08-13 11:15:01 -07:00
James Kuszmaul
92edf35b41 Make deprecated warnings not error for macs.
Change-Id: I82e748e2f313e111ed2acd30fd11a1b027a6797c
2015-08-13 12:33:05 -04: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
Tyler Veness
f0e3bb5164 artf4165: D term of PID controller now uses change in input instead of change in error
This avoids large additions introduced by the D term when a step change occurs in the setpoint. Otherwise, the changes return the same values. Let error = setpoint - input and prevError = prevSetpoint - prevInput. If the D term is calculated via error - prevError, then:

error - prevError = (setpoint - input) - (prevSetpoint - prevInput)

If we ignore the setpoint changing, then we get:

error - prevError = (setpoint - input) - (setpoint - prevInput)
                  = prevInput - input

Change-Id: Ifa4af9b265e3c4bd263e8541355f2b80269693e9
2015-07-30 08:55:28 -07:00
Tyler Veness
918cde0c0f artf4155: Move Port.h from hal/lib/Athena to hal/include/HAL
Change-Id: I76a8d8baf4d77b7383c321d16a9286537632c3e9
2015-07-30 08:54:02 -07:00
peter mitrano
43f16510fa moved ctre includes from C++Devices into Hal
Change-Id: I0d0460516b5e26345faa321ed6e24d80eba65358
2015-07-30 07:57:14 -07:00
Brad Miller (WPI)
959f8775d0 Merge "Temporarily disable MutexTests until artf4167 is resolved." 2015-07-30 07:51:14 -07:00
Brad Miller (WPI)
0d70a39f67 Merge "Replaced ::std with std for readability/consistency." 2015-07-30 07:47:38 -07:00
James Kuszmaul
ba57c7f24d Make gradle actually build command tests in C++.
Change-Id: I7052f526facc557eb0a0ca58467e1220722f7d18
2015-07-30 10:00:53 -04:00
James Kuszmaul
4b575e3e7e Replaced ::std with std for readability/consistency.
Change-Id: I65f9673c237d3513f99827e28963eb22ae9df0c2
2015-07-29 16:48:04 -04:00
James Kuszmaul
cbc372c71e Temporarily disable MutexTests until artf4167 is resolved.
Change-Id: I09f4e48ff304df312daf4ebb77681965acf6066d
2015-07-27 11:51:29 -04:00
Brad Miller (WPI)
f74ca87e26 Merge "NamedSendable::GetName() is now const qualified" 2015-07-23 07:49:02 -07:00
Brad Miller (WPI)
5756be5c23 Merge "Fix std::unique_ptrs using incomplete types" 2015-07-23 07:48:05 -07:00
Brad Miller (WPI)
2da3f7f89b Merge "Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro" 2015-07-23 07:46:51 -07:00
Brad Miller (WPI)
cf965d26a0 Merge "Make test scripts spawn driverstation as admin." 2015-07-23 07:45:17 -07:00
Brad Miller (WPI)
af3eaae090 Merge "Comment out SetPriority() in Task constructor." 2015-07-23 07:43:17 -07:00
James Kuszmaul
9c2678fdb9 Make test scripts spawn driverstation as admin.
Change-Id: Ic7f27fa902b2ac67c6785b7f422601ade3d23f2c
2015-07-21 08:50:43 -04:00
Tyler Veness
3bbeccfbb5 Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro
Change-Id: I8371beb286a20d4c7619aab226136569fdefafef
2015-07-21 01:23:34 -07:00
Tyler Veness
881dcd08e5 Fix std::unique_ptrs using incomplete types
CANTalon declared a std::unique_ptr<CanTalonSRX> with CanTalonSRX as an incomplete type. This causes a compilation error in code using CANTalons. The CANTalonTest didn't catch this because it included ctre/CanTalonSRX.h as well as CANTalon.h. Normal user code doesn't do that.

I reviewed uses of std::unique_ptr elsewhere and determined that PIDCommand may suffer from the same problem. There is no test for PIDCommand to prove otherwise.

Change-Id: I54caf4941927910471ffb7170eb6737ba0e08437
2015-07-20 20:39:49 -07:00
James Kuszmaul
6bd2534f0e Comment out SetPriority() in Task constructor.
Change-Id: I82bdab5558f328d686461556b9425ddec878eb6b
2015-07-20 19:38:06 -04:00
Tyler Veness
451c4e81c3 NamedSendable::GetName() is now const qualified
Change-Id: Ie9e4daac4473e44f4248385f992da750501443e5
2015-07-20 16:17:29 -07:00
James Kuszmaul
eb7d55fd59 Fixed classes with undefined constructor.
IterativeRobot and BinaryImage had no constructor
defined (and so would give linker errors).
Error just had an empty constructor defined,
so I switched to "=default".

Change-Id: Ia8efb4282928227878dfefeda58ccb8cf06aabb2
2015-07-20 17:31:44 -04:00
Brad Miller (WPI)
c776324f96 Merge "Make the teststand run as lvuser instead of admin." 2015-07-20 14:22:17 -07:00
James Kuszmaul
98f2d08103 Changed const char* -> string in most of wpilibc.
The HAL will remain untouched in order to maintain C-style
compatibility. A few places in wpilibc were left as
C-style strings, especially if special formatting (eg,
elaborate uses of snprintf or sscanf) was being used.

In general, const char* was changed to std::string.
character buffers used for formatting were either
untouched, changed to std::stringstream, or changed
to std::string, depending on what was done with
the buffer.

Change-Id: I5e431ddf1cc4d9a6d534e1f21b16ea23be26e7f1
2015-07-20 13:20:02 -04:00
James Kuszmaul
534ea134a4 artf4154: Get rid of raw pointers in C++.
This deals with the majority of the user-facing code
in wpilibC++Devices and a substantial portion of it in
wpilibC++. wpilibC++Sim and wpilibC++IntegrationTests
are untouched except where it is necessary to make them
work with the rest of the libraries.

There is still a lot to do in the following areas:
-The HAL (which we may not want to touch at all).
-The I2C, Serial, and SPI interfaces in wpilibC++Devices,
  which I haven't gotten around to doing yet.
-Most wpilibC++Devices classes have void* pointers
  for interacting with the HAL.
-InterruptableSensorBase passes a void *params for
  the interrupt handler.
-I haven't converted all the const char* to std::strings.
-There are plenty of other cases of raw pointers still
  existing.
-This doesn't fall directly under raw pointer stuff,
  but move syntax and rvalue references could be introduced
  in many places.
-I haven't touched vision code.
-The Resource classes conflict (one is in the hal, the other
  in wpilibC++). Someone should figure out a more
  permanent fix (eg, just renaming them), then doing
  what I did (making a new namespace for one of them,
  essentially the same as renaming it).

A few other things:
-I created a NullDeleter class which is marked as deprecated.
  What this does is it can be passed as the deleter to a
  std::shared_ptr so that when you are converting raw pointers
  to shared_ptrs the shared_ptr doesn't do any deletion if
  someone else owns the raw pointer. This should only be
  used in making old raw pointer UIs.
-I had to alter the build.gradle so that it did not
  emit errors when deprecated functions called deprecated
  functions. Unfortunately, gradle doesn't appear to be
  actually printing out gcc warnigns for some reason.
  The best way I have found to fix this is to patch
  the toolchains (https://bitbucket.org/byteit101/toolchain-builder/pull-request/5/make-gcc-not-throw-warnings-for-nested/diff)
  so that a deprecated function calling a deprecated
  function is fine but a non-deprecated function calling
  a deprecated function will throw a warning (which we
  then elevate with -Werror). I believe that clang
  deals with this properly, although I have not
  tried it myself.

Change-Id: Ib8090c66893576fe73654f4e9d268f9d37be06a2
2015-07-20 13:18:29 -04:00
Tyler Veness
fd4c169658 artf4149: Removed references to VxWorks
Implemented setTaskPriority() and getTaskPriority() in Task HAL API

Removed all other unimplemented functions in HAL and removed spawnTask()

Replaced instances of pthread_t* with TASK typedef

Removed unused HAL error constants and removed commented-out classes and functions in wpilibj's HALLibrary

Changed Task class API to match the construction semantics of a std::thread

Change-Id: I3bc951a3da90d24c5589fae4d1ca2bb60225c873
2015-07-20 11:49:29 -04:00
James Kuszmaul
5712565068 Removed dependencies on pthread from frcsim.
Because we want to be able to compile/run wpilibC++Sim on
windows, we would prefer not to require a windows version
of pthread. This commit moves from pthread constructs to
standard library constructs.

Change-Id: I12392a8910189537dd067afdf017e4994d570a66
2015-07-20 07:06:57 -07:00
Tyler Veness
3f59f3472a artf4156: Replaced synchronization primitives with C++11 equivalents
Change-Id: I90da739347e875efda2a29dd5484b6dda3cd4753
2015-07-20 10:06:08 -04:00
James Kuszmaul
b8f044f8ec Make the teststand run as lvuser instead of admin.
Change-Id: I46c9fee09c99826393d02f792508307a77d14320
2015-07-17 13:32:59 -04:00
Brad Miller (WPI)
7f5ee01d3e Merge "DISALLOW_COPY_AND_ASSIGN macro now uses the delete keyword and allows move assignment and construction" 2015-07-07 16:49:23 -07:00
Tyler Veness
f4d84cdd4f Fixed potentially uninitialized value warnings emitted by clang
Removed unused variable from DigitalInput class

Removed extraneous explicit std::string conversions in Preferences class

Change-Id: Ia445abfd136a7b3e7f0491ed22aaa057814bcc8f
2015-07-07 16:46:33 -07:00
Brad Miller (WPI)
974e301a8b Merge changes I3d35139f,I05bb06f6,I4a3db0f1,I452b4794,If281e46a
* changes:
  artf4107: Removed most "Init" functions from classes
  artf4107: Replaced throw() with noexcept
  artf4107: GetInstance() calls are now atomic
  artf4107: Uniform initialization syntax introduced
  artf4107: clang-modernize was run on WPILib
2015-07-07 16:34:39 -07:00
Brad Miller (WPI)
9dc7bb4ec0 Merge "Changed 'mvn.bat' to 'mvn.cmd' such that the eclipse plugins can build on Windows with the current version of maven." 2015-07-07 16:21:04 -07:00
Tyler Veness
1ab3ea670d artf4107: Removed most "Init" functions from classes
They were either replaced with delegating constructors or merged into the only constructor in the class.

Change-Id: I3d35139f6ab23c719433a9f76942b02a3b07ddac
2015-07-02 21:50:40 -07:00
Tyler Veness
e4a8aacc51 artf4107: Replaced throw() with noexcept
Change-Id: I05bb06f6485120da05ce22c464b41f3cb0a0e00e
2015-07-02 21:50:39 -07:00
Tyler Veness
faedfa6ed4 artf4107: GetInstance() calls are now atomic
C++11 guarantees construction of static variables to be atomic, so this patch takes advantage of that.

Change-Id: I4a3db0f19c5fa5461fef3b6b63d7b8fec596c962
2015-07-02 21:50:39 -07:00
Tyler Veness
368ad30d37 artf4107: Uniform initialization syntax introduced
Change-Id: I452b4794d757a0817589ec62b75eda7fbdd74904
2015-07-02 21:50:39 -07:00
Tyler Veness
b1befed14f artf4107: clang-modernize was run on WPILib
Loops were converted to their range-based equivalents, variable types were replaced with auto where the type was already specified on the same line, the override keyword was added, and instances of NULL and assignments of 0 to pointers were replaced with nullptr.

Change-Id: If281e46a2e2e1c37f278d56df9915236d4b2c864
2015-07-02 21:49:47 -07:00
Tyler Veness
045a9b32db DISALLOW_COPY_AND_ASSIGN macro now uses the delete keyword and allows move assignment and construction
Change-Id: Ibb19cdb4343e0d7ddaa073cff5373ec24f24a2d3
2015-07-02 21:41:27 -07:00
James Kuszmaul
7a711a21f9 Make jenkins fail if tests fail catastrophically.
Previously, when the C++ tests seg faulted, Jenkins didn't make any noise.

Change-Id: I3e3599d1b55d704c59a9675e3074ee76348cb035
2015-07-02 16:58:10 -04:00
James Kuszmaul
1c3882ec72 Create a WPILib Style guide.
This commit is intended to be used a place
to start work on getting the styleguides which
we would like to use for WPILib up to date in
some useful format.

This particular commit need not be merged immediately
and people who wish to contribute to/have suggestions
for the style guide can either comment on this
or make commits based on this with their
suggestions.

The changes in this commit itself are relatively minimal,
just adding reminders that the style guides are
works in progress.

The main things which we need to do to get the style
guides useful are:
-Making formatting rules clear/easy to follow. For
  instance, I do not believe that the original guides
  linked straight to the eclipse format configuration
  files, even though they are quite useful.
-Adding in some WPILib specific stuff and information
  about how best to work on the code in our environment.
-Removing any guidelines which we don't want or don't need.
-Making the style guide readable/accessable enough that
  we can actually expect people to use/read it.
-Determining how/to what degree we want to enforce the
  strictures in the style guide.
-Determining how to handle our pre-existing code to
  either update it outright or to grandfather it in.
-Any other things to do which I may have forgotten
  while writing this commit message.

Change-Id: Ia6ea131e7d81d8c77a0487c8da17c0b264590e06
2015-07-01 15:44:17 -04:00
James Kuszmaul
35ccbb9c90 Fixed bad initialization of PDP.
Change-Id: I4603c7d51cfb8962d012aff0b6a1dac2e7525e40
2015-06-29 15:17:03 -04:00
Joseph
8794f7d636 Changed 'mvn.bat' to 'mvn.cmd' such that the eclipse plugins can build on
Windows with the current version of maven.

Change-Id: I10305a01392d9fe3002c451aa0b835a407fa2c81
2015-06-26 09:51:29 -04:00
Joseph
2c392d1813 Fixed comment problem in GyroMecanum cpp and made other small fixes to sample
programs.

Change-Id: Id6ee60085fa369ce3eb2e8261c0352b24886e2ae
2015-06-26 09:39:36 -04:00
Brad Miller (WPI)
7dcbe171bc Merge "Major formatting changes (breaks diffs). No code changes." 2015-06-25 12:29:00 -07:00
Brad Miller (WPI)
6fefcc779a Merge "Added new sample programs to the eclipse plugins for C++ and Java. Modified examples.xml for the corresponding added programs." 2015-06-25 12:19:26 -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
Joseph
ae90e5f6d3 Added new sample programs to the eclipse plugins for C++ and Java.
Modified examples.xml for the corresponding added programs.

Change-Id: I3d86c570f446ec8cf3013c58dd94215f2907bbb1
2015-06-25 14:31:51 -04:00
Brad Miller (WPI)
2d71c1c1c7 Merge "[artf4062] Eclipse now throws error on bad build." 2015-06-25 10:26:46 -07:00
Brad Miller (WPI)
0ad0b567e8 Merge "Artifact artf3896, commented out line that deletes the folders/files in wpilib/tools so teams smartdashboard extensions don't get deleted on plugin update." 2015-06-25 10:24:41 -07:00
James Kuszmaul
4013402134 Add PIDInterface for PIDController and CAN devices.
Added a PIDInterface for the PIDContrller, CANJaguar, and CANTalon to
inherit from.

Change-Id: I88d4943159476a44400009703db5e79d8cd4b5a9
2015-06-25 12:10:35 -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
Brad Miller (WPI)
6ce98056d3 Merge "Added Ultrasonic example program in Java and C++, updated examples XML." 2015-06-25 08:51:28 -07:00
Brad Miller (WPI)
c7944d76af Merge "Add check for CPP Perspective to CPP Launch Shortcuts. Fixes artf2627" 2015-06-25 08:49:01 -07:00
Kevin O'Connor
9c0df8c8fa Add check for CPP Perspective to CPP Launch Shortcuts. Fixes artf2627
Change-Id: I56f73c41d3266a557d6d42e5b6f7d7c97ce845b0
2015-06-25 09:43:44 -04:00
Tyler Veness
5598445a67 Improve const correctness.
See https://usfirst.collab.net/sf/tracker/do/viewArtifact/projects.wpilib/tracker.4_defects/artf4148

Change-Id: I47b0d5a91fd49e47e2c7348b0705e998ec815682
2015-06-24 15:20:44 -07:00
Joseph
c357d1dcae Added Ultrasonic example program in Java and C++, updated examples XML.
Change-Id: I510bef33d8565d124894d926d6634b04b1b6ca28
2015-06-24 16:30:55 -04:00
jmanning
c6b790cadd Artifact artf3586: Added include for stdint.h in WPIErrors.h file, so the header can stand alone.
Change-Id: Ia4fdad9d5c994fd78220dc81809a180a529d3792
2015-06-24 08:29:29 -07:00
jmanning
ead60eaab8 artf3622: Each Solenoid creates handles for all other Solenoids as well
Fixed so that one static handle is called for all Solenoids.

Change-Id: Ib5f3bbaa160d253e0533259bfe0e9e2a6f11733f
2015-06-24 08:28:37 -07:00
jmanning
39130721d0 Artifact artf3528, Added support for PDP's having addresses other than zero, and added ability to have multiple PDP's.
Change-Id: I8e36ab47d6f60b99a668965396c25856cc07a0cb
2015-06-24 08:13:39 -07:00
Kevin O'Connor
8d17270dce Merge "Added functions to get names, HID types and isXbox descriptors from joysticks." 2015-06-24 08:13:12 -07:00
jmanning
bf4ccf13d9 Added functions to get names, HID types and isXbox descriptors from joysticks.
Change-Id: I3cd6ebc04d64398f05001cd008696e13ee1ab6ea
2015-06-24 10:56:59 -04:00
James Kuszmaul
ee824680d2 Re-adjusted some PID values for the tests.
Change-Id: I95623307c2a0b86003acbbcd029768fae5d4689e
2015-06-23 11:27:25 -04:00
James Kuszmaul
d252ed5283 [artf4062] Eclipse now throws error on bad build.
Although I have tested this on my machine, further testing
to ensure that the problem really is solved may be helpful.

Change-Id: I892ad7d9f8fa7e791390a38036dafdba00d3a670
2015-06-22 14:03:32 -04:00
Brad Miller (WPI)
3de0f162bf Merge "Added modified Google Style Guide." 2015-06-22 08:31:54 -07:00
Brad Miller (WPI)
13948e8199 Merge "[artf3943] Add LiveWindow mode to CANTalon." 2015-06-22 08:30:51 -07:00
Brad Miller (WPI)
ac80114c42 Merge "Fixed BuiltInAccelerometer Tests, changed expected axis of gravity from the z-axis to the y-axis." 2015-06-22 08:29:52 -07:00
James Kuszmaul
7100052c54 Added modified Google Style Guide.
See artf4151. This is just a preliminary run at
putting together an appropriate style guide for
WPILib. Edits will need to be made and the style
guide should evolve over time. However, we have to
start somewhere, and enforcing at least the basic
formatting rules should make a good start.

Change-Id: I608b6f6f52918e2dda7443abb64c535e96d0af69
2015-06-19 09:36:26 -04:00
jmanning
4b45b6a191 Artifact artf3896, commented out line that deletes the folders/files in wpilib/tools so teams smartdashboard extensions don't get deleted on plugin update.
Change-Id: Ie738bf249a4dc8c300a3ed95a8178b8dc3ff6443
2015-06-18 13:52:22 -04:00
James Kuszmaul
b5ce281357 [artf3943] Add LiveWindow mode to CANTalon.
Still needs testing.

Change-Id: If01ed86a7f75c644c4eeea5ad775d006a424e888
2015-06-17 15:19:29 -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
James Kuszmaul
0862210f59 Fix bad suffix for staticLibArchiver on macs. Needs to be tested on mac.
Change-Id: I3bc851feec54d7ad86c2a59731b94ca6a59a5f46
2015-06-12 14:01:56 -07:00
Sam Carlberg
1c9dffc301 Commented OS X workaround in build.gradle
Change-Id: Icf9361e3f9f6f7d6d459eb483fcf4e51a5e5c26c
2015-06-12 16:12:41 -04:00
Brad Miller (WPI)
32251fe4a3 Merge "Makes the build work on Mac (needs to be tested on other platforms)" 2015-06-12 13:10:01 -07:00
Brad Miller (WPI)
08487b56ac Merge "Changed calculate method to protected and virtual" 2015-06-12 13:09:38 -07:00
Sam Carlberg
40c6fbe24d Makes the build work on Mac (needs to be tested on other platforms)
Change-Id: Ibc579d5f141f3ace9892e7f898cfd21050bc2aaf
2015-06-12 13:09:24 -07:00
Brad Miller (WPI)
33f012a60e Merge "CANTalon: Add getter methods for soft limits." 2015-06-12 13:04:33 -07:00
Brad Miller (WPI)
fafc8635c8 Merge "add some comments etc documenting various not-implemented things" 2015-06-12 13:03:41 -07:00
Brad Miller (WPI)
8674ac20fa Merge "Added missing archiver prefix for wpilibc" 2015-06-12 13:01:19 -07:00
Joseph
2296d6560d Changed calculate method to protected and virtual
Change-Id: I0e5900b4f079eee5f7b8933de2bf2f0a064cf762
2015-06-12 12:33:25 -07:00
Fred Silberberg (WPI)
bbffc825e4 Merge "Change wpilibcZip to use "lib" instead of "libs" to match where eclipse plugins expect libraries" 2015-06-10 08:55:34 -07:00
Kevin O'Connor
682bc171fd Change wpilibcZip to use "lib" instead of "libs" to match where eclipse plugins expect libraries
Change-Id: I597c43d773507037cc7677fe4e1952a640543c81
2015-06-10 10:40:49 -04:00
Peter Johnson
47088c0354 CANTalon: Add getter methods for soft limits.
Added functions:
- getForwardSoftLimit
- getReverseSoftLimit
- isForwardSoftLimitEnabled
- isReverseSoftLimitEnabled

Change-Id: I03b8f692c08c326a6ff0bfd929b7fdd5d7406a0f
2015-06-03 08:37:59 -07:00
Brian Silverman
4cac5a957b add some comments etc documenting various not-implemented things
Change-Id: I1103b65006e8330260bfe1202bdb64eb84d3fccc
2015-06-03 11:27:35 -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
Brian Silverman
880eae1424 don't use uninitialized variables
Change-Id: I9869c3bf64f00ddff641e5dc06b16179c3b3ce2f
2015-06-03 09:05:36 -04:00
Brad Miller (WPI)
d1d28e70e1 Merge "This commit adds JNI bindings for the C++ Notifier." 2015-06-03 06:02:03 -07:00
Brad Miller (WPI)
269bf9db64 Merge "Removed confusing error on deploy." 2015-06-03 05:59:59 -07:00
Brad Miller (WPI)
671954a664 Merge "Add MSYS Makefile option for cmake to Building.md as well as a note about the warning that's generated. Fixes artf3748" 2015-06-03 05:56:50 -07:00
Brad Miller (WPI)
19526361f1 Merge "Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840" 2015-06-03 05:54:19 -07:00
Brad Miller (WPI)
a9593854d8 Merge "Fix usage reporting for new motor controllers and Analog output" 2015-06-03 05:53:07 -07: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
0b7bb41b22 This commit adds JNI bindings for the C++ Notifier.
The bindings only wrap the HAL interface, rather than the entire C++ Notifier,
as I ran into issues trying to wrap the whole Notifier (all the existing
bindings only wrap HAL components, so wrapping stuff in :wpilibc is
unexplored). As such, the new edu.wpi.first.wpilibj.Notifier is just a
re-implementation of the wpilibc/.../Notifier.cpp.

The purpose of doing this bindings is to allow Java users a better option
for running tasks which require good timing (such as control loops). The
previous method used java.util.Timer to schedule a task, causing various
issues. Although this update does improve things, Java loop timing is still
substantially worse than that of C++, and, even worse, if Java decides to call
the garbage collector at the wrong time then the loop can be delayed by
multiple milliseconds and the next iteration will be shorter to account for it
(although this particular behavior could be updated).

A few notes on individual components:
-the HAL Task.hpp and Task.cpp were modified due to compilation/linkage
 issues with the JNI bindings. Nothing substantive changed.
-NotifierJNI was added to the build files for gradle.
-HALUtil was modified to include a function for getting the length of a C
 pointer, rather than relying on it being 32-bit.

Change-Id: I966512d8a82c2a438ed8c8bbcc6cdc6ed186d0f2
2015-06-02 16:05:03 -04:00
James Kuszmaul
90f05dd31a Removed confusing error on deploy.
rm no longer throws a file not found error on deploy.
Also, throw in a sync command at the end of the deploy so that we don't get corrupted files.

Change-Id: I561916e4fec1b8449f9a70b7ee2155b0b62abc80
2015-06-02 16:04:25 -04:00
Kevin O'Connor
9b6e48e142 Add MSYS Makefile option for cmake to Building.md as well as a note about the warning that's generated. Fixes artf3748
Change-Id: I67371a7a98d998b221731f9a8da8139057c6aa96
2015-06-02 11:00:25 -04:00
Kevin O'Connor
5a094879b6 Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840
Change-Id: I2371fc9cf64588e38f35b17715773604df6c2392
2015-06-02 10:00:34 -04:00
Kevin O'Connor
8b71ddc30f Fix usage reporting for new motor controllers and Analog output
Change-Id: I574e431ae551ecf8efc90c004abf14568f22c068
2015-06-02 09:46:09 -04: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
01d73d04f3 Added missing archiver prefix for wpilibc
Change-Id: I010a036915b1df85b35444890aa2d1cc2592470a
2015-05-20 18:55:54 -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
Joe Ross
0dffbd8634 Catch exception when instantiating USB camera if camera isn't present
Change-Id: I7f81c26619e55b49a0d205bdefe5fcd8adc7c3e2
2015-03-22 11:36:02 -07:00
Kevin O'Connor
0e46592ad1 Don't send DS errors if no DS.
Change-Id: I765d8c21371e772ec09bf696f6dd2fff43f8ed24
2015-02-23 16:19:16 -05:00
Brad Miller (WPI)
d2edb80da2 Merge "Use PCM Device ID when getting status. Fixes artf4014." 2015-02-23 13:15:26 -08:00
Brad Miller
6159fde98e Set POV values on error to return -1 rather than 0 AND bump the version number (artf4005)
Change-Id: I6fffb693a8e58427086b9f9a673cd70bebdbca33
2015-02-20 18:35:38 -05:00
Joe Ross
7bdd91a058 Use PCM Device ID when getting status. Fixes artf4014.
Change-Id: I0e1f478d1b96d20b97dec8d0ffe251c8fd0f6897
2015-02-15 16:43:09 -08:00
Kevin O'Connor
605bb45e0c Fix endian order of buffers in AnalogTrigger.java
Change-Id: Ica262494c4b8169d812295006e24f9cb440de078
2015-02-13 11:16:55 -05:00
Brad Miller
215002e487 Fix analog trigger bug with MXP mapping (artf4010)
Add the interrupt code for MXP mapping and analog triggers
Took out the unneeded static definition
Change-Id: I9a3483ee8f806b46b4349845e7a189f497c36916
2015-02-12 17:33:31 -05:00
Brad Miller
964475c724 Bump the version number to 1.1 for the network table changes
Change-Id: Id3ed20c88de5744acfe95ed0916c3c7f3fc0e386
2015-02-10 17:21:02 -05:00
Fredric Silberberg
bfa4bbaf78 Final move of Dustins network tables patches
Change-Id: I7d351d87e63c8174b62f4ec09f805f685c80019c
2015-02-09 14:22:44 -05:00
Mitchell Wills
39158754d7 Partial merge of patch from James Killian
Narrows scope of locks in write manager
added delay to incomming stream monitor loop

Change-Id: I6ced23c11cd3c2102041a73cb94fd1f1d351c7a4
2015-02-07 19:56:12 -05:00
Mitchell Wills
048b02e6cd Applied patch from Dustin Spicuzza to fix robot hang
Change-Id: I273feafcad5c95de04a11bab64c2d5596f248662
2015-02-07 19:56:11 -05:00
Fred Silberberg (WPI)
130319b771 Merge "Fixes artf3989: Java SerialPort no longer ignores return value of serialRead" 2015-01-21 14:58:09 -08:00
Thomas Clark (WPI)
0b414b1bde Merge "Disable Encoder console spam introduced in e13720b." 2015-01-21 14:05:01 -08:00
Thomas Clark (WPI)
8a244cc9dc Merge "Make index encoder constructors work." 2015-01-21 14:03:17 -08:00
Brad Miller (WPI)
397162390b Merge "Correct energy to be in Joules rather then millijoules. Fixes artf3940" 2015-01-21 12:15:23 -08:00
Joe Ross
bbc216f998 Disable Encoder console spam introduced in e13720b.
Change-Id: I10501f9bb9e8f8e0607291209f9a44a8dc3fa6b8
2015-01-18 18:57:34 -08:00
Joe Ross
72a56e6a8a Make index encoder constructors work.
Change-Id: I50e1262128197e7d65ed773c998d820efde152fe
2015-01-17 22:28:02 -08:00
Colby Skeggs
102c992e50 Fixes artf3989: Java SerialPort no longer ignores return value of serialRead
Change-Id: I5d522111189372a3c95b90804abf05ae1d0b553e
2015-01-18 01:30:19 +00:00
Joe Ross
9f057fddfd Correct energy to be in Joules rather then millijoules. Fixes artf3940
Note: power and thus energy will still be wrong until PDP firmware 1.39
or later is used. See artf3939.
Change-Id: Ic68b8a28c78f1b5d524fa5fb45e3bc0d9cd4a76a
2015-01-17 09:59:25 -08:00
Brad Miller
e614217d41 New netconsole-host that overwrites the old one on every deploy
Change-Id: I9f9e94a67810b1b40b354a2bfc511f44a05b858a
2015-01-16 21:03:52 -05:00
Kevin O'Connor
9b7042a51a Fix errors in Vision examples.
Change-Id: I752a99ff7b8872a0fc8926e3633c2b521383bbd0
2015-01-16 15:35:48 -05:00
Brad Miller (WPI)
081d7f7361 Merge "Applied updated DIOJNI file from Ron Rossbach. Fixes artf3982." 2015-01-16 07:36:17 -08:00
Brad Miller (WPI)
352c021b17 Merge "Updated the Java CameraServer to use the new USBCamera and prevent large camera data copies. Fixed a small bug in USBCamera to prevent reinitializing a camera if it is already initialized. Also fixed some issues with the getJpegSize function to correct for Java incorrectly casting 0xff to an integer, and the byte buffer limit being set incorrectly." 2015-01-16 07:35:32 -08:00
Brad Miller (WPI)
5f90bf167e Merge "Enable nivision Java wrappers to be generated with Python 3." 2015-01-16 07:35:17 -08:00
Brad Miller (WPI)
445eafefb3 Merge "More Java nivision wrapper fixes." 2015-01-16 07:34:33 -08:00
Brad Miller (WPI)
a917f63e7d Merge "2015 Color and Retroreflective vision samples for C++ and Java" 2015-01-16 07:33:21 -08:00
Brad Miller (WPI)
2228361f39 Merge "Add SetCANJaguarSyncGroup to RobotDrive" 2015-01-16 07:32:57 -08:00
Fredric Silberberg
aaa599fa28 Updated the Java CameraServer to use the new USBCamera and prevent large
camera data copies. Fixed a small bug in USBCamera to prevent
reinitializing a camera if it is already initialized. Also fixed some
issues with the getJpegSize function to correct for Java incorrectly
casting 0xff to an integer, and the byte buffer limit being set incorrectly.

Change-Id: I184efd265c617b02523dd9c5d347cc7ca5b4a77b
2015-01-15 19:27:00 -05:00
Peter Johnson
5d95bbb33f Enable nivision Java wrappers to be generated with Python 3.
Change-Id: I8ce57874e4730ed10dd0093c147b14c22f141201
2015-01-15 00:04:23 -08:00
Peter Johnson
d0258923e8 More Java nivision wrapper fixes.
- Fix sliceByteBuffer, getBytes, and putBytes implementations, which had
  functional errors.  Also, getBytes and putBytes now use the ByteBuffer
  get/put byte[] functions, which should improve performance.

- Don't generate wrappers for functions that are not available in the
  shared library.

Change-Id: Iaf45814b34720d3fdcd58adf99ad9c3ff2703bc3
2015-01-14 23:49:37 -08:00
Kevin O'Connor
91ccc5d10b 2015 Color and Retroreflective vision samples for C++ and Java
Change-Id: Id95925ced100b25d591c40995bb016780737312d
2015-01-14 12:45:17 -05:00
Brad Miller (WPI)
9fda920055 Merge "Add @file annotation so files are picked up in doxygen" 2015-01-14 07:54:34 -08:00
Brad Miller (WPI)
e9dd72ac77 Merge changes I0ec40c14,I4d099e62
* changes:
  nivision Java wrappers: implement our own error text function.
  Fix a few major nivision Java wrapper issues.
2015-01-14 07:53:48 -08:00
Brad Miller (WPI)
cce1bbc1f2 Merge "Update to point to Gazebo3.2 header location." 2015-01-14 07:41:18 -08:00
Peter Johnson
9fc79c41d1 nivision Java wrappers: implement our own error text function.
Change-Id: I0ec40c143b1c5a5fff8495643f83ad494ab32e57
2015-01-14 01:08:29 -08:00
Joe Ross
1dba916887 Add @file annotation so files are picked up in doxygen
Change-Id: Ie2e0bdd23d29dbf91600a25e3c0ae0228519b41a
2015-01-13 22:44:54 -08:00
Peter Johnson
ce7a56284f Fix a few major nivision Java wrapper issues.
- sliceByteBuffer() was not setting native order on the duplicated buffer.
  This caused all array-copyin functions to generate bad values.
- Correctly handle unsigned byte and unsigned short values.  These could
  read/write to bad locations previously.
- Implement custom version of imaqReadFile() to always pass in NULL for
  the colorTable.  Eventually a more-complete version should be written.

Also this works around a crash in imaqGetErrorText() by not calling it from
throwJavaException().  It's not clear why imaqGetErrorText() is crashing at
present (my best guess is there's still something fishy with multiple C++
lib versions getting loaded somehow), as this used to work.  Instead,
the exception now just gives the error code without the error message,
which is not user friendly but at least doesn't crash.  This will be fixed
in a future commit by creating our own version of imaqGetErrorText() based
on the information available in the header file.

Change-Id: I4d099e62ee41f8e2a50089806561be191cb5d9d7
2015-01-13 22:18:17 -08:00
Joe Ross
34d515debb Make sure Utility file is included in doxygen output.
Fixes http://www.chiefdelphi.com/forums/showpost.php?p=1427109&postcount=3

Change-Id: I716cd6be21980945c4a7846f5c32e50e040be3e9
2015-01-12 22:44:02 -08:00
Brad Miller (WPI)
cff103d15e Merge "Add encoder indexing in Java" 2015-01-12 12:48:39 -08:00
Brad Miller (WPI)
1b5cabc0d1 Merge "Add encoder indexing support in C++" 2015-01-12 12:48:23 -08:00
Brad Miller (WPI)
9fcfc5b3b7 Merge "Added the C++ implementation of Peter Johnson's UsbCamera. Rewrote CameraServer to use the new USBCamera implementation and get rid of some unnecessary copying of the entire image." 2015-01-12 10:45:57 -08:00
Brad Miller (WPI)
f181c70134 Merge "Add USBCamera class." 2015-01-12 10:45:41 -08:00
Brad Miller (WPI)
46c40da539 Merge "NIVision: Add dx functions." 2015-01-12 10:45:20 -08:00
Brad Miller (WPI)
1c05a982e1 Merge "Synchronize CANTalon documentation between languages." 2015-01-12 10:43:37 -08:00
Thomas Clark
ba7f56833b Add SetCANJaguarSyncGroup to RobotDrive
Manually specifying a sync group causes that value to be
passed in all of the speed controller Set() calls, and
CANJaguar::UpdateSyncGroup() to be called afterwards.

Change-Id: I365216463e3dd57b3fafb1bed898fb0da4b08793
2015-01-12 01:27:53 -05:00
Fredric Silberberg
7600473da6 Applied updated DIOJNI file from Ron Rossbach. Fixes artf3982.
Change-Id: Ibf20e833d7ab5b1ca80239ad5b8bb116c1624fca
2015-01-11 14:34:26 -05:00
Peter Johnson
9f04b79580 Fix Timer.hasPeriodPassed().
It was incorrectly using seconds instead of milliseconds.

Change-Id: Iecd2802c548caee4a5185f00a2b785143d6b1b16
2015-01-11 01:55:33 -08:00
Fredric Silberberg
2282a11a79 Added the C++ implementation of Peter Johnson's UsbCamera.
Rewrote CameraServer to use the new USBCamera implementation and get rid
of some unnecessary copying of the entire image.

Change-Id: I877750e990b6159c0aaf829df62b253a171fbada
2015-01-09 14:39:47 -05:00
Peter Johnson
1a2344bddc Add USBCamera class.
Change-Id: Ie7dfa679d9eeb7d55613ac1694a63ce70161d76c
2015-01-08 21:14:32 -08:00
Fred Silberberg (WPI)
ae9a7d19f1 Merge "Miscellaneous AnalogTrigger fixes" 2015-01-08 14:07:45 -08:00
Fred Silberberg (WPI)
e1141b9f27 Merge "Disable C optimize setting so better C++ doc is generated" 2015-01-08 13:47:10 -08:00
Fred Silberberg (WPI)
ff71aca572 Merge "Update docs to add missing channel numbers" 2015-01-08 13:44:32 -08:00
Fred Silberberg (WPI)
837671e95f Merge "Document that PDP must be address 0 and add/fix measurement units" 2015-01-08 13:43:36 -08:00
Fred Silberberg (WPI)
38c0308fc7 Merge "Correct path of sfx so that it can be launched from eclipse menu" 2015-01-08 13:42:43 -08: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
Thomas Clark
e13720bb94 Add encoder indexing in Java
Change-Id: I7d6a7da4301703aafab9d63ce67b6c88c62647c9
2015-01-08 00:23:32 -05:00
Joe Ross
0cf7d6f457 Update docs to add missing channel numbers
Change-Id: I2ffcc84c4801c5bd1062b74f36dd35e06b4834e6
2015-01-07 20:15:26 -08:00
Thomas Clark
a2dfffeddc Add encoder indexing support in C++
Java will be done tonight or tomorrow

Change-Id: I3a3287a197b6f071c261172eb8ec930693e8b3c7
2015-01-07 00:06:45 -05:00
Brad Miller
87e1df068c Fixed a null pointer exception in the mecanum drive sample program (Fixes artf3974)
Change-Id: I9518cd49ca815b9e1dc3ab63b7a4ee7034e5b444
2015-01-05 17:34:13 -05:00
Peter Johnson
f19c290fde NIVision: Add dx functions.
This includes getters, setters, video mode enumerate, and get image data.

These are necessary to improve the CameraServer code performance.

Also clean up unused return generation.

Change-Id: I3e7365e046d0ea9370586c5158138a5b07e20218
2015-01-05 01:11:49 -08:00
Joe Ross
5c342a8e1a Document that PDP must be address 0 and add/fix measurement units
Change-Id: I4864e3242d8a19ad3dfb7740f23632e2b939ca90
2015-01-02 16:08:19 -08:00
Joe Ross
f7117aac4b Correct path of sfx so that it can be launched from eclipse menu
Change-Id: I54f35d480afbe1d356ee5a55e8c04e62f94ee757
2015-01-02 15:41:04 -08:00
Alex Henning
05cd0627b2 Update to point to Gazebo3.2 header location.
Change-Id: Ifebb31a375e8b7a6136115748c3634757fb732b8
2015-01-02 18:34:35 -05:00
Joe Ross
2bc83bd80a Disable C optimize setting so better C++ doc is generated
Change-Id: I9cc98c83f47013e174835a6e418c49305ef360e5
2014-12-31 20:03:44 -08:00
Joe Ross
79fbbbc0dd Synchronize CANTalon documentation between languages.
Still lots of documentation needed.

Change-Id: I122d00fb0f4a9f57f3d479749ec02b2249856d2b
2014-12-31 19:18:52 -08:00
Brad Miller (WPI)
359a155915 Merge "Make 3 axis Accelerometers work in LiveWindow. Fixes artf3902." 2014-12-30 21:05:26 -08:00
Brad Miller
fb7f5e9de8 Add methods to retreive the FPGA index for counters and encoders and return the encoding type as an integer
Change-Id: Iaa4062ec124b968b27e7c812cc754032fcb354d2

Add methods to retrieve the FPGA index for counters and encoders and return the encoding type as an integer

Change-Id: If04dc291f39a9b331495d2b97a8b87d3ded71280
2014-12-30 23:23:04 -05:00
Joe Ross
7db63055f6 Make 3 axis Accelerometers work in LiveWindow. Fixes artf3902.
Change-Id: Iced12b3c408b0d7b8fe822a9f17a7992293bae7d
2014-12-30 19:59:25 -08:00
Thomas Clark (WPI)
b94341a23e Merge "Update nivision JNI generator to correctly gen Priv_ReadJPEGString_C." 2014-12-30 14:18:00 -08:00
Peter Johnson
afbd70d393 Update nivision JNI generator to correctly gen Priv_ReadJPEGString_C.
Change-Id: I206da9f3f660b4d567a3b535702b70e5f967b071
2014-12-30 13:24:30 -08:00
Joe Ross
ceccd95084 Add PDP to LiveWindow for C++
Change-Id: I45967739b81090e809b9e8f1c31ad7ff58554ec1
2014-12-30 12:31:35 -08:00
Brad Miller (WPI)
91b9812482 Merge "Add PDP LiveWindow code" 2014-12-30 11:57:28 -08:00
Brad Miller
0dbc40e515 Added missing .java file
Change-Id: I96aa235960bc59f435b7b1b55a29462f8f8052e4
2014-12-30 14:35:06 -05:00
Brad Miller
5ce89b3382 Added a Java AxisCamera sample program
Change-Id: Iba0eb9f06a91f577323cefd695f8dd601a96db97
2014-12-30 10:27:20 -05:00
Thomas Clark
8ccf3d9c14 Add AxisCamera Java class
The API is basically the same as the C++ one.

The JNI function for Priv_ReadJPEGString_C was manually renamed, since the
python scripts don't name the C++ functions correctly, causing an
UnsatisfiedLinkError at runtime. If further changes are made to the bindings,
either the method will have to be manually renamed again after the code is
regenerated, or the python scripts will have to be updated.

The old ignored edu.wpi.first.wpilibj.camera package was removed.

Change-Id: Icd37fc15c7bb41061568c3b2f580c6765cbf0300
2014-12-30 02:17:03 -05:00
Joe Ross
230fa2d168 Add PDP LiveWindow code
Change-Id: Ia3f4d8118d9068d021994fd2e5aca676d7dfa979
2014-12-29 21:10:21 -08:00
Joe Ross
d165f57e6e Clean up misc documentation
Change-Id: Ib0a4a7a389fb657d78d8b8bce4fcaeed67c3693d
2014-12-29 15:10:41 -08:00
Brad Miller (WPI)
2d15b6b03e Merge "Update Java install URL to the new URL with the java installer." 2014-12-29 13:38:47 -08:00
Brad Miller (WPI)
5d9baa44ee Merge changes Ie40db6c9,I0b5e752e
* changes:
  Write lib version from Java (fixes artf3788)
  Update Javadocs for Java (fixes artf3761 and artf3953)
2014-12-29 13:35:52 -08:00
Brad Miller (WPI)
822416d2f7 Merge "Write lib version from C++ (fixes artf3788)" 2014-12-29 13:35:04 -08:00
Brad Miller (WPI)
3fe726d851 Merge "Update docs for C++ (fixes artf3761 and artf3953)" 2014-12-29 13:26:13 -08:00
Kevin O'Connor
4c0b2c18ab Write lib version from Java (fixes artf3788)
Change-Id: Ie40db6c993d12aadb66b07fcfdc0a62b87a2e2ed
2014-12-29 16:06:11 -05:00
Kevin O'Connor
b4c5a3af77 Update Javadocs for Java (fixes artf3761 and artf3953)
Change-Id: I0b5e752e8f6377770163dcdc61aa79ad4c7cbe94
2014-12-29 16:02:07 -05:00
Kevin O'Connor
eddb0b20b0 Write lib version from C++ (fixes artf3788)
Change-Id: Ia11c2dab2050ffe4299d1ccd68c986573f0a05e3
2014-12-29 14:15:55 -05:00
Kevin O'Connor
6d8e782f53 Update docs for C++ (fixes artf3761 and artf3953)
Change-Id: Ic0c4ac8494cadff13461d9bb8b5943cd87619f0a
2014-12-29 14:09:37 -05:00
Joe Ross
0368322385 Update Camera templates to make C++ and Java more similar.
Include delays and template code from other examples to show how to use
these examples in a full robot program. Change Java example in example
finder to Simple Vision to match C++. Add comments about how to find cam
number and change default to cam0.

Change-Id: I85846ccfaf016c538a750b057a7fd766cdff9447
2014-12-29 13:48:11 -05:00
Joe Ross
19e05ff52b Update Java install URL to the new URL with the java installer.
Change-Id: Id554d0e2251d9efd7f06466bd2e093602911dc54
2014-12-28 20:23:48 -08:00
Brad Miller (WPI)
a6aef54ef4 Merge "Axis camera C++ example program" 2014-12-28 13:15:54 -08:00
Brad Miller
32f3bea465 Axis camera C++ example program
Change-Id: I60a14ce91fc09831b497ccdaaa7bb1bb26c8d945
2014-12-28 15:47:08 -05:00
Brad Miller (WPI)
9aacf5eb29 Merge "Artifact artf3925 : PCM : Can't find any user facing java/C++ API for getting/clearing PCM faults" 2014-12-28 10:58:12 -08:00
Thomas Clark
f3484686c9 Fix some typos in AxixCamera.cpp
There were some mistakes in comments left over from copying and pasting
comments from pre-2015 code, a couple formatting issues, and one getter
that wasn't implemented

Change-Id: I2e9d19be15445717cce175902c42e7e0932b56ad
2014-12-28 02:31:17 -05:00
Brad Miller (WPI)
b78b14bf5f Merge "Add AxisCamera C++ class" 2014-12-27 19:37:49 -08:00
Brad Miller (WPI)
c08dc98650 Merge "Add the 2014 C++ vision classes back in" 2014-12-27 19:37:29 -08:00
Brad Miller (WPI)
9fbffd88cb Merge "Change the java intermediate vision filename to match c++" 2014-12-27 18:38:11 -08:00
Brad Miller
6c15a3600a Change the java intermediate vision filename to match c++
Change-Id: Iadd173a6ea6089203103f0ca9c220a0b4ff5b286
2014-12-27 21:35:33 -05:00
Omar Zrien
548941dd99 Artifact artf3925 : PCM : Can't find any user facing java/C++ API for getting/clearing PCM faults
Change-Id: If5cb5b08f685158c5317233c4d9bc8e688138df7
2014-12-26 19:40:39 -05:00
Thomas Clark
9d8418c14e Add AxisCamera C++ class
Change-Id: I927334753027b519214d7541497f6c7f6d698163
2014-12-26 16:36:55 -05:00
Brad Miller (WPI)
326bf4fc9c Merge "Updates the InterrupatableSensorBase documentation to reflect the bug described in artf3623." 2014-12-26 13:28:20 -08:00
Fredric Silberberg
3c4a1d9a1a NIVision Forward Port
Ported the NIVision libraries from the old NIVision implementation to
the new autogenerated JNI bindings.

Change-Id: I7c68ca6abef1185d59a9787e9a269d720c825e2f
2014-12-24 16:39:46 -05:00
Fredric Silberberg
7687028269 Updates the InterrupatableSensorBase documentation to reflect the bug
described in artf3623.

Change-Id: I5f93dea65202cf30ba67c063eb8c90bedbfe43ae
2014-12-24 14:19:01 -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
Thomas Clark
53473e21be Add the 2014 C++ vision classes back in
Most of the old vision code still compiles with minimal changes. I haven't
tested it extensively, since the AxisCamera class isn't done, but it
should work, as it was barely modified.

Java bindings are still TODO, since they used some JNA stuff that probably
won't work now.

Change-Id: I8edf991410cb30b932379f277cee9d329ee35009
2014-12-23 17:42:14 -05:00
Brad Miller (WPI)
b4097fbd58 Merge "ClearStickyFaults() should not take a param, just clears sticky flags in a one shot manner. GetCompressorFault() => GetCompressorCurrentTooHighFault() There are now three compressor related faults so getters needed to be more verbose. New getters()... GetCompressorCurrentTooHighStickyFault GetCompressorShortedStickyFault GetCompressorShortedFault GetCompressorNotConnectedStickyFault GetCompressorNotConnectedFault" 2014-12-22 09:20:31 -08:00
Brad Miller (WPI)
3b72114555 Merge "Fix imports on vision examples so they compile. Fix Typo." 2014-12-22 09:16:42 -08:00
Brad Miller (WPI)
cc36454b90 Merge "Add C interface for CanTalonSRX::SetModeSelect(modeSelect, demand)." 2014-12-22 08:45:10 -08:00
Omar Zrien
aae20ddbff Artifact artf3945 : CANTalon : Motor Safety Object never feed
Change-Id: I6894399d0eb7c36ff698639862fa6ad045a70db8
2014-12-21 16:47:03 -05:00
Joe Ross
ffd9061766 Fix imports on vision examples so they compile. Fix Typo.
Change-Id: I1d6ebf47c824fa93d8a312882cddc778f340009e
2014-12-20 20:47:09 -08:00
Peter Johnson
9ffdea188b Add C interface for CanTalonSRX::SetModeSelect(modeSelect, demand).
Change-Id: Ic8305ec283ddb89afc60d6bc5226411b1f8cc18b
2014-12-20 12:46:05 -08:00
Patrick Plenefisch
46dc99a115 Adding SFX to tools zip
Change-Id: I09a04506682a5d0ccbe8e556285de587915f7383
2014-12-19 09:52:25 -08:00
Brad Miller (WPI)
91d714d2e9 Merge "Single line bug in CanTalonSRX::GetAnalogInVel(). return value was not being sign-extended." 2014-12-19 07:02:09 -08:00
Brad Miller (WPI)
9a28aaaa7c Merge "Change expected voltage on CAN tests" 2014-12-19 07:01:20 -08:00
Omar Zrien
96a76ba89e Single line bug in CanTalonSRX::GetAnalogInVel(). return value was not being sign-extended.
Change-Id: I44271726ece9aaa7b94f35e611f24a18dbb53825
2014-12-19 03:27:29 -05:00
Brad Miller
d26059a4fb Change expected voltage on CAN tests
Change-Id: I8c4533c7bcc81e7904d10792316382d4c01a840a
2014-12-18 21:22:31 -05:00
Brad Miller
ee0d835304 Remove an extra constructor from a bad merge
Change-Id: I0475eef143814ebf8ee4ec71a019872420442c4f
2014-12-18 18:28:15 -05:00
James Kuszmaul
6080a3b186 Duplicate of gerrit 739; changed method from public to private.
Change-Id: Ib15210ff0e5d8d99a649397499bab4737a1a489e
2014-12-18 16:08:46 -05:00
Omar Zrien
3d06a763a2 CanTalon : Adding config routines for limit switch normally open vs normally closed.
They already existed in Labview, so this will keep parity
New C++/Java funcs
ConfigFwdLimitSwitchNormallyOpen
ConfigRevLimitSwitchNormallyOpen

Change-Id: Ifd65ead827838e7158f7261c67adc3738c72eabf
2014-12-18 15:57:26 -05:00
Omar Zrien
e1480ec798 Noticed that if changeControlMode() is called every teleop loop, it causes motor to stutter as it enters and immediately leaves kDisabled.
A simple improvement was to only perform the disable-before-next-set strategy if the caller's request mode is not equal to the current mode.

To keep things simple, SetControlMode was renamed to private method ApplyControlMode so we can still invoke it from c'tor.
Then, the new impl'n of SetControlMode() just calls ApplyControlMode() when caller's request mode is different.  That takes care of direct-calls from team source, and indirect calls through enableControl().

Applied to both c++ and java.
Tested in java so far...

Change-Id: I934c06c5339d933918470659acd635e12eb4d113
2014-12-18 15:54:47 -05:00
Omar Zrien
a5d9ba412c Second pass through all the HAL functions and cpp/java API. Filled in some parity holes between java and cpp.
Java...
added setStatusFrameRateMs() to modify the frame rate for status frames
added missing func that already exists in c++
	isFwdLimitSwitchClosed()
	isRevLimitSwitchClosed()
	getNumberOfQuadIdxRises()
	getPinStateQuadA()
	getPinStateQuadB()
	getPinStateQuadIdx()
added getAnalogInRaw() that doesn't count overflows (for potentiometers).
added setStatusFrameRateMs() to modify the frame rate for status frames
added getBrakeEnableDuringNeutral()

C++...
added GetAnalogInRaw() that doesn't count overflows (for potentiometers).
added SetStatusFrameRateMs() to modify the frame rate for status frames
added GetBrakeEnableDuringNeutral()
added kLimitMode_SrxDisableSwitchInputs to CANSpeedController::LimitMode

Patch set 2: Joe Ross, fixed two javadoc errors

Change-Id: I0bf871e138953de60eeacb547dc359f2125b1327
2014-12-18 15:51:47 -05:00
Omar Zrien
2434515d41 artf3913
Increased wait delay to 4ms to cover worst case delays for solicted signal getters.
Specifically....
-Get firmware vers
-Get P,I,D,F gains
-Get IZone, Get CloseLoopRampRate
-Get IAccum (integral accumulator)

Change-Id: I313ea984832cce5182af8e5af5e775837fd54fdc
2014-12-18 15:49:29 -05:00
Brad Miller (WPI)
741618250b Merge "C++ CANTalon was missing SetIzone. Added SetIzone to match java, and made the set/get Izone integral." 2014-12-18 12:45:34 -08:00
Omar Zrien
8b8d7e77cd C++ CANTalon was missing SetIzone. Added SetIzone to match java, and made the set/get Izone integral.
Change-Id: I264ac8faaab0ebd208062923f6da2094e7e28b0a
2014-12-18 15:16:10 -05:00
Omar Zrien
c093a553ee changed variable type of closeLoopRampRate in setpid to double from int. It's represents V per sec since it calls setCloseLoopRampRate() underneath.
The other remaining closeloopramprate changes are also merged into this commit, so they may be redundant on gerrit.

Change-Id: Ic3108bb3669e487009b8f52412da3c2f44c42f6f
2014-12-18 15:11:39 -05:00
Fred Silberberg (WPI)
a1375e58cd Merge "Don't fail silently if DIO or PWM allocation fails" 2014-12-18 11:25:39 -08:00
Brad Miller (WPI)
15ff7f5038 Merge "Added the getButtons method back that reads all the buttons at the same time" 2014-12-18 10:33:11 -08:00
Brad Miller
c17ba98f72 Added the getButtons method back that reads all the buttons at the same time
Change-Id: I0f7f35b6a70f861911166de7be3802547ff4b2eb
2014-12-18 10:57:11 -05:00
Brad Miller (WPI)
dee755ab19 Merge "renamed param to match function name." 2014-12-18 07:06:20 -08:00
Brad Miller (WPI)
92c54f5f5d Merge "Image v23" 2014-12-17 15:10:36 -08:00
Fred Silberberg (WPI)
1fde00643f Merge "Fixed post4066 bug: Prestart() inaccessible." 2014-12-17 14:19:03 -08:00
Colby Skeggs
47443b4e1e Fixed post4066 bug: Prestart() inaccessible.
Change-Id: Ie179453b038458e77257c1b2d0acba7a4224f6c4
2014-12-17 13:39:54 -08:00
PetaroMitaro
f01e5b5570 fixed robotCommand in src
Change-Id: I591939301da4427e9139b824b016bb00d4b24485
2014-12-17 16:11:48 -05:00
Omar Zrien
198e2eed14 ClearStickyFaults() should not take a param, just clears sticky flags in a one shot manner.
GetCompressorFault() => GetCompressorCurrentTooHighFault()
	There are now three compressor related faults so getters needed to be more verbose.
New getters()...
	GetCompressorCurrentTooHighStickyFault
	GetCompressorShortedStickyFault
	GetCompressorShortedFault
	GetCompressorNotConnectedStickyFault
	GetCompressorNotConnectedFault

Fire and forget api added. Likely not used any time soon, BUT having it ready in HAL is harmless.
	FireOneShotSolenoid()
	SetOneShotDurationMs()

Solenoid fuse and compressor current too high fault bits were flipped in decoder

Change-Id: Ib47dddddd8e4cc22149de1b583968d99919b00af
2014-12-17 15:05:46 -05:00
Fredric Silberberg
22c4207553 Image v23
This updates the image version to version 23. It also moves the vision libraries
to follow the same conventions as the rest of the ni libraries.

Change-Id: I39e6fb3d8bbd2fd3141c2a43a5bae2fd15149003
2014-12-17 11:04:21 -05:00
Omar Zrien
bea9eb0efa renamed param to match function name.
Change-Id: I89c483691e0f99a6d20bed1271209a8141e71c0e
2014-12-16 20:05:30 -05:00
Brad Miller (WPI)
b72eb4b812 Merge "added Java vision example programs" 2014-12-16 11:43:02 -08:00
Dustin Spicuzza
0d8c454727 Don't fail silently if DIO or PWM allocation fails
Change-Id: I800c429507c3436c2d49561ba279700ad52569fe
2014-12-16 14:24:14 -05:00
PetaroMitaro
d61d491a02 added Java vision example programs
Change-Id: Icd99f53cc544c2609a333f0a86f4eac064d565bd
2014-12-16 11:14:37 -05:00
Brad Miller (WPI)
786e844a9f Merge "Fix ControllerPower 5v faults and add javadocs. Fixes artf3918." 2014-12-16 08:07:30 -08:00
Joe Ross
170b5860ee Fix javadoc compile errors that broke build.
Change-Id: Ie110743154f842dc3a2e756f7917e3aa131c87bd
2014-12-15 19:03:27 -08:00
PetaroMitaro
26c50ebe02 fixed java CameraServer
Change-Id: I34b8c1e2ff05199afdcab579f7ac7188fbe40fd7
2014-12-15 19:45:56 -05:00
Joe Ross
46c659d6b6 Enable Java 8 doclint checking (except for missing tags).
Change-Id: Iebfc7b99cbe43375f9cc067cca322244af44395b
2014-12-15 15:50:44 -08:00
Joe Ross
6fdd491081 Fix javadoc warnings.
Change-Id: I37049f234c6dfddc138121822525794d74e1b74c
2014-12-15 18:48:46 -05:00
Fred Silberberg (WPI)
fe4535dfa0 Merge "Resolved artf3579: robot can no longer be enabled until robotInit() finishes in IterativeRobot; similar options available by overriding prestart() for other base classes." 2014-12-15 15:39:21 -08:00
Brad Miller
636e2e13ad Wrong package declaration in camera server
Change-Id: Ia35d7f78d37aa0db51eb98901364fc228dabaa53
2014-12-15 13:40:25 -05:00
PetaroMitaro
d3f5b74668 added CameraServer.java
Change-Id: I4c41b560d879ffc6d8aa4681cad8f75297fe6cda

Fixed some issues with the camera server class

Change-Id: Ifda524b55f84053be004a404a2890905ded7b266
2014-12-15 11:00:49 -05:00
Brad Miller (WPI)
8116bbd15b Merge "Fix various bugs in nivision wrappers." 2014-12-15 05:42:07 -08:00
Peter Johnson
37052246a5 Fix various bugs in nivision wrappers.
- IMAQdx typedef overrides were being ignored, resulting in incorrect types
(e.g. IMAQdxSession was a long instead of an int).

- Allocated byte buffers byte order was not being set.

- imaqDispose was incorrectly named.

Change-Id: I5d038d45e82755615f0a5bb928defb98f557f93e
2014-12-15 02:44:07 -08:00
Joe Ross
a649d3b553 Fix ControllerPower 5v faults and add javadocs. Fixes artf3918.
5V faults was returning count of 3.3V faults. Copied javadocs from
C++.

Change-Id: I95b5c6ed1213ed235ecde11ef7e28ad05aabca6e
2014-12-14 16:55:22 -08:00
Omar Zrien
6a7e7cf611 Two param constructor added to C++/java CANTalon so caller can optionally specify the periodMs at which the talon control frame is sent.
The param is capped in the HAL C++ class to [1ms, 95ms] so that zero and negative periods are caped to 1ms, and so that caller can't pass an absurdly large value, which causes TALON is appear disabled.

Change-Id: I4207194be25a33bbd6ad281a75301ce6684659a5
2014-12-14 17:09:52 -05:00
Brad Miller (WPI)
77997e52fb Merge "added PDP methods to javalib" 2014-12-14 07:34:56 -08:00
Peter Johnson
e655072efc Synchronize access to buffered Joystick data.
Change-Id: Iae453872e89c7b6364d486a6bbc8b210c94defee
2014-12-14 10:22:18 -05:00
Brad Miller (WPI)
0427fc34c4 Merge "Check for negative button value and add missing newline." 2014-12-14 07:07:01 -08:00
Brad Miller (WPI)
e33d80be14 Merge "Add USB serial port option. Uses kUSB for ALSR3" 2014-12-14 07:05:52 -08:00
Brad Miller (WPI)
8381eee185 Merge "Wrap IMAQdx functions." 2014-12-14 06:57:00 -08: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
Omar Zrien
3a684d28b2 PWM timing change for SP and SRX. added 3us to outer bounds
Change-Id: Idce12f8290b5f5646d0d3b14c2a4414fba3120cd
2014-12-13 18:06:43 -05:00
Joe Ross
8786b242b2 Add USB serial port option. Uses kUSB for ALSR3
Change-Id: Ie43fa14fff6aa2f332d3ebacfba099984f8b4eb7
2014-12-13 11:52:27 -08:00
Peter Johnson
b29a4bebf2 Check for negative button value and add missing newline.
Change-Id: I407ab2e0090c22b08503c6de0460d6c1291fa07f
2014-12-13 02:37:35 -08:00
Peter Johnson
db0b421019 Wrap IMAQdx functions.
Quite a few functions aren't wrapped, but the most critical ones for
vision should be.

This also fixes a couple of issues:
- nivision_arm.ini (and imaqdx_arm.ini) are now generated without need for
  running the output on the RoboRIO.
- enum values are generated even if the value is not directly specified.
2014-12-13 00:32:20 -08:00
Kevin O'Connor
8efe998270 Make VictorSP and TalonSRX use correct bounds (give an extra 1us on min and max to ensure saturation). Fixes artf3914 for C++ and Java
Change-Id: Ia1a848e011615e4ff50b9f5ef6e1017764aeb904
2014-12-12 18:09:44 -05:00
Brad Miller (WPI)
ac60198842 Merge "Change vision defaults from "cam1" to cam0". Add some error reporting to Intermediate Vision example" 2014-12-12 14:01:26 -08:00
Brad Miller (WPI)
8a5ee71fd8 Merge "Make SetImaqError actually set the error" 2014-12-12 14:00:48 -08:00
Brad Miller (WPI)
af4ce1074a Merge "Image v22" 2014-12-12 12:49:11 -08:00
Dustin Spicuzza
7636041393 Don't use raw type for HALSetNewDataSem
Change-Id: Ifb6561a33b8e0c49072f9d9c00a2c9c8f4cc3fe3
2014-12-12 15:26:47 -05:00
Fredric Silberberg
745489fec7 Image v22
Added the v22 libraries and headers, and updated the minimum version number to version 22

Change-Id: Ie89dcde0212f164296c01e906b3ee9f332fb0b02
2014-12-12 15:15:45 -05:00
Kevin O'Connor
04f9ca4feb Change vision defaults from "cam1" to cam0". Add some error reporting to Intermediate Vision example
Change-Id: If0bb60611c6c5e6f2411ad5d0432c712b24efb24
2014-12-12 15:08:07 -05:00
Kevin O'Connor
ca5dfbe492 Make SetImaqError actually set the error
Change-Id: Ib714a2ff380319c60f42c859454441e4b69736e0
2014-12-12 14:36:27 -05:00
Brad Miller (WPI)
07619a37a0 Merge "Add C function wrappers for CanTalonSRX." 2014-12-12 05:12:07 -08:00
Brad Miller (WPI)
34d3d756ea Merge "Update javadoc for RobotDrive. Mecanum methods are implemented." 2014-12-12 05:11:06 -08:00
Brad Miller (WPI)
61a5fcce18 Merge "Squashed commit of the following:" 2014-12-12 05:10:34 -08:00
Brad Miller (WPI)
82c4563d34 Merge "getHALErrorMessage(): Add missing CTRE errors." 2014-12-12 05:06:37 -08:00
Peter Johnson
fa337bc747 Add C function wrappers for CanTalonSRX.
Also sync wpilibC++Devices copy of CanTalonSRX.h.

Change-Id: Ideabb0493230ab37563698d37b0360c590f4bbbb
2014-12-12 01:41:08 -08:00
Peter Johnson
8ae7e973f2 getHALErrorMessage(): Add missing CTRE errors.
Change-Id: Ifea0bd9c57d007744616c8808e8f4b1429199898
2014-12-12 00:11:50 -08:00
Peter Johnson
574f2e692a Java nivision: Add RawData to wrap void*.
Change-Id: I8a5dc2a208a39b3c0a26a1a9f906a5c19738628d
2014-12-11 22:19:08 -08:00
Kevin O'Connor
827341caa2 Squashed commit of the following:
commit c8543f97f77a0fef282b6598ae094ac75ea1dd22
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Thu Dec 11 16:41:08 2014 -0500

    Go back to buffering Joystick data.

    Change-Id: I0b4204bfc6e81f50dc4a01c58cfbe14a771e902f

commit a8ddee2a923749903aafe2a8121171b1d70750e7
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Fri Dec 5 17:38:58 2014 -0500

    Add error for using non-existent button 0. Fixes artf3870.

    Change-Id: I5b83cc7e3f0e4ab957279a877c76eeab6cb4b77b

Change-Id: Iae36482fd82176a9e09da1cfdfb69591411b2be2
2014-12-11 16:47:29 -05:00
Brad Miller (WPI)
dd272e6bcb Merge "Add Java nivision wrappers." 2014-12-11 10:00:38 -08:00
Joe Ross
3bdaa63a28 Update javadoc for RobotDrive. Mecanum methods are implemented.
Change-Id: Ia0e0fc62f8deae778eaa14789086ff47210796bb
2014-12-10 19:34:56 -08:00
Brad Miller (WPI)
41b393c210 Merge "Fixed minor issues in CANTalon. Fixes artf3884, 3885, 3887." 2014-12-10 05:53:56 -08:00
Brad Miller (WPI)
11cf860ecd Merge "Check and coerce rumble inputs to range of 0 - 1." 2014-12-10 05:31:55 -08:00
Brad Miller (WPI)
2168d2cb77 Merge "Require Jaguar version v108 or higher." 2014-12-09 14:21:10 -08:00
Peter Johnson
430722c4a3 Add Java nivision wrappers.
Only very basic testing performed to date.

The wrappers are still a bit incomplete (some structures and functions),
but are much more complete than the old ones.

Fixes artf3796.

Changes from initial changeset:
- Use // for comments.
- Add auto-generate notices to the beginning of each generated file.
- Include error number with error text in exception.
- Add free() function to structures.
- Fix out-of-order / non-array enums.
- Avoid duplicate calls to DisposedStruct.write() as .getAddress() does it.
- Refactor OpaqueStruct.
- Default to no null allowed except when overridden.
- Implement unowned return values.
- Add gen_struct_sizer script.

Change-Id: Ie0d102c45817ea8812d98fe4938d1a2255c61664
2014-12-09 00:48:57 -08:00
Joe Ross
497f38fe0e Check and coerce rumble inputs to range of 0 - 1.
Change-Id: Ic2ee301549e68e8cc56f91755521f456c8d0b5f7
2014-12-08 20:45:22 -08:00
James Kuszmaul
9f2dcdeab6 Fixed minor issues in CANTalon. Fixes artf3884, 3885, 3887.
Adds isEnabled and getSetpoint functions to CANTalon classes.
Sets m_controlEnabled=false in Java if changeControlMode(Disabled) is
called.

Change-Id: I08fd0972df22ad83c5578dd43dd6b3536f3b365b
2014-12-08 15:32:54 -05:00
PetaroMitaro
ac07142e4c added PDP methods to javalib
Change-Id: I60f3f615b01dba6e05721c78ba890859c7c9f027
2014-12-07 14:40:27 -05:00
Omar Zrien
19a7243bfc C++
Added Get/clear routine for IntegralAccumulator
Added missing status check in GetFirmwareVersion().  I don't expect this to affect anything.

JAVA
Renamed getRampRate to getCloseLoopRampRate in java to match the set routines in java, and match all routines in cpp.
Added GetFirmwareVersion to java to match cpp.
Added Get/clear routine for IntegralAccumulator
Retested all three routines in java.

Change-Id: I4ce9d9c87a379b9d4a76aae226e2072876218688
2014-12-07 11:19:14 -05:00
Brad Miller (WPI)
e3ac0b628c Merge "Fixed issue in setting CANTalon values." 2014-12-07 08:12:14 -08:00
James Kuszmaul
709a88ad68 Fixed issue in setting CANTalon values.
Used to be that if you called Set less than ~20 ms after changing the
mode, potentially unwanted behavior could ensue.

Change-Id: I27cb3603286d8fddd894649787d88c0446b00615
2014-12-07 10:52:32 -05:00
Omar Zrien
6b844b52ec comment change and added SetModeSelect(int modeSelect,int demand)
{

Change-Id: Iadac7ec70cf04cdc339771c4e919e93723cf62ec
2014-12-06 15:32:14 -05:00
Omar Zrien
9056edf932 commented out system.out.prints in CANTalon.set()
Change-Id: I85bc50c5f1ee7364395eb28d03e3845fe70649c0
2014-12-06 13:39:49 -05:00
Brad Miller (WPI)
ff2ea1287d Merge "Added C++ versions of the joystick query functions" 2014-12-05 17:29:55 -08:00
Brad Miller
b41690b387 Added C++ versions of the joystick query functions
Change-Id: I4acdb0a54493e633b2a7a9b265c3958a9ba163d1
2014-12-05 20:13:23 -05:00
Fred Silberberg (WPI)
ce8e65d41e Merge "Changed AnalogPotentiometer to use angle specification and rail voltage." 2014-12-05 16:58:04 -08:00
James Kuszmaul
66622b43e7 Fixed accidental confusion between seconds/milliseconds.
get* in CANTalon would've blocked for 1 sec instead of 1ms.

Change-Id: I1b6fce24329e2789053372181dbef5c28f4b747a
2014-12-05 19:16:53 -05:00
Omar Zrien
568b842c73 added setPosition to java. Great for zero-ing your relative sensors, also exists in cpp and LV.
Change-Id: Idfd8c0d2c568306cb6853803315a99b92992b388
2014-12-05 19:11:17 -05:00
Omar Zrien
4d142cdafa commented out throws in getP,getI,getD,getIzone, getRampRate.
Getting/setting these should be available all the time.

Change-Id: I8ecc6dc8847c946c63c83081a338c1bd70a656b5
2014-12-05 19:05:25 -05: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
4833316571 Added more Talon SRX documentation and PID samples.
Change-Id: I2b1326c11452c6895846ded1277dbf4d38a5222d
2014-12-05 17:21:36 -05:00
Brad Miller (WPI)
16f9db30a9 Merge "fixed bug artf3676 : Typing in a project name into the create command dialog in eclipse is broken" 2014-12-05 14:07:38 -08:00
PetaroMitaro
e092742f40 fixed bug artf3676 : Typing in a project name into the create command dialog in eclipse is broken
Change-Id: I591f1950624e280feb8f7cb262bce11783cb3ff1
2014-12-05 16:32:51 -05:00
PetaroMitaro
4f6fa2482b added joystick and driverstation counts for POV, buttons, and axis 2014-12-05 16:30:20 -05:00
Joe Ross
52408e2658 Add classes for VictorSP and TalonSRX PWM control.
Update documentation for existing classes to better describe what
they control

Change-Id: I1932b39a3f082c2eb57f41edb4ba55c73cce2938
2014-12-05 16:20:58 -05:00
Brad Miller (WPI)
d986ffac81 Merge "Java-Installer" 2014-12-05 13:02:54 -08:00
Fredric Silberberg
bc3c5447e7 Java-Installer
Added the java-installer to the tools-zip created by the plugins

Change-Id: Ibf03e3cf83c6c8a7663c4c55c0fb18623020039e
2014-12-05 16:02:15 -05:00
Brad Miller (WPI)
b125e6b40a Merge "Various getters and setters added to C++. usleep added to the getters that require a little time for solicted response (getPIDF, getIzone, and getFirmwareVers. Tested against the TALON SRX unit test originally written for CanTalonSrx HAL class." 2014-12-05 12:52:51 -08:00
Brad Miller (WPI)
88a043bda4 Merge "Change Periodic Status rate to 20ms. Jaguar firmware v109 fixes issue with periodic status sending." 2014-12-05 11:49:52 -08:00
Fred Silberberg (WPI)
c57d01af94 Merge "Add USB IP to deploy fallbacks and make fallbacks work." 2014-12-05 11:48:44 -08:00
Brad Miller (WPI)
6abde412c1 Merge "Image v20" 2014-12-05 11:42:40 -08:00
Brad Miller (WPI)
5e6cd0bf9e Merge "Implement Joystick Outputs and Rumble (fixes artf3807)" 2014-12-05 11:42:14 -08:00
Kevin O'Connor
ec03c3068d Add USB IP to deploy fallbacks and make fallbacks work.
Change-Id: Iae28b1bc883e65cd6f3a88858405d43815c7323b
2014-12-05 13:53:44 -05:00
Kevin O'Connor
45f3b76103 Fix off-by-one in button checking (fixes artf3861)
Change-Id: Ic3c33bf08417fef9c7432a19a419534b76cb8597
2014-12-05 12:26:05 -05:00
Kevin O'Connor
dac04cb4a2 Implement Joystick Outputs and Rumble (fixes artf3807)
Change-Id: I7e2fa3990f47b6c51ae498035878a29c02817c1b
2014-12-05 12:24:50 -05:00
Omar Zrien
7d026be264 Various getters and setters added to C++.
usleep added to the getters that require a little time for solicted response (getPIDF, getIzone, and getFirmwareVers.
Tested against the TALON SRX unit test originally written for CanTalonSrx HAL class.

Change-Id: I7e75b8b63ac9ffecb5d48b87cbe0e0ee05bbb5a2
2014-12-05 05:08:10 -05: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
Fredric Silberberg
cd01945908 Image v20
This adds the updated v20 libraries, and bumps the image version number
in the ant build scripts

Change-Id: I7c4431c167dd77763d4004709454767daefccbf0
2014-12-04 14:50:21 -05:00
Kevin O'Connor
36c53667cd Require Jaguar version v108 or higher.
Change-Id: Ib3a29a9182a776771db8b45bf82df3168e800277
2014-12-04 14:15:01 -05:00
Omar Zrien
ea610eb302 Getters for : AppliedThrotte, CloseLoopErr, Sensor/Ain/Enc Pos and Vel are now signed extended. Before this negative values would not de-serialize correctly.
There are some redundant TALON fixes in this particular commit, hopefully it handles ok on Jenkins.
Tested with Talon SRX Unit Test (firm 0.34)

Change-Id: I67db546fea2867cc6bd53ea26dc1cb61ac106490
2014-12-04 10:40:59 -05:00
Omar Zrien
d04476bb2f Wired close loop pos and vel to CANTalon::Set().
Did basic testing with close loop pos with talon slaving.

Change-Id: I880a29bff29a43d45b7af1be05e08b09063bf5d7
2014-12-04 10:40:59 -05:00
Kevin O'Connor
2bb0a32c15 Change Periodic Status rate to 20ms. Jaguar firmware v109 fixes issue with periodic status sending.
Change-Id: I9d5e1f8dce5f63ea97fc3d14de518980d299b5eb
2014-12-04 10:22:01 -05:00
Fredric Silberberg
cdbe80315f Image v19
This updates the hal headers and ni libraries for image v19. There were
very few changes this time around, only some network communications stuff.
Also updated the minimum version number in the build properties to the new
image version

Change-Id: Ic8cb384b92c54d938dec36df34fc609626b4cd5d
2014-12-03 18:19:25 -05:00
Brad Miller (WPI)
517e708fd8 Merge "Reorded network table init to avoid error and added disabledInit to template (artf3841, artf3840)" 2014-12-03 14:37:07 -08:00
Brad Miller
70825be690 Reorded network table init to avoid error and added disabledInit to template (artf3841, artf3840)
Change-Id: I5d1b1925f594e8019541033b20f70be003798d82
2014-12-03 17:36:26 -05:00
Brad Miller (WPI)
43532198c7 Merge "Artifact artf3520 : Need a PDP Clear Sticky Faults API" 2014-12-03 11:40:18 -08:00
Omar Zrien
4da9ebe1fd Artifact artf3520 : Need a PDP Clear Sticky Faults API
Artifact artf3740 : C++ and Java don't implement all PDP features

Change-Id: I6a519d16de412a4d477b1f9c57e9b405b2e1aae0
2014-12-03 14:36:43 -05:00
Brad Miller (WPI)
9479793e1d Merge "Open scope of several data fields to be able to extend CommandGroup" 2014-12-03 11:08:06 -08:00
Brad Miller (WPI)
20e9f499b0 Merge "Add hasPeriodPassed function to java, for parity with C++ Timer API" 2014-12-03 11:06:58 -08:00
Brad Miller
3d897cef58 Make robot programs deploy as lvuser for correct permissions (artf3860)
Change-Id: Ia996f9c1b910c5c9cf33ca8a4305acd8b141b40c
2014-12-03 11:40:35 -05:00
Brad Miller
fa229f2b13 Added java joystick message spam fix (artf3836)
Change-Id: I1e29aea00dc61574272f47fc3e1bcd98bd825d22
2014-12-03 11:05:49 -05:00
Brad Miller
b1056cf6d7 Prevented missing joystick messages from coming out more than once a seccond (fixes artf3836)
Change-Id: I78c0862b0d1c65951a01169db56dbe4eaddf8247
2014-12-03 07:42:48 -05:00
Dustin Spicuzza
8e707169a1 Add hasPeriodPassed function to java, for parity with C++ Timer API
Change-Id: I0f9a2714f20deaaccce610bd3eec58409eac3104
2014-11-30 23:51:01 -05:00
Joe Ross
47961c8b13 Open scope of several data fields to be able to extend CommandGroup
Change-Id: I81ac59dd45aa50ed3d8dc4fdd1d5807899af546b
2014-11-30 08:28:15 -08:00
Brad Miller (WPI)
b59f4141c4 Merge "Open scope for gyro methods. Fixes FirstForge artf1699." 2014-11-28 08:34:15 -08:00
Brad Miller (WPI)
d62d82b28b Merge "Feed motor safety when StopMotor is called. Fixes artf1687 on FirstForge." 2014-11-28 08:29:27 -08:00
Brad Miller
a9d30c0389 Fixed a typo in the SRX sample project to correct a variable name error
Change-Id: I68f9cf33062bf2ef5df88247af8a5ee470a28d77
2014-11-28 11:07:08 -05:00
Joe Ross
6e0c84d942 Feed motor safety when StopMotor is called. Fixes artf1687 on FirstForge.
Change-Id: I75c1b30c28193c1e5ed5f6fad502ab88ebc345fa
2014-11-27 11:31:00 -08:00
Joe Ross
bb8ea17acf Open scope for gyro methods. Fixes FirstForge artf1699.
Allows user to cause gyro calibration on demand. It also exposes
the AnalogInput object as protected to allow the user to extend
the gyro class and implement their own calibration.

Change-Id: Ib4206a9b16ce6d5e8e5ca9c28a14471974705a7f
2014-11-27 08:37:27 -08:00
Brad Miller (WPI)
c683e24aa9 Merge changes If51bf61d,Ia6f4997b
* changes:
  Added Omar's new CanTalonSRX code.
  Added nicer Java interface for Talon SRX -- throttle mode works.
2014-11-26 12:53:44 -08: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
Brad Miller (WPI)
f6de7bc961 Merge "Java debug launcher no longer waits for text marker to appear in console." 2014-11-26 12:05:27 -08:00
Brad Miller
c00d9f1523 Updated the names and descriptions for the c++ vision examples
Change-Id: I7f4e72ddd3e5f5ad20012ed81bd74fa5373e0ebd
2014-11-26 14:26:32 -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
Brad Miller (WPI)
3c8b31608c Merge "Use standard eclipse dialogs instead of Swing dialogs" 2014-11-26 10:32:19 -08:00
Brad Miller (WPI)
29f36b0eac Merge "Overwrite instead of append during version check. Fixes artf3818" 2014-11-26 09:10:17 -08:00
Brad Miller (WPI)
486885e8bf Merge changes Id7a97940,I6234fe06
* changes:
  Simulator makefiles: Set file extension based on platform
  Fix CMakeLists.txt to not be platform specific
2014-11-26 09:02:01 -08:00
Brad Miller (WPI)
020d97580a Merge "Fixed bug with SDFormat version changing." 2014-11-26 09:01:36 -08: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
Brad Miller (WPI)
f590cda8f9 Merge "match templates with robot builder." 2014-11-26 08:34:03 -08:00
Joe Ross
c98f54dbbc match templates with robot builder.
Change-Id: Iedb8b9efc58ca73bc654b119d5d1aed5b4eb5553
2014-11-26 07:41:56 -08:00
Brad Miller
81840b2c49 Add a getControlWord() call to the run thread in DS so that the program is kept alive
Change-Id: I8b86506f6125422e19e8b5ab23e3667bf808bdc4
2014-11-25 17:34:38 -05:00
Paul Malmsten
78ccb48fd3 Java debug launcher no longer waits for text marker to appear in console.
Lanucher immediately attempts to attach 20 times before giving up
and waits 2 seconds between attempts.

Change-Id: Ib0a70b8bbf5e90d5a733ea4e0d6b17d91b36db87
2014-11-23 15:34:52 -05:00
Kevin O'Connor
b9913d3e12 Overwrite instead of append during version check. Fixes artf3818
Change-Id: I05bde0997e13318c113a7f7ee228fa1c007bfd2f
2014-11-22 14:32:13 -05:00
Brad Miller (WPI)
56430ccd7c Merge "Pipe java program output through NetConsole" 2014-11-22 11:14:06 -08:00
Brad Miller (WPI)
d412584f16 Merge "Tried to improve reliability of a couple of unit tests." 2014-11-22 10:58:09 -08:00
Kevin O'Connor
364a3afad4 Pipe java program output through NetConsole
Change-Id: Ia012d73236d8e9c73cb53eb011f1b1f9d3c2ce83
2014-11-21 16:39:46 -05:00
Kevin O'Connor
97456f40f7 Don't buffer NetComms data and add IsDSAttached() check to C++ IsEnabled() method (fixes artf3747)
Change-Id: Idaa7edcd601147c39fb31b7966d9e975869dea87
2014-11-21 13:14:48 -05:00
Kevin O'Connor
7e5ed03d28 Check if Joystick Button exists when requested and pass 0 and warn if it doesn't
Change-Id: I2194859ef8b263f1a20aba52ec154fb0a1fc8078
2014-11-21 12:07:08 -05:00
Kevin O'Connor
14a1e6ae8e Get MatchTime from NetComms (fixes artf2538)
Change-Id: I7ea438ce4610087bceac696a958e3c1e3ead238a
2014-11-21 10:37:29 -05:00
Dustin Spicuzza
529f5b773f Use standard eclipse dialogs instead of Swing dialogs
- Swing dialog triggers freeze on Eclipse Luna on OSX 10.10

Change-Id: I9f59e884d19dd397502537286d2730be9eb0fec1
2014-11-20 23:39:54 -08: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
Alex Henning
e86312cd6f Fixed bug with SDFormat version changing.
Change-Id: Ia2d17fc60763678ad4971d108861988157537fc3
2014-11-20 16:07:00 -05:00
Brad Miller (WPI)
99dc3c90ed Merge "Removed the tail command" 2014-11-19 16:57:01 -08:00
Brad Miller
4ad8818a8a Added vision samples
Change-Id: Ieb482d072ae15817be40477f187f081c9f7fe19f
2014-11-19 19:39:35 -05:00
Fredric Silberberg
e4babbe4d6 Removed the tail command
The build scripts were still calling the tail command for following the log
file, even though we're now using netconsole. I've removed them.

Change-Id: I48498c1ef338f99130e447097081db92b394e1aa
2014-11-19 14:20:53 -05:00
Fred Silberberg (WPI)
9ec5164075 Merge "Handle cases where no DS is attached (initial m_controlWord, reportError, getAlliance and getLocation) fixes artf3778" 2014-11-19 10:42:32 -08:00
Fred Silberberg (WPI)
033e5f37b4 Merge "Add methods for checking Watchdog status, ds status, and brownout status" 2014-11-19 10:34:33 -08:00
Brad Miller (WPI)
e3d256e441 Merge "Change uint to int for channels on constructors which can take a single channel or single pointer to avoid ambiguous calls." 2014-11-19 10:28:34 -08:00
Kevin O'Connor
867e4080dc Change uint to int for channels on constructors which can take a single channel or single pointer to avoid ambiguous calls.
Change-Id: Id56f611675bf4dee8d31e152c4ee30112d07aac4
2014-11-19 11:40:43 -05:00
Kevin O'Connor
4be9732e9c Moves C++ global build properties to properties file to match Java.
Adds host reachability check and static IP fallback
Adds roboRIO Image check
Adds JRE check for Java

Change-Id: I07f3a0863bde0ebec7e7d8f48270e45758bddba5
2014-11-19 09:20:35 -05:00
Kevin O'Connor
cd29e1c32f Handle cases where no DS is attached (initial m_controlWord, reportError, getAlliance and getLocation) fixes artf3778
Change-Id: I6befa8e31e6762a101cd0a19641e558c955865b9
2014-11-18 16:54:06 -05:00
Kevin O'Connor
e73b3ed7b5 Add methods for checking Watchdog status, ds status, and brownout status
Change-Id: I723c87d0c50612cbffbb81b0e039efd0ef05fcd0
2014-11-18 15:56:59 -05:00
Dustin Spicuzza
d7a9794080 Simulator makefiles: Set file extension based on platform 2014-11-17 21:36:29 -08:00
Dustin Spicuzza
6234fe06f5 Fix CMakeLists.txt to not be platform specific
- Additionally, use the boost macro to properly find its library
2014-11-17 21:36:29 -08:00
Fred Silberberg (WPI)
c7a90b2ccc Merge "Fix write when used with long byte array." 2014-11-17 11:56:51 -08:00
Brad Miller (WPI)
e5443f0e78 Merge "Added in new headers and libraries for image version 18. This image contains a change to fix artf3773, which switched setDataSem to be a pthread_cond_t variable instead of a mutex. As a result, a few new HAL functions had to be exposed over JNI, specifically the functions for MultiWait." 2014-11-17 11:28:36 -08:00
Brad Miller (WPI)
0abe19a1ae Merge "Added support for launching a simulation friendly SmartDashboard." 2014-11-17 11:27:13 -08:00
Joe Ross
ccd64090bb Fix write when used with long byte array.
If the byte array allocated is longer then the count passed to the
write method, there will be a buffer overflow exception. Only put
the number of bytes specified by count.

Change-Id: I10ff48d5a5cf3f82c4e4e347326be033db300cdb
2014-11-16 16:40:49 -08:00
Fredric Silberberg
c6891fc034 Added in new headers and libraries for image version 18. This image contains a change to fix artf3773, which switched setDataSem to be a pthread_cond_t variable instead of a mutex. As a result, a few new HAL functions had to be exposed over JNI, specifically the functions for MultiWait.
Change-Id: I28be07c8102acb078440ee74ded46527328dd271
2014-11-16 17:01:44 -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
Brad Miller (WPI)
0670ff145f Merge "Using netconsole-host to start programs and get output directed to netconsole and the log file (fixes artf3777, artf3750)" 2014-11-15 16:27:27 -08:00
Brad Miller
655ade6436 Using netconsole-host to start programs and get output directed to netconsole and the log file (fixes artf3777, artf3750)
Change-Id: I904989f94132dd0031b5bec9cca2c8dee46070fe
2014-11-15 19:19:36 -05:00
Alex Henning
7cfa0d04d7 Added support for launching a simulation friendly SmartDashboard.
Change-Id: I84176cf522da20a74234f7cfb7b8a6aaca7d9248
2014-11-14 16:08:17 -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
Thomas Clark
c1f68eb2b0 Stick the CanTalonSrx code in, get it to compile
There's a CANTalon class, but it doesn' do anything yet

Change-Id: Ib397db6fc0376f9de95e5efc42a223700be3dbca
2014-11-14 15:21:12 -05:00
Brad Miller (WPI)
fb53eea6b2 Merge "[artf3749] Repaired undefined behavior in takeMultiWait." 2014-11-13 10:07:50 -08:00
Brad Miller
6c294e137b Increase timeout on network table test
Change-Id: I362209954a0abf09c1cd9a0421c2e67a15a58dc6
2014-11-13 09:49:30 -05:00
Brad Miller (WPI)
988defee16 Merge "Adds the new shared object libraries and headers for image version 17" 2014-11-13 06:39:03 -08:00
Brad Miller (WPI)
279ae1cd9d Merge "Removed remains of the old toolchain method." 2014-11-13 05:09:49 -08:00
Brad Miller (WPI)
49f6b90d15 Merge "Removed the timing option from Iterative Robot Template since it conflicted with its purpose (artf3751)" 2014-11-12 12:50:27 -08:00
Fredric Silberberg
6cd5eeab6f Adds the new shared object libraries and headers for image version 17 2014-11-12 15:43:58 -05:00
Brad Miller
c883c9e2fc Removed release configuration from template (fixes artf3688)
Change-Id: I4e6d1abc68f23f870911b7d871b5a835cc26afef
2014-11-12 15:41:55 -05:00
Alex Henning
54951c888f Removed remains of the old toolchain method.
Change-Id: Ib885730acdbb27707ce2caadadc3f9ce86fdd0ca
2014-11-12 15:27:29 -05:00
Brad Miller (WPI)
739508ff83 Merge "First cut at pulling in riolog plugin." 2014-11-12 12:22:04 -08:00
James Kuszmaul
f67849a9b1 [artf3749] Repaired undefined behavior in takeMultiWait.
Change-Id: Ieae7d602472f585db2a896cc76355a5c23d1d670
2014-11-12 15:21:53 -05:00
Brad Miller (WPI)
7c5b3c6286 Merge "Added the OutlineViewer to distribute with the plugins." 2014-11-12 11:47:29 -08:00
Brad Miller (WPI)
eb536ba340 Merge "Added default world files to examples." 2014-11-12 11:40:13 -08:00
Brad Miller (WPI)
19737ba443 Merge "Implement user API for roboRIO power methods (fixes artf3728 and artf3537)" 2014-11-12 06:35:48 -08:00
Brad Miller (WPI)
9f0bed2e6f Merge "Correct off-by-one error in DigOut PWM Gen B HAL code (fixes artf3705 for C++/Java)" 2014-11-12 06:32:07 -08:00
Brad Miller (WPI)
86e4c3b77c Merge "athena-deploy now calls the clean step to deal with a known ant issue where it does not detect changed constants. This addresses art3766." 2014-11-12 06:30:26 -08:00
Fred Silberberg (WPI)
e216d1abd6 Merge "Fix all the samples to build with the C++11/14 language features (constexpr)" 2014-11-11 13:52:33 -08:00
Alex Henning
20aeb5c6cc Added the OutlineViewer to distribute with the plugins.
Change-Id: I958050675782ad2c16e44fad4e272204e19d7d48
2014-11-11 16:39:10 -05:00
Kevin O'Connor
3ad31dd4d7 Implement user API for roboRIO power methods (fixes artf3728 and artf3537)
Change-Id: I7501a83dcdd81d45b298e044379ea4ac3670c742
2014-11-11 15:42:56 -05:00
Kevin O'Connor
4c5b8c8c46 Correct off-by-one error in DigOut PWM Gen B HAL code (fixes artf3705 for C++/Java)
Change-Id: I4cd65089690463b69cfe815bd078d744fb21ff0f
2014-11-11 15:40:48 -05:00
Fredric Silberberg
747cdc8a58 Updated an incorrect voltage constant for the 5V input rail, and added
parenthesis to make the order of operations explicit.
Fix for artf3728

Change-Id: I2dfbad03980c4154cf253fbb06792b8502fcca02
2014-11-11 15:29:20 -05:00
Brad Miller
c3c7baa15c Removed the timing option from Iterative Robot Template since it conflicted with its purpose (artf3751) 2014-11-11 14:49:05 -05:00
Fredric Silberberg
2fdb7c8eba athena-deploy now calls the clean step to deal with a known ant issue where it does not detect changed constants. This addresses art3766.
Change-Id: I0bead9f585c610bb10faef3494c0b3358a79447f
2014-11-11 14:16:43 -05:00
Brad Miller
1d0a6b8ace Fix all the samples to build with the C++11/14 language features (constexpr) 2014-11-11 09:15:46 -05:00
Alex Henning
08fdf45f6e Added default world files to examples.
This saves a step and prevents one of the biggest user errors with the
pacgoat example.

Change-Id: Icdceb1da37c4b456f1a34daa815f3bbe2a47e18e
2014-11-09 14:26:23 -05:00
Paul Malmsten
7338471194 First cut at pulling in riolog plugin.
Plugin was retrieved from https://github.com/mstoeckl/riolog.git with minimal changes to
make it compile.

Change-Id: I340d77c69fe7598595deeaba8d4cd9414b971399
2014-11-08 12:56:45 -05:00
Brad Miller (WPI)
da0cc0c83f Merge "Fixes for 0 based joysticks and joystick axes in simulation." 2014-11-07 08:33:33 -08:00
Brad Miller (WPI)
6e0637e771 Merge "Upped the limits for the output on some PID tests." 2014-11-07 08:31:59 -08:00
Brad Miller (WPI)
8d49d8255b Merge "Move SerialPort to HAL and add SerialPort support for Java Squashed commit of the following:" 2014-11-07 08:27:36 -08:00
Alex Henning
3b53f84c8f Fixes for 0 based joysticks and joystick axes in simulation.
Change-Id: I67608450d0818b38f6d5b5c709190433f2dc5cf5
2014-11-06 19:00:02 -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
Kevin O'Connor
18de3aebdd Make sure the whole JVM exits if an exception is thrown. This prevents the DS thread, NT thread or any additional user thread from keeping the program alive when the main thread exits (fixes artf3743)
Change-Id: Ide89a3abe57171553af0a8c68077391b9a91fd29
2014-11-05 15:51:15 -05:00
Brad Miller (WPI)
de5e5ab405 Merge "[artf3709] Fixed PIDController loop timing." 2014-11-05 11:51:04 -08:00
Kevin O'Connor
6b6e5d9530 Move SerialPort to HAL and add SerialPort support for Java
Squashed commit of the following:

commit 4359262e2fef69b1646e3d76641fe622a78dfd89
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Wed Oct 29 13:43:12 2014 -0400

    Add SerialPort to JNI and modify Java SerialPort to use it.

    Change-Id: Id3e6fa538a50e6a96274d8fb1be546dc396fc9c6

commit 114b192388c2fb01745cb3d5ad83612e9d66ea83
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Oct 28 15:46:06 2014 -0400

    Move Serial port handling to HAL and define serial errors

    Change-Id: I4cc73b64d71aafacb410bce080cb29e5fdf565a3

Change-Id: I35b729ad502137ee4c877a415d78007861991e31
2014-11-05 13:58:14 -05:00
Kevin O'Connor
fa20e6ca4f Check for fatal interrupt status on multiple interrupt methods to avoid hanging program (fixes artf3602)
Change-Id: I31cb499fd1641deec26001b719fd0a6f07d20692
2014-11-05 13:19:41 -05:00
Brad Miller (WPI)
e56aa87af4 Merge "Change Talon to use 1x update rate (fixes artf3733)" 2014-11-05 09:55:39 -08:00
Brad Miller (WPI)
63bb8e1f32 Merge "Remove unimplemented sendErrorStreamToDriverStation method (fixes artf3617)" 2014-11-05 08:44:48 -08:00
Brad Miller (WPI)
c1e63acc14 Merge "Use ByteBuffer for conversion from raw sensor bytes to Java types (fixes artf2673)" 2014-11-05 08:44:20 -08:00
Brad Miller (WPI)
68ba9bfeae Merge "Detect projects which are duplicates on Windows due to casing (fixes artf3487)." 2014-11-05 07:48:39 -08:00
Brad Miller (WPI)
aa643d8ba7 Merge "Update Interrupt Javadocs (fixes artf3492 and artf3602)" 2014-11-05 07:46:26 -08:00
Brad Miller (WPI)
1f8a3d5bf3 Merge "DigitalInputs are now automatically added the LiveWindow in both C++ and Java" 2014-11-05 07:43:52 -08:00
Brad Miller (WPI)
2fa04c1750 Merge "Don't raise exception for Joystick axis/POV out of active range. Shorten error message and change to Warning (filtered by DS by default)" 2014-11-05 07:17:09 -08:00
Brad Miller (WPI)
cd3db9631e Merge "Move user program to home\lvuser based on comments from Joe" 2014-11-05 05:23:22 -08:00
Brad Miller (WPI)
8ccb99d87c Merge "Added ignore support for intellij" 2014-11-04 13:49:24 -08:00
Brad Miller (WPI)
b14ca08474 Merge "[artf3717] Added isEnabled to Teleop Loops in Samples." 2014-11-04 13:48:46 -08:00
Kevin O'Connor
b898cec901 Change Talon to use 1x update rate (fixes artf3733)
Change-Id: I592147100058504c919bdd2f31d56580503f5bc2
2014-10-31 18:52:28 -04:00
James Kuszmaul
687e2c6711 [artf3709] Fixed PIDController loop timing.
For C++: The PIDController loop had been changed to run an infinite loop
with a Wait(period) rather than using the Notifier class to schedule
exact runs of the CallCalculate command. Essentially a revert to bb50f4b134,
accounting for more recent changes.

For Java: A similar problem had developed; essentially, a TimerTask used
to be used and at some point was changed to a Runnable. The Runnable had
an infinite loop with a Wait; TimerTask actually schedules things reasonably
(although it is not strictly real-time). Also, there were some
Thread-safety issues which I fixed.

Although Java and C++ had similar issues, they seem to have developed
these issues independently.

Changes have been tested on the GearsBot in both C++ and Java (and it
    works).

Change-Id: I478cb8bfd77cd2d031f8e343d0b8193b602dcc2a
2014-10-31 17:01:44 -04:00
Kevin O'Connor
594d0d8029 Use ByteBuffer for conversion from raw sensor bytes to Java types (fixes artf2673)
Change-Id: Ic22c6569614a457cc4156541d79ed4ce05db8273
2014-10-31 14:03:20 -04:00
Fredric Silberberg
0f825b7179 Added ignore support for intellij
Change-Id: Ia55578c89fadb92d5bd0877d296305081ece0358
2014-10-30 14:48:31 -04:00
Fredric Silberberg
345ceafa0d DigitalInputs are now automatically added the LiveWindow in both C++ and Java
Change-Id: Ic3520737841f2901becfdc99e3900e4e63da8822
2014-10-30 14:46:59 -04:00
Kevin O'Connor
b030be68d3 Detect projects which are duplicates on Windows due to casing (fixes artf3487).
Change-Id: I5f1ecc657fea226ea0eb1429a0f394a3345264db
2014-10-29 16:30:24 -04:00
Kevin O'Connor
fba155804e Update Interrupt Javadocs (fixes artf3492 and artf3602)
Change-Id: Iad66841266a2d5ff606f7e27e90f7c975143245c
2014-10-29 15:23:55 -04:00
Kevin O'Connor
97f954aef6 Remove unimplemented sendErrorStreamToDriverStation method (fixes artf3617)
Change-Id: I35dc863b3318e22e503d95273812ab25a1ae0a70
2014-10-29 14:30:22 -04:00
Brad Miller (WPI)
80194e9809 Merge "Added message to notify when simulation is unsupported." 2014-10-28 13:48:04 -07:00
James Kuszmaul
767686ae2e [artf3717] Added isEnabled to Teleop Loops in Samples.
Anywhere in the sample programs where there was just a
isOperatorControl() in the while loop for Teleop, added an "&&
isEnabled()".

Change-Id: Ib81e8bab79923e262c314a073a591855cbf06846
2014-10-27 15:55:47 -04:00
Peter Johnson
7f30b6bff4 Don't raise exception for Joystick axis/POV out of active range. Shorten error message and change to Warning (filtered by DS by default)
Return 0.0 in this case (as it can be commonly caused by
the joystick not being plugged in).

Still raise exception (Java) / set error (C++) if the asked-for axis/POV
is higher than kMaxJoystickAxes/kMaxJoystickPOVs.

See artf3673.

Change-Id: I4847c5badb358ed08f01170724ec1446af2e4ab9
2014-10-27 15:36:48 -04:00
Kevin O'Connor
8c395ca292 Move user program to home\lvuser based on comments from Joe
Change-Id: I289cfb4603a4ead6641161191129cb5ca0ea9858
2014-10-27 13:43:07 -04:00
Brad Miller (WPI)
5b2520c35f Merge "Fixed building of the frcsim-libwpilibsim-cpp deb." 2014-10-27 09:40:22 -07:00
Alex Henning
fa8d7b843c Fixed building of the frcsim-libwpilibsim-cpp deb.
There is still a bug where the examples have been updated to use 0 based
joysticks, but the simulation libraries have not been updated. I'll fix
that as a separate commit focused on fixing the joystick APIs.

Change-Id: I3b358e67b7fa18b30d1fd2b53098659cfefdfd76
2014-10-26 20:43:50 -04:00
Brad Miller (WPI)
93100c0e67 Merge "Increases the runtime of the PID test to improve stability." 2014-10-24 14:01:04 -07:00
Brad Miller (WPI)
b80565d065 Merge "Decreases the amount of console spam during tests." 2014-10-24 14:00:25 -07: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
Brad Miller (WPI)
18bdb7fdec Merge "Added C++ Encoder samples to Eclipse Plugin." 2014-10-24 13:15:43 -07:00
Brad Miller (WPI)
f6e8db50f8 Merge "Fixed New Project Wizard to have a radio option always selected" 2014-10-24 13:13:10 -07:00
James Kuszmaul
20c60a5fe6 Added C++ Encoder samples to Eclipse Plugin.
Reads values from quadrature encoder and displays them on the
SmartDashbord.

Also added Encoder with Motor Control example, which is identical to the
Motor Control sample but displays an encoder value on the
SmartDashboard.
2014-10-24 16:01:11 -04:00
Brad Miller (WPI)
66b7a8b66e Merge "Use either DO PWM A or B not A and B and update javadoc to reflect 6 generators (artf3698)" 2014-10-24 12:10:42 -07:00
Peter Johnson
8ebf88b741 Java DriverStation.InTest: Set correct flag.
Change-Id: I99aa58f4fa4df13990cc310a0f21e9a9fd817eb0
2014-10-24 14:19:30 -04:00
Brad Miller (WPI)
b85b0c8eb2 Merge "Keep Notifier firing after FPGA rollover (fixes artf3582), simulation may still have an issue with counter rollover" 2014-10-24 11:07:09 -07:00
Peter Johnson
c58fde19f9 Increase the number of joystick ports to 6.
Change-Id: I18a29a3a8c8f38b3b21c3e76eead3526b9d02875
2014-10-24 13:59:59 -04:00
Kevin O'Connor
003dc0dc2b Pass errors to DS in C++ and Java
Squashed commit of the following:

commit f317b3522e312cf7e7bb9eb0494f2f96a7f6363c
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Mon Oct 20 17:15:46 2014 -0400

    Send unhandled exceptions back to the DS.

    Change-Id: I0e658fdb6d43593ee20457f20f71f4f4cd2d21c3

commit f834ef8c791945697ad483c27b4167eb917ac242
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Mon Oct 20 16:05:24 2014 -0400

    Add StackTrace to Java errors

    Change-Id: I83b162afcc5f294703705770fbcd8623b0895539

commit 02e040b0c79067ce046ada29e26004e0460fceb0
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Mon Oct 20 15:07:44 2014 -0400

    HAL Errors to DS in Java

    Change-Id: I5fb51e4066bbc26ea59ca513c03c5ec5ace98831

commit 03775ddc42b129c27fdf403f17f0796009311c3c
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Mon Oct 20 13:38:18 2014 -0400

    Update AnalogInput to report errors for getting and setting sample rate

    Change-Id: I00eb78f52fc5b17a60bc84456f0ec9842cc40ef7

commit 4c10cb79612ae81e3cbb6bd4d6da8cf3b8955821
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Mon Oct 20 11:46:03 2014 -0400

    Define errors in HAL

    Change-Id: I96595472e42ba61f0f3d0da17caf01a748d0422a

commit 56cb5dcd93e5e849a016f63ac9d0dc245a23eb2b
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Fri Oct 17 10:59:29 2014 -0400

    Throttle errors (1 report per second per error code) and fix issue with GetTime conflicting with GetTime from Timer.h/Timer.cpp

    Change-Id: Ibe4dc2e400fc4671b240b876a46959256ea65ad7

commit 71c78826e548682ecd0c1548255f8a6552cece32
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Thu Oct 16 16:41:04 2014 -0400

    Feed errors to DS from C++

    Change-Id: I009a7798499fd93e9fdd976ff00aa74c0bd094ae

commit 81030c6cee7f18a5ddf0e95c4e402a6cf7b5de6c
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Thu Oct 16 16:40:50 2014 -0400

    Don't try to de-mangle lines without any symbols in them

    Change-Id: Icea02494b68f2ec9116d6cbf20a35a3a132234f8

Change-Id: If7717025b03914183736ccd95da5c9d49819a6f3
2014-10-24 13:23:17 -04:00
Peter Johnson
26419ec209 Don't use "final" in command-based template RobotMap.
While final would seem to make sense for RobotMap values (as these values
should be constant at runtime), RobotMap values are often not truly final
in the Java sense of the word, as on real robots they often change between
project builds (e.g. they often can and will be changed by teams as wiring
changes on the physical robot).

Unfortunately, incremental compilation in Eclipse follows Java rules, and
doesn't track cross-module dependencies on final variable values, resulting
in very non-intuitive behavior when a final variable's value is changed:
other (unchanged) Java modules using the final variable are NOT recompiled
(as is necessary to pick up the new value), and there is no easy way to
force recompilation of every Java file in the project.

Change-Id: I75b13aaf4f4a687698f853d5e11eef5f904716ea
2014-10-24 00:07:30 -07:00
Brad Miller (WPI)
3834393698 Merge "Improves the general stability of the CANJaguarDefault tests" 2014-10-23 13:27:16 -07:00
Alex Henning
97be9765cd Changed the version to include time to fix issue with replacing.
Change-Id: I80654640207a8200354f4961c476a4f4fcf5c5a6
2014-10-23 13:55:45 -04:00
Alex Henning
0881ac0b24 Fixed issue where plugins don't show up on some installs.
Change-Id: I848930dc5516a36771e46c8d0e550763821bc057
2014-10-23 13:55:44 -04:00
Brad Miller (WPI)
1b7e5970f9 Merge "Added C++ sample for CAN monitoring of PDP." 2014-10-23 10:46:45 -07: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
Brad Miller (WPI)
fc34b9b803 Merge "Aggregate javadocs and use JavaFinal docs when building plugins (fixes artf3533)" 2014-10-23 09:06:29 -07:00
James Kuszmaul
9af070a4af Added C++ sample for CAN monitoring of PDP.
Uses CAN to monitor PDP and displays values on the SmartDashboard.

Change-Id: Icb06fec0b65ce02b7c396e7d4e379cee0d959095
2014-10-23 10:07:53 -04:00
Jonathan Leitschuh
93925bc025 Fixes the GyroTest
Change-Id: Ia72fcb0533ea4e91b5f7e469e1a0b367eebda3b7
2014-10-22 18:39:27 -04:00
Jonathan Leitschuh
132804a4ce Updates the test scripts to prevent a race time condition
The two run scripts now take an extra optional parameter [-m] that overrides the giving and taking of the mutex and lets the user handle it. This is used by the jenkins script to prevent other users from jumping in at any time while the script is running.

Change-Id: Iffcbeb7ce677b173b1e9b7d9953d5a35b2643436
2014-10-22 16:23:26 -04:00
Brad Miller (WPI)
9e6d683671 Merge "Increases tolerances for the PID tests" 2014-10-22 11:36:36 -07: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
Brad Miller (WPI)
213e73c43e Merge "v16 Image" 2014-10-22 10:46:43 -07:00
Brad Miller (WPI)
455654a95b Merge "Fix joystick issues [artf3707]" 2014-10-22 10:44:55 -07:00
Joe Ross
261b1857cd make getControlMode public. Was public in 2014.
Change-Id: I158f41e66407d47c50e3d632661a040c8cd68d14
2014-10-22 13:36:38 -04:00
Kevin O'Connor
f3fe64a60e Keep Notifier firing after FPGA rollover (fixes artf3582), simulation may still have an issue with counter rollover
Change-Id: I11d86bd65c1e0db123d93aa143b8c8c3b823737a
2014-10-22 13:36:17 -04:00
Brad Miller (WPI)
f108853e1b Merge "Added sample programs for Solenoids and Relays." 2014-10-22 09:00:59 -07:00
Thomas Clark
a56c0eb4af Fix joystick issues [artf3707]
Make axes and POVs 0-based like they are on the DS

Correct default joystick axis numbers to be 0-based

Fix array dimensions for joystick axis values

Increase the number of joystick ports to the maximum 6 that the DS supports

Change-Id: I16d0e6e636188cbdd9cd7bfa0453a62466a55093
2014-10-22 11:49:55 -04:00
Jonathan Leitschuh
8c01e9065a Fixes a bug with the test stand launch script
The Test Stand Serve launch script now runs the correct command.

Change-Id: I790b55fc24284665ec5f32effdd6fbc66c2d334a
2014-10-22 11:23:49 -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
Brad Miller (WPI)
53255a764f Merge "Relay: Allow "On" state to be set via SmartDashboard." 2014-10-22 07:30:29 -07:00
James Kuszmaul
3abd352be9 Added sample programs for Solenoids and Relays.
Added a sample program to the eclipse plugin which uses joystick buttons
in Operator Control mode in order to control the output of a single and
a double solenoid.
Also added a sample program which uses joystick buttons to control a
spike/Relay.

Bonus: The title on the window that you get when you are opening a sample in
C++ said "Java" instead of "C++". Fixed now.

Change-Id: I0d01c23003d1fba2dbb08cbe6977ec886d97a22f
2014-10-22 09:34:52 -04:00
Thomas Clark
70be534fe0 v16 Image
Change-Id: I054ce8fdeb904ef00e88ce9e3133a381da396b42
2014-10-21 16:41:24 -04:00
Jonathan Leitschuh
e677d52a21 Increases the allowed runtime for two network tables tests
This test has been causing the build system to fail to build occasionally
Tested 15 times with 0% failure rate

Change-Id: I8d335b368d95060630b1cd47926e5ba0898e78b7
2014-10-21 15:48:56 -04:00
Kevin O'Connor
62790c0f47 Use either DO PWM A or B not A and B and update javadoc to reflect 6 generators (artf3698)
Change-Id: Id8d29831c97accd54dd359c6f20a447d8eed59db
2014-10-21 14:33:02 -04:00
Brad Miller (WPI)
cd75dc71e8 Merge "Recover from signals in Wait() [artf3495]" 2014-10-21 08:46:54 -07:00
Brad Miller (WPI)
a381b60e32 Merge "Added sample program for Motor Controller." 2014-10-21 07:12:11 -07:00
James Kuszmaul
311a690262 Added sample program for Motor Controller.
Sample uses joystick output to directly control a motor controller.
Added to C++ eclipse plugin with in same way as Java MotorControl
sample.

Change-Id: I7ce36b8000fbeb94e637a820f82399462b1416e5
2014-10-21 10:03:02 -04:00
Brad Miller (WPI)
a2f015c25b Merge "Dynamically generates tools zip file." 2014-10-20 15:20:46 -07:00
Alex Henning
5c26b37d3b Dynamically generates tools zip file.
Currently the file only includes RobotBuilder and
SmartDashboard. Additionally, testing is necessary too make sure that
the unzipping is working properly.

Change-Id: I21c0ebef592891c7d27016db401ec69c35a62acd
2014-10-20 15:47:30 -04:00
Thomas Clark
8dba364bef Recover from signals in Wait() [artf3495]
Change-Id: I6e7e404b916d9fc35524998369272bc30131bb7b
2014-10-20 15:01:35 -04:00
Brad Miller (WPI)
76f9b3bbc2 Merge "Adding stdint.h to the Joystick.h makes the indexer work (fixes artf3505)" 2014-10-20 07:47:31 -07:00
Brad Miller (WPI)
bbeb0084a2 Merge "Set RobotBase instance in constructor [artf3652]" 2014-10-20 07:46:48 -07:00
Thomas Clark
e51c3daf00 Set RobotBase instance in constructor [artf3652]
Also, remove the dead code that appeared to set the singleton instance,
but isn't actually run.

Change-Id: I1967026295b97f0c5e64256f2c701569da2a2091
2014-10-20 10:41:01 -04:00
Brad Miller
dc89ec673a Adding stdint.h to the Joystick.h makes the indexer work (fixes artf3505)
Change-Id: I6fee6d8ae0089fd4ffc2f043270bc719058f4b2d
2014-10-19 20:16:51 -04:00
Joe Ross
fc7c015823 Fix warnings for javadocs
Change-Id: I818c2086d69eff098543b4d5a554ba9d703e01e8
2014-10-19 16:48:16 -07:00
Thomas Clark (WPI)
c52e29432c Merge "make preferences check for [ and ] in key" 2014-10-19 14:57:42 -07:00
Brad Miller (WPI)
53d50f470a Merge "updted licesne strings in eclipse plugins" 2014-10-19 14:53:59 -07:00
Brad Miller (WPI)
ca303e0169 Merge "fixed template on checkedin java examples" 2014-10-19 14:52:31 -07:00
Joe Ross
042a1dbc82 make preferences check for [ and ] in key
Change-Id: If60e87f1f141678ba261c7bf77aa26a12aa97a8b
2014-10-19 17:52:15 -04:00
Brad Miller (WPI)
3c91de56d3 Merge "Fix segfault in DIO PWM generators [artf3653]" 2014-10-19 14:49:10 -07:00
Thomas Clark (WPI)
0c2f3c19cc Merge "Fix Java Joystick.getPOV()." 2014-10-19 14:41:50 -07:00
Thomas Clark
023d20abc1 Fix segfault in DIO PWM generators [artf3653]
The HAL PWM generator functions tried to interpret ID numbers as int pointers
instead of ints, leading to segfaults whenever PWM generators were used.

Change-Id: I51d50162a8fc04a04795e7ca20a23de26b9e848d
2014-10-19 16:27:47 -04:00
Alex Henning
5c702edd8f Support for pushing NetworkTables (java) to the maven repository.
Change-Id: I1b5af460aa9aff078328506351f7434227ec43ad
2014-10-18 20:53:50 -04:00
Brad Miller (WPI)
d90bbc195c Merge "Removed vestigial POM file from NetworkTables" 2014-10-18 15:38:00 -07:00
Peter Johnson
3365d0dc18 Fix Java Joystick.getPOV().
It subtracts 1 from pov; this should not be done here as it is done in the
DriverStation class.

Change-Id: I7fba2c87fc4dcb2f693201346b0d935662a49678
2014-10-18 09:22:58 -07:00
Peter Johnson
615d62a219 Relay: Allow "On" state to be set via SmartDashboard.
Change-Id: I350be338045e6d27aaaea2740695930dcdd202fa
2014-10-18 08:24:11 -07:00
Alex Henning
78988584e3 Removed vestigial POM file from NetworkTables
Flattened networktables/java/Athena into networktables/java since Athena
+ Desktop builds are identical and we dropped Azalea support.

Change-Id: If965891c163394fed3bd1a3570b1f923cdd6fd56
2014-10-17 21:38:40 -04:00
Brad Miller (WPI)
294e224fcd Merge "allow installation on eclipse 3.8 (ubuntu 14.04)" 2014-10-17 14:12:55 -07:00
Brad Miller (WPI)
436c92961b Merge "Add new joystick features" 2014-10-17 14:08:49 -07:00
Brad Miller (WPI)
341abbfaaf Merge "Run the scheduler in disabled (fixes artf3631)" 2014-10-17 13:50:35 -07:00
Brad Miller (WPI)
eab34bbb88 Merge "Add SD methods with default values to match Java (fixes artf3648)" 2014-10-17 13:47:47 -07:00
Brad Miller (WPI)
5db5320793 Merge "Add method to get Device ID to Can Jaguar (fixes artf3613)" 2014-10-17 13:46:07 -07:00
Brad Miller (WPI)
54eaa913f6 Merge "Make Java ignore section headers in Preferences file and start file with [Preferences] to match C++ (fixes artf3629)" 2014-10-17 13:45:34 -07:00
Thomas Clark
8a541a67ca Add new joystick features
Axis counts other than six and POVs are both present in C++ and Java now

Add dynamic joystick axis counts, up to 12

Change-Id: Ieade5e61a89df822df8702cb32326e4635558778

Add support for POVs in C++

Change-Id: I12dc0fcaca605a256ddcf990eebde45767229171

Make POVs work in Java

Change-Id: Ie2d98adb416c1930f058bdd21c3e7d26289df503
2014-10-17 16:39:10 -04:00
Brad Miller (WPI)
7fa0eea492 Merge "ADXL345_SPI: Report usage." 2014-10-17 12:19:47 -07:00
Brad Miller (WPI)
cc431354b7 Merge "Counter::setUpSource(AnalogTrigger): actually set the source." 2014-10-17 11:40:35 -07:00
Kevin O'Connor
65c10cd469 Aggregate javadocs and use JavaFinal docs when building plugins (fixes artf3533)
Change-Id: I4c8ae68daa470bea52b4f9f3fb129f50d5f238e3
2014-10-16 14:57:50 -04:00
Kevin O'Connor
fea52a77a3 Add SD methods with default values to match Java (fixes artf3648)
Change-Id: Iee955f987ac1214d773cfd733ed99e3cbd1ac3d0
2014-10-15 17:03:04 -04:00
Kevin O'Connor
4e31b68008 Add method to get Device ID to Can Jaguar (fixes artf3613)
Change-Id: I7b0cb555a56ee97cf90ea32a3080b7c14bb5ca56
2014-10-15 16:11:29 -04:00
Kevin O'Connor
f99b57b1fe Run the scheduler in disabled (fixes artf3631)
Change-Id: Ib1614e2c96b4cda580110ea427398bcfe2ff6fbe
2014-10-15 15:32:38 -04:00
Kevin O'Connor
dad3b68f36 Make Java ignore section headers in Preferences file and start file with [Preferences] to match C++ (fixes artf3629)
Change-Id: Ia56cca061851727eee25d3996314a01022378a07
2014-10-15 14:37:25 -04:00
Kevin O'Connor
08c8723174 Merge "Add error message to new project wizard if project already exists" 2014-10-13 07:45:25 -07:00
Peter Johnson
ce768ae341 ADXL345_SPI: Report usage.
Change-Id: I369a3aecf36fc9071b10cbacc1ebac5f98c1dd39
2014-10-12 14:38:02 -07:00
Joe Ross
217c50c28f allow installation on eclipse 3.8 (ubuntu 14.04)
Change-Id: I5d0f6a05724debefecb562f8f0fb0c8acea8e2c2
2014-10-11 18:24:51 -07:00
Peter Johnson
fcc8230dbf Counter::setUpSource(AnalogTrigger): actually set the source.
Previously this created the output but didn't set up the source.

Change-Id: Ifac7ed589358e15bc70ba46ae4a756ce56683a8a
2014-10-10 09:15:42 -07:00
Evin Ugur
d2c1bc174f updted licesne strings in eclipse plugins
Change-Id: I9593e4dda3e8db8f1fd3d847285932affffcfd51
2014-10-09 19:33:10 -04:00
Evin Ugur
6fe638e977 Fixed New Project Wizard to have a radio option always selected 2014-10-09 19:21:36 -04:00
Evin Ugur
07837c4ab4 fixed template on checkedin java examples
Change-Id: I0a99aefc21e3cc2471f0ad75192c51def8bd5ba8
2014-10-09 14:15:58 -04:00
Brad Miller
daee45780d Added additional NI libraries to make C++ builds work
Change-Id: Id550b698451999a6c3d52313211798be5eddd47c
2014-10-09 09:43:12 -04:00
Patrick Plenefisch
8079482820 Create HOME on windows
Change-Id: Id16278b5280e25e383e474faf4b511c47e5d0751
2014-10-08 17:15:51 -04:00
Brad Miller (WPI)
0b828eec62 Merge "Disable CANJaguar current PID test" 2014-10-08 12:51:58 -07:00
Brad Miller (WPI)
49e06bd13b Merge "Move interrupt methods to InterruptableSensorBase" 2014-10-08 12:51:28 -07: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
4d2a720f47 Move interrupt methods to InterruptableSensorBase
Analog interrupts work again now, and RequestInterrupts is no longer
duplicated three times.

Change-Id: I5244b76262d7620852141cd21b2429d627636793
2014-10-08 14:52:24 -04:00
Patrick Plenefisch
591e1de721 use WPILIB eclipse var & use luna to build
Change-Id: I5e8560329226fca3c60f337b6b4744c50a09cdc9
2014-10-08 10:39:06 -04:00
Brad Miller (WPI)
dc09233fca Merge "void* -> void by creating proxy fuction" 2014-10-07 14:21:45 -07:00
Patrick Plenefisch
037d3b2fb5 void* -> void by creating proxy fuction
Change-Id: I903c3d98f3210d1969b9aed6c84f5ccaa803a9ed
2014-10-07 17:19:32 -04:00
Kevin O'Connor
a3995a202d Fix bitfield indexing on PWM Latch
Change-Id: I63b423dbcab9f0f8b5b384654824f1c69b0fa052
2014-10-07 16:52:21 -04:00
Thomas Clark (WPI)
a71f07ed67 Merge "HAL: build shared library as well as static library." 2014-10-07 08:24:27 -07:00
Brad Miller (WPI)
cb81aa6fe9 Merge "Update headers and .sos to v15 image + most API changes" 2014-10-07 07:22:14 -07:00
Thomas Clark (WPI)
ace43a6a12 Merge "DigitalOutput: Fix enablePWM()." 2014-10-07 07:18:19 -07:00
Thomas Clark (WPI)
a4e8d65b71 Merge "Relay: In free(), set both forward and reverse to 0." 2014-10-07 07:17:10 -07:00
Brad Miller
bfd88f1dab Reserve network communications
Change-Id: Ie98e31baf9d5ce01056a89e009ec62c8bbb62f2e
2014-10-06 10:21:55 -04:00
Peter Johnson
a65cb500fb Relay: In free(), set both forward and reverse to 0.
Also, check status in between the two calls.

Change-Id: I5a6c24aefde3707a953a41cb7c56e8fb372e1ea0
2014-10-06 00:31:46 -07:00
Peter Johnson
f27df43b5b DigitalOutput: Fix enablePWM().
Previously enablePWM() wanted m_pwmGenerator to already be non-null on entry.
This is impossible as the only place m_pwmGenerator is set is later in this
function.

Also add correct m_pwmGenerator null checks to disablePWM() and
updateDutyCycle().

Change-Id: Ia5bbfdc62824e1cf4c2f503308313b7ef39ae2fe
2014-10-05 20:51:57 -07: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
Brad Miller
2f26361398 Added Mecanum drive sample program
Change-Id: I0538c21116cd6c8836f76b6d4446b83d8723a20f
2014-10-05 16:03:36 -04:00
Peter Johnson
52ecbd38ac HAL: build shared library as well as static library.
Change-Id: I02143d601dc1dc0a6f35d61b6d008340333ee98a
2014-10-03 19:13:34 -07:00
Brad Miller (WPI)
6089722c4f Merge "Too many bugs with LTO in GCC 4.9 & Binutils 2.24. Disabling. Maybe later." 2014-10-03 09:58:29 -07:00
Patrick Plenefisch
244ecd23ee Too many bugs with LTO in GCC 4.9 & Binutils 2.24. Disabling. Maybe later.
Change-Id: Id10ebb9768743e5f852275ae1f1d7a80094c99ed
2014-10-02 23:15:50 -04:00
Kevin O'Connor
8aeacac302 Set Start Mode to remote to allow Debug As->WPILib Deploy to launch without error on Windows
Change-Id: Ida1e12692f829f02eef5284b3cfbcbb7d63c88c3
2014-10-02 18:20:24 -04:00
Brad Miller (WPI)
45021c7f3d Merge "Figured out the madness: not launching properly (no copy)" 2014-10-02 15:07:07 -07:00
Brad Miller (WPI)
857a1abb01 Merge "Prevent leading zeroes in team number and warn user about them (fixes artf3429)" 2014-10-02 11:49:44 -07:00
Brad Miller (WPI)
c11f194cbf Merge "Allow dataRecieved to be null in I2C transaction (fixes artf3603)" 2014-10-02 11:48:22 -07:00
Brad Miller
8b806e11e2 Added Arcade C++ example and a hierarchy for C++ examples.
Change-Id: I31094dd4f158345103628aacd7de3cb86f27c483
2014-10-02 14:42:24 -04:00
Brad Miller
ba5111b994 Add a Motor Controller example java program
Change-Id: I7b0a7622fbf4cbe2ef541088bbe521d4cac9aa22
2014-10-02 14:12:16 -04:00
Brad Miller (WPI)
88bf4ee567 Merge "Added a hierarchy of example categories that looks very much like what's in LabVIEW and placed the one project in a bunch of categories as a proof of concept." 2014-10-02 10:46:24 -07:00
Brad Miller
76295a5746 Fix eclipse launching of tools (SmartDashboard, sfx, OutlineViewer, and RobotBuilder)
Change-Id: I8d0fbf2b25d29cd9645ee9e92c67316802a46490
2014-10-02 10:38:30 -04:00
Brad Miller
90a106ccfb Added a hierarchy of example categories that looks very much like what's in LabVIEW and placed the one project in a bunch of categories as a proof of concept.
Change-Id: If6e1f916ffbe7c0a36a8cccf5be46c36a1e6d6a6
2014-10-01 19:58:46 -04:00
Brad Miller
0fcef94904 Whoops, need to change the joystick port assignments to be zero based on the sample program.
Change-Id: I359e793ae13a1f3030a79f7cc19ffe10d93bbdfd
2014-10-01 19:23:22 -04:00
Brad Miller
3f38f3e84f Added a tank drive example for java
Change-Id: Id1a2a57d768251ace45a30977d335f8b6ce2ba8f
2014-10-01 19:04:03 -04:00
Kevin O'Connor
64abdb8223 Allow dataRecieved to be null in I2C transaction (fixes artf3603)
Change-Id: I02fb5ba8c5e0677b710a8bd63e98a4851c52883e
2014-10-01 14:47:16 -04:00
Kevin O'Connor
aaa7eabd03 Prevent leading zeroes in team number and warn user about them (fixes artf3429)
Change-Id: I722351d78dc53a4919bcda0ba31b188caa2d38d8
2014-10-01 14:20:03 -04:00
Brad Miller
1cef27134e Changed joystick port numbers to be zero-based for C++ and Java.
Change-Id: Ifd55e8654be3b15abbe7460d2e9e6fff8acd9977
2014-10-01 11:25:51 -04:00
Patrick Plenefisch
aaab77cdbc Figured out the madness: not launching properly (no copy)
Change-Id: I8127a9ae4cce5109d2373edfdb60ba212dfb70cb
2014-09-30 18:56:57 -04:00
Kevin O'Connor
7e2c68214d Set debug flag user to lvuser to allow it to be deleted (fixes artf3415)
Change-Id: I8931427f447e2e0b443e4b6c82dddfe9d50ef553
2014-09-29 16:05:48 -04:00
Brad Miller (WPI)
ad906da673 Merge "Squashed commit of the following:" 2014-09-27 12:24:03 -07:00
Patrick Plenefisch
a6ea51ad02 Fix simulator builds (and don't clean, dh does that also)
Change-Id: I921c7d6d56e439592b0d94e85f16cb090095caca
2014-09-26 17:58:26 -04:00
Kevin O'Connor
d72ee199fe Squashed commit of the following:
commit a3ccfab0a42414aa169792356bfc47ee8d0d2d7b
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Sep 23 13:56:59 2014 -0400

    Implement zero latch (used to reduce brownout latency) in Java

    Change-Id: I3bf4ffbf20cf3d8a42da4fa1755b4306c49ede34

commit 0af37dfcc0d1172974519c44126973c302385d55
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Sep 23 13:03:07 2014 -0400

    Implement zero latch (used to improve brownout latency) in C++

    Change-Id: I62bedd1af65d367c32e2ab0b5a4fc679776eecb5

Change-Id: Ic27f37a9ab45aad82c1f7154d4edfbccfaa19229
2014-09-26 17:20:57 -04:00
Patrick Plenefisch
19b2d05236 Fix simulator builds (dh knows how to CMake)
Change-Id: Id78d1d58d160a5f54d63aa91627cd406621d467b
2014-09-26 16:37:11 -04:00
Patrick Plenefisch
26d789b89f Copy to the correct folder name
Change-Id: Id78d1d58d160a5f54d63aa91627cd406621d467b
2014-09-26 14:11:51 -04:00
Brad Miller (WPI)
f50b058457 Merge changes I6b5d2767,I6f4b94d1,Iada981fc
* changes:
  JNI should ignore -lfrc and installing the new ld scripts
  Renaming and merging WPILibC++ into Devices and simulator files
  Initial linker script to abstract away the massive library list
2014-09-26 09:35:57 -07:00
Patrick Plenefisch
39da9d67ba JNI should ignore -lfrc and installing the new ld scripts
Change-Id: I6b5d2767a0148bd01246c6a205ba32d30440b3d5
2014-09-26 12:13:28 -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
Brad Miller
295f212c8e Change digital input to return boolean values to match Java
Change-Id: I5cfa1d300b8185ef7a32413b7f9626229d309cac
2014-09-25 18:35:25 -04:00
Patrick Plenefisch
fa4a39dcc6 Initial linker script to abstract away the massive library list
Change-Id: Iada981fc9d50c640d4c519f5024f48f6b3df7433
2014-09-25 17:13:37 -04:00
Brad Miller
66c653a21f Get the simulator build to accept c++11 languge
Change-Id: I7406cc3815f0086e66c8a8973062d8fb7b2030f2
2014-09-25 15:31:41 -04:00
Patrick Plenefisch
340a3d492c Fixing pedantics and using RTTI for command name
Change-Id: I16dc33faa229bc83af21ecf55011108245f67141
2014-09-25 14:43:40 -04:00
Patrick Plenefisch
6710ac3a2f fixing all warnings and making sure they will stay fixed
Change-Id: Iff55ea18976562f37d6cc2848abff20c2c59ad96
2014-09-25 14:43:27 -04:00
Brad Miller (WPI)
9e62e60e6f Merge "Remove CPP Preferences page from WPILib preferences (code has already been deleted)" 2014-09-25 10:14:24 -07:00
Alex Henning
e6c56e4446 Modified simulation debs to exclude building the toolchain.
Note: it currently doesn't seem to build due to a previous change that
needs further investigation.

Change-Id: I1a7f90a66d972b85541939f42e1afcb76f2fb9f4
2014-09-24 22:38:04 -04:00
Brad Miller (WPI)
35f1aded63 Merge "Change RobotState functions to return actual values (this time with nullptrs) [artf3611]" 2014-09-24 13:22:10 -07:00
Brad Miller
4904e1dc2c Change RobotState functions to return actual values (this time with nullptrs) [artf3611]
Change-Id: Icbe8fbf3d936ab696fed7f264bdf49b95d35c0de
2014-09-24 16:21:14 -04:00
Brad Miller (WPI)
28b9c18e22 Merge "Add a getDeviceNumber method to CANJaguar" 2014-09-24 12:43:06 -07:00
Thomas Clark
a548b14b7e Add a getDeviceNumber method to CANJaguar
[artf3613]

Change-Id: Idc01c0d27740bbb575f00de6065a7ced52f787e1
2014-09-24 14:37:07 -04:00
Thomas Clark
323022acfd Remove "using namespace std;" from headers
[artf3605]

Change-Id: I0dc6172114608eb5e52d341be8064758faa1c781
2014-09-24 14:13:29 -04:00
Brad Miller (WPI)
1bcdd301eb Merge "Fix changes where the default value was always being returned for many of the robot state status functions." 2014-09-24 08:03:42 -07:00
Patrick Plenefisch
21f728c802 Moving to arm-frc-linux-gnueabi in cproject and attempting to use gdb (overwritten)
Change-Id: I7dd5017f461bbff82c5ed6f64842880e4f0a44c9
2014-09-23 22:19:43 -04:00
Brad Miller (WPI)
49d440eccc Merge changes I4f5a36e6,I248d27cc,I55769599,I7688b8cd
* changes:
  Removing Toolchains!
  Enabling C++14 and removing path for new toolchains
  Remove unnecessary config for cproject/Simulate target
  Updating template .cproject to avoid specifiyng commands and defaults Fixes unknown GCC errors (supposedly)
2014-09-23 19:06:53 -07:00
Brad Miller
00486e2ec2 Fix changes where the default value was always being returned for many of the robot state status functions.
Change-Id: I50f11ce6d8ba4cbaa9ab7f44cd2f353e8bba72dd
2014-09-23 17:36:37 -04:00
Patrick Plenefisch
a3115dac19 Removing Toolchains!
Change-Id: I4f5a36e62a42c82cd2c23244bf3cdc62b2ed45d5
2014-09-23 15:26:08 -04:00
Patrick Plenefisch
1f35670a18 Enabling C++14 and removing path for new toolchains
Change-Id: I248d27cceeb16fd2b5690a9637245c7451f2c527
2014-09-23 15:23:48 -04:00
Patrick Plenefisch
d1d81e5e19 Remove unnecessary config for cproject/Simulate target
Change-Id: I5576959974bede623fb0fe267f0d8b163124c2c9
2014-09-23 15:20:45 -04:00
Kevin O'Connor
a7b166e3fd Remove CPP Preferences page from WPILib preferences (code has already been deleted)
Change-Id: I58a4df41fdd846187ecfc6e57f0c4239bd435d42
2014-09-23 13:04:09 -04:00
Brad Miller
6c28e09662 Updated bootstrap file to install the new toolchains
Change-Id: Ia9e254ed577517b191fee49bc55778636479be9c
2014-09-21 18:47:59 -04:00
Patrick Plenefisch
8199fb28d8 Updating template .cproject to avoid specifiyng commands and defaults
Fixes unknown GCC errors (supposedly)

Change-Id: I7688b8cd66f8ea70195a7e60500e212766415eb2
2014-09-21 16:38:42 -04:00
Patrick Plenefisch
f2920fd77f Enable C++14 and Wextra
Change-Id: I7548ffe02def72d1204f533fc118523f7dbff5e0
2014-09-20 23:09:20 -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
Patrick Plenefisch
3f0f7931b8 Changing cmake to test the tests (Jenkins)
Change-Id: I4f499c6325cdab399a51385c5acb73a665d9a9ae
2014-09-20 15:41:38 -04:00
Brad Miller
cad83ed3ca Bump the version number for the windows toolchains to force them to reload.
Change-Id: Ib095d5c1caf51739cc1b5bee1680592e0cfc34de
2014-09-18 17:18:03 -04:00
Kevin O'Connor
62d6579428 Add missing semi-colon to cproject file
Change-Id: I540730c3a4be32c6a636296ce36aab5b230afc8a
2014-09-16 00:50:43 -04:00
Brad Miller (WPI)
1d7b17a2ba Merge "Add quotes around linker flag path to libs (fixes artf2390 / artf3453)" 2014-09-15 09:17:01 -07:00
Brad Miller
738859c4ea Fixed bug where mac toolchains always reinstall on Eclipse start
Change-Id: Id94631162efe5766feedac2979264fe17e09b5eb
2014-09-14 15:31:56 -04:00
Patrick Plenefisch
127ff0ac0a Fixing extraction recursion: use provided version
Change-Id: I0aa0a66eae85a43df308b4c0dafbe6b953ffad5c
2014-09-14 15:31:50 -04:00
Patrick Plenefisch
472f51fc73 Add version=current to global wpilib.properties file on any property save
Change-Id: I6dc6eeac27ab97be567450c90f50ace7da6679b7
2014-09-13 18:36:02 -04:00
Kevin O'Connor
887a4e94f3 Add error message to new project wizard if project already exists
Change-Id: Ifeeaf25954261ff2ba1287103f6ca2f8186aeee8
2014-09-11 15:22:12 -04:00
Brad Miller (WPI)
0f0850ca95 Merge "Update to v14 headers and libraries" 2014-09-11 08:12:45 -07:00
Thomas Clark
ab27f795b7 Update to v14 headers and libraries
Change-Id: Ibc28fc73c36acf6d9d15b3f255cbf93ad6ad70a8
2014-09-10 14:43:53 -04:00
Thomas Clark
b16a037759 Store preferences in a directory writable by lvuser
Change-Id: I1ed43968c2be76bfcb050a115f59517c398efff3
2014-09-10 14:05:51 -04:00
Brad Miller
1e812ac4d9 Added comments to the compressor class per artf3527.
Change-Id: I48d0d16242da064e8502e6fbddccca82dc680044

Updated comments with a few more details

Change-Id: Icab1698f2ea4e2032e50cbf5ac63341ba5ee1dcf
2014-09-10 12:02:13 -04:00
Brad Miller (WPI)
ecc6815f68 Merge "Fix status buffer allocation in SolenoidBase" 2014-09-10 08:57:53 -07:00
Brad Miller (WPI)
ca9f5a676d Merge "Make all channel errors throw IndexOutOfBounds" 2014-09-10 08:57:35 -07:00
Thomas Clark
debf9e0ee9 Make all channel errors throw IndexOutOfBounds
Only relay and PWM channels out of range used to throw
IndexOutOfBoundsExceptions, but Resource would catch the error
first in most cases.

Change-Id: I8feb0daf378e181f982203d46bf5a10dbde4a02e
2014-09-10 11:54:57 -04:00
Thomas Clark
15abbb36c2 Fix status buffer allocation in SolenoidBase
This fixes [artf3488] and [artf3506]

Change-Id: I6e89fc7bfc8d6c38a4bbf364a0fad412ab54e225
2014-09-10 11:36:50 -04:00
Kevin O'Connor
d9b974300f Add quotes around linker flag path to libs (fixes artf2390 / artf3453)
Change-Id: I0d4aac49edb0e93f0bfd2cc8937eca476deafc4c
2014-09-08 14:45:08 -04:00
Brad Miller
e60baf41a9 Added the "version=current" property to allow projects to correctly reference the updated installation
Change-Id: Ia6f45fab6b1d279e89129d9a0350b8aa7cf8c98a
2014-09-06 23:50:06 +00:00
Brad Miller (WPI)
09cb3a22cd Merge "Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524" 2014-09-06 15:47:07 -07:00
Brad Miller
27ecd35834 Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524 2014-09-06 18:41:05 -04:00
Patrick Plenefisch
ff6d180305 Revert "Fixing java version number to be current"
This reverts commit 410b739c23.
2014-09-06 18:19:25 -04:00
Patrick Plenefisch
410b739c23 Fixing java version number to be current
Change-Id: I4d124921f5735cc2a7ff24eba10246eb9e57a67b
2014-09-06 17:23:06 -04:00
Thomas Clark
2144b853d1 Set the cpp-version variable per-project
Set cpp-version in the build.properties of each C++ project, instead of
globally in wpilib.properties.  It's 'current' by default.

Change-Id: I4618131be14390f51763b39aa751aa110f7af56f
2014-09-03 16:37:33 -04:00
Thomas Clark (WPI)
f87c517e6d Merge "Remove Version number from zips" 2014-08-31 14:56:00 -07:00
Patrick Plenefisch
77dac9bd77 Remove Version number from zips
Change-Id: Ifc9ba2e47a61f2d545b7c4b40c327b661b4f48ba
2014-08-31 17:55:19 -04:00
Thomas Clark (WPI)
56cf287b39 Merge "require pthread and rt lib for Itests" 2014-08-31 13:29:36 -07: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
Joe Ross
da2ea9ea87 remove/fix references to cRIO documentation.
Edited comments related to sidecar, breakout, 9472. Some references were
to unused methods in simulation that were removed.

Change-Id: I99b6fe9e8cb982831ffbf29177f84e2f9f71ef47
2014-08-30 08:56:06 -07: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)
b7458e7ba6 Merge "Make Talon the default speed controller for RobotDrive" 2014-08-29 10:53:30 -07:00
Thomas Clark
3fddee51c2 Make Talon the default speed controller for RobotDrive
Change-Id: I87047e11efb26f5081a3e23dc8f36fa9bb76a88c
2014-08-29 13:00:48 -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
Thomas Clark (WPI)
f439adc2a3 Merge "fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat" 2014-08-29 09:38:51 -07: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
Brad Miller (WPI)
ef7c554029 Merge "Wrap CPP Lib and Include paths in quotes (fixes artf2390)" 2014-08-27 13:07:52 -07:00
Brad Miller (WPI)
359b4ec86b Merge "Added support for 32-bit builds." 2014-08-27 13:06:30 -07:00
Brad Miller (WPI)
21153fc63f Merge "Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called" 2014-08-27 13:05:04 -07:00
Alex Henning
daa8bd67ef Added support for 32-bit builds.
Change-Id: I609844b3c72ca9d016a43a7b0e288abb4dc2400e
Note: Jenkins probably needs to be restarted to get proper sbuild permissions.
2014-08-27 15:46:41 -04:00
Kevin O'Connor
e5e568fa73 Wrap CPP Lib and Include paths in quotes (fixes artf2390)
Change-Id: Ied08c559140ecb28a41f61d968a37cd772255b8c
2014-08-27 15:27:18 -04:00
Kevin O'Connor
c9f6fcd969 Fix artf3447 Java only runs teleop - Correct off by one error in Control Word compares
Change-Id: I5965008ac75a9c3cc3a3473fa775729421b8957c
2014-08-27 15:22:20 -04:00
Kevin O'Connor
778620b0a9 Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called
Change-Id: I863ba263b822a60f46a04f4de2e3c570df5f317d
2014-08-27 15:14:22 -04:00
Kevin O'Connor
d58c6f0c0f Merge "Kill program before debugging C++ so file upload doesn't fail" 2014-08-27 11:44:45 -07:00
Jonathan Leitschuh
a14d854211 Cpp tests without color for jenkins. Fixes startDS to not kill the driver station.
Change-Id: I538aae4e2d6d94f0f510203d2d4cb9f40ffa4303
2014-08-26 14:26:11 -04:00
Fred Silberberg (WPI)
c5fc1dc5be Merge "Change SampleRobot template to use 0 based PWM" 2014-08-26 10:35:43 -07:00
Jonathan Leitschuh
cded5351df Test scripts have permission to run and fixes sshpass.
Updates vagrant file to have sshpass by default.
Adds configuration for setting up the network in bridged mode so that the scripts can use mdns to connect to the roboRIO.

Change-Id: I7274a24c772790c9495e8a1c083385ef528044a6
2014-08-26 12:56:10 -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
Brad Miller (WPI)
4ef798a0c0 Merge "Updates gitignore to use a file generated using http://www.gitignore.io" 2014-08-26 08:08:11 -07:00
Jonathan Leitschuh
7ec8d4e9a3 Updates gitignore to use a file generated using http://www.gitignore.io
Removes more OSX/Windows/Linux files.
Adds gitignores for cmake, Gradle, and Maven

Change-Id: I96ada2ef360770975f4afc068985cd6a21880a5f
2014-08-26 11:05:43 -04:00
Omar Zrien
17e7fc8f20 fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat
Change-Id: I0bdcf073637a47a9e6864f6d561cc812a1d5b021
2014-08-24 19:57:40 -04:00
Joe Ross
023f955a56 Change SampleRobot template to use 0 based PWM
Change-Id: Ia299db32ba724e5a5ddc2e9a3c0dbb5d8acbb08f
2014-08-23 15:06:31 -07:00
Alex Henning (WPI)
52e358c180 Merge "Add Preferences to simulation" 2014-08-23 11:12:34 -07:00
Kevin O'Connor
7638e2b6e5 Kill program before debugging C++ so file upload doesn't fail
Change-Id: Ibd4fdb6cbf491f20d66f36c4fb84753a1abbfd1e
2014-08-21 17:19:23 -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
Joe Ross
04fadb85f5 Add Preferences to simulation
Change-Id: Id2891dac25ab6a929b5b90164cc5ecef49f40906
2014-08-20 21:07:12 -07:00
Brad Miller (WPI)
698b371b16 Merge "Add OI and RobotMap files to Command Project template (fixes artf2407)" 2014-08-20 13:41:50 -07:00
Brad Miller (WPI)
6dde2c2b4c Merge "Adds interrupts to Java" 2014-08-20 13:39:47 -07: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
Kevin O'Connor
bf5eaf657e Add OI and RobotMap files to Command Project template (fixes artf2407)
Change-Id: Ia3fb2a03b6435ae74bd70ad856a41a2c15f22f5a
2014-08-20 14:35:04 -04:00
Kevin O'Connor
3baaea5a44 Squashed commit of the following:
commit b4589d75b682d5bb99a98e9af975dd5c03a574dc
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Aug 19 17:15:12 2014 -0400

    Make CPP debugging from menu item work.

    Change-Id: I5bda07e088560adabbb9bc5fbfce9bd9456f7e1f

commit aaa832376700156abb1002ce7ad9334c4983be43
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Aug 19 17:13:22 2014 -0400

    Change CPP debug to use mDNS (artf3410)

    Change-Id: I01b97e1754c2abd4d18b41ab2f890b1b5470d616

Change-Id: I405bd1808d301f650f9293c60db161205ee6e704
2014-08-19 17:20:15 -04:00
Jonathan Leitschuh
2cc937f5e1 Fixes debugging in Java
When deploying a Java program in debug mode any previous running programs should be properly removed. [artf3408]
This should link with (https://usfirst.collab.net/sf/go/artf3408?nav=1&_pagenum=2&returnUrlKey=1408475631056)

[artf3415] is still an issue until NI resolves it.
This should link with (https://usfirst.collab.net/sf/go/artf3415?nav=1&_pagenum=1&returnUrlKey=1408475758258)

Change-Id: Ica9639b5a406b70be4d51aa4e45ffef56baddc93
2014-08-19 15:16:55 -04:00
Brad Miller (WPI)
23b6a980c2 Merge "Uses ${ant.java.version} for javac when compiling" 2014-08-18 14:32:10 -07:00
Thomas Clark
89b80db2d0 Merge "Fix PIDError property" 2014-08-18 13:32:52 -07:00
Thomas Clark
1f27d36884 Fix PIDError property
Change-Id: I3ea040ae4e0520a231bab95390746eba4315fd8d
2014-08-18 16:29:41 -04:00
Thomas Clark
125dfac8b4 Merge "Fix Java IT build" 2014-08-18 13:00:12 -07: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
Kevin O'Connor
dddba82d18 Fix artf3337 - add include to define int32_t in CounterBase.h
Change-Id: Ia6ce4e57a36d628fb9f61e1ac8c3d3101e22f165
2014-08-18 14:19:13 -04:00
Jonathan Leitschuh
78e2a8d1b9 Uses ${ant.java.version} for javac when compiling
This uses the ant jvm version variable to compile teams robot projects.

Change-Id: I4f5b704e5230c1bd09323abea6c4044c709c3eff
2014-08-18 11:42:28 -04:00
Thomas Clark
687bc44ae5 Add new CTRE classes and update PDP tests
Change-Id: I489091c5b8b0f1f9890e5104bf01e40ae53cf6ce
2014-08-18 10:32:26 -04:00
Jonathan Leitschuh (WPI)
c82a94b268 Merge "Make Java tests run with TestNG" 2014-08-18 07:17:11 -07:00
Alex Henning (WPI)
d407fe546f Merge "Fixes for simulation parallel builds." 2014-08-17 17:23:44 -07:00
Alex Henning
699949fdf4 Fixes for simulation parallel builds.
Change-Id: I2b2385b6677a892fd1fd8a0c4b6f995418c33900
2014-08-17 19:48:08 -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
Brad Miller (WPI)
e523157507 Merge "Fixed bug with joystick buttons/axes out of range." 2014-08-15 10:03:02 -07:00
Brad Miller (WPI)
3eba1c4688 Merge "Add delays to make C++ ITs more reliable" 2014-08-15 10:00:30 -07: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
Jonathan Leitschuh
9dfd6bde9d Adds a Vagrant configuration file and setup script
Vagrant allows developers to install Vagrant and their choice of virtual box in which to develop.
This provides a consistent environment where anyone can devlop WPIlib without having to go through a lengthy setup process.

Change-Id: Iced863d307f0e6a761441f17c3de377594197c38
2014-08-15 10:56:31 -04:00
Alex Henning
eded28ebfa Fixed bug with joystick buttons/axes out of range.
Change-Id: I85f0a9f47dfbb786f850c1f382c0e18a4e4b8254
2014-08-15 10:29:39 -04:00
Alex Henning
c68ee3001e Added message to notify when simulation is unsupported.
Also links to screensteps instructions to set it up.

Change-Id: I61bca3ad773d5e08b3a4f8fa6bc0fd2cd1c04c59
2014-08-14 11:37:02 -04:00
Thomas Clark (WPI)
777dc2113d Merge "Updated installer to point to the new location." 2014-08-14 08:01:56 -07:00
Thomas Clark (WPI)
174f2c0e23 Merge "Increased build speed + caching of debs." 2014-08-14 08:01:23 -07:00
Thomas Clark (WPI)
434caf81d7 Merge "Add back SampleRobot Template Add GettingStarted example based on IterativeRobot" 2014-08-14 08:00:53 -07:00
Thomas Clark (WPI)
9327170069 Merge "Beginning of gradle conversion." 2014-08-14 08:00:03 -07:00
Kevin O'Connor
597e209c09 Add back SampleRobot Template
Add GettingStarted example based on IterativeRobot

Change-Id: Ic8caec4f62b7bdbaae7fafedfec5859b2f936809
2014-08-14 07:51:20 -04:00
Alex Henning
ad1ace1022 Increased build speed + caching of debs.
Make sure to add -j to improve build time by 10 minutes or more.

Change-Id: If2838a4042592fbfd1a0f40882efd7dd70270266
2014-08-13 18:22:40 -04:00
Alex Henning
70d09de2e9 Fixed frcsim script to have the proper LOAD_LIBRARY_PATH.
Change-Id: I83bdf3edcf5e69e1b5b358f92af26b8749039c7d
2014-08-13 15:22:36 -04:00
Thomas Clark
f7e1753e03 Fix C++ linker settings
Change-Id: I980e00968b0b465e6bba26a6586e23cc4e20f320
2014-08-13 11:56:36 -04:00
Alex Henning
df3f3cc0e1 Updated installer to point to the new location.
Change-Id: Id5f11a2952511bb781a4b4b38bcdcac1ec3ae2b0
2014-08-13 11:16:22 -04:00
Alex Henning
25308e2442 Beginning of gradle conversion.
Change-Id: Ic9690af60cd53b5237cd8c05d41598a94f6025f1
2014-08-12 17:25:10 -04:00
Alex Henning
6b3e2690d0 Fixed placement of libWPILibAthena.a
Change-Id: Ie50de30bcf911149d18d96e2b510b34424177e15
2014-08-12 17:15:44 -04:00
Alex Henning
ae10d43900 Fixes for examples and Gazebo 3.1.
Change-Id: Ie41a29b4b8f5cee87357f44adb45f54e03487622
2014-08-12 15:47:10 -04:00
Thomas Clark (WPI)
d4e377fc0e Merge "Adds the Trigger template and adds WPILib.h import to all templates" 2014-08-12 12:33:46 -07:00
Jonathan Leitschuh
9126646fef Adds the Trigger template and adds WPILib.h import to all templates
Change-Id: Ibaecc4802822cf4c0a4a5bf9ddc960b96e40d1e9
2014-08-12 15:32:29 -04:00
Thomas Clark (WPI)
d3f632486f Merge "Added support for Jenkins to generate doxygen." 2014-08-12 12:22:53 -07:00
Alex Henning
268459206f Added support for Jenkins to generate doxygen.
Change-Id: I2febfe42cc9301446f796376cfe8e1ef6744f19a
2014-08-12 15:22:16 -04:00
Thomas Clark (WPI)
df390c275d Merge "Merged sources in wpilibJavaFinal." 2014-08-12 12:09:31 -07:00
Jonathan Leitschuh (WPI)
1742634a96 Merge "Fix the example programs" 2014-08-12 12:06:42 -07:00
Alex Henning
0f8f83500b Merged sources in wpilibJavaFinal.
Change-Id: Iab8d079716eae3e5631cf7a62d6e88340e55e03c
2014-08-12 14:59:16 -04:00
Thomas Clark
d5c73c95dc Fix the example programs
Remove the test examples that don't do anything helpful

Fix the PacGoat and GearsBot examples to compile

Change-Id: Ic11ca7a97a5b52524fe60dc24fcec6ecfae7ebb7
2014-08-12 14:52:22 -04:00
Alex Henning
ca7dc5d6ac Removed excessive linking.
Change-Id: Iffc8517da2a4d6b67612b6076023211c07768714
2014-08-12 12:07:09 -04:00
Alex Henning
66e1f2a184 Fixed a few bugs with C++ due to the merge.
Change-Id: I6c5120ff502b40ecba0884f5a3631fa91822cfd4
2014-08-12 10:12:55 -04:00
Alex Henning
1301d76d61 Fixes for HLUsageReporting due to Jonathan's exceptions.
Change-Id: I28d6719d0b8f5a71186f6a764c9541277aea6237
2014-08-11 14:59:21 -04:00
Thomas Clark
a72ea14f92 Removed Simple Robot template option
Remove the option in Eclipse to make a "Simple Robot" project, since
there is no more simple robot template and the resulting project isn't
even generated correctly.

Change-Id: I06a9db8c7f5fb82b7be3eadb1f91813321a36119
2014-08-11 12:01:38 -04:00
Thomas Clark
14b2f14669 Merge "Implement DriverStation::GetBatteryVoltage" 2014-08-11 08:56:52 -07:00
Thomas Clark
d2cd5f3571 Implement DriverStation::GetBatteryVoltage
Make the GetBatteryVoltage method work using the new tPower header

Change-Id: If504f8a46f3f7f737f0b729b72fc6b5da0d29ff9
2014-08-11 11:56:10 -04:00
Jonathan Leitschuh (WPI)
7ecde3a33a Merge "Fix the default C++ linker settings" 2014-08-11 08:55:50 -07:00
Alex Henning (WPI)
81143fc534 Merge "Adds Exception throwing the basic robot systems are not properly initialized." 2014-08-11 08:53:37 -07:00
Thomas Clark
c58a86a3ab Fix the default C++ linker settings
Change-Id: I839b67fa6e9798f980db05f5a4ff9c8f47c32424
2014-08-11 11:27:48 -04:00
Alex Henning (WPI)
2f655bb49d Merge "Fixed bug with plugins not including all simulation dependencies." 2014-08-11 08:22:15 -07:00
Alex Henning
657054c9e2 Fixed bug with plugins not including all simulation dependencies.
Change-Id: I34c84c6cd4d918039726aa2efb81efbcf98dd593
2014-08-11 11:20:07 -04:00
Kacper Puczydlowski
f4d542b212 Add FakeEncoderTest for C++
Change-Id: Ic030a1d055a03f5b245e19e6466af05e72dd7deb
2014-08-11 11:15:42 -04:00
Alex Henning
8db11a4c6c Fix to deal with the certificates on collabnet having expired.
Change-Id: I0c7580f06107d59dfc32b343304529b17763c7fa
2014-08-11 08:13:08 -04:00
Joe Ross
14d784bca1 Fix import, resolves artf3339
Change-Id: I0abed3495ffc35161793f3a6140fb21872004866
2014-08-10 17:01:31 -07: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 (WPI)
b371600f0f Merge "Completed artf2675 - rename SimpleRobot -> SampleRobot." 2014-08-08 12:39:14 -07:00
Thomas Clark (WPI)
6c3b002a87 Merge "Refactors the CANJaguar tests to be more straightforward." 2014-08-08 12:14:24 -07:00
Colby Skeggs
0f93247641 Completed artf2675 - rename SimpleRobot -> SampleRobot.
Change-Id: I23fc503f64fa6a715867f4b92f9d03e21f6c5f82
2014-08-08 10:50:16 -07: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
Thomas Clark
5b8279f404 Remove old driver station code
We don't need to send status data from the user program anymore

Change-Id: Ifbdb037cfb4e36681914dd7a3a2f5c56cbead6a2
2014-08-08 11:23:03 -04:00
Thomas Clark
8abbcf53f4 Update to the v13 headers and libraries
Add all of the most recent headers and .SOs

Also make DriverStation work with the new FRC comm protocol, using the new
functions for getting status data

Change-Id: I1c7fc5f90e72c5fbebf87d9923ce0967ed0ef3bc

Initial HAL support for v13 ds

Change-Id: I9a7f37ef8e24241598fa3981cb3df30c07c52e0f

New ds stuff in the HAL

Change-Id: I025910625453baf63f79f49bbc70ba8b2f093f50

New ds stuff in C++

Joysticks are still todo

Driver station IO is pulled out

Change-Id: I1bb59037c097713bd943e7bef00e12f67f13c3ac

New ds works in C++ and Java.  Joysticks still todo

Change-Id: Ic93f8686856761badc592eceaf05964f52355578

Make joysticks work again with the v13 image protocol

Change-Id: Ief7ee95d3398c2262ca07ab7d60499af3c8f60f7
2014-08-07 16:37:02 -04:00
Thomas Clark (WPI)
b8eeeabbb5 Merge "Removes encoder.start() from the example programs" 2014-08-07 13:18:42 -07:00
Jonathan Leitschuh
9a2bd8c49b Removes encoder.start() from the example programs
Change-Id: I26a9901a978481bb37fdb6eac6a2457c2ca990b8
2014-08-07 16:17:35 -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
1ce03b9c46 DoubleSolenoid works in C++ now
Change-Id: I75130f816efe8ef9c82e936bba834609c470f379
2014-08-05 14:42:37 -04:00
Thomas Clark
a09f75934a The output range can be set on a PIDSubSystem
Also, mimimum -> minimum in PIDController.h

Change-Id: I0cdfdca6ca2bdf2c2a40ee524cc925281069fcf4
2014-08-05 14:03:02 -04:00
Jonathan Leitschuh
aab98c0638 Adds Exception throwing the basic robot systems are not properly initialized.
Adds a BaseSystemNotInitalizedException to be thrown in the event that HLUsageRepoting, RobotState or Timer does not have its static implementation set.

Change-Id: I66fde262baa1a9d32d1df9fafa08ba3173bcbb72
2014-08-05 13:44:21 -04:00
Jonathan Leitschuh (WPI)
741e28b855 Merge "Added version numbers to maven plugins" 2014-08-05 10:29:31 -07: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 (WPI)
7442a7ed7d Merge "Only update FRC Java Projects (fixes artf2627)" 2014-08-05 10:19:01 -07:00
Jonathan Leitschuh (WPI)
765198f5f5 Merge "Updated some comments that mention the cRIO" 2014-08-05 10:18:25 -07:00
Thomas Clark
ed08ab2989 Fixed voltage range checking and error message
Change-Id: I7ba05eb27f3d82bfd37f6b407fe39e0ab9cf5bf0
2014-08-05 13:16:10 -04:00
Jonathan Leitschuh (WPI)
4b22742cdc Merge "Cleaned up C++ compiler warnings" 2014-08-05 09:13:40 -07:00
Alex Henning (WPI)
45f93e9aba Merge "Added support for building debs on jenkins." 2014-08-05 09:04:04 -07:00
Alex Henning
049377c9ea Added support for building debs on jenkins.
Change-Id: Iec732b3a0d036e53e02e377b830f8af6b8eaf731
2014-08-05 11:54:15 -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
Thomas Clark
9ff420547a Updated some comments that mention the cRIO
Change-Id: Ib5e3c34fa2db83f48ca88153e8f4c834b31291f5
2014-08-05 11:17:38 -04:00
Jonathan Leitschuh (WPI)
1be31431bc Merge "Removed the User LED functions" 2014-08-05 07:37:03 -07:00
Thomas Clark
32cafd0efc Removed the User LED functions
There is no "User" LED on the RoboRIO, these functions didn't
do anything.

Change-Id: I8d2eaf0efde90cc444503a79f26d591ddaaa6322
2014-08-05 10:35: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
60a3fd0698 Added gyro deadbands
During calibration, the Gyro class sets the accumulator deadband to contain
whatever the farthest sample from the center was.  The integration test
passes now.

A SetDeadBand method was added to the Gyro class for teams to set their own
deadbands.

Change-Id: Idbe4c279e2991b4daed4d4cf3bfaf605d4ee25c0
2014-08-04 17:44:04 -04:00
Kevin O'Connor
b86c114939 Only update FRC Java Projects (fixes artf2627)
Change-Id: I62715ab5ed01d1d6c6ee1a877fad3d12a5c0219b
2014-08-04 16:35:28 -04:00
Jonathan Leitschuh (WPI)
14f201cd36 Merge "getAnalogAverageValue should use a 32-bit int" 2014-08-04 13:17:07 -07:00
Thomas Clark
c49ea255b9 getAnalogAverageValue should use a 32-bit int
getAnalogAverageValue gets a 32-bit integer and returns it as an int32_t,
but previously it stored the intermediate value as a 16-bit int.

Change-Id: I0a8b0cd3b3ff9b1ff40ad7942170f633c44c127b
2014-08-04 16:08:58 -04:00
Kevin O'Connor
065e1c24eb Update plugin menu text and make template menu options only show for correct language (fixes artf2408)
Change-Id: I13b80ab43aa79bd1aa8d12b7a8331a602a976bd0
2014-08-04 16:05:24 -04:00
Kevin O'Connor
ecdb77e4be Update plugin target to use mDNS (causes Java debug to now use mDNS)
Change-Id: I570b6e99282583b343e3dcb7f072a707726804e3
2014-08-04 16:01:53 -04:00
Jonathan Leitschuh (WPI)
10aad6d1c8 Merge "Fixed a few more small TODOs" 2014-08-04 12:41:34 -07:00
Thomas Clark
e73c8d06eb Fixed a few more small TODOs
Timer::Get now compensates for the FPGA time rolling over after 71 minutes

UltraSonic::Ping doesn't bother disabling automatic mode, since it asserts
that it's not in automatic mode on the line before.

Change-Id: I6b0f45327c453abd8a846ec8da0f9676e210d909
2014-08-04 15:25:41 -04:00
Thomas Clark
dc341a448e Fixed a few simple SmartDashboard FIXMEs and TODOs
SmartDashboard does usage reporting now (or will when it's implemented
in the HAL).

Global errors are raised in C++ when problems happen, since there is
no SmartDashboard instance.  Previously, no error reporting was done
at all.

GetData was uncommented.

Change-Id: I3331eb9f09924d1d0028e3fa041f0cf68caa5cf5
2014-08-04 14:43:31 -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
Thomas Clark (WPI)
f57a2dc5a9 Merge "Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)" 2014-08-04 07:54:23 -07:00
Kevin O'Connor
7006d1ebc4 Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)
Change-Id: I3223868968ae1d55314d76018a5dd98eaac14255
2014-08-04 10:52:37 -04:00
Thomas Clark (WPI)
c32e5707d4 Merge "Remove extra semi-colon" 2014-08-04 07:47:26 -07:00
Jonathan Leitschuh (WPI)
c27da3587d Merge "Added an interrupt test for C++" 2014-08-04 07:25:30 -07:00
Joe Ross
f18cccbc30 Remove extra semi-colon
Change-Id: I90052addd8ea499ce794d110b6945e9c7d7379cf
2014-08-03 18:08:03 -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
792e3b6ccc Removed modules from the HAL and JNI bindings
Modules aren't used anymore in wpilibc and wpilibj, so the hal functions
that references them and and JNI bindings for these functions have been
pulled out.

Both Counter classes were also modified because they still referenced
modules.

Change-Id: Ic01feb145a4ed5f08cd55f140867c721f5ee7b10
2014-08-01 15:01:28 -04:00
Jonathan Leitschuh
fd4379a946 Makes the Counter.Mode an enum and adds Null Checking
Adds null checking to the AnalogTrigger, AnalogTriggerOutput, and Counter classes

Change-Id: I09e962db36dbde0479a73a47c9998de03cd6bbb5
2014-08-01 13:41:34 -04:00
Jonathan Leitschuh
a40cdf5197 Implements the AnalogTriggerType as an enumeration
Change-Id: I411104a0bec733dc0b3854470c36366f3aec7bd6
2014-08-01 12:51:26 -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
Jonathan Leitschuh
38583789be Fixes the TiltPanCamera test (now GyroTest)
Change-Id: I3e954e60162ce84372a2dea39803437589aaaf00
2014-07-31 16:08:14 -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
Jonathan Leitschuh (WPI)
e0e2b498a5 Merge "Accumulators wait for the next sample after reset" 2014-07-31 12:54:26 -07: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)
41bb0da4e6 Merge "Fixes bugs with the Gyro" 2014-07-31 12:41:40 -07:00
Jonathan Leitschuh
97ade3606e Fixes bugs with the Gyro
If the gyro was initialized with an analog input the gyro class would not be calibrated properly.
Removes unnecessary type casting.

Change-Id: I6baa72919019a33cce7d3074f8477104cbe65396
2014-07-31 15:32:03 -04:00
Jonathan Leitschuh (WPI)
2735406bfb Merge "Added a Java internal accelerometer test" 2014-07-31 11:25:26 -07:00
Thomas Clark
ab04e19aae Added a Java internal accelerometer test
Change-Id: I9cae930bbae97af6461d13776cbfc9bb87e0cac4
2014-07-31 10:59:41 -04:00
Thomas Clark (WPI)
a58288ae6d Merge "Refactors the RobotBase Setup into a method." 2014-07-31 07:39:35 -07:00
Jonathan Leitschuh
7905259e21 Refactors the RobotBase Setup into a method.
This allows the robot base setup to be used for the robot base as well as the setup for the test system.

Change-Id: I2f8e37d42c84001f4b4eff2afd7c3e1d73785d7c
2014-07-31 10:37:39 -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
Jonathan Leitschuh (WPI)
526df3679a Merge "Added a C++ Preferences test" 2014-07-31 06:36:20 -07:00
Thomas Clark
d8da3e5f1f Added a C++ Preferences test
Change-Id: I6c210535dcfad7c75ff4c04ee6446147efb2fc57
2014-07-30 17:33:26 -04:00
Jonathan Leitschuh
c0af235050 Removes the dependency-reduced-pom.xml from the repository.
Also adds this file to the .gitignore

Change-Id: I731c58d4f8a96531e61598e281a769e6b13e2e86
2014-07-30 14:08:21 -04:00
Jonathan Leitschuh (WPI)
7f6ca6824e Merge "HALInitialize should be the first thing called" 2014-07-30 08:50:09 -07:00
Thomas Clark
231bb55b2a HALInitialize should be the first thing called
Constructing a new HardwareTimer before HALInitialize is called
causes segfaults sometimes in user programs, since getFPGATime assumes
that the tGlobal objected was constructed.  This problem did not appear
in integration tests, where the calls were in the correct order.

Change-Id: I95471e9e8ad7bc5d48a65893856089e35c0b091a
2014-07-30 11:26:50 -04:00
Thomas Clark
76e488061d Removed cRIO tests, NetBeans stuff, and Ant stuff
Change-Id: I066e73916ac944e3145554a49051fb3a92d8c16d
2014-07-30 10:45:58 -04:00
Thomas Clark (WPI)
5e8ea38465 Merge "Fixes the PDP test." 2014-07-30 07:35:15 -07:00
Thomas Clark
a5b72d62a1 Remove the last obsolete interface
Change-Id: I5921968b3064af53f716858092c2da3ea7522362
2014-07-29 18:01:17 -04:00
Jonathan Leitschuh
a5e15b16fd Fixes the PDP test.
Switches the PDP test to use the MotorEncoderFixture.
Also adds helpful output information when running MotorEncoderTests by displaying the current MotorEncoder under test

Change-Id: I1d14986a6ff0ebfffa87d2fd8077d7dd1eef50e3
2014-07-29 18:01:00 -04:00
Jonathan Leitschuh (WPI)
264c38a674 Merge "Removed the old "parsing" interfaces" 2014-07-29 14:45:55 -07:00
Thomas Clark (WPI)
20de3abe80 Merge "Updates the TimerTest to give a clearer output." 2014-07-29 14:42:51 -07:00
Jonathan Leitschuh
3536d47835 Updates the TimerTest to give a clearer output.
Change-Id: I4d6685392e4e3cb21b8a24607904d0c888658855
2014-07-29 17:41:57 -04:00
Thomas Clark
60a294fbad Removed the old "parsing" interfaces
Change-Id: I94ff79f36d5b61f90c2f242fa06816bf3a3b7ac2
2014-07-29 17:34:39 -04:00
Jonathan Leitschuh (WPI)
dc42a1129f Merge "The LiveWindow instance isn't a global static" 2014-07-29 14:00:31 -07:00
Thomas Clark
386dc1f16b Added AnalogTrigger tests
Change-Id: I60c3e576e100632635278e80743975daf238e904
2014-07-29 16:48:28 -04:00
Thomas Clark
038478e437 The LiveWindow instance isn't a global static
The LiveWindow singleton instance shouldn't be a global static
variable, since the order that global statics are constructed is
undefined, and it's required by other constructors.

Change-Id: I2edccc1f723f0ea41b1347379b3e3778a50afcdc
2014-07-29 16:12:23 -04:00
Thomas Clark (WPI)
26e90a988b Merge "Adds/Updates CANJava Testing Framework." 2014-07-29 12:57:08 -07:00
Jonathan Leitschuh (WPI)
d5cd47bfa1 Merge "Minor updates to the C++ CANJaguar ITs" 2014-07-29 12:52:17 -07:00
Jonathan Leitschuh
1e35ef7802 Adds/Updates CANJava Testing Framework.
Change-Id: Iabd80ebd365a05063985fa45ce62849ced17c096
2014-07-29 15:50:31 -04:00
Jonathan Leitschuh (WPI)
65607b5bc1 Merge "Fixed CANJaguar::GetOutputVoltage for negative voltages" 2014-07-29 12:48:56 -07: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
Jonathan Leitschuh
92bd697417 Fixes a bug where the testing framework would never set the implementation for the libraries.
Change-Id: I8f745ebd870c8dacf28b0459e3d5128195fcbb87
2014-07-29 15:30:33 -04:00
Thomas Clark
ed0df5432f Fixed CANJaguar::GetOutputVoltage for negative voltages
Previously, negative output voltages were unpacked incorrectly.

Now, they're requested as percentages, unpacked, and then scaled
in software based on the bus voltage.  The output voltage and
bus voltage shouldn't ever be out of sync, since they're in
the same message.

Change-Id: I745fffd0faa6cbaab967240271e6cfa8653212e2
2014-07-29 15:25:35 -04:00
Thomas Clark
6deb196e90 Support for the "USER" button on the RoboRIO
You can get the state of the USER button with GetUserButton() in
C++ or Utility.getUserButton() in java.

Change-Id: I923e62cab5e621ef43fed503acab5c0d751264fb
2014-07-29 14:42:08 -04:00
Jonathan Leitschuh (WPI)
8b612f713b Merge "CANJaguar::Disable stops periodic setpoints" 2014-07-29 08:39:12 -07:00
Thomas Clark
d66bafb687 CANJaguar::Disable stops periodic setpoints
Calling CANJaguar::Disable() now makes NetComms stop periodic
setpoint messages, so the motor actually stops until EnableControl()
is called again.

Change-Id: Ib4eb4ad5f729be5c74e799f02ed000511de1e03d
2014-07-29 11:09:37 -04:00
Alex Henning (WPI)
78d2ccd299 Merge "Added stack traces and better error reporting in C++" 2014-07-29 07:27:12 -07:00
Thomas Clark (WPI)
06d59447be Merge "Adds missing Javadocs and @Overrides annotations to the PIDController in Java" 2014-07-29 07:25:34 -07:00
Jonathan Leitschuh
3475a4a8c6 Adds missing Javadocs and @Overrides annotations to the PIDController in Java
Change-Id: I61bf9a31c238b44012d01d4fae11971cc7951d54
2014-07-29 10:19:54 -04:00
Thomas Clark (WPI)
6af242b556 Merge "Fixes for javadoc eclipse plugin." 2014-07-29 07:13:00 -07:00
Alex Henning
c72e704396 Fixes for javadoc eclipse plugin.
Change-Id: I629a8b22acc2073b97b3b478c8b9d52b03cfa353
2014-07-29 10:01:23 -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
Joe Ross
c1d8e4ef4b Make AnalogInput PIDGet return an average voltage. artf2391 for Java.
Equivalent to Ia7f06ca2
Previously it returned a raw value instead of a voltage.

Change-Id: I6f1bcf8fdd7f98ae62ed991f29fec35f4ffb4098
2014-07-28 08:04:10 -07:00
Alex Henning (WPI)
338120c3a5 Merge "Fixed wpi_setErrnoError to print the error name" 2014-07-28 07:05:51 -07:00
Alex Henning (WPI)
a7efbe0d7a Merge "Fixed Preferences in C++" 2014-07-28 07:04:13 -07:00
Thomas Clark (WPI)
4c78280308 Merge "Correct voltage range in javadocs for RoboRIO" 2014-07-28 06:37:02 -07:00
Joe Ross
5a3889a3aa Correct voltage range in javadocs for RoboRIO
Change-Id: I6049fac62bb4f1fb15364bd26d0511d0603c0aee
2014-07-28 09:34:48 -04:00
Thomas Clark (WPI)
2fd4964b62 Merge "ADXL345_I2C: Make constructor explicit." 2014-07-28 06:26:10 -07:00
Thomas Clark (WPI)
6ae6394548 Merge "AnalogPotentiometer: Make constructors explicit." 2014-07-28 06:25:43 -07:00
Peter Johnson
310151132d AnalogPotentiometer: Make constructors explicit.
The second and third arguments have default values, so it needs to
be explicit.

Change-Id: I893a45d750291f96983bef6b753d91f10c44d2ab
2014-07-28 00:01:42 -07:00
Peter Johnson
7f4e1e39ae ADXL345_I2C: Make constructor explicit.
The second argument has a default value, so it needs to be explicit.

Change-Id: I5c38f8f55f9c21576835c005acd8d80fe6864140
2014-07-27 23:59:59 -07:00
Peter Johnson
eebdc3d20c BuiltInAccelerometer: Add virtual destructor.
Change-Id: I38e5ca92ba6c5b395366cfd8ea35acd2a08dbdac
2014-07-27 23:52:00 -07:00
Thomas Clark
980ea96b05 Fixed Preferences in C++
The file name was never updated from the old path, a deadlock occured
sometimes.  A "resource not found" message was also set when fopen()
returns an error, which should be an errno message because it's a C
library error.

Change-Id: Ic913a08f6f5d73219cb6625198f5a4519c039956
2014-07-25 17:03:28 -04:00
Thomas Clark
1038f98e83 Fixed wpi_setErrnoError to print the error name
Previously, wpi_setErrnoError and wpi_setErrnoErrorWithContext
always printed "Unknown errno" whenever a C library error
occured.

Change-Id: Ib235138eea0e83b0d7462dfd6e834e3499e3b0c5
2014-07-25 16:52:00 -04:00
Thomas Clark
326aa2e85c Fixed a typo with the tGlobal commit
Change-Id: Ic801e9f73235cd24e9f57484c8af892c9c125075
2014-07-25 13:08:52 -04:00
Thomas Clark
6071fc7fb3 Fixed CANJaguar percent scaling issue [artf2637]
Percent mode used to be scaled incorrectly in Java because the
max output voltage was initialized to a wrong value.

Change-Id: If88bb2f1d198e13b1724afc62a522fbf91a14b5b
2014-07-25 13:01:24 -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
Brad Miller (WPI)
f4f7588cfb Merge "A few small changes to the C++ ITs" 2014-07-25 08:54:42 -07:00
Brad Miller (WPI)
80ecff6bdb Merge "AnalogInput::PIDGet returns an average voltage[artf2391]" 2014-07-25 08:52:16 -07:00
Brad Miller (WPI)
e487c950e9 Merge "Only create one tGlobal object" 2014-07-25 08:51:32 -07:00
Thomas Clark
191e9d5d6b AnalogInput::PIDGet returns an average voltage[artf2391]
Previously it returned a raw value instead of a voltage.

Change-Id: Ia7f06ca24a6c79468c7be89a07c615d7015ffef9
2014-07-25 09:41:06 -04:00
thomasclark
40fc8326aa Only create one tGlobal object
This fixes a problem with getFPGATime() blocking for around 1 second
each time it's called.

Change-Id: I8aafb725889c231ffb2c91e7cb4bbb8110474a9d
2014-07-24 18:30:13 -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
Jonathan Leitschuh
3ec797a8cf Updates the CANJaguar to free itself before throwing an exception in the constructor. This allows it to be allocated later without throwing an Allocation exception.
Change-Id: Ifbd15fecad92fa17a1c4b92d444b67221dacb4b5
2014-07-24 16:55:27 -04:00
Jonathan Leitschuh
78e6cf7208 Updates the AbstractComsSetup message to report JUnits multiple exceptions correctly.
Adds a simple logger to the AbstractComsSetup that prints messages to the console based on the log level.
Replaces all System.out prints with TestBench.out()

Change-Id: Ieb7acfe51aa2febe9cfd3883f8a33094c9b72a6e
2014-07-24 15:01:44 -04:00
Jonathan Leitschuh
2481e98bc8 Fixes a deallocation of the Relay resource when calling free. Changes fake "Enum Classes" into real Enumerations
Change-Id: I9d5a4760235adc9e02e41040c9973316e1f32da2
2014-07-24 13:59:21 -04:00
thomasclark
c81d510ebe CANJaguar::ChangeControlMode marks the controlmode as unverified
This previous caused a bug where the Jaguar would sometimes
behave as if it were in the wrong mode, even when everything was
verfied.

Change-Id: Id5b96e0f7e64066eaaa0e5be4ba53fca76ba0703
2014-07-24 13:54:01 -04:00
Thomas Clark (WPI)
3fb4159101 Merge "Added missing call to m_ds.waitForData()" 2014-07-24 10:41:17 -07:00
Alex Henning
2e1bd171a5 Added missing call to m_ds.waitForData()
It was accidentally deleted in a previous commit[1] and none of our
tests caught it. As a result iterative robot loops run too fast (using
extra CPU).

[1] https://usfirst.collab.net/gerrit/gitweb?p=wpilibj.git;a=blobdiff;f=WPILibJ/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java;h=0e936de8ec86a76e0a63ddbfc65ec2b88bc71725;hp=d4c5d38a14e29c926389ba1ae84fcbd09ee51f19;hb=HEAD;hpb=726ac3a3d272310b367b25f3c7e15ba6d07b957d;tflink=projects.wpilib/scm.WPILibJ

Change-Id: I663f8619406f26b7fa6fc12bce4444657b829d9f
2014-07-24 12:02:50 -04:00
Alex Henning (WPI)
25e7a077c1 Merge "Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp." 2014-07-24 08:59:51 -07:00
Colby Skeggs
dc48dc7f7b Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp.
Change-Id: Ic00fcd5026ce0570c79a65be178e45eeb94b3deb
2014-07-24 11:54:46 -04:00
Colby Skeggs
2dd45c3ea6 Fixed FRCSim artf2619, and misc reformatting.
Change-Id: I7133f46f88f7e2cb2451c2a6714daa8f3f368b40
2014-07-23 14:43:11 -07:00
Jonathan Leitschuh (WPI)
461e359484 Merge "Remove the Kinect code from C++" 2014-07-23 13:57:20 -07:00
thomasclark
78dac49cf6 Remove the Kinect code from C++
Change-Id: Ifef909a8948f1d0f881bf394b9a3ba925644306f
2014-07-23 16:55:45 -04:00
thomasclark
66ba9a728e Fixed some bugs with CANJaguar verification in Java
Change-Id: I5f6510d53c806845f6bae5eb8fd9ebbc8fde054e
2014-07-23 16:33:57 -04:00
Jonathan Leitschuh (WPI)
c3d1e80a62 Merge "Fixed some bugs with CANJaguar verification in C++" 2014-07-23 12:48:17 -07:00
Jonathan Leitschuh (WPI)
01ca19f78f Merge "Added a Jaguar brownout test in C++, cleaned up some C++ tests" 2014-07-23 12:46:27 -07: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
b0369342e9 Fixed some bugs with CANJaguar verification in C++
Change-Id: I3f17c090e26c6019523eb92eb47714464aa01baf
2014-07-23 15:22:26 -04:00
Alex Henning
26d101caf9 Restructure WPILibJ to share code.
wpilibJavaDevices now contains RoboRIO specific code and wpilibJava has
shared high level information. The restructuring was mostly just copy
and paste. The three big exceptions are Timer, RobotState and
HLUsageReporting. Those require some dependencies injection since that
appears to be the cleanest way to share the code.

Change-Id: Ie7011e32bc95953a87801a9905b3bfec7f8de285
2014-07-23 14:11:52 -04:00
Jonathan Leitschuh
e84e0ebab8 Updates the TestBench to use parameters to run specific test methods or test/suite classes.
Updates the test bench to only print "Waiting for enable" on one line with a counter.
Updates all SubSuites to extend the AbstractTestSuite class.
Also includes a small set of tests to prove the validity of the base AbstractTestSuite

Change-Id: I447ca2537a08c84ab1d69fa200cb8125b448a589
2014-07-23 10:43:42 -04:00
Jonathan Leitschuh (WPI)
0704a697ce Merge "Updated the C++ TiltPanCameraTest" 2014-07-23 07:02:46 -07:00
Jonathan Leitschuh (WPI)
13f97bb6e3 Merge "Added an Accelerometer interface" 2014-07-23 06:57:42 -07: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
thomasclark
41c2b9402c Added an Accelerometer interface
ADXL345_I2C, ADXL345_SPI, and BuiltInAccelerometer implement this interface.

The analog accelerometer class Accelerometer was renamed to
AnalogAccelerometer.

Change-Id: Iaae79d582a24c36c372f5fd4ea6df37be289b9c1
2014-07-22 18:04:00 -04:00
Jonathan Leitschuh (WPI)
99632e003b Merge "Fixed the Command-Based Robot template [artf2550]" 2014-07-22 11:00:46 -07:00
thomasclark
fe12394c93 Fixed the Command-Based Robot template [artf2550]
Change-Id: I49361a70fd19d59fbeb9e22a8f65de875fa5a04a
2014-07-22 13:57:45 -04:00
Jonathan Leitschuh (WPI)
fbf196763f Merge "Removed AnalogModule, DigitalModule, and Module from C++" 2014-07-22 10:53:21 -07:00
thomasclark
b5fb35c0c4 Removed AnalogModule, DigitalModule, and Module from Java
Change-Id: I42c58237f1e14d0ebae1c7266aecda00d51eeae1
2014-07-22 13:33:00 -04:00
Alex Henning (WPI)
48e8b2136e Merge "Add support for downloading models hosted on FIRSTForge." 2014-07-22 09:54:23 -07:00
Alex Henning (WPI)
e962c770bb Merge "Fixed installation of frc_gazebo_plugins and a few minor fixes." 2014-07-21 14:12:38 -07:00
Alex Henning
1b7a352cbb Add support for downloading models hosted on FIRSTForge.
Change-Id: I191dc2620b5907316fbc38275d68c568656fa863
Completes: artf2620
2014-07-21 17:09:29 -04:00
thomasclark
1a77cea13a Removed AnalogModule, DigitalModule, and Module from C++
The HAL calls from Analog/DigitalModule are now directly in the classes
that use them.

Change-Id: I1cf879ab2979be903d03ab8282dfe5a5e7ae9443
2014-07-21 16:32:36 -04:00
Alex Henning
afa39deec5 Fixed installation of frc_gazebo_plugins and a few minor fixes.
Change-Id: I1cb30acb69526455469ad890dfee8edd42958a5d
2014-07-21 14:55:43 -04:00
Jonathan Leitschuh
f27e16735f Adds resource tracking to CANJaguar in C++
Change-Id: I0d562af5e9f4f50f79d61db15ff25eaf4dae00d5
2014-07-21 14:36:43 -04:00
Thomas Clark (WPI)
d8a5ced015 Merge "Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()" 2014-07-21 08:23:59 -07:00
Jonathan Leitschuh
8fe606a4b1 Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()
Change-Id: I6ed75428d31df219daf55969e9cd019bf9e0e117
2014-07-21 11:21:36 -04:00
thomasclark
6053a0cc24 Added BuiltInAccelerometer in Java and updated C++
Change-Id: I5a3360c51334e85da6a15fd640f9420bc3b64dca
2014-07-21 10:09:41 -04:00
Jonathan Leitschuh (WPI)
be106b3527 Merge "Added a C++ built-in accelerometer class" 2014-07-21 06:11:59 -07:00
Jonathan Leitschuh (WPI)
ebaf2ef058 Merge "Added HAL methods for using the built-in accelerometer" 2014-07-21 06:02:32 -07:00
thomasclark
9f1a9a07c9 Added a C++ built-in accelerometer class
Change-Id: I80cee788912277f06ac4bdda40261f160de0cbaa
2014-07-21 08:57:03 -04:00
thomasclark
ec2a455bc7 Added HAL methods for using the built-in accelerometer
Change-Id: I5372f5df9b29c546dab3913fcf983a7a9a5427dc
2014-07-21 08:49:51 -04:00
Jonathan Leitschuh
3d740a9a25 Adds Resource tracking to CANJaguar
Change-Id: Ic5da91d378d997f57c65b3bace5fcfd24485dddb
2014-07-18 15:00:59 -04:00
Thomas Clark (WPI)
1dd1e0be1e Merge "Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value." 2014-07-17 12:55:24 -07:00
Jonathan Leitschuh
437e3ff266 Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value.
Change-Id: I3a3b368d429dc5cd00baf94ccd80a676a10cbb48
2014-07-17 15:51:01 -04:00
Jonathan Leitschuh (WPI)
f373c8708d Merge "The camera fixture tests now include an SPI accelerometer test" 2014-07-17 12:48:32 -07:00
thomasclark
54a657a7d4 The camera fixture tests now include an SPI accelerometer test
Change-Id: I5dae746541d1d0e29f7d7c140a8fed8418502f45
2014-07-17 15:44:51 -04:00
Kevin O'Connor
60d8508a65 Fix artf2636 Don't consume ByteBuffer when checking class specific status
Change-Id: I94e46bd436cc8fd41c7550f1135287027e8be9c4
2014-07-17 15:22:53 -04:00
Kevin O'Connor
02a28c8f04 Add allocation checking for I2C MXP. Update DIO counts in Lib layer until resource checking moves down to HAL
Change-Id: I0abe80bcbe9cbbc81f0887a1cd1a3aa0862df5f1
2014-07-17 15:22:53 -04:00
Kevin O'Connor
b128828977 Update Digital Pin count to reflect full 16 DIO on MXP
Change-Id: I180dee11c2c2a7e0585f153ba4b1832bce2bd6d3
2014-07-17 15:22:52 -04:00
Kevin O'Connor
1a1a12316b Remove JNA hack no longer being used
Change-Id: If85d24003524af71d47115ac0ef31ebc88b70f42
2014-07-17 15:22:51 -04:00
Thomas Clark (WPI)
d0fdb3e704 Merge "Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API." 2014-07-17 12:16:14 -07:00
Jonathan Leitschuh (WPI)
5d2e20eaec Merge "More CANJaguar integration tests" 2014-07-17 11:39:26 -07:00
Jonathan Leitschuh
fc0eb4e956 Adds/updates the documentation for the CANJaguar Classes for C++ & Java.
Also removes private unused methods in Java and an unused constructor.

Change-Id: I0a810a4839a5c6752872d947239dd9305141672e
2014-07-17 14:36:51 -04:00
thomasclark
968b69d37d More CANJaguar integration tests
Change-Id: I92e6bb7ee0e7d43c1468650e2c69bb8f46a0154d
2014-07-16 16:45:52 -04:00
Kevin O'Connor
343c7f4f3e Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API.
Change-Id: I9b2c05a05cbe443331a5b6da6a6d7c7be751a5e7
2014-07-16 16:34:37 -04:00
Jonathan Leitschuh (WPI)
80c5c09f77 Merge "Encoders and counters work on the MXP" 2014-07-16 12:10:30 -07:00
thomasclark
cb9df310dc Encoders and counters work on the MXP
Change-Id: Ifeb0533dde53a1ccba841b29e2b86f6f4a1bb33f
2014-07-16 15:06:08 -04:00
thomasclark
f566c087dc Fix a few wrong messages in CANJaguar
Change-Id: I8e1a8fa9b0c20a40e060a8319dbbd605173dc407
2014-07-16 10:27:17 -04:00
Brad Miller (WPI)
7ca1b498e4 Merge "Added generic CAN methods to the HAL" 2014-07-11 12:09:46 -07:00
thomasclark
8bba58b9ab Added generic CAN methods to the HAL
Packing, unpacking, caching, receiving, and sending CAN messages can be done
with a thin wrapper around CANSessionMux now, removing the need for duplicated
code between different CAN devices and languages.

Change-Id: If40181e479f45a443db7a1c264437f7f89ff54d9
2014-07-11 11:38:22 -04:00
Colby Skeggs
8ae64a12ea Removed modules from the simulation infrastructure and refactored FRCPlugin.
Pneumatics still have CAN modules. The refactored code is now eight
plugins for sensors and actuators. There is some code reuse that should
be refactored out, but that level of abstraction will wait until we
figure out how these plugins are integrating with gazebo proper.

Change-Id: I357e695ef05af6dda83a39ba60380686bd57d11a
Closes: artf2610, artf2623
2014-07-07 13:33:34 -07:00
Alex Henning (WPI)
3b4718fc92 Merge "Fixed FRCSim artf2609 - double ports handled wrong." 2014-07-07 12:22:39 -07:00
Alex Henning (WPI)
5800af49bc Merge "Fixed FRCSim artf2599." 2014-07-07 11:46:49 -07:00
Thomas Clark (WPI)
63fc4f6cfb Merge "Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework." 2014-07-03 13:20:50 -07:00
Jonathan Leitschuh
8b770ffb41 Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework.
Change-Id: I1452cace993a5ea8bdd87797d3125cd353b9218f
2014-07-03 15:38:04 -04:00
Colby Skeggs
55fde6b616 Fixed FRCSim artf2609 - double ports handled wrong.
Change-Id: I2dc59c8d3113f3024d237763eb4e2f94bb85ff1a
2014-07-03 12:23:29 -07:00
Colby Skeggs
5ddacb43c1 Fixed FRCSim artf2599.
Made the wpilibC++Sim codebase's motor control as
similar to the wpilibC++ motor control as possible.

Change-Id: I5510d952cb40c4a3def210f46a566d7102d604ee
2014-07-02 15:43:12 -07:00
Brad Miller (WPI)
65c3c0ba09 Merge "Updated the HAL, wpilibj, and wpilibc for PCM and PDP" 2014-07-02 14:04:51 -07:00
Brad Miller (WPI)
fc3ed33f77 Merge "PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API. CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters. Some template magic to make the PDP and PCM getters/setters easy to stamp out." 2014-07-02 14:04:35 -07:00
thomasclark
255a3a5b12 Updated the HAL, wpilibj, and wpilibc for PCM and PDP
Removed #if 0...#endif from PCM.cpp

Change-Id: I2d117c87a3fa10bddebf83706f79c2e767d22a0d

Update the HAL to the PCM/PDP changes

Change-Id: If554b650e263f174e90864f1e9ffba91daf20f7e

Update C++ to the PCM/PDP changes

Change-Id: Ia3114d4526be1dc5cc2f74fd8f7ab44f204d15f2

Updated PCM/PDP in Java

Change-Id: I8fe03afbcb1739d555e86abc0eaae1e12313d490
2014-07-02 16:49:36 -04:00
Omar Zrien
0ef5c3adfa PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API.
CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters.
Some template magic to make the PDP and PCM getters/setters easy to stamp out.

Change-Id: Ibdd0745af070756a282df5074504491fadfde336
2014-07-02 16:48:55 -04:00
Brad Miller (WPI)
37ebcabc4a Merge "Fixed periodic voltage status message" 2014-07-02 10:42:04 -07:00
Brad Miller (WPI)
244ee8d920 Merge "Fixed C++ deploy in Eclipse" 2014-07-02 10:41:36 -07:00
thomasclark
b97d2eb0c3 Fixed periodic voltage status message
Previously, the voltage was requested as a percentage and decoded as
a number of volts, which resulted in values being scaled wrong. The
correct message is requested now.

Change-Id: I5e81c7a4a2e2698f2e8a84ba747217e0e14f7676
2014-07-02 12:14:49 -04:00
thomasclark
ae8d22b0f2 Fixed C++ deploy in Eclipse
Eclipse now runs an ant script to deploy C++ programs, which runs the
robot program with the run-at-startup system

Change-Id: I3e63967ebc40ad3c38aa561fd303ca3c577fd2a2
2014-07-01 17:04:28 -04:00
Brad Miller (WPI)
ff8016c088 Merge "Fixes CounterTest for C++" 2014-07-01 13:01:10 -07:00
Brad Miller (WPI)
f0fb3023ad Merge "CANJaguar uses periodic status updates [artf2621]" 2014-07-01 13:00:15 -07:00
Kacper Puczydlowski
1d33edffee Fixes CounterTest for C++
Change-Id: I3446561cd255c56edd3f284a45ec4fd7efaf84e6
2014-07-01 14:16:53 -04:00
thomasclark
5bd546f1fd CANJaguar uses periodic status updates [artf2621]
All status data is now in 3 messages automatically sent periodically
by the Jaguar, removing the need to send several hundred requests
every second.

The C++ integration test was also updated to be more robust against
timing problems.

Change-Id: I13bacc6c8173ea1a2291a96ad3bd80ff5b18d16f
2014-07-01 12:02:44 -04:00
3127 changed files with 173046 additions and 465731 deletions

107
.clang-format Normal file
View File

@@ -0,0 +1,107 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

223
.gitignore vendored
View File

@@ -1,20 +1,78 @@
wpilibc/build/
hal/build/
networktables/cpp/build/
build/
networktables/OutlineViewer/nbproject/private
*~
target/
dist/
bin/
.project
.cproject
.settings/
.classpath
# WPIlib Specific
#Java File extentions
dependency-reduced-pom.xml
/wpilibj/src/shared/java/edu/wpi/first/wpilibj/util/WPILibVersion.java
/wpilibc/shared/src/WPILibVersion.cpp
/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/WPILibVersion.java
/wpilibc/src/main/native/cpp/WPILibVersion.cpp
doxygen.log
# Created by the jenkins test script
test-reports
# IntelliJ
*.iml
*.ipr
*.iws
.idea/
# Created by http://www.gitignore.io
### Linux ###
*~
# KDE directory preferences
.directory
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Java ###
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
@@ -22,3 +80,140 @@ bin/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### C++ ###
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Compiled Dynamic libraries
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
### CMake ###
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
### Vagrant ###
.vagrant/
### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
### Python ###
*.pyc
__pycache__
# Gradle wrapper
!gradle-wrapper.jar
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
#catkin stuff
package.xml
# Doxygen stuff
NO
# Simulation folder stuff
!simulation/install_resources/*
# VSCode
.vscode/
#classpaths and projects
.project
.classpath
#Visual Studio
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
*.VC.db-shm
*.VC.db-wal
*.sln
*.vcxproj
*.vcxproj.filters
# Visual Studio 2015 cache/options directory
.vs/

View File

@@ -1,5 +0,0 @@
[gerrit]
host=usfirst.collab.net
port=29418
project=allwpilib
defaultbranch=master

View File

@@ -1,13 +0,0 @@
syntax: re
^\.hgignore$
.*/target(?:/|$)
.*/dist(?:/|$)
eclipse-plugins/.*/bin(?:/|$)
syntax: glob
wpilibc/build/
hal/build/
networktables/cpp/build/
build/
networktables/OutlineViewer/nbproject/private
*~

41
.styleguide Normal file
View File

@@ -0,0 +1,41 @@
cppHeaderFileInclude {
\.h$
\.hpp$
\.inc$
}
cppSrcFileInclude {
\.cpp$
}
generatedFileExclude {
gmock/
ni-libraries/include/
ni-libraries/lib/
hal/src/main/native/athena/ctre/
hal/src/main/native/athena/frccansae/
hal/src/main/native/athena/visa/
hal/src/main/native/include/ctre/
UsageReporting\.h$
}
modifiableFileExclude {
wpilibj/src/arm-linux-jni/
wpilibj/src/main/native/cpp/
\.patch$
\.png$
\.py$
\.so$
}
includeOtherLibs {
^HAL/
^llvm/
^networktables/
^opencv2/
^support/
}
includeProject {
^ctre/
}

6
.styleguide-license Normal file
View File

@@ -0,0 +1,6 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) {year} FIRST. All Rights Reserved.{padding}*/
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/

40
.travis.yml Normal file
View File

@@ -0,0 +1,40 @@
sudo: true
dist: trusty
language: java
addons:
apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- g++-6
- python3.5
before_install:
- sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
- sudo apt-get update -q || true
- sudo apt-get install clang-format-5.0 -y
install:
- wget https://bootstrap.pypa.io/get-pip.py
- sudo python3.5 get-pip.py
- python3.5 -m pip install --user wpiformat
- mkdir -p $HOME/latest-gcc-symlinks # see travis-ci/travis-ci#3668
- ln -s /usr/bin/g++-6 $HOME/latest-gcc-symlinks/g++
- ln -s /usr/bin/gcc-6 $HOME/latest-gcc-symlinks/gcc
- export PATH=$HOME/latest-gcc-symlinks:$PATH
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
script:
- python3.5 -m wpiformat -y 2018 -clang 5.0
- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes
- ./gradlew --no-daemon --console=plain -PskipAthena :hal:halSimSharedLibrary :wpilibc:wpilibcSharedLibrary :wpilibj:wpilibJNISharedSharedLibrary :wpilibj:jar

View File

@@ -1,29 +0,0 @@
Building everything requires Maven
mvn package -DembeddedJDKHome=/home/patrick/Downloads/arm-jdk1.7.0_45/
TODO... Explain maven....
TODO.. how to import into eclipse correctly...
Building C++ only
------------------
C++ requires cmake if not run from maven, and is much faster.
Make a new directory and then run:
```
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../arm-toolchain.cmake
make # multicore add -j(num of cpu cores + 1), so -j3 on dual core for faster compile
make install DESTDIR=/some/dir/you/want/to/put/all/headers/and/libs #optional
``
Alternatively, if you like IDEs, you can import it directly into QtDeveloper, or a number of other IDEs such as Code::Blocks or Eclipse. See CMake documentation for details.
Eclipse demo:
```
cd ..
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../allwpilib/arm-toolchain.cmake .. -G "Eclipse CDT4 - Unix Makefiles"
```
and then import that directory into eclipse. Eclipse will detect a CDT project and standard tools will work.
GCC versions
------------
Update arm-toolchain.cmake if the triplet changes (eg using Ubuntu repo arm compiler is arm-linux-gnueabi) or in a non-standard location. Currently it assumes that the compiler is on the path.

View File

@@ -1,12 +0,0 @@
cmake_minimum_required(VERSION 2.8)
project(All-WPILib)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wextra -Wno-unused-parameter -fPIC")
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
get_filename_component(HAL_API_INCLUDES hal/include REALPATH)
get_filename_component(NWT_API_INCLUDES networktables/cpp/include REALPATH)
add_subdirectory(hal)
add_subdirectory(networktables/cpp)
add_subdirectory(wpilibc)

56
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,56 @@
# Contributing to WPILib
So you want to contribute your changes back to WPILib. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules written here, and behave with Gracious Professionalism.
- [General Contribution Rules](#general-contribution-rules)
- [What to Contribute](#what-to-contribute)
- [Coding Guidelines](#coding-guidelines)
- [Submitting Changes](#submitting-changes)
- [Pull Request Format](#pull-request-format)
- [Merge Process](#merge-process)
- [Licensing](#licensing)
## General Contribution Rules
- Everything in the library must work for the 3000+ teams that will be using it.
- We need to be able to maintain submitted changes, even if you are no longer working on the project.
- Tool suite changes must be generally useful to a broad range of teams
- Excluding bug fixes, changes in one language generally need to have corresponding changes in other languages.
- Some features, such the addition of C++11 for WPILibC or Functional Interfaces for WPILibJ, are specific to that version of WPILib only.
- Substantial changes often need to have corresponding LabVIEW changes. To do this, we will work with NI on these large changes.
- Changes should have tests.
- Code should be well documented.
- This often involves ScreenSteps. To add content to ScreenSteps, we will work with you to get the appropriate articles written.
## What to Contribute
- Bug reports and fixes
- We will generally accept bug fixes without too much question. If they are only implemented for one language, we will implement them for any other necessary languages. Bug reports are also welcome, please submit them to our GitHub issue tracker.
- While we do welcome improvements to the API, there are a few important rules to consider:
- Features must be added to both WPILibC and WPILibJ, with rare exceptions.
- During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams.
- Ask about large changes before spending a bunch of time on them! You can create a new issue on our GitHub tracker for feature request/discussion and talk about it with us there.
- Features that make it easier for teams with less experience to be more successful are more likely to be accepted.
- Features in WPILib should be broadly applicable to all teams. Anything that is team specific should not be submitted.
- As a rule, we are happy with the general structure of WPILib. We are not interested in major rewrites of all of WPILib. We are open to talking about ideas, but backwards compatibility is very important for WPILib, so be sure to keep this in mind when proposing major changes.
- Generally speaking, we do not accept code for specific sensors. We have to be able to test the sensor in hardware on the WPILib test bed. Additionally, hardware availability for teams is important. Therefore, as a general rule, the library only directly supports hardware that is in the Kit of Parts. If you are a company interested in getting a sensor into the Kit of Parts, please contact FIRST directly at frcparts@firstinspires.org.
## Coding Guidelines
WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system.
While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
## Submitting Changes
### Pull Request Format
Changes should be submitted as a Pull Request against the master branch of WPILib. For most changes, we ask that you squash your changes down to a single commit. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. No change will be merged unless it is up to date with the current master. We will also not merge any changes with merge commits in them; please rebase off of master before submitting a pull request. We do this to make sure that the git history isn't too cluttered.
### Merge Process
When you first submit changes, Travis-CI will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Travis passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our Jenkins instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
## Licensing
By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).

24
LICENSE.txt Normal file
View File

@@ -0,0 +1,24 @@
Copyright (c) 2009-2017 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

114
README.md Normal file
View File

@@ -0,0 +1,114 @@
# WPILib Project
[![Build Status](https://travis-ci.org/wpilibsuite/allwpilib.svg?branch=master)](https://travis-ci.org/wpilibsuite/allwpilib)
Welcome to the WPILib project. This repository contains the HAL, WPILibJ, and WPILibC projects. These are the core libraries for creating robot programs for the roboRIO.
- [WPILib Mission](#wpilib-mission)
- [Building WPILib](#building-wpilib)
- [Requirements](#requirements)
- [Setup](#setup)
- [Building](#building)
- [Publishing](#publishing)
- [Structure and Organization](#structure-and-organization)
- [Contributing to WPILib](#contributing-to-wpilib)
## WPILib Mission
The WPILib Mission is to enable FIRST Robotics teams to focus on writing game-specific software rather than focussing on hardware details - "raise the floor, don't lower the ceiling". We work to enable teams with limited programming knowledge and/or mentor experience to be as successful as possible, while not hampering the abilities of teams with more advanced programming capabilities. We support Kit of Parts control system components directly in the library. We also strive to keep parity between major features of each language (Java, C++, and NI's LabVIEW), so that teams aren't at a disadvantage for choosing a specific programming language. WPILib is an open source project, licensed under the BSD 3-clause license. You can find a copy of the license [here](license.txt).
# Building WPILib
Using Gradle makes building WPILib very straightforward. It only has a few dependencies on outside tools, such as the ARM cross compiler for creating roboRIO binaries.
## Requirements
- A C++ compiler
- On Linux, gcc works fine
- On Windows, you need Visual Studio 2015 (the free community edition works fine).
Make sure to select the C++ Programming Language for installation
- [ARM Compiler Toolchain](http://first.wpi.edu/FRC/roborio/toolchains/)
* Note that for 2017-2018 and beyond, you will need version 5 or greater of gcc
- Doxygen (Only required if you want to build the C++ documentation)
## Setup
Clone the WPILib repository. If the toolchains are not installed, install them, and make sure they are available on the system PATH.
See the [styleguide README](https://github.com/wpilibsuite/styleguide/blob/master/README.md) for wpiformat setup instructions.
## Building
All build steps are executed using the Gradle wrapper, `gradlew`. Each target that Gradle can build is referred to as a task. The most common Gradle task to use is `build`. This will build all the outputs created by WPILib. To run, open a console and cd into the cloned WPILib directory. Then:
```bash
./gradlew build
```
To build a specific subproject, such as WPILibC, you must access the subproject and run the build task only on that project. Accessing a subproject in Gradle is quite easy. Simply use `:subproject_name:task_name` with the Gradle wrapper. For example, building just WPILibC:
```bash
./gradlew :wpilibc:build
```
If you have installed the FRC Toolchain to a directory other than the default, or if the Toolchain location is not on your System PATH, you can pass the `toolChainPath` property to specify where it is located. Example:
```bash
./gradlew build -PtoolChainPath=some/path/to/frc/toolchain/bin
```
If you also want simulation to be built, add -PmakeSim. This requires gazebo_transport. We have tested on 14.04 and 15.05, but any correct install of Gazebo should work, even on Windows if you build Gazebo from source. Correct means CMake needs to be able to find gazebo-config.cmake. See [The Gazebo website](https://gazebosim.org/) for installation instructions.
```bash
./gradlew build -PmakeSim
```
If you prefer to use CMake directly, the you can still do so.
The common CMake tasks are wpilibcSim, frc_gazebo_plugins, and gz_msgs
```bash
mkdir build #run this in the root of allwpilib
cd build
cmake ..
make
```
The gradlew wrapper only exists in the root of the main project, so be sure to run all commands from there. All of the subprojects have build tasks that can be run. Gradle automatically determines and rebuilds dependencies, so if you make a change in the HAL and then run `./gradlew :wpilibc:build`, the HAL will be rebuilt, then WPILibC.
There are a few tasks other than `build` available. To see them, run the meta-task `tasks`. This will print a list of all available tasks, with a description of each task.
wpiformat can be executed anywhere in the repository via `py -3 -m wpiformat` on Windows or `python3 -m wpiformat` on other platforms.
## Publishing
If you are building to test with the Eclipse plugins or just want to export the build as a Maven-style dependency, simply run the `publish` task. This task will publish all available packages to ~/releases/maven/development. If you need to publish the project to a different repo, you can specify it with `-Prepo=repo_name`. Valid options are:
- development - The default repo.
- beta - Publishes to ~/releases/maven/beta.
- stable - Publishes to ~/releases/maven/stable.
- release - Publishes to ~/releases/maven/release.
The following maven targets a published by this task:
- edu.wpi.first.wpilib.cmake:cpp-root:1.0.0 - roboRIO C++
- edu.wpi.first.wpilibc.simulation:WPILibCSim:0.1.0 - Simulation C++
- edu.wpi.first.wpilibj:wpilibJavaFinal:0.1.0-SNAPSHOT - roboRIO Java
- edu.wpi.first.wpilibj:wpilibJavaSim:0.1.0-SNAPSHOT - Simulation Java
- edu.wpi.first.wpilibj.simulation:SimDS:0.1.0-SNAPSHOT - The driverstation for controlling simulation.
- org.gazebosim:JavaGazebo:0.1.0-SNAPSHOT - Gazebo protocol for Java.
## Structure and Organization
The main WPILib code you're probably looking for is in WPILibJ and WPILibC. Those directories are split into shared, sim, and athena. Athena contains the WPILib code meant to run on your roboRIO. Sim is WPILib code meant to run on your computer with Gazebo, and shared is code shared between the two. Shared code must be platform-independent, since it will be compiled with both the ARM cross-compiler and whatever desktop compiler you are using (g++, msvc, etc...).
The Simulation directory contains extra simulation tools and libraries, such as gz_msgs and JavaGazebo. See sub-directories for more information.
The integration test directories for C++ and Java contain test code that runs on our test-system. When you submit code for review, it is tested by those programs. If you add new functionality you should make sure to write tests for it so we don't break it in the future.
The hal directory contains more C++ code meant to run on the roboRIO. HAL is an acronym for "Hardware Abstraction Layer", and it interfaces with the NI Libraries. The NI Libraries contain the low-level code for controlling devices on your robot. The NI Libraries are found in the ni-libraries folder.
The [styleguide repository](https://github.com/wpilibsuite/styleguide) contains our style guides for C++ and Java code. Anything submitted to the WPILib project needs to follow the code style guides outlined in there. For details about the style, please see the contributors document [here](CONTRIBUTING.md#coding-guidelines).
# Contributing to WPILib
See [CONTRIBUTING.md](CONTRIBUTING.md).

View File

@@ -1,10 +0,0 @@
cmake_minimum_required(VERSION 2.8)
INCLUDE(CMakeForceCompiler)
set(ARM_PREFIX arm-none-linux-gnueabi)
set(CMAKE_SYSTEM_NAME Linux)
CMAKE_FORCE_CXX_COMPILER(${ARM_PREFIX}-g++ GNU)
CMAKE_FORCE_C_COMPILER(${ARM_PREFIX}-gcc GNU)
set(CMAKE_CXX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -Wall -Wno-psabi" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g" CACHE STRING "" FORCE) # still want debugging for release?
SET(CMAKE_FIND_ROOT_PATH $ENV{USER_HOME}/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/arm-none-linux-gnueabi/libc)

202
build.gradle Normal file
View File

@@ -0,0 +1,202 @@
import edu.wpi.first.nativeutils.NativeUtils
import edu.wpi.first.nativeutils.tasks.JNIHeaders
buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.edu.wpi.first:native-utils:1.5.1'
}
}
plugins {
id 'net.ltgt.errorprone' version '0.0.10'
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '2.0'
id 'idea'
}
ext.licenseFile = file("$rootDir/LICENSE.txt")
ext.getJNIHeadersClass = {
return JNIHeaders
}
ext.getClassifier = { binary->
return NativeUtils.getClassifier(binary)
}
ext.getPlatformPath = { binary->
return NativeUtils.getPlatformPath(binary)
}
ext.createComponentZipTasks = { components, name, base, type, project, func ->
def configMap = [:]
components.each {
if (it in NativeLibrarySpec && it.name == name) {
it.binaries.each {
def target = getClassifier(it)
if (configMap.containsKey(target)) {
configMap.get(target).add(it)
} else {
configMap.put(target, [])
configMap.get(target).add(it)
}
}
}
}
def taskList = []
def outputsFolder = file("$project.buildDir/outputs")
def baseN = base + name
configMap.each { key, value ->
def task = project.tasks.create(baseN + "-${key}", type) {
description = 'Creates component archive for platform ' + key
destinationDir = outputsFolder
classifier = key
baseName = baseN + '-classifier'
duplicatesStrategy = 'exclude'
from(licenseFile) {
into '/'
}
func(it, value)
}
taskList.add(task)
project.build.dependsOn task
project.artifacts {
task
}
}
return taskList
}
ext.createAllCombined = { list, name, base, type, project ->
def outputsFolder = file("$project.buildDir/outputs")
def baseN = base + name
def task = project.tasks.create(baseN + '-all', type) {
description = 'Creates component archive for all classifiers'
destinationDir = outputsFolder
classifier = 'all'
baseName = baseN + '-classifier'
duplicatesStrategy = 'exclude'
list.each {
it.outputs.files.each {
from project.zipTree(it)
}
dependsOn it
}
}
project.build.dependsOn task
project.artifacts {
task
}
return task
}
ext.includeStandardZipFormat = { task, value ->
value.each { binary->
if (binary.buildable) {
if (binary instanceof SharedLibraryBinarySpec) {
task.dependsOn binary.buildTask
task.from(new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
into getPlatformPath(binary) + '/shared'
}
task.from (binary.sharedLibraryFile) {
into getPlatformPath(binary) + '/shared'
}
task.from (binary.sharedLibraryLinkFile) {
into getPlatformPath(binary) + '/shared'
}
} else if (binary instanceof StaticLibraryBinarySpec) {
task.dependsOn binary.buildTask
task.from (binary.staticLibraryFile) {
into getPlatformPath(binary) + '/static'
}
}
}
}
}
// Ensure that the WPILibVersioningPlugin is setup by setting the release type, if releaseType wasn't
// already specified on the command line
if (!hasProperty('releaseType')) {
WPILibVersion {
releaseType = 'dev'
}
}
def pubVersion
if (project.hasProperty("publishVersion")) {
pubVersion = project.publishVersion
} else {
pubVersion = WPILibVersion.version
}
def outputsFolder = file("$buildDir/outputs")
def versionFile = file("$outputsFolder/version.txt")
task outputVersions() {
description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
group = 'Build'
outputs.files(versionFile)
doFirst {
buildDir.mkdir()
outputsFolder.mkdir()
}
doLast {
versionFile.write pubVersion
}
}
task build() {}
build.dependsOn outputVersions
task clean(type: Delete) {
delete buildDir
}
subprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'checkstyle'
repositories {
mavenCentral()
}
checkstyle {
toolVersion = "8.1"
configFile = new File(rootDir, "styleguide/checkstyle.xml")
}
// Disables doclint in java 8.
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
ext.setupWpilibRepo = { publishing ->
publishing.repositories.maven {
url = WPILibVersion.mavenLocalUrl
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}

2
cmake/.gitignore vendored
View File

@@ -1,2 +0,0 @@
*~
target/

View File

@@ -1,151 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilib.cmake</groupId>
<artifactId>cpp-root</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<profiles>
<profile>
<id>unix-properties</id>
<properties>
<cmakeGenerator>Unix Makefiles</cmakeGenerator>
</properties>
<activation>
<os>
<family>unix</family>
</os>
</activation>
</profile>
<profile>
<id>MAC-properties</id>
<properties>
<cmakeGenerator>Unix Makefiles</cmakeGenerator>
</properties>
<activation>
<os>
<family>mac</family>
</os>
</activation>
</profile>
<profile>
<id>windows-properties</id>
<properties>
<cmakeGenerator>MSYS Makefiles</cmakeGenerator>
</properties>
<activation>
<os>
<family>windows</family>
</os>
</activation>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<version>2.8.11-b4</version>
<executions>
<execution>
<id>cmake</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<options>
<option>-DCMAKE_TOOLCHAIN_FILE=../../../arm-toolchain.cmake</option>
<option>-DCMAKE_INSTALL_PREFIX=target-root</option>
</options>
</configuration>
</execution>
<execution>
<id>cmake2</id>
<phase>generate-resources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<target>install</target>
</configuration>
</execution>
</executions>
<configuration>
<sourcePath>..</sourcePath>
<targetPath>${project.build.directory}/cmake</targetPath>
<projectDirectory>${project.build.directory}/cmake</projectDirectory>
<generator>${cmakeGenerator}</generator>
<buildType>release</buildType>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<!-- Set time stamp and version properties. -->
<execution>
<id>set-version-info</id>
<goals>
<goal>run</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<target>
<tstamp>
<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
</tstamp>
<tstamp>
<format property="version-info" pattern="yyyy.MMdd.HHmmss"/>
</tstamp>
<property name="version" value="${version-info}.${build-number}"/>
</target>
<exportAntProperties>true</exportAntProperties>
</configuration>
</execution>
<!-- Unzip the include files for cpp.zip. -->
<execution>
<id>unzip-cpp-includes</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo file="${project.build.directory}/cmake/target-root/so.properties">cpp-sos=${version-info}</echo>
<zip destfile="${project.build.directory}/${project.build.finalName}.zip" basedir="${project.build.directory}/cmake/target-root" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>zip-cpp-includes</id>
<phase>compile</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${project.build.finalName}.zip</file>
<type>zip</type>
</artifact>
<artifact>
<file>${project.build.directory}/cmake/target-root/lib/libHALAthena.a</file>
<type>a</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
# Temporary method to deploy C++ integration tests to the RoboRIO
if [ $(which sshpass) ]
then
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram $*
else
ssh admin@10.1.90.2 killall FRCUserProgram
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
ssh admin@10.1.90.2 ./FRCUserProgram $*
fi

235
config.gradle Normal file
View File

@@ -0,0 +1,235 @@
import edu.wpi.first.nativeutils.*
import org.gradle.internal.os.OperatingSystem
def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT']
def windowsReleaseCompilerArgs = ['/O2']
def windowsLinkerArgs = [ '/DEBUG:FULL' ]
def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ]
def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g',
'-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread']
def linuxLinkerArgs = ['-rdynamic', '-pthread']
def linuxReleaseCompilerArgs = ['-Og']
def linuxDebugCompilerArgs = ['-O0']
def linux32BitArg = '-m32'
def macCompilerArgs = ['-std=c++11', '-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',
'-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field',
'-Wno-unused-const-variable', '-pthread']
def macReleaseCompilerArgs = ['-O2']
def macDebugCompilerArgs = ['-O0']
def mac32BitArg = '-m32'
def buildAll = project.hasProperty('buildAll')
def windows64PlatformDetect = {
def arch = System.getProperty("os.arch")
def isWin = OperatingSystem.current().isWindows()
if (buildAll) {
return isWin
} else {
return isWin && arch == 'amd64'
}
}
def windows32PlatformDetect = {
def arch = System.getProperty("os.arch")
def isWin = OperatingSystem.current().isWindows()
if (buildAll) {
return isWin
} else {
return isWin && arch == 'x86'
}
}
def linux32IntelPlatformDetect = {
def arch = System.getProperty("os.arch")
def isLinux = OperatingSystem.current().isLinux()
def isIntel = (arch == 'amd64' || arch == 'i386')
if (buildAll) {
return isLinux && isIntel
} else {
return isLinux && arch == 'i386'
}
}
def linux64IntelPlatformDetect = {
def arch = System.getProperty("os.arch")
def isLinux = OperatingSystem.current().isLinux()
def isIntel = (arch == 'amd64' || arch == 'i386')
if (buildAll) {
return isLinux && isIntel
} else {
return isLinux && arch == 'amd64'
}
}
def linuxArmPlatformDetect = {
def arch = System.getProperty("os.arch")
def isIntel = (arch == 'amd64' || arch == 'i386')
return OperatingSystem.current().isLinux() && !isIntel
}
def mac64PlatformDetect = {
def arch = System.getProperty("os.arch")
def isMac = OperatingSystem.current().isMacOsX()
if (buildAll) {
return isMac
} else {
return isMac && arch == 'x86_64'
}
}
def mac32PlatformDetect = {
def arch = System.getProperty("os.arch")
def isMac = OperatingSystem.current().isMacOsX()
if (buildAll) {
return isMac
} else {
return isMac && arch == 'x86'
}
}
if (!project.hasProperty('skipAthena')) {
model {
buildConfigs {
roboRio(CrossBuildConfig) {
architecture = 'athena'
operatingSystem = 'linux'
toolChainPrefix = 'arm-frc-linux-gnueabi-'
compilerArgs = linuxCompilerArgs
linkerArgs = linuxLinkerArgs
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Gcc'
exclude << 'halSim'
exclude << 'halSimStaticDeps'
exclude << 'halSimTestingBase'
exclude << 'wpilibcTestingBase'
}
}
}
}
if (!project.hasProperty('onlyAthena')) {
model {
buildConfigs {
winX86(BuildConfig) {
architecture = 'x86'
operatingSystem = 'windows'
compilerArgs = windowsCompilerArgs
linkerArgs = windowsLinkerArgs
releaseCompilerArgs = windowsReleaseCompilerArgs
releaseLinkerArgs = windowsReleaseLinkerArgs
compilerFamily = 'VisualCpp'
detectPlatform = windows32PlatformDetect
exclude << 'halAthena'
}
winX64(BuildConfig) {
architecture = 'x86-64'
operatingSystem = 'windows'
compilerArgs = windowsCompilerArgs
linkerArgs = windowsLinkerArgs
releaseCompilerArgs = windowsReleaseCompilerArgs
releaseLinkerArgs = windowsReleaseLinkerArgs
compilerFamily = 'VisualCpp'
detectPlatform = windows64PlatformDetect
exclude << 'halAthena'
}
/* Disable 32 bit linux until we can figure out jenkins
linuxX86(BuildConfig) {
architecture = 'x86'
operatingSystem = 'linux'
compilerArgs = linuxCompilerArgs
compilerArgs << linux32BitArg
linkerArgs = linuxLinkerArgs
linkerArgs << linux32BitArg
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Gcc'
detectPlatform = linux32IntelPlatformDetect
exclude << 'halAthena'
}
*/
linuxX64(BuildConfig) {
architecture = 'x86-64'
operatingSystem = 'linux'
compilerArgs = linuxCompilerArgs
linkerArgs = linuxLinkerArgs
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Gcc'
detectPlatform = linux64IntelPlatformDetect
exclude << 'halAthena'
}
/* 32 bit Mac OS X not supported by OpenCV.
* If support is ever added, will add this back in
macX86(BuildConfig) {
architecture = 'x86'
operatingSystem = 'osx'
compilerArgs = macCompilerArgs
compilerArgs << mac32BitArg
linkerArgs << mac32BitArg
debugCompilerArgs = macDebugCompilerArgs
releaseCompilerArgs = macReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Clang'
detectPlatform = mac32PlatformDetect
exclude << 'halAthena'
}
*/
macX64(BuildConfig) {
architecture = 'x86-64'
operatingSystem = 'osx'
compilerArgs = macCompilerArgs
debugCompilerArgs = macDebugCompilerArgs
releaseCompilerArgs = macReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Clang'
detectPlatform = mac64PlatformDetect
exclude << 'halAthena'
}
}
}
}
if (project.hasProperty('linuxCross')) {
model {
buildConfigs {
linuxArm(CrossBuildConfig) {
architecture = 'nativearm'
operatingSystem = 'linux'
toolChainPrefix = 'PLEASE_PROVIDE_A_COMPILER_NAME'
compilerArgs = linuxCompilerArgs
linkerArgs = linuxLinkerArgs
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
skipByDefault = true
compilerFamily = 'Gcc'
exclude << 'gmock'
exclude << 'halAthena'
}
}
}
} else {
model {
buildConfigs {
linuxArm(BuildConfig) {
architecture = 'nativearm'
operatingSystem = 'linux'
compilerArgs = linuxCompilerArgs
linkerArgs = linuxLinkerArgs
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Gcc'
detectPlatform = linuxArmPlatformDetect
exclude << 'halAthena'
}
}
}
}

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first</groupId>
<artifactId>driver-station</artifactId>
<packaging>jar</packaging>
<version>0.1.0-SNAPSHOT</version>
<profiles>
<profile>
<id>docline-java8-disable</id>
<activation>
<jdk>[1.8,</jdk>
</activation>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>edu.wpi.first.driverstation.DriverStation</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,248 +0,0 @@
package edu.wpi.first.driverstation;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import edu.wpi.first.driverstation.fms.FMSController;
import edu.wpi.first.driverstation.fms.FMSInterface;
import edu.wpi.first.driverstation.robotcoms.ControlMode;
import edu.wpi.first.driverstation.robotcoms.RobotComm;
/**
* Driver station implementation for the test stand. This is based heavily on
* code done by Brendan McLeod, modified for command line argument and local
* socket input.
*
* @author Fredric Silberberg
*/
public class DriverStation {
protected static final Logger log = Logger.getLogger(DriverStation.class
.getName());
protected static DriverStation station;
public static void main(String[] args) {
int team = 190, port = 6190;
List<String> commandQueue = new LinkedList<>();
// If there are command line arguments, then input them
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
String command = args[i];
switch (command) {
case "-t":
// Get the team number if there is still an argument
if (i + 1 < args.length) {
try {
team = Integer.parseInt(args[++i]);
} catch (NumberFormatException ex) {
log.log(Level.WARNING,
"Error, non-integer team number " + args[i]);
displayUsage();
System.exit(-1);
}
} else {
log.log(Level.WARNING,
"Error, no team number provided.");
displayUsage();
System.exit(-1);
}
log.log(Level.INFO, "Team number is set to " + team);
break;
case "-h":
// Display help
displayUsage();
return;
// TODO: Support networked commands
// case "-p":
// // Get the port number
// // Get the team number if there is still an argument
// if (i + 1 < args.length) {
// try {
// port = Integer.parseInt(args[++i]);
// } catch (NumberFormatException ex) {
// log.log(Level.WARNING,
// "Error, non-integer port number " + args[i]);
// displayUsage();
// System.exit(-1);
// }
// } else {
// log.log(Level.WARNING,
// "Error, no port number provided.");
// displayUsage();
// System.exit(-1);
// }
// log.log(Level.INFO, "Port number is set to " + port);
// break;
case "enable":
case "disable":
case "teleop":
case "auto":
case "estop":
case "reboot":
case "test":
// Add the command to the queue of commands
commandQueue.add(command);
break;
default:
log.log(Level.SEVERE, "Unknown input " + command);
displayUsage();
System.exit(-1);
}
}
}
station = new DriverStation(team, port);
for (String command : commandQueue) {
station.addCommand(command);
}
station.run();
}
public static void displayUsage() {
System.out.println("The Java FRC Driverstation");
System.out.println("To Use: java -jar <driverstation jar> [commands]");
System.out.println("-h: Print this display and exit");
System.out.println("-t [team]: Specify the team number (default 190)");
System.out
.println("enable, disable, teleop, auto, test, estop, reboot");
System.out.println("Run the given commands on startup");
}
RobotComm robot;
FMSInterface fms;
LinkedBlockingQueue<String> queue;
Thread netThread, sysThread;
public DriverStation(final int team, final int port) {
queue = new LinkedBlockingQueue<>();
robot = new RobotComm(team);
fms = new FMSController(team);
robot.setFMSController(fms);
robot.setDaemon(true);
sysThread = new Thread(new Runnable() {
public void run() {
BufferedReader sysIn = new BufferedReader(
new InputStreamReader(System.in));
while (!Thread.interrupted()) {
try {
String com = sysIn.readLine();
log.log(Level.FINE, "Recieved stdin command " + com);
station.addCommand(com);
} catch (IOException ex) {
log.log(Level.WARNING, "Error in system read thread",
ex);
}
}
}
});
sysThread.setDaemon(true);
// TODO: Test the networking protocol
// netThread = new Thread(new Runnable() {
// public void run() {
// ServerSocket servSock = null;
// List<Thread> connections = new LinkedList<>();
// try {
// servSock = new ServerSocket(port);
// while (!Thread.interrupted()) {
// Socket sock = servSock.accept();
// Thread newCon = new Thread(new ReadThread(sock, station));
// newCon.run();
// connections.add(newCon);
// log.log(Level.INFO, "Accepted new network connection");
// }
// } catch (IOException ex) {
// log.log(Level.WARNING, "Error with the network thread", ex);
// } finally {
// try {
// for (Thread t : connections) {
// t.interrupt();
// }
// servSock.close();
// } catch (IOException | NullPointerException e) {
// log.log(Level.SEVERE,
// "Error when closing the server socket", e);
// }
// }
// }
// });
// netThread.setDaemon(true);
}
public void run() {
System.out.println("Activating driver station");
robot.start();
System.out
.println("The driverstation supports the following commands:");
System.out
.println("enable, disable, teleop, auto, test, reboot, estop, quit");
sysThread.start();
// netThread.start();
while (true) {
try {
String command = queue.take();
log.log(Level.FINE, "Received command " + command);
switch (command) {
case "enable":
log.log(Level.INFO, "Enabling robot");
robot.setEnabled(true);
break;
case "disable":
log.log(Level.INFO, "Disabling robot");
robot.setEnabled(false);
break;
case "teleop":
log.log(Level.INFO, "Setting robot to teleop mode");
robot.setControlMode(ControlMode.TELEOP);
break;
case "auto":
log.log(Level.INFO, "Setting robot to auto mode");
robot.setControlMode(ControlMode.AUTO);
break;
case "test":
log.log(Level.INFO, "Setting robot to test mode");
robot.setControlMode(ControlMode.TEST_MODE);
break;
case "estop":
log.log(Level.INFO, "Estoping robot");
robot.eStopRobot();
break;
case "reboot":
log.log(Level.INFO, "Rebooting robot");
robot.rebootRobot();
break;
case "quit":
log.log(Level.INFO, "Shutting down");
sysThread.interrupt();
// netThread.interrupt();
return;
default:
log.log(Level.WARNING, "Unknown input " + command);
break;
}
} catch (InterruptedException e) {
log.log(Level.WARNING, "Error when taking command", e);
}
}
}
public void addCommand(String command) {
try {
queue.put(command);
} catch (InterruptedException e) {
log.log(Level.WARNING, "Error when added an element to the queue",
e);
}
}
}

View File

@@ -1,42 +0,0 @@
package edu.wpi.first.driverstation;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ReadThread implements Runnable {
private final Logger log = Logger.getLogger(DriverStation.class.getName());
Socket sock;
DriverStation ds;
public ReadThread(Socket sock, DriverStation ds) {
this.sock = sock;
this.ds = ds;
}
@Override
public void run() {
try {
BufferedReader netIn = new BufferedReader(new InputStreamReader(
sock.getInputStream()));
while (!Thread.interrupted()) {
String com = netIn.readLine();
log.log(Level.FINE, "Received command " + com);
ds.addCommand(com);
}
} catch (IOException e) {
log.log(Level.WARNING, "IO Exception in net thread", e);
} finally {
try {
sock.close();
} catch (IOException | NullPointerException ex) {
log.log(Level.SEVERE, "Error when closing the socket", ex);
}
}
}
}

View File

@@ -1,249 +0,0 @@
package edu.wpi.first.driverstation.fms;
import edu.wpi.first.driverstation.DriverStation;
import edu.wpi.first.driverstation.fms.FMSInterface;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.CRC32;
import edu.wpi.first.driverstation.robotcoms.ControlMode;
/**
*
* @author Brendan
*/
public class FMSController extends Thread implements FMSInterface {
private static final Logger log = Logger.getLogger(DriverStation.class
.getName());
private class FMSDataIn extends Thread {
private FMSController fmsController;
private int FMSreceivePort = 1120;
private DatagramSocket FMSreceiveSocket;
public FMSDataIn(FMSController fmsController) {
this.fmsController = fmsController;
try {
FMSreceiveSocket = new DatagramSocket(FMSreceivePort);
} catch (SocketException ex) {
log.log(Level.WARNING, "Error creating Robot Sockets", ex);
}
}
@Override
public void run() {
while (true) {
try {
byte[] receiveData = new byte[74];// the size of the data
DatagramPacket receivePacket = new DatagramPacket(
receiveData, receiveData.length);
FMSreceiveSocket.receive(receivePacket);
fmsController
.setIP(receivePacket.getAddress().getAddress());
fmsController.receiveFMSpacket(receiveData);
} catch (Exception ex) {
log.log(Level.INFO, "Receive error", ex);
}
}
}
}
private FMSDataIn dataInput;
private DatagramSocket FMSsendingSocket;
private int teamNumber;
private int FMSsendPort = 1160;
private byte[] ipFMS = new byte[4];
private boolean[] controlState = new boolean[8];
// {auto, test, mode, enabled, not-estopped}
private boolean[] fromRobot = new boolean[] { false, false, false, true };
private char[] batteryData = new char[] { 13, 13 };
private long lastFMS = 0;
private long lastFMSSent = 0;
char[] stationID = new char[2];
private boolean isRobotConnected;
/*
* controlState[0] //null controlState[1] //WAP link controlState[2] //check
* version #s controlState[3] //request DS info? controlState[4]
* //auto-teleop controlState[5] //enabled-disabled controlState[6] //not
* estop controlState[7] //null
*/
public FMSController(int team) {
teamNumber = team;
try {
FMSsendingSocket = new DatagramSocket(FMSsendPort);
} catch (SocketException ex) {
log.log(Level.WARNING, "Error creating FMS Sockets", ex);
}
for (int i = 0; i < 4; i++) {
ipFMS[i] = (byte) 0xFF;
}
dataInput = new FMSDataIn(this);
dataInput.setDaemon(true);
setDaemon(true);
start();
}
@Override
public void start() {
dataInput.start();
super.start();
}
@Override
public void run() {
while (true) {
if ((System.currentTimeMillis() > (lastFMSSent + 100))) {
lastFMSSent = System.currentTimeMillis();
sendFMSData();
}
}
}
private void setIP(byte[] ipIn) {
ipFMS = ipIn;
}
@Override
public boolean isFMSConnected() {
return ((lastFMS + 1000) > System.currentTimeMillis());
}
private void receiveFMSpacket(byte[] receiveData) {
lastFMS = System.currentTimeMillis();
// reveive data 0, 1 are useless
// 2 contains control data
for (int i = 0; i < 8; i++) {
controlState[i] = (receiveData[2] & (1 << (i))) > 0;
}
stationID[0] = (char) receiveData[3];
stationID[1] = (char) receiveData[4];
}
private void sendFMSData() {
CRC32 crctest = new CRC32();
byte[] sendData = new byte[50];
for (int i = 0; i < 50; i++) {
sendData[i] = 0x00;
}
if (isRobotConnected)// {auto, test mode, enabled, not-estopped}
{
sendData[2] += 0x02;
}
if (fromRobot[0])// 0 holds the mode (1=auto 0=teleop)
{
sendData[2] += 0x10;
}
if (fromRobot[2])// 1 holds enabled (1=enabled)
{
sendData[2] += 0x20;
}
if (fromRobot[3])// 2 holds not e-stoped (1=good, 0=bad)
{
sendData[2] += 0x40;
}
byte teamHigh = (byte) ((teamNumber - (teamNumber % 100)) / 100);
byte teamLow = (byte) (teamNumber % 100);
sendData[6] = 10;// IP address
sendData[7] = teamHigh;
sendData[8] = teamLow;
sendData[9] = 5;// make this variable!!!!
sendData[10] = (byte) stationID[0];// the alliance color
sendData[11] = (byte) stationID[1]; // the station number
sendData[26] = 0x00;// amount of dropped packets
sendData[27] = 0x00;// amount of dropped packets
sendData[28] = 0x00;// number of packets received
sendData[29] = 0x00;// number of packets received
sendData[30] = 0x00;// trip time
sendData[31] = 0x00;// trip time
sendData[32] = 0x00;// trip time
sendData[33] = 0x00;// trip time
// need to capture actual voltage
sendData[40] = (byte) batteryData[0];
sendData[41] = (byte) batteryData[1];
/*
* get CRC
*/
crctest.reset();
crctest.update(sendData);
/*
* convert CRC to byte format
*/
long crccheck = crctest.getValue();
sendData[46] = (byte) ((crccheck >> 24) & 0xff);
sendData[47] = (byte) ((crccheck >> 16) & 0xff);
sendData[48] = (byte) ((crccheck >> 8) & 0xff);
sendData[49] = (byte) ((crccheck) & 0xff);
log.log(Level.FINE, "Sending FMS Data");
/*
* send packet
*/
try {
DatagramPacket sendPacket = new DatagramPacket(sendData,
sendData.length, InetAddress.getByAddress(ipFMS),
FMSsendPort);
FMSsendingSocket.send(sendPacket);
} catch (Exception e) {
}
}
@Override
public char getAllianceColor() {
return stationID[0];
}
@Override
public char getDSNumber() {
return stationID[1];
}
@Override
public boolean isEnabled() {
return controlState[5];
}
@Override
public ControlMode getControlMode() {
if (!controlState[4]) {
return ControlMode.TELEOP;
}
return ControlMode.AUTO;
}
@Override
public void updateBattery(char[] batteryData) {
this.batteryData = batteryData;
}
@Override
public void updateRobotFeedback(boolean[] fromRobot) {
this.fromRobot = fromRobot;
}
@Override
public void setRobotConnected(boolean connected) {
isRobotConnected = connected;
}
}

View File

@@ -1,25 +0,0 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.driverstation.fms;
import edu.wpi.first.driverstation.robotcoms.ControlMode;
/**
*
* @author Brendan
*/
public interface FMSInterface {
public char getAllianceColor();
public char getDSNumber();
public boolean isFMSConnected();
public boolean isEnabled();
public ControlMode getControlMode();
public void updateBattery(char[] batteryData);
public void updateRobotFeedback(boolean[] fromRobot);
public void setRobotConnected(boolean connected);
}

View File

@@ -1,54 +0,0 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.driverstation.fms;
import edu.wpi.first.driverstation.robotcoms.ControlMode;
/**
*
* @author Brendan
*/
public class NoFMSController implements FMSInterface {
@Override
public char getAllianceColor() {
return 'B';
}
@Override
public char getDSNumber() {
return '1';
}
@Override
public boolean isFMSConnected() {
return false;
}
@Override
public boolean isEnabled() {
return false;
}
@Override
public ControlMode getControlMode() {
return ControlMode.TELEOP;
}
@Override
public void updateBattery(char[] batteryData) {
return;
}
@Override
public void updateRobotFeedback(boolean[] fromRobot) {
return;
}
@Override
public void setRobotConnected(boolean connected) {
return;
}
}

View File

@@ -1,24 +0,0 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.driverstation.robotcoms;
/**
*
* @author Brendan
*/
public enum ControlMode {
AUTO("AUTO"), TELEOP("TELEOP"), TEST_MODE("TEST");
private String name;
private ControlMode(String name) {
this.name = name;
}
@Override
public String toString() {
return name; //To change body of generated methods, choose Tools | Templates.
}
}

View File

@@ -1,319 +0,0 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.driverstation.robotcoms;
import edu.wpi.first.driverstation.DriverStation;
import edu.wpi.first.driverstation.fms.FMSInterface;
import edu.wpi.first.driverstation.fms.NoFMSController;
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.CRC32;
/**
*
* @author Brendan
*/
public class RobotComm extends Thread {
private static final Logger log = Logger.getLogger(DriverStation.class
.getName());
private class RobotDataIn extends Thread {
RobotComm theRobotComm;
private DatagramSocket robotReceiveSocket;
private int robotReceivePort = 1150;
public RobotDataIn(RobotComm robotComm) {
theRobotComm = robotComm;
try {
robotReceiveSocket = new DatagramSocket(robotReceivePort);
} catch (SocketException ex) {
log.log(Level.WARNING, "Error creating Robot Sockets", ex);
}
}
public void run() {
while (true) {
try {
byte[] receiveData = new byte[1024];// the size of the data
DatagramPacket receivePacket = new DatagramPacket(
receiveData, receiveData.length);
robotReceiveSocket.receive(receivePacket);
theRobotComm.receiveRobotpacket(receiveData);
Thread.yield();
} catch (Exception ex) {
}
}
}
}
private DatagramSocket robotSendingSocket;
private RobotDataIn inputSocket;
private final int robotSendPortNormal = 1110;
// private final int robotSendPortNormal = 1115;//actually for sending on
// the field (used for robot sim)
private final int robotSendPortFMS = 1115;
private int sentPackets;// the current packet ID that is being sent to the
// robot
private int lastRobotPacket;// the last packet ID to have been recieved by
// the robot
private long lastRobotTime;// the time stamp when the robot was seen
private boolean[] controlDataToSend;// {auto, test mode, enabled,
// not-estopped, reboot}
private boolean[] controlFromRobot;// {auto, test mode, enabled,
// not-estopped}
private byte[] stationID = new byte[2];
private char[] batteryData = new char[2];
private int robotTeam = 0;
private long lastSentTime = 0;
private int packetOffset = 0;
private FMSInterface fmsController;
public RobotComm(int team) {
robotTeam = team;
try {
robotSendingSocket = new DatagramSocket();// robotSendPortNormal);
} catch (SocketException ex) {
log.log(Level.WARNING, "Error creating Robot Sockets", ex);
}
sentPackets = 0;
controlFromRobot = new boolean[] { false, false, false, true };// {auto,
// test
// mode,
// enabled,
// not-estopped}
controlDataToSend = new boolean[] { false, false, false, true, false };// {auto,
// test
// mode,
// enabled,
// not-estopped,
// reboot}
fmsController = new NoFMSController();
inputSocket = new RobotDataIn(this);
inputSocket.setDaemon(true);
}
@Override
public void start() {
inputSocket.start();
super.start();
}
@Override
public void run() {
while (true) {
if ((lastSentTime + 20) < System.currentTimeMillis()) {
lastSentTime = System.currentTimeMillis();
sendRobotData();
}
}
}
public void rebootRobot() {
setEnabled(false);
controlDataToSend[4] = true;
}
public void setControlMode(ControlMode theMode) {
if (theMode == ControlMode.AUTO) {// {auto, test mode, enabled,
// not-estopped}
controlDataToSend[0] = true;
controlDataToSend[1] = false;
} else if (theMode == ControlMode.TELEOP) {// {auto, test mode, enabled,
// not-estopped}
controlDataToSend[0] = false;
controlDataToSend[1] = false;
} else if (theMode == ControlMode.TEST_MODE) {// {auto, test mode,
// enabled,
// not-estopped}
controlDataToSend[0] = false;
controlDataToSend[1] = true;
}
}
public void setEnabled(boolean enabled) {// {auto, test mode, enabled,
// not-estopped, reboot}
controlDataToSend[2] = enabled;
}
public void eStopRobot() {
controlDataToSend[3] = false;
}
public void setAllianceInfo(byte allianceColor, byte allianceStation) {
stationID = new byte[] { allianceColor, allianceStation };
}
public void setTeamNumber(int newTeam) {
robotTeam = newTeam;
}
public void setFMSController(FMSInterface newFMS) {
fmsController = newFMS;
}
/**
* Packs up all the data and sends the packet to the robot
*/
private void sendRobotData() {
sentPackets++;
sentPackets = sentPackets % 0xFFFF;// makes it overflow properly
packetOffset = sentPackets - lastRobotPacket;
CRC32 crctest = new CRC32();
byte[] sendData = new byte[1024];
for (int i = 0; i < 1024; i++) {
sendData[i] = 0x00;
}
// Construct the pacet counts
sendData[0] = (byte) ((sentPackets >> 8) & 0xFF);
sendData[1] = (byte) (sentPackets & 0xFF);
// {auto, test mode, enabled, not-estopped, reboot}
if (controlDataToSend[4]) {// reboot bit
sendData[2] += 0x80;
controlDataToSend[4] = false;
}
if (controlDataToSend[3]) {// not e-stop bit
sendData[2] += 0x40;
} else {
controlDataToSend[3] = true;
}
if (controlDataToSend[2])// if enabled
{
sendData[2] += 0x20;
}
if (controlDataToSend[0])// 1 holds the mode (1=auto 0=teleop)
{
sendData[2] += 0x10;
}
if (fmsController.isFMSConnected()) {
sendData[2] += 0x08;
}
if (!isConnected()) {
sendData[2] += 0x04;
}
sendData[3] = (byte) 0xFF;// make all digial inputs high
sendData[4] = (byte) ((robotTeam >> 8) & 0xFF);// packs up and sends
// team number
sendData[5] = (byte) ((robotTeam) & 0xFF);
sendData[6] = stationID[0];// the alliance color
sendData[7] = stationID[1]; // the station number
sendData[72] = (byte) 0x31;
sendData[73] = (byte) 0x31;
sendData[74] = (byte) 0x33;
sendData[75] = (byte) 0x30;
sendData[76] = (byte) 0x21;
sendData[77] = (byte) 0x21;
sendData[78] = (byte) 0x30;
sendData[79] = (byte) 0x30;
crctest.reset();
crctest.update(sendData);
long crccheck = crctest.getValue();
sendData[1020] = (byte) ((crccheck >> 24) & 0xff);
sendData[1021] = (byte) ((crccheck >> 16) & 0xff);
sendData[1022] = (byte) ((crccheck >> 8) & 0xff);
sendData[1023] = (byte) ((crccheck >> 0) & 0xff);
byte teamHigh = (byte) ((robotTeam - robotTeam % 100) / 100);
byte teamLow = (byte) (robotTeam % 100);
/*
* send packet
*/
try {
DatagramPacket sendPacket;
if (!fmsController.isFMSConnected()) {
sendPacket = new DatagramPacket(sendData, sendData.length,
InetAddress.getByAddress(new byte[] { 10, teamHigh,
teamLow, 2 }), robotSendPortNormal);
} else {
sendPacket = new DatagramPacket(sendData, sendData.length,
InetAddress.getByAddress(new byte[] { 10, teamHigh,
teamLow, 2 }), robotSendPortFMS);
}
robotSendingSocket.send(sendPacket);
} catch (Exception e) {
log.log(Level.WARNING, "Failed to send", e);
}
fmsController.setRobotConnected(isConnected());
}
public boolean isConnected() {
if (!(lastRobotTime + 100 > System.currentTimeMillis())) {
return (false);
}
if (packetOffset > 25) {
return (false);
}
return (true);
}
public char[] getBatteryData() {
return batteryData;
}
/**
* Return the control data that it has gathered from the robot in the
* format: {auto, test mode, enabled, not-estopped}
*
* @return The data from the robot
*/
public boolean[] getControlDataFromRobot() {
return controlFromRobot;
}
public double getBatteryVoltage() {
return Double.parseDouble(getBatteryString());
}
public String getBatteryString() {
return (String.format("%x", getBatteryData()[0]) + "." + String.format(
"%x", getBatteryData()[1]));
}
protected void receiveRobotpacket(byte[] dataIn) {// this gets called
// whenever a new robot
// packet is recieved
int teamNumber = 0;
teamNumber += dataIn[8] & 0xFF;
teamNumber = ((teamNumber << 8) + (dataIn[9] & 0xFF)) & 0xFFFF;
if (robotTeam == teamNumber) {
lastRobotTime = System.currentTimeMillis();
batteryData[0] = (char) dataIn[1];
batteryData[1] = (char) dataIn[2];
lastRobotPacket = 0;
lastRobotPacket += dataIn[30] & 0xFF;
lastRobotPacket = ((lastRobotPacket << 8) + (dataIn[31] & 0xFF)) & 0xFFFF;
controlFromRobot[0] = ((0x10 & dataIn[0]) > 0);// auto
controlFromRobot[2] = ((0x20 & dataIn[0]) > 0);// enabled
controlFromRobot[3] = true;// robot isn't estopped yet
} else {
log.log(Level.INFO, "Data from different team...");
}
fmsController.updateRobotFeedback(controlFromRobot);
fmsController.updateBattery(batteryData);
}
}

View File

@@ -1,4 +0,0 @@
*runcppprogram text eol=lf
*runjavaprogram text eol=lf
*robotCommand text eol=lf
*robotDebugCommand text eol=lf

View File

@@ -1,4 +0,0 @@
*~
target/
bin/
.settings/

View File

@@ -1 +0,0 @@
bin.includes = feature.xml

View File

@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.core.feature"
label="WPILib Robot Development Core"
version="0.1.0.qualifier"
provider-name="Worcester Polytechnic Institute">
<copyright>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<url>
<discovery label="Juno" url="http://download.eclipse.org/releases/juno/"/>
</url>
<plugin
id="edu.wpi.first.wpilib.plugins.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.core.feature</artifactId>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -1,34 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: edu.wpi.first.wpilib.plugins.core
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.core;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: edu.wpi.first.wpilib.plugins.core.WPILibCore
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jface.text,
org.eclipse.core.resources,
org.eclipse.ui.editors,
org.eclipse.ui.ide,
org.eclipse.ant.core;bundle-version="3.2.400",
org.eclipse.ant.launching;bundle-version="1.0.200",
org.eclipse.debug.core;bundle-version="3.7.100",
org.eclipse.core.externaltools;bundle-version="1.0.100",
org.eclipse.debug.ui;bundle-version="3.8.1",
org.eclipse.ui.externaltools;bundle-version="3.2.100",
org.eclipse.ant.ui;bundle-version="3.5.300",
org.eclipse.ui.console;bundle-version="3.5.100",
org.eclipse.ui.navigator;bundle-version="3.5.200",
org.eclipse.ui.navigator.resources;bundle-version="3.4.400",
org.eclipse.ui.intro,
org.eclipse.ui.intro.universal,
org.eclipse.core.expressions;bundle-version="3.4.400"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: edu.wpi.first.wpilib.plugins.core,
edu.wpi.first.wpilib.plugins.core.ant,
edu.wpi.first.wpilib.plugins.core.installer,
edu.wpi.first.wpilib.plugins.core.launching,
edu.wpi.first.wpilib.plugins.core.nature,
edu.wpi.first.wpilib.plugins.core.preferences,
edu.wpi.first.wpilib.plugins.core.wizards

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,3 +0,0 @@
a#WPILibRobotDevelopment-introLink img { background-image : url(graphics/sample.gif); }
a#WPILibRobotDevelopment-introLink:hover img { background-image : url(graphics/sample_hov.gif); }

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<introContent>
<extensionContent id="WPILibRobotDevelopment-introExtension" style="css/sample.css" name="Sample Extension" path="overview/@">
<group style-id="content-group" id="WPILibRobotDevelopment-introLink-group">
<link label="WPILib Documentation" url="http://wpilib.screenstepslive.com/s/3120" id="WPILibRobotDevelopment-introLink" style-id="content-link">
<text>Documentation of how WPILib and it's associated tools work. (Internet Connection Needed)</text>
</link>
</group>
</extensionContent>
</introContent>

View File

@@ -1,10 +0,0 @@
source.. = src/main/java/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
resources/
buildDirectory = build/
plugin.destination = ${basedir}/repository
eclipse.home = /usr/lib/eclipse

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

View File

@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
name="FRCProjectNature"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature">
</run>
</runtime>
</extension>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="edu.wpi.first.wpilib.plugins.core.actionSet"
label="WPILib Action Set"
visible="true">
<menu
id="edu.wpi.first.wpilib.plugins.core.menu"
label="WPI&amp;Lib">
<separator
name="edu.wpi.first.wpilib.plugins.core.actions">
</separator>
</menu>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunSmartDashboardAction"
icon="icons/smartdashboard16x16.png"
id="edu.wpi.first.wpilib.plugins.core.actions.RunSmartDashboardAction"
label="Run &amp;SmartDashboard"
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
toolbarPath="WPILib"
tooltip="Launch the SmartDashboard to get feedback from the robot.">
</action>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunRobotBuilderAction"
icon="icons/robotbuilder16x16.png"
id="edu.wpi.first.wpilib.plugins.core.actions.RunRobotBuilderAction"
label="Run &amp;RobotBuilder"
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
toolbarPath="WPILib"
tooltip="Launch the RobotBuilder to help develop command-based programs.">
</action>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunSFXDashboardAction"
icon="icons/sfxdashboard16x16.png"
id="edu.wpi.first.wpilib.plugins.core.actions.RunSFXDashboardAction"
label="Run &amp;SFX Dashboard"
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
toolbarPath="WPILib"
tooltip="Launch the SFX Dashboard to get feedback from the robot.">
</action>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunOutlineViewerAction"
icon="icons/outlineviewer16x16.png"
id="edu.wpi.first.wpilib.plugins.core.actions.RunOutlineViewerAction"
label="Run &amp;Outline Viewer"
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
toolbarPath="WPILib"
tooltip="Launch the Outline Viewer to see the raw feedback from the robot.">
</action>
</actionSet>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
class="edu.wpi.first.wpilib.plugins.core.preferences.WPILibPreferencePage"
id="edu.wpi.first.wpilib.plugins.core.preferences.WPILibPreferencePage"
name="WPILib Preferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="edu.wpi.first.wpilib.plugins.core.preferences.PreferenceInitializer">
</initializer>
</extension>
<extension
point="org.eclipse.ui.intro.configExtension">
<configExtension
configId="org.eclipse.ui.intro.universalConfig"
content="WPILib Intro/sample.xml">
</configExtension>
</extension>
</plugin>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.core</artifactId>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -1,151 +0,0 @@
package edu.wpi.first.wpilib.plugins.core;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import edu.wpi.first.wpilib.plugins.core.ant.AntPropertiesParser;
import edu.wpi.first.wpilib.plugins.core.installer.ToolsInstaller;
import edu.wpi.first.wpilib.plugins.core.preferences.PreferenceConstants;
/**
* The activator class controls the plug-in life cycle
*/
public class WPILibCore extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "edu.wpi.first.wpilib.plugins.core"; //$NON-NLS-1$
// The shared instance
private static WPILibCore plugin;
/**
* The constructor
*/
public WPILibCore() {
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
new ToolsInstaller(getDefaultVersion()).installIfNecessary();
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static WPILibCore getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given plug-in
* relative path
*
* @param path
* the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
public Properties getProjectProperties(IProject project) {
List<InputStream> streams = new ArrayList<InputStream>();
try {
if (project != null) {
try {
streams.add(project.getFile("build.properties")
.getContents());
} catch (CoreException e) {
} // No properties file
}
File file = new File(getWPILibBaseDir() + "/wpilib.properties");
streams.add(new FileInputStream(file));
return new AntPropertiesParser(streams).getProperties();
} catch (Exception e) {
WPILibCore.logError("Error loading project properties.", e);
return new Properties();
}
}
public void saveGlobalProperties(Properties props) {
try {
props.store(new FileOutputStream(new File(WPILibCore.getDefault()
.getWPILibBaseDir() + "/wpilib.properties")),
"Don't add new properties, they will be deleted by the eclipse plugin.");
} catch (IOException e) {
WPILibCore.logError("Error saving global properties.", e);
}
}
public int getTeamNumber(IProject project) {
return Integer.parseInt(getProjectProperties(project).getProperty(
"team-number", "0"));
}
public String getTargetIP(IProject project) {
String target = getProjectProperties(project).getProperty("target");
if (target != null)
return target;
else {
int teamNumber = getTeamNumber(project);
return "10." + (teamNumber / 100) + "." + (teamNumber % 100) + ".2";
}
}
public String getWPILibBaseDir() {
return System.getProperty("user.home") + "/wpilib";
}
public String getDefaultVersion() {
return "2013-test-0.4";
}
public String getCurrentVersion() {
return getPreferenceStore()
.getString(PreferenceConstants.TOOLS_VERSION);
}
public static void logInfo(String msg) {
getDefault().getLog().log(new Status(Status.INFO, PLUGIN_ID, Status.OK, msg, null));
}
public static void logError(String msg, Exception e) {
getDefault().getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e));
}
}

View File

@@ -1,71 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.actions;
import java.io.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Our sample action implements workbench action delegate.
* The action proxy will be created by the workbench and
* shown in the UI. When the user tries to use the action,
* this delegate will be created and execution will be
* delegated to it.
* @see IWorkbenchWindowActionDelegate
*/
public class RunOutlineViewerAction implements IWorkbenchWindowActionDelegate {
/**
* The constructor.
*/
public RunOutlineViewerAction() {
}
/**
* The action has been activated. The argument of the
* method represents the 'real' action sitting
* in the workbench UI.
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
String jarFile = WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools"+File.separator
+WPILibCore.getDefault().getCurrentVersion()+File.separator+"OutlineViewer-with-dependencies.jar";
String[] cmd = {"java", "-jar", jarFile};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
} catch (CoreException e) {
WPILibCore.logError("Error running outline viewer.", e);
}
}
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
* if we want, but this can only happen after
* the delegate has been created.
* @see IWorkbenchWindowActionDelegate#selectionChanged
*/
public void selectionChanged(IAction action, ISelection selection) {
}
/**
* We can use this method to dispose of any system
* resources we previously allocated.
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
}
/**
* We will cache window object in order to
* be able to provide parent shell for the message dialog.
* @see IWorkbenchWindowActionDelegate#init
*/
public void init(IWorkbenchWindow window) {
}
}

View File

@@ -1,78 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.actions;
import java.io.File;
import java.io.FilenameFilter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Our sample action implements workbench action delegate.
* The action proxy will be created by the workbench and
* shown in the UI. When the user tries to use the action,
* this delegate will be created and execution will be
* delegated to it.
* @see IWorkbenchWindowActionDelegate
*/
public class RunRobotBuilderAction implements IWorkbenchWindowActionDelegate {
/**
* The constructor.
*/
public RunRobotBuilderAction() {
}
/**
* The action has been activated. The argument of the
* method represents the 'real' action sitting
* in the workbench UI.
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
File dir = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools"+File.separator
+WPILibCore.getDefault().getCurrentVersion());
File[] files = dir.listFiles(new FilenameFilter() {
@Override public boolean accept(File dir, String name) {
return name.startsWith("RobotBuilder") && name.endsWith(".jar");
}
});
if (files.length < 1) return;
String[] cmd = {"java", "-jar", files[0].getAbsolutePath()};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
} catch (CoreException e) {
WPILibCore.logError("Error running RobotBuilder.", e);
}
}
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
* if we want, but this can only happen after
* the delegate has been created.
* @see IWorkbenchWindowActionDelegate#selectionChanged
*/
public void selectionChanged(IAction action, ISelection selection) {
}
/**
* We can use this method to dispose of any system
* resources we previously allocated.
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
}
/**
* We will cache window object in order to
* be able to provide parent shell for the message dialog.
* @see IWorkbenchWindowActionDelegate#init
*/
public void init(IWorkbenchWindow window) {
}
}

View File

@@ -1,71 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.actions;
import java.io.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Our sample action implements workbench action delegate.
* The action proxy will be created by the workbench and
* shown in the UI. When the user tries to use the action,
* this delegate will be created and execution will be
* delegated to it.
* @see IWorkbenchWindowActionDelegate
*/
public class RunSFXDashboardAction implements IWorkbenchWindowActionDelegate {
/**
* The constructor.
*/
public RunSFXDashboardAction() {
}
/**
* The action has been activated. The argument of the
* method represents the 'real' action sitting
* in the workbench UI.
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
String jarFile = WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools"+File.separator
+WPILibCore.getDefault().getCurrentVersion()+File.separator+"sfx.jar";
String[] cmd = {"java", "-jar", jarFile};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
} catch (CoreException e) {
WPILibCore.logError("Error running SFXDashboard.", e);
}
}
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
* if we want, but this can only happen after
* the delegate has been created.
* @see IWorkbenchWindowActionDelegate#selectionChanged
*/
public void selectionChanged(IAction action, ISelection selection) {
}
/**
* We can use this method to dispose of any system
* resources we previously allocated.
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
}
/**
* We will cache window object in order to
* be able to provide parent shell for the message dialog.
* @see IWorkbenchWindowActionDelegate#init
*/
public void init(IWorkbenchWindow window) {
}
}

View File

@@ -1,71 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.actions;
import java.io.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Our sample action implements workbench action delegate.
* The action proxy will be created by the workbench and
* shown in the UI. When the user tries to use the action,
* this delegate will be created and execution will be
* delegated to it.
* @see IWorkbenchWindowActionDelegate
*/
public class RunSmartDashboardAction implements IWorkbenchWindowActionDelegate {
/**
* The constructor.
*/
public RunSmartDashboardAction() {
}
/**
* The action has been activated. The argument of the
* method represents the 'real' action sitting
* in the workbench UI.
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
String jarFile = WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools"+File.separator
+WPILibCore.getDefault().getCurrentVersion()+File.separator+"SmartDashboard.jar";
String[] cmd = {"java", "-jar", jarFile};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
} catch (CoreException e) {
WPILibCore.logError("Error running SmartDashboard.", e);
}
}
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
* if we want, but this can only happen after
* the delegate has been created.
* @see IWorkbenchWindowActionDelegate#selectionChanged
*/
public void selectionChanged(IAction action, ISelection selection) {
}
/**
* We can use this method to dispose of any system
* resources we previously allocated.
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
}
/**
* We will cache window object in order to
* be able to provide parent shell for the message dialog.
* @see IWorkbenchWindowActionDelegate#init
*/
public void init(IWorkbenchWindow window) {
}
}

View File

@@ -1,83 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.ant;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public class AntPropertiesParser {
List<InputStream> files;
public AntPropertiesParser(List<InputStream> files) {
this.files = files;
}
@SuppressWarnings("serial")
public AntPropertiesParser(final InputStream file) {
this(new ArrayList<InputStream>() {{add(file);}});
}
public Properties getProperties() throws CoreException {
return getProperties(null);
}
public Properties getProperties(Properties defaults) throws CoreException {
Properties props = defaults;
for (int i = files.size()-1; i >= 0; i--) {
props = getPropertyFile(files.get(i), props);
}
return props;
}
public Properties getPropertyFile(InputStream resource, Properties defaults) throws CoreException {
Properties props;
if (defaults == null) props = new Properties();
else props = new Properties(defaults);
try {
props.load(resource);
} catch (IOException e) {
WPILibCore.logError("Error loading property file: "+resource, e);
return null;
}
// TODO: Improve parsing of ant properties
boolean overflow = false;
for (Object key : props.keySet().toArray()) {
int count = 0;
while (props.getProperty((String) key).toString().contains("$") && count < 10) {
Pattern pattern = Pattern.compile( "\\$\\{(.*?)\\}" );
Matcher matcher = pattern.matcher( props.getProperty((String) key).toString() );
StringBuffer sb = new StringBuffer();
while ( matcher.find() ) {
String prop = matcher.group().substring(2, matcher.group().length()-1);
if (props.getProperty(prop) != null) {
matcher.appendReplacement(sb, Matcher.quoteReplacement(props.getProperty(prop)));
} else if (prop.equals("user.home")) {
matcher.appendReplacement(sb, Matcher.quoteReplacement(System.getProperty("user.home")));
} else {
matcher.appendReplacement(sb, Matcher.quoteReplacement(matcher.group()));
}
}
matcher.appendTail( sb );
props.setProperty((String) key, sb.toString());
count++;
}
if (count >= 50) overflow = true;
}
if (overflow) throw new CoreException(new Status(0, "WPI", "Could not parse build.properties file"));
return props;
}
}

View File

@@ -1,243 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.installer;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.swing.JOptionPane;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugPlugin;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public abstract class AbstractInstaller {
protected File installLocation;
protected String version;
public AbstractInstaller(String version) {
this.installLocation = new File(WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + getFeatureName() + File.separator + version);
this.version = version;
}
/**
* @return The name of the feature being installed.
*/
protected abstract String getFeatureName();
/**
* Update the installed version to the latest version.
* @param version The latest version installed.
*/
protected abstract void updateInstalledVersion(String version);
/**
* @return The input stream to the zip file being installed.
*/
protected abstract InputStream getInstallResourceStream();
public void installIfNecessary() {
final Job installJob = new Job("Install " + getFeatureName()) {
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask(getTaskMessage(), IProgressMonitor.UNKNOWN);
WPILibCore.logInfo("Installing "+getFeatureName()+" if necessary");
if (!isInstalled()) {
WPILibCore.logInfo("Install necessary");
try {
install();
} catch (InstallException e) {
WPILibCore.logError("Error installing "+getFeatureName(), e);
return new Status(IStatus.ERROR, WPILibCore.PLUGIN_ID,
getErrorMessage(e));
}
}
updateInstalledVersion(version);
WPILibCore.logInfo("Installed");
return Status.OK_STATUS;
}
private String getErrorMessage(InstallException ex) {
String message = "Unable to install " + getFeatureName();
if (ex.getCause() != null) {
message += ": " + ex.getCause().getMessage();
} else if (ex.getMessage() != null) {
message += ": " + ex.getMessage();
}
message += ". See console for details.";
return message;
}
private String getTaskMessage() {
try {
return "Extracting to " + installLocation.getCanonicalPath();
} catch (IOException ex) {
WPILibCore.logError("installIfNecessary().getTaskMessage()", ex);
return "Extracting";
}
}
};
installJob.setUser(true);
installJob.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
installJob.schedule();
}
/**
* This function has been updated to guarantee that the wpilib folder date
* is older than the jar file being run, which ensures up to date tools.
*
* @return True for is there and newer, false otherwise.
*/
protected boolean isInstalled() {
return installLocation.exists();
}
/**
* This function will delete an old wpilib subfolder if necessary and then copy
* the resource stream to the intended directory.
*
* @throws InstallException if bad things happen ...
*/
protected void install() throws InstallException {
if(installLocation.exists()) {
if(!removeFileHandler(installLocation, true)) {
JOptionPane.showMessageDialog(null,
String.format("Could not update the old wpilib folder.%n"
+ "Please close any WPILib tools and restart Eclipse."));
}
else
removeFileHandler(installLocation, false);
}
installLocation.mkdirs();
final String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS X") || osName.startsWith("Linux")) { // Unix-like OSes must preserve the executable bit; call unzip
final File tmpFile = File.createTempFile(getFeatureName()+"-", ".zip");
try {
// Copy to temporary file
try (final InputStream zip = getInstallResourceStream();
final FileOutputStream fout = new FileOutputStream(tmpFile)) {
copyStreams(zip, fout);
}
// Call 'unzip'
final String[] cmd = {"unzip", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
WPILibCore.logInfo("unzip "+tmpFile.getAbsolutePath()+" -d "+installLocation.getAbsolutePath());
final Process unzipProcess = DebugPlugin.exec(cmd, installLocation);
try (final InputStream is = unzipProcess.getInputStream()) {
copyStreams(is, System.out); // Copy output to console
}
// Check result
final int exitCode = unzipProcess.waitFor();
if (exitCode > 1 || exitCode < 0) { // Exit code 1 indicates success with warnings
throw new InstallException("Unzip process failed with code " + exitCode);
}
} finally {
tmpFile.delete();
}
} else {
ZipInputStream zip = new ZipInputStream(getInstallResourceStream());
ZipEntry entry = zip.getNextEntry();
while (entry != null) {
WPILibCore.logInfo("\tZipEntry " + entry + ": " + entry.getSize());
File f = new File(installLocation, entry.getName());
if (entry.isDirectory()) {
f.mkdirs();
} else {
FileOutputStream fo = new FileOutputStream(f);
copyStreams(zip, fo);
fo.close();
}
zip.closeEntry();
entry = zip.getNextEntry();
}
zip.close();
}
} catch (IOException | CoreException | InterruptedException ex) {
throw new InstallException("Install encountered a problem", ex);
}
}
private static void copyStreams(InputStream source, OutputStream destination) throws IOException {
byte[] buffer = new byte[1024];
int len;
while((len = source.read(buffer)) >= 0){
destination.write(buffer,0,len);
}
}
/**
* Recursively remove all of the files and folders described by this file handler.
*
* @param file The file to remove
* @param testRun True to just test if the files can be deleted
* @return True if this and all subFiles were removed, false otherwise.
*/
private static boolean removeFileHandler(File file, boolean testRun) {
// if normal files (data files and the like)
if(file.isFile()) {
if(testRun) return file.getParentFile().canWrite();
else return file.delete();
}
// if folders
else if(file.isDirectory()) {
for(File f : file.listFiles()) {
if(!removeFileHandler(f, testRun))
return false;
}
if(testRun) return file.getParentFile().canWrite();
else return file.delete();
}
// I'm not sure what to do if the file is not normal or a directory ...
else return false;
}
/**
* Indicates that an attempt to install a resource failed.
*/
private static class InstallException extends Exception {
private static final long serialVersionUID = 4883122446098399588L;
/**
* @see Exception#Exception()
*/
@SuppressWarnings("unused")
public InstallException() {
super();
}
/**
* @see Exception#Exception(String)
*/
public InstallException(String message) {
super(message);
}
/**
* @see Exception#Exception(String, Throwable)
*/
public InstallException(String message, Throwable cause) {
super(message, cause);
}
}
}

View File

@@ -1,38 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.preferences.PreferenceConstants;
public class ToolsInstaller extends AbstractInstaller {
public ToolsInstaller(String version) {
super(version);
}
@Override
protected String getFeatureName() {
return "tools";
}
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCore.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLS_VERSION)) {
WPILibCore.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
}
}
@Override
protected InputStream getInstallResourceStream() {
return ToolsInstaller.class.getResourceAsStream("/resources/tools.zip");
}
}

View File

@@ -1,148 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.launching;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut;
import org.eclipse.ant.launching.IAntLaunchConstants;
import org.eclipse.core.externaltools.internal.IExternalToolConstants;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.IConsoleConstants;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Contains functions to launch ant scripts while having the output sent to the
* console. Allows for the use of arguments, the specification of targets, and
* the choice of launch modes
*
* @author Ryan O'Meara
*/
@SuppressWarnings("restriction")
public class AntLauncher {
private static boolean installing = false;
/**
* Runs an ant script's target's with the given arguments, in the given launch mode
* @param antScript A java.io.File representation of the ant file to execute
* @param targets A String of the ant targets to run. For multiple targets,
* format if "target1,target2". For no targets, this argument can be null. This
* method will assume output should be sent to the console, same as calling
* runAntFile(antScript, targets, arguments, mode, true)
* @param arguments A String of arguments to run the file with. Format is
* "-argument1 -argument2". For no arguments, this argument can be null
* @param mode String, either "run" or "debug". If an invalid input is given,
* defaults to "run"
* @return The ILaunch started, or null if it failed to start
*/
public static ILaunch runAntFile(File antScript, String targets, String arguments, String mode){
return runAntFile(antScript, targets, arguments, mode, true);
}
/**
* Runs an ant script's target's with the given arguments, in the given launch mode
* @param antScript A java.io.File representation of the ant file to execute
* @param targets A String of the ant targets to run. For multiple targets,
* format if "target1,target2". For no targets, this argument can be null. Allows
* choice of outputting to the console
* @param arguments A String of arguments to run the file with. Format is
* "-argument1 -argument2". For no arguments, this argument can be null
* @param mode String, either "run" or "debug". If an invalid input is given,
* defaults to "run"
* @param outputToConsole If true, output will be sent to console, if false it will not
* @return The ILaunch started, or null if it failed to start
*/
public static ILaunch runAntFile(File antScript, String targets, String arguments, String mode, boolean outputToConsole){
//Input error checking
if((mode == null)||(!mode.equalsIgnoreCase(ILaunchManager.DEBUG_MODE))){mode = ILaunchManager.RUN_MODE;} //Launcher only accepts run or debug
if((targets != null)&&(targets.equalsIgnoreCase(""))){targets = null;} //Standardize representation of "none"
if((arguments != null)&&(arguments.equalsIgnoreCase(""))){arguments = null;}
if(antScript.getAbsolutePath().indexOf("install.xml") != -1){
installing = true;
}else{
installing = false;
}
ILaunch ret = null;
try{
//Show the console
if(outputToConsole){
try{
final IWorkbenchPage activePage = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
activePage.showView(IConsoleConstants.ID_CONSOLE_VIEW);
}catch(Exception e){}
}
//Get an ant launch config setup to use eclipse VM - which users will setup to be the jdk,
//allowing the use of javac. Also sets the location of the file to execute
ILaunchConfiguration launcher = AntLaunchShortcut.createDefaultLaunchConfiguration(new Path(antScript.getAbsolutePath()), null);
//Get copy that can be edited
ILaunchConfigurationWorkingCopy workingCopy = launcher.getWorkingCopy();
//Prevent this configuration from appearing in history or dialogs
workingCopy.setAttribute(ILaunchManager.ATTR_PRIVATE, false);
//Setup to show output on console
if(outputToConsole){
workingCopy.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true);
workingCopy.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, true);
}else{
workingCopy.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
workingCopy.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, false);
}
workingCopy.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
if(targets != null){
workingCopy.setAttribute(IAntLaunchConstants.ATTR_ANT_TARGETS, targets);
}
if(arguments != null){
workingCopy.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments);
}
if(mode.equals(ILaunchManager.DEBUG_MODE)){
Set<String> modes = new HashSet<String>();
modes.add(ILaunchManager.DEBUG_MODE);
workingCopy.addModes(modes);
}
//Save/assert all changes
launcher = workingCopy.doSave();
//Launch the modified configuration in the specified mode
try {
ret = launcher.launch(mode, null, true, true);
} catch(Exception e) {
//Does not need Output, handled and resolved internally
WPILibCore.logError("Error running launch.", e);
return null;
}
} catch(Exception e) {
WPILibCore.logError("Error running ant file", e);
return null;
}
return ret;
}
public static boolean isInstalling(){
return installing;
}
}

View File

@@ -1,97 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.nature;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Project nature which configures any project which is given it to be an
* FRC Project, and designates it so FRC options will be enabled to act on
* it
*
*/
public class FRCProjectNature implements IProjectNature {
public static final String FRC_PROJECT_NATURE =
"edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature";
private IProject internalProject;
/**
* IStatus representing a failed configuration attempt
*
* @author Ryan O'Meara
*/
private class FRCProjectFailedStatus implements IStatus{
String message;
public FRCProjectFailedStatus(String message){
this.message = message;
}
@Override
public IStatus[] getChildren() {return null;}
@Override
public int getCode() {return 0;}
@Override
public Throwable getException() {return null;}
@Override
public String getMessage() {return message;}
@Override
public String getPlugin() {return WPILibCore.PLUGIN_ID;}
@Override
public int getSeverity() {return ERROR;}
@Override
public boolean isMultiStatus() {return false;}
@Override
public boolean isOK() {return false;}
@Override
public boolean matches(int severityMask) {
if((severityMask & ERROR) == ERROR){return true;}
return false;
}
}
public FRCProjectNature(){
internalProject = null;
}
@Override
public void configure() throws CoreException {
if(internalProject == null){
throw new CoreException(
new FRCProjectFailedStatus("No project set"));
}
}
@Override
public void deconfigure() throws CoreException {
if(internalProject == null){
throw new CoreException(
new FRCProjectFailedStatus("No project set"));
}
}
@Override
public IProject getProject() {
return internalProject;
}
@Override
public void setProject(IProject project) {
internalProject = project;
}
}

View File

@@ -1,69 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.preferences;
import java.util.List;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
public class ComboFieldEditor extends FieldEditor {
private List<String> choices;
private Composite parent;
Combo comboDropDown;
public ComboFieldEditor(String preference, String label, Composite parent, List<String> choices) {
super(preference, label, parent);
this.choices = choices;
for (String choice : choices) {
comboDropDown.add(choice);
}
}
public void setChoice(String item) {
comboDropDown.select(choices.indexOf(item));
}
public String getChoice() {
return choices.get(comboDropDown.getSelectionIndex());
}
@Override protected void adjustForNumColumns(int numColumns) {
((GridData) parent.getLayoutData()).horizontalSpan = numColumns;
}
@Override protected void doFillIntoGrid(Composite parent, int numColumns) {
this.parent = parent;
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = numColumns;
parent.setLayoutData(gd);
Label label = getLabelControl(parent);
label.setText(getLabelText());
comboDropDown = new Combo(parent, SWT.DROP_DOWN | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
comboDropDown.setLayoutData(gd);
}
@Override protected void doLoad() {
String item = getPreferenceStore().getString(getPreferenceName());
setChoice(item);
}
@Override protected void doLoadDefault() {
String item = getPreferenceStore().getDefaultString(getPreferenceName());
setChoice(item);
}
@Override protected void doStore() {
getPreferenceStore().setValue(getPreferenceName(), getChoice());
}
@Override public int getNumberOfControls() {
return 2;
}
}

View File

@@ -1,10 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.preferences;
/**
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String TEAM_NUMBER = "teamNumberPreference";
public static final String TOOLS_VERSION = "toolsVersionPreference";
public static final String UPDATE_TOOLS_VERSION = "udpateToolsVersionPreference";
}

View File

@@ -1,25 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Class used to initialize default preference values.
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibCore.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.TEAM_NUMBER,
WPILibCore.getDefault().getProjectProperties(null).getProperty("team-number", "0"));
store.setDefault(PreferenceConstants.TOOLS_VERSION, WPILibCore.getDefault().getDefaultVersion());
store.setDefault(PreferenceConstants.UPDATE_TOOLS_VERSION, true);
}
}

View File

@@ -1,98 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.preferences;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* This class represents a preference page that
* is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
* us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
* are stored in the preference store that belongs to
* the main plug-in class. That way, preferences can
* be accessed directly via the preference store.
*/
public class WPILibPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
IntegerFieldEditor teamNumberEditor;
private ComboFieldEditor toolsVersionEditor;
private BooleanFieldEditor autoUpdateEditor;
public WPILibPreferencePage() {
super(GRID);
setPreferenceStore(WPILibCore.getDefault().getPreferenceStore());
setDescription("A preference page for changing all workspace level settings.");
}
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
* of preferences. Each field editor knows how to save and
* restore itself.
*/
public void createFieldEditors() {
teamNumberEditor = new IntegerFieldEditor(PreferenceConstants.TEAM_NUMBER,
"&Team Number:", getFieldEditorParent());
addField(teamNumberEditor);
toolsVersionEditor = new ComboFieldEditor(PreferenceConstants.TOOLS_VERSION,
"&Tools Version:", getFieldEditorParent(), getInstalledVersions());
addField(toolsVersionEditor);
autoUpdateEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_TOOLS_VERSION,
"&Auto Update Tools Version", getFieldEditorParent());
addField(autoUpdateEditor);
}
private List<String> getInstalledVersions() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
WPILibCore.logInfo("Preferences initialized.");
Properties props = WPILibCore.getDefault().getProjectProperties(null);
getPreferenceStore().setValue(PreferenceConstants.TEAM_NUMBER,
Integer.parseInt(props.getProperty("team-number", "0")));
}
@Override public void performApply() {
performOk();
}
@Override public boolean performOk() {
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("team-number", teamNumberEditor.getStringValue());
WPILibCore.getDefault().saveGlobalProperties(props);
return super.performOk();
}
}

View File

@@ -1,90 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.net.URL;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public abstract class ExampleWizard extends Wizard implements INewWizard {
private ExampleWizardChoicePage page1;
private IWizardPage page2;
protected ISelection selection;
private TeamNumberPage teamNumberPage;
/**
* Constructor for SampleNewWizard.
*/
public ExampleWizard() {
super();
setNeedsProgressMonitor(true);
}
/**
* The worker method. It will find the container, create the
* file if missing or just replace its contents, and open
* the editor on the newly created file.
*/
protected abstract void doFinish(IExampleProject ex, String teamNumber) throws CoreException;
protected abstract IWizardPage getDetailsPage();
public abstract IExampleProject makeExampleProject(String name, String description,
List<String> tags, List<String> folders, List<IExampleProject.ExportFile> files);
public abstract URL getResourceURL();
public abstract String getXMLFile();
protected TeamNumberPage getTeamNumberPage() {
return teamNumberPage;
}
/**
* Adding the page to the wizard.
*/
public void addPages() {
if (TeamNumberPage.needsTeamNumberPage()) {
teamNumberPage = new TeamNumberPage(selection);
addPage(teamNumberPage);
}
page1 = new ExampleWizardChoicePage(this, selection);
addPage(page1);
page2 = getDetailsPage();
addPage(page2);
}
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
* using wizard as execution context.
*/
public boolean performFinish() {
try {
doFinish(page1.getExampleProject(), TeamNumberPage.getTeamNumberFromPage(teamNumberPage));
} catch (CoreException e) {
WPILibCore.logError("Error finishing example.", e);
MessageDialog.openError(getShell(), "Error", e.getMessage());
return false;
}
return true;
}
/**
* We will accept the selection in the workbench to see if
* we can initialize from it.
* @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
}
}

View File

@@ -1,240 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* The "New" wizard page allows setting the container for the new file as well
* as the file name. The page will only accept file name without the extension
* OR with the extension that matches the expected one (mpe).
*/
public class ExampleWizardChoicePage extends WizardPage {
private Tree exampleTree;
private Browser descriptionText;
private IExampleProject selectedExample;
private ExampleWizard parent;
/**
* Constructor for SampleNewWizardPage.
*
* @param pageName
*/
public ExampleWizardChoicePage(ExampleWizard parent, ISelection selection) {
super("wizardPage");
this.parent = parent;
setTitle("Select Example Project to Create");
setDescription("This wizard creates a new example project based on your selection.");
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
exampleTree = new Tree(container, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
gd.heightHint = 400;
exampleTree.setLayoutData(gd);
exampleTree.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
dialogChanged();
}
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
dialogChanged();
}
});
descriptionText = new Browser(container, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
gd.heightHint = 400;
gd.widthHint = 300;
descriptionText.setLayoutData(gd);
initialize();
dialogChanged();
setControl(container);
}
/**
* Tests if the current workbench selection is a suitable container to use.
*/
private void initialize() {
Document doc = loadXMLResource(parent.getXMLFile());
// Generate all of the tags
List<Tag> tags = new ArrayList<Tag>();
NodeList nList = doc.getElementsByTagName("tagDescription");
for (int i = 0; i < nList.getLength(); i++) {
if (nList.item(i).getNodeType() == Node.ELEMENT_NODE) {
tags.add(generateTagFromElement((Element) nList.item(i)));
}
}
// Generate all of the example projects
List<IExampleProject> examples = new ArrayList<IExampleProject>();
nList = doc.getElementsByTagName("example");
for (int i = 0; i < nList.getLength(); i++) {
if (nList.item(i).getNodeType() == Node.ELEMENT_NODE) {
examples.add(generateExampleFromElement((Element) nList.item(i)));
}
}
WPILibCore.logInfo(examples.toString());
WPILibCore.logInfo(tags.toString());
// Generate the tags tree
for (Tag tag : tags) {
TreeItem tagItem = new TreeItem(exampleTree, SWT.NONE);
tagItem.setData(tag);
tagItem.setText(tag.getName());
for (IExampleProject ex : examples) {
if (ex.getTags().contains(tag.getName())) {
TreeItem exItem = new TreeItem(tagItem, SWT.NONE);
exItem.setData(ex);
exItem.setText(ex.getName());
}
}
tagItem.setExpanded(true);
}
}
/**
* Ensures that both text fields are set.
*/
private void dialogChanged() {
if (exampleTree.getSelection().length > 0) {
Object selectedData = exampleTree.getSelection()[0].getData();
if (selectedData instanceof IExampleProject) {
IExampleProject example = (IExampleProject) selectedData;
descriptionText.setText(example.getContent());
selectedExample = example;
} else if (selectedData instanceof Tag) {
Tag tag = (Tag) selectedData;
descriptionText.setText(tag.getContent());
selectedExample = null;
} else selectedExample = null;
}
if (selectedExample == null) {
updateStatus("Must select a valid example before continuing.");
return;
}
updateStatus(null);
}
private void updateStatus(String message) {
setErrorMessage(message);
setPageComplete(message == null);
}
private Document loadXMLResource(String filename) {
final URL installURL = parent.getResourceURL();
URL url = null;
try {
url = new URL(installURL, filename);
} catch (final MalformedURLException e) {
WPILibCore.logError("loadXMLResource()", e);
return null;
}
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
Document doc;
try {
dBuilder = dbFactory.newDocumentBuilder();
doc = dBuilder.parse(url.openStream());
} catch (ParserConfigurationException e) {
WPILibCore.logError("Error parsing "+filename, e);
return null;
} catch (SAXException e) {
WPILibCore.logError("SAX issue with "+filename, e);
return null;
} catch (IOException e) {
WPILibCore.logError("Error reading "+filename, e);
return null;
}
doc.getDocumentElement().normalize();
return doc;
}
private Tag generateTagFromElement(Element element) {
String name = element.getElementsByTagName("name").item(0).getTextContent();
String description = element.getElementsByTagName("description").item(0).getTextContent();
return new Tag(name, description);
}
private IExampleProject generateExampleFromElement(Element element) {
String name = element.getElementsByTagName("name").item(0).getTextContent();
String description = element.getElementsByTagName("description").item(0).getTextContent();
List<String> tags = new ArrayList<String>();
Node tagsElement = element.getElementsByTagName("tags").item(0);
if (tagsElement.getNodeType() == Node.ELEMENT_NODE) {
NodeList tagElementList = ((Element) tagsElement).getElementsByTagName("tag");
for (int i = 0; i < tagElementList.getLength(); i++) {
tags.add(tagElementList.item(i).getTextContent());
}
}
List<String> packages = new ArrayList<String>();
tagsElement = element.getElementsByTagName("packages").item(0);
if (tagsElement.getNodeType() == Node.ELEMENT_NODE) {
NodeList elementList = ((Element) tagsElement).getElementsByTagName("package");
for (int i = 0; i < elementList.getLength(); i++) {
packages.add(elementList.item(i).getTextContent());
}
}
List<IExampleProject.ExportFile> files = new ArrayList<IExampleProject.ExportFile>();
tagsElement = element.getElementsByTagName("files").item(0);
if (tagsElement.getNodeType() == Node.ELEMENT_NODE) {
NodeList elementList = ((Element) tagsElement).getElementsByTagName("file");
for (int i = 0; i < elementList.getLength(); i++) {
if (elementList.item(i).getNodeType() == Node.ELEMENT_NODE) {
element = (Element) elementList.item(i);
files.add(new IExampleProject.ExportFile(element.getAttribute("source"),
element.getAttribute("destination")));
}
}
}
return parent.makeExampleProject(name, description, tags, packages, files);
}
public IExampleProject getExampleProject() {
return selectedExample;
}
}

View File

@@ -1,17 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.util.List;
public interface IExampleProject extends ProjectType {
public String getName();
public String getContent();
public List<String> getTags();
static class ExportFile {
public String source, destination;
public ExportFile(String source, String destination) {
this.source = source;
this.destination = destination;
}
}
}

View File

@@ -1,60 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
/**
* An interface for providing hooks into the project creation
* process. It provides necessary information and can perform
* both initialization and finalization of the project
* creation process.
*
* @author Alex Henning
*/
public interface IProjectCreator {
/**
* @return The name of the project to create.
*/
String getName();
/**
* @return The main package to be created. Should be an
* empty string if irrelevant.
*/
String getPackageName();
/**
* @return Map of keys to be substituted with values
* during the creation process.
*/
Map<String, String> getValues();
/**
* @return The natures that this project should have.
*/
List<String> getNatures();
/**
* @return A project type object that provides files
* and directories to create.
*/
ProjectType getProjectType();
/**
* Run extra initialization code on the project.
* @param project The project being created
* @throws CoreException
*/
void initialize(IProject project) throws CoreException;
/**
* Run extra finalization code on the project.
* @param project The project being created
* @throws CoreException
*/
void finalize(IProject project) throws CoreException;
}

View File

@@ -1,17 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import org.eclipse.core.resources.IProject;
/**
* A filter that can be used to select projects.
*
* @author alex
*
*/
public interface IProjectFilter {
/**
* @param project The project to check.
* @return Whether or to accept the project.
*/
boolean accept(IProject project);
}

View File

@@ -1,245 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.util.Map;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
/**
* The "New" wizard page allows setting the container for the new file as well
* as the file name. The page will only accept file name without the extension
* OR with the extension that matches the expected one (mpe).
*/
public class NewProjectMainPage extends WizardPage {
private Text projectNameText;
private Text packageText;
Map<String, ProjectType> types;
private Text worldText;
private Button worldButton;
Button simpleRobot, iterativeRobot, commandRobot;
private boolean showPackage;
private boolean showProjectTypes;
private TeamNumberPage teamNumberPage;
/**
* Constructor for SampleNewWizardPage.
* @param teamNumberPage
*
* @param pageName
*/
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
super("wizardPage");
this.teamNumberPage = teamNumberPage;
showPackage = true;
showProjectTypes = false;
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
label.setText("Project &Name:");
projectNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
projectNameText.setLayoutData(gd);
projectNameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
if (showPackage) {
label = new Label(container, SWT.NULL);
label.setText("&Package:");
packageText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
packageText.setLayoutData(gd);
packageText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
}
if (showProjectTypes) {
Group projectTypeGroup = new Group(container, SWT.BORDER);
projectTypeGroup.setText("Project Type");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
projectTypeGroup.setLayoutData(gd);
GridLayout groupLayout = new GridLayout();
groupLayout.numColumns = 1;
projectTypeGroup.setLayout(groupLayout);
simpleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
//simpleRobot.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
simpleRobot.setText("Simple Robot: A flexible robot project intended for robots that implement basic functionality. Can also be used as a starting point for teams with a custom framework.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
simpleRobot.setLayoutData(gd);
simpleRobot.setSelection(true);
iterativeRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
iterativeRobot.setText("Iterative Robot: A robot project that allows robots to be implemented in an iterative manner.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
iterativeRobot.setLayoutData(gd);
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
commandRobot.setLayoutData(gd);
}
label = new Label(container, SWT.NULL);
label.setText("Simulation &World:");
Composite comp = new Composite(container, SWT.NULL);
gd = new GridData(GridData.FILL_HORIZONTAL);
comp.setLayoutData(gd);
GridLayout groupLayout = new GridLayout();
groupLayout.numColumns = 2;
comp.setLayout(groupLayout);
worldText = new Text(comp, SWT.BORDER | SWT.SINGLE);
worldText.setLayoutData(gd);
worldText.setText("/usr/share/frcsim/worlds/GearsBotDemo.world");
worldText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
worldButton = new Button(comp, SWT.NULL);
worldButton.setText("Browse");
worldButton.addSelectionListener(new SelectionAdapter() {
@Override public void widgetSelected(SelectionEvent e) {
browse();
}
});
initialize();
dialogChanged();
setControl(container);
}
/**
* Tests if the current workbench selection is a suitable container to use.
*/
private void initialize() {
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
if (showPackage) {
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
if (teamNumberPage != null) {
teamNumberPage.registerChangeListener(new ChangeListener() {
@Override public void stateChanged(ChangeEvent e) {
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
}
});
}
}
}
/**
* Ensures that both text fields are set.
*/
private void dialogChanged() {
String projectName = getProjectName();
String packageString = "";
if (showPackage) packageString = getPackage();
if (projectName.length() == 0) {
updateStatus("Project name must be specified");
return;
}
if (showPackage && packageString.length() == 0) {
updateStatus("Package must be specified");
return;
}
if (showPackage && !packageString.matches("^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*)*)$")) {
updateStatus("Must be valid java package");
return;
}
updateStatus(null);
}
private void browse() {
FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
dialog.setText("Pick a World to Simulate");
dialog.setFileName(worldText.getText());
dialog.setFilterNames(new String[] { "World Files", "All Files (*.*)" });
dialog.setFilterExtensions(new String[] { "*.world", "*.*" });
String result = dialog.open();
if (result != null) {
worldText.setText(result);
}
}
private void updateStatus(String message) {
setErrorMessage(message);
setPageComplete(message == null);
}
public String getProjectName() {
return projectNameText.getText();
}
public String getPackage() {
return packageText.getText();
}
public ProjectType getProjectType() {
if (!showProjectTypes) return null;
else if (simpleRobot.getSelection()) return types.get(ProjectType.SIMPLE);
else if (iterativeRobot.getSelection()) return types.get(ProjectType.ITERATIVE);
else return types.get(ProjectType.COMMAND_BASED);
}
public String getWorld() {
return worldText.getText().replace(System.getProperty("user.home"), "${user.home}");
}
public void setShowPackage(boolean bool) {
showPackage = bool;
}
public void setShowProjectTypes(boolean bool) {
showProjectTypes = bool;
}
public void setProjectTypes(Map<String, ProjectType> types) {
showProjectTypes = true;
this.types = types;
}
}

View File

@@ -1,51 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.util.Arrays;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
public class ProjectComboField {
public static String NO_PROJECT = "No Project";
private Combo combo;
public ProjectComboField(Composite composite, int config, IProjectFilter filter) {
combo = new Combo(composite, config);
combo.add(NO_PROJECT);
combo.select(0);
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
if (filter == null || filter.accept(project))
combo.add(project.getName());
}
}
public void setProject(IProject project) {
if (project != null)
combo.select(Arrays.binarySearch(combo.getItems(), project.getName()));
else combo.select(0);
}
public IProject getProject() {
return ResourcesPlugin.getWorkspace().getRoot().getProject(combo.getItem(combo.getSelectionIndex()));
}
public boolean isValid() {
return combo.getSelectionIndex() != 0;
}
public void setLayoutData(GridData gd) {
combo.setLayoutData(gd);
}
public void addModifyListener(ModifyListener modifyListener) {
combo.addModifyListener(modifyListener);
}
}

View File

@@ -1,195 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* Utilities for creating a new project and files from templates. Uses
* IProjectCreator to provide hooks for generating the directory
* structure, initial files, initializing and finalizing the creation
* of the new project.
*
* @author Alex Henning
**/
public class ProjectCreationUtils {
/**
* Create a project using the given IProjectCreator.
*
* @param creator The creator that provides the necessary information
* to create the project.
* @return The newly created project.
*/
public static IProject createProject(IProjectCreator creator) {
IProject project = createBaseProject(creator.getName(), null);
try {
creator.initialize(project);
for (String nature : creator.getNatures()) {
addNature(project, nature);
}
addToProjectStructure(project, creator);
addFilesToProject(project, creator);
creator.finalize(project);
} catch (CoreException e) {
WPILibCore.logError("Error creating project "+creator.getName(), e);
project = null;
}
return project;
}
private static IProject createBaseProject(String projectName, IPath location) {
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (!newProject.exists()) {
IPath projectLocation = location;
IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());
if (location != null &&
ResourcesPlugin.getWorkspace().getRoot().getLocation().equals(location)) {
projectLocation = null;
}
desc.setLocation(projectLocation);
try {
newProject.create(desc, null);
if (!newProject.isOpen()) {
newProject.open(null);
}
} catch (CoreException e) {
WPILibCore.logError("Can't create new project.", e);
}
}
return newProject;
}
private static void addNature(IProject project, String nature_id) throws CoreException {
if (!project.hasNature(nature_id)) {
IProjectDescription desc = project.getDescription();
String[] prevNatures = desc.getNatureIds();
String[] newNatures = new String[prevNatures.length + 1];
System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
newNatures[prevNatures.length] = nature_id;
desc.setNatureIds(newNatures);
project.setDescription(desc, null);
}
}
private static void addToProjectStructure(IProject project, IProjectCreator creator) throws CoreException {
String[] paths = creator.getProjectType().getFolders(creator.getPackageName());
for (String path : paths) {
IFolder etcFolders = project.getFolder(path);
createFolder(etcFolders);
}
}
private static void createFolder(IFolder folder) throws CoreException {
IContainer parent = folder.getParent();
if (parent instanceof IFolder) {
createFolder((IFolder) parent);
}
if (!folder.exists()) {
folder.create(false, true, null);
}
folder.refreshLocal(IResource.DEPTH_INFINITE, null);
}
private static void addFilesToProject(IProject project, IProjectCreator creator) throws CoreException {
Map<String, String> files = creator.getProjectType().getFiles(creator.getPackageName());
for (Entry<String, String> e : files.entrySet()) {
try {
URL url = new URL(creator.getProjectType().getBaseURL(), e.getValue());
createTemplateFile(project, e.getKey(), url, creator.getValues());
} catch (MalformedURLException e1) {
WPILibCore.logError("Error adding file "+e.toString()+" to project.", e1);
}
}
}
/**
* Create a file in the project from a template. Substituting as required.
*
* @param project The project to use create the file in.
* @param filepath The path of the created file.
* @param filesource The source of the template to use.
* @param vals The map of values to use for substitution.
* @throws CoreException
*/
public static void createTemplateFile(IProject project, String filepath, URL url, Map<String, String> vals) throws CoreException {
IFile template = project.getFile(new Path(filepath));
if (!template.exists()) {
InputStream in = openTemplateContentStream(project, url, vals);
template.create(in, true, null);
}
}
private static InputStream openTemplateContentStream(IProject project, URL url, Map<String, String> vals) {
//http://eclipse-javacc.cvs.sourceforge.net/viewvc/eclipse-javacc/sf.eclipse.javacc/src-plugin/sf/eclipse/javacc/wizards/JJNewWizard.java?view=markup
//eclipse plugin distributing template files
try {
return makeTemplateInputStream(url.openStream(), vals);
} catch (final MalformedURLException e) {
WPILibCore.logError("Malformed URL "+url, e);
} catch (final IOException e) {
WPILibCore.logError("Issue opening input stream.", e);
}
return null;
}
private static InputStream makeTemplateInputStream(InputStream stream, Map<String, String> vals) {
String str;
try {
str = readInput(stream);
stream.close();
} catch (final IOException e) {
WPILibCore.logError("Error reading template.", e);
return null;
}
// Instantiate template
for (Entry<String, String> e : vals.entrySet())
str = str.replace(e.getKey(), e.getValue());
return new ByteArrayInputStream(str.getBytes());
}
private static String readInput(InputStream stream) {
StringBuffer buffer = new StringBuffer();
try {
InputStreamReader isr = new InputStreamReader(stream);
Reader in = new BufferedReader(isr);
int ch;
while ((ch = in.read()) > -1) {
buffer.append((char)ch);
}
in.close();
return buffer.toString();
} catch (IOException e) {
WPILibCore.logError("Error reading input.", e);
return null;
}
}
}

View File

@@ -1,14 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import java.net.URL;
import java.util.Map;
public interface ProjectType {
String SIMPLE = "SIMPLE";
String ITERATIVE = "ITERATIVE";
String COMMAND_BASED = "COMMAND_BASED";
String[] getFolders(String packageName);
Map<String, String> getFiles(String packageName);
URL getBaseURL();
}

View File

@@ -1,19 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
public class Tag {
private String name, description;
public Tag(String name, String description) {
this.name = name;
this.description = description;
}
public String getName() {
return name;
}
public String getContent() {
return "<h1>"+name+"</h1><p>"+description+"</p>";
}
}

View File

@@ -1,111 +0,0 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import javax.swing.event.ChangeListener;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public class TeamNumberPage extends WizardPage {
private Text teamNumberText;
private ChangeListener listener;
/**
* Constructor for SampleNewWizardPage.
*
* @param pageName
*/
public TeamNumberPage(ISelection selection) {
super("wizardPage");
setTitle("Set Team Number");
setDescription("This page lets you set your team number so that code can be loaded onto the right robot.");
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
label.setText("Team &Number:");
teamNumberText = new Text(container, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
teamNumberText.setLayoutData(gd);
teamNumberText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
label = new Label(container, SWT.NULL);
label.setText("Team number is a global setting that can be changed in Window > Preferences > WPILib Preferences > Team Number");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
label.setLayoutData(gd);
initialize();
dialogChanged();
setControl(container);
}
/**
* Tests if the current workbench selection is a suitable container to use.
*/
private void initialize() {
String teamNumber = Integer.toString(WPILibCore.getDefault().getTeamNumber(null));
teamNumberText.setText(teamNumber);
}
/**
* Ensures that both text fields are set.
*/
private void dialogChanged() {
String teamNumber = getTeamNumber();
if (listener != null) listener.stateChanged(null);
if (!teamNumber.matches("^([0-9]+)$")) {
updateStatus("Team number must be a valid integer.");
return;
}
updateStatus(null);
}
private void updateStatus(String message) {
setErrorMessage(message);
setPageComplete(message == null);
}
public String getTeamNumber() {
return teamNumberText.getText();
}
public static boolean needsTeamNumberPage() {
return WPILibCore.getDefault().getTeamNumber(null) == 0;
}
public static String getTeamNumberFromPage(TeamNumberPage teamNumberPage) {
if (teamNumberPage != null) {
return teamNumberPage.getTeamNumber();
} else {
return Integer.toString(WPILibCore.getDefault().getTeamNumber(null));
}
}
public void registerChangeListener(ChangeListener changeListener) {
listener = changeListener;
}
}

View File

@@ -1 +0,0 @@
bin.includes = feature.xml

View File

@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.cpp.feature"
label="Robot C++ Development"
version="0.1.0.qualifier"
provider-name="Worcester Polytechnic Institute">
<description>
FRC Robot C++ Program Development Environment.
</description>
<copyright>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<url>
<discovery label="CDT" url="http://download.eclipse.org/tools/cdt/releases/juno/"/>
<discovery label="RSE" url="http://download.eclipse.org/tm/updates/2.0/"/>
</url>
<includes
id="edu.wpi.first.wpilib.plugins.core.feature"
version="0.0.0"/>
<plugin
id="edu.wpi.first.wpilib.plugins.cpp"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.feature</artifactId>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.linux.feature"
label="Linux Toolchain for Robot C++ Development"
version="0.2.0"
provider-name="Worcester Polytechnic Institute"
os="linux">
<description>
The C++ toolchain to build Athena programs on Linux.
</description>
<copyright>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<requires>
<import feature="edu.wpi.first.wpilib.plugins.cpp.feature" version="0.1.0.qualifier"/>
</requires>
<plugin
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.linux"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.linux.feature</artifactId>
<version>0.2.0</version>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -1,12 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Linux
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.cpp.toolchains.linux;singleton:=true
Bundle-Version: 0.2.0
Bundle-Activator: edu.wpi.first.wpilib.plugins.cpp.toolchains.linux.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
edu.wpi.first.wpilib.plugins.core;bundle-version="0.1.0",
edu.wpi.first.wpilib.plugins.cpp;bundle-version="0.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7

View File

@@ -1,8 +0,0 @@
Making This Plugin Work
=======================
This plugin needs a very big zip that contains the toolchain. This is
currently hosted by Jenkins in the "Windows Toolchain Provider"
project. This can also be created from the download from mentor
embedded. The file should be resources/toolchain.zip and contains the
5 main directories.

View File

@@ -1,7 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
resources/,\
plugin.xml
src.includes = resources/

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup
class="edu.wpi.first.wpilib.plugins.cpp.toolchains.linux.Activator">
</startup>
</extension>
</plugin>

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.linux</artifactId>
<version>0.2.0</version>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>edu.wpi.first.wpilib.plugins.cpp.toolchains</groupId>
<artifactId>linux</artifactId>
<version>1.0.0</version>
<type>zip</type>
<destFileName>toolchain.zip</destFileName>
</artifactItem>
</artifactItems>
<overWriteIfNewer>true</overWriteIfNewer>
<outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,62 +0,0 @@
package edu.wpi.first.wpilib.plugins.cpp.toolchains.linux;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin implements IStartup {
// The plug-in ID
public static final String PLUGIN_ID = "edu.wpi.first.wpilib.plugins.cpp.toolchains.windows"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
private String getCurrentVersion() {
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
@Override
public void earlyStartup() {
new ToolchainInstaller(getCurrentVersion()).installIfNecessary();
}
}

View File

@@ -1,36 +0,0 @@
package edu.wpi.first.wpilib.plugins.cpp.toolchains.linux;
import java.io.InputStream;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version);
}
@Override
protected String getFeatureName() {
return "toolchains";
}
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
}
@Override
protected InputStream getInstallResourceStream() {
return ToolchainInstaller.class.getResourceAsStream("/resources/toolchain.zip");
}
}

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature"
label="Mac Toolchain for Robot C++ Development"
version="0.2.0"
provider-name="Worcester Polytechnic Institute"
os="macosx">
<description>
The C++ toolchain to build Athena programs on a Mac.
</description>
<copyright>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<requires>
<import feature="edu.wpi.first.wpilib.plugins.cpp.feature" version="0.1.0.qualifier"/>
</requires>
<plugin
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.mac"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature</artifactId>
<version>0.2.0</version>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -1,12 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Windows
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.cpp.toolchains.mac;singleton:=true
Bundle-Version: 0.2.0
Bundle-Activator: edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
edu.wpi.first.wpilib.plugins.core;bundle-version="0.1.0",
edu.wpi.first.wpilib.plugins.cpp;bundle-version="0.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7

View File

@@ -1,8 +0,0 @@
Making This Plugin Work
=======================
This plugin needs a very big zip that contains the toolchain. This is
currently hosted by Jenkins in the "Windows Toolchain Provider"
project. This can also be created from the download from mentor
embedded. The file should be resources/toolchain.zip and contains the
5 main directories.

View File

@@ -1,7 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
resources/,\
plugin.xml
src.includes = resources/

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup
class="edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.Activator">
</startup>
</extension>
</plugin>

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.mac</artifactId>
<version>0.2.0</version>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>edu.wpi.first.wpilib.plugins.cpp.toolchains</groupId>
<artifactId>mac</artifactId>
<version>1.0.0</version>
<type>zip</type>
<destFileName>toolchain.zip</destFileName>
</artifactItem>
</artifactItems>
<overWriteIfNewer>true</overWriteIfNewer>
<outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,62 +0,0 @@
package edu.wpi.first.wpilib.plugins.cpp.toolchains.mac;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin implements IStartup {
// The plug-in ID
public static final String PLUGIN_ID = "edu.wpi.first.wpilib.plugins.cpp.toolchains.windows"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
private String getCurrentVersion() {
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
@Override
public void earlyStartup() {
new ToolchainInstaller(getCurrentVersion()).installIfNecessary();
}
}

View File

@@ -1,36 +0,0 @@
package edu.wpi.first.wpilib.plugins.cpp.toolchains.mac;
import java.io.InputStream;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version);
}
@Override
protected String getFeatureName() {
return "toolchains";
}
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
}
@Override
protected InputStream getInstallResourceStream() {
return ToolchainInstaller.class.getResourceAsStream("/resources/toolchain.zip");
}
}

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature"
label="Windows Toolchain for Robot C++ Development"
version="0.2.0"
provider-name="Worcester Polytechnic Institute"
os="win32">
<description>
The C++ toolchain to build Athena programs on Windows.
</description>
<copyright>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2013 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<requires>
<import feature="edu.wpi.first.wpilib.plugins.cpp.feature" version="0.1.0.qualifier"/>
</requires>
<plugin
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature</artifactId>
<version>0.2.0</version>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

Some files were not shown because too many files have changed in this diff Show More