Commit Graph

75 Commits

Author SHA1 Message Date
Alex Henning
0f8f83500b Merged sources in wpilibJavaFinal.
Change-Id: Iab8d079716eae3e5631cf7a62d6e88340e55e03c
2014-08-12 14:59:16 -04:00
Alex Henning
1301d76d61 Fixes for HLUsageReporting due to Jonathan's exceptions.
Change-Id: I28d6719d0b8f5a71186f6a764c9541277aea6237
2014-08-11 14:59:21 -04: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
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
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
a5b72d62a1 Remove the last obsolete interface
Change-Id: I5921968b3064af53f716858092c2da3ea7522362
2014-07-29 18:01:17 -04:00
Thomas Clark
60a294fbad Removed the old "parsing" interfaces
Change-Id: I94ff79f36d5b61f90c2f242fa06816bf3a3b7ac2
2014-07-29 17:34:39 -04: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
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
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
thomasclark
b5fb35c0c4 Removed AnalogModule, DigitalModule, and Module from Java
Change-Id: I42c58237f1e14d0ebae1c7266aecda00d51eeae1
2014-07-22 13:33:00 -04:00
thomasclark
6053a0cc24 Added BuiltInAccelerometer in Java and updated C++
Change-Id: I5a3360c51334e85da6a15fd640f9420bc3b64dca
2014-07-21 10:09:41 -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
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
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
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
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
thomasclark
f566c087dc Fix a few wrong messages in CANJaguar
Change-Id: I8e1a8fa9b0c20a40e060a8319dbbd605173dc407
2014-07-16 10:27:17 -04:00
Brad Miller (WPI)
65c3c0ba09 Merge "Updated the HAL, wpilibj, and wpilibc for PCM and PDP" 2014-07-02 14:04:51 -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
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
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
Jonathan Leitschuh
4de246876a Adds/Formats the CANJaguar.set() Javadocs
Change-Id: I7e8735d9de336ba906b319b01eff4b2e88fb2a26
2014-06-27 11:24:51 -04:00
Brad Miller (WPI)
606eaa67b9 Merge "CANJaguar waits in the constructor for initial status data" 2014-06-26 09:28:33 -07:00
thomasclark
1cafebc5a3 CANJaguar waits in the constructor for initial status data
The C++ and Java CANJaguar constructors now wait up to 50 ms for the status
data to arrive at least one time.  They break early if it arrives sooner.

This allows status getters to always work immediately after the object is
constructed.

Change-Id: I4a1f1538837c11b24d45e87251743b6c106ddefb
2014-06-26 11:54:58 -04:00
Brad Miller (WPI)
cc76500fdb Merge "* Add WriteBulk and ReadOnly to C++ I2C" 2014-06-26 07:05:26 -07:00
thomasclark
f3593c6986 CANJaguar in Java now requires control mode configuration data at compile time
Change-Id: I80b63e876d330d693375d69137c78e487c03c1c7
2014-06-25 16:25:39 -04:00
thomasclark
1bbf350811 Java CANJaguar changes
Change-Id: Icb15b1b140816e44caec36cda2466a64e5cabf1d

Change-Id: Idd6aebefe03acff5ab211a5e3e73a29563601515
2014-06-24 16:22:25 -04:00
Kevin O'Connor
605148456e * Add WriteBulk and ReadOnly to C++ I2C
Change-Id: If6082f6b92b4be5e328278ba536d5a7681082c9f (+4 squashed commit)

Squashed commit:

[86b4ae7] * Port I2C to roboRIO in JNI and Java. Left read method as a transaction and added readOnly. Left write as a single byte and added writeBulk. Need to go back to C++ and update to match.

Change-Id: I290d84211a4b7bb942d785730c0e6929449cf69f

[7d37419] * Remove HiTechnic sensors from Java. May be added back later as examples

Change-Id: Ie93e23a70fd953c99c03d50d9529220f86d32e03

[e62bfbf] * I2C ported to roboRIO i2clib in HAL and C++

Change-Id: Idb0e8cee5a1e8c1a0b0733ca94b528f659352915

[1059a48] * Remove HiTechnic sensors (Lego connector) may be added back as examples later

Change-Id: I84b8e1e022db2c69d487ed9ad5b3ec0e7ea57282 (+2 squashed commit)

Squashed commit:

[e62bfbf] * I2C ported to roboRIO i2clib in HAL and C++

Change-Id: Idb0e8cee5a1e8c1a0b0733ca94b528f659352915

[1059a48] * Remove HiTechnic sensors (Lego connector) may be added back as examples later

Change-Id: I84b8e1e022db2c69d487ed9ad5b3ec0e7ea57282
2014-06-23 18:23:14 -04:00
Colby Skeggs
f5862582e6 FRCSim artf2604: Synchronized the codebases of WPILibJ-Simulation
and the main WPILibJ.

Change-Id: I9b933b6f21be21cd5e9808b6f8d127a995a742e7
2014-06-23 11:05:46 -07:00
Jonathan Leitschuh
1fb6d9fd0c Updates/Tests the AnalogPotentiometer
New constructor for the AnalogPotentiometer to allow users to pass it an AnalogInput into the constructor
New FakePotentiometerSource to emulate a AnalogPotentiometer

Change-Id: I0f85b3d38e99d7ccbc7676bdf17fc3ec7e041e84
2014-06-18 17:21:53 -04:00
Alex Henning
9ff7412780 Fixes for rebasing.
Change-Id: I765d2f2fc044fb30caef3cda8ff6bd03fef6b4e0
2014-06-17 14:09:58 -07:00
Jonathan Leitschuh
fc2f0e37ba Adds JNI methods for the new CANSessionMUX
Updates the CAN send message to use CANSessionMuxSendMessage in the C++ JNI

Updates the CANJNI to use the new C++ JNI parameters

Change-Id: Ib7da7d5929c7c5656bf388246aa72aed23590173
2014-06-16 15:39:27 -04:00
thomasclark
58021f7397 Removed analog and digital module numbers
AnalogModule and DigitalModule classes still exist, at least until they are
refactored into the classes that use them.

Change-Id: I5544d5418822f19d54ba0a5d651e64fad8b7b10d
2014-06-13 17:57:40 -04:00
Brad Miller (WPI)
fdfc33a380 Merge "Removes the print line from the Preferences class so that the write method no longer causes a system print" 2014-06-13 11:41:34 -07:00
Jonathan Leitschuh
4be3bc25ac Removes the print line from the Preferences class so that the write method no longer causes a system print
Change-Id: I42af95c3bdd48fa1e2d92fe1c70b8e777f822616
2014-06-13 14:36:37 -04:00
Brad Miller (WPI)
c7e7f39c4a Merge "Updates the PID.free() method to release the NetworkTable listener. [artf2571] Documentation update on the Depreciated method. Removes the PID.setTolerance(Tolerance tolerance) method because it was private and never used" 2014-06-13 07:26:19 -07:00
Jonathan Leitschuh
94894931a5 Updates the PID.free() method to release the NetworkTable listener. [artf2571]
Documentation update on the Depreciated method.
Removes the PID.setTolerance(Tolerance tolerance) method because it was private and never used

Change-Id: I5cddbcc96ed40b5bb0d9f33e2a3586dce91dc532
2014-06-13 10:24:32 -04:00
Alex Henning
cb56c9a144 Initial commit of the WPILib simulation support in an alpha quality state.
Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing.

Added Omar's changes to the compressor interface

Fixes to make C++ plugin compile on linux.

Added import of the WPILibSim code from the graduate class. It shows up as wpilibJavaSim to follow the convention set by wpilibJava, wpilibJavaJNI and wpilibJavaFinal.

Fixed wpilibJavaSim artifactId to mirror the new convention.

Modified the build of the java plugin to pull in the simulation dependencies.

Added stacktrace printing.

Fixed support for creating projects.

Added support for the isReal() and isSimulation() methods along with the AnalogPotentiometer object to support simulating GearsBot.

Added support for a "WPILib Simulate" button.

Added GearsBot to the built in examples.

Added support for specifying the world file during project creation and switched the default from BluntObjectBot to GearsBot.

Removed unused import.

Added file browser for world files.

Added support for debugging in simulation.

Change simulate icon to be a Gazebo icon.

Switched over to the gazebo messaging system.

Updated location of default world file.

Reverted cmake change.

Fixed bug in WPILibJSim, added better logging and cleaned up code.

Made the frc_gazebo_plugin build using raw cmake instead of catkin, breaking the final ROS dependencies.

Added installation to frc_gazebo_plugin Makefile.

Fixed running of simulation to actually use frcsim.

Initial commit of simulation library for C++. Has the minimal subset of features necessary for having a Simple Robot run in teleoperated mode.

Added notes for generating protobuf messages.

Import of the debuild process into the main repository.

Moved frc_gazebo_plugin under simulation and removed the gazebo folder.

Updated the gazebo plugin to remove excessive printing and limit motor signal to [-1,1].

Updated WPILibJSim to support latching messages and to sleep for 20ms in iterative robot.

Reduced delay between starting frcsim and the users program to 1 second.

Updated GearsBot example.

Fixed a few minor issues for demoable state.

Added simulator support for Victors, Jaguars and Talons.

Added NetworkTables, SmartDashboard and LiveWindow to the simulator.

Added AnalogPotentiometer for simulation.

Added support for simulating encoders.

Added simulation support for Gyro.

Added IterativeRobot, Fixed Timers, Notifiers, PIDControllers and other minor fixes + cleanup.

Added RobotDrive support to simulation.

Separated out JavaGazebo so that SimDS will be able to reuse it.

Separated out SimDS into its own application..

Fixes so that the SimDS is distributed and runs properly for Java with the eclipse plugins.

Added DriverStation support to WPILibCSim

Cleanup of DriverStation, WaitUntilCommand and AnalogPotentiometer for WPILibCSim.

Cleanup of includes for WPILibCSim

Added AnalogPotentiometer to the real WPILibC.

Added AnalogPotentiometer to the real WPILibC.

Added GearsBot example to C++ eclipse plugin.

WPILibCSim fixes to work with launching from the plugin.

Package libwpilibsim in a deb file.

Added includes to plugin distribution.

Added support for external-limit-switches to Gazebo, Java and C++.

Added support for Gazebo Rangefinders and Analog channels to read their values in C++ and Java.

Added support for internal limit switches.

Updated GearsBot programs to use limit switches + range finders.

Added disabling of motors when robot is disabled to more closely mimic the real robot.

Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing.

Change-Id: I624c5f4d0f28282616a7c92083575bf68adcdce2
2014-06-13 09:31:32 -04:00
thomasclark
3538e2c05c Changed AnalogChannel to AnalogInput, added AnalogOutput for MXP
Change-Id: I863d89c61ff2cf4a7a3aeeca1296978e728758b6
2014-06-12 18:08:20 -04:00
thomasclark
8d5c67e6aa Added Omar's changes to the compressor interface
Change-Id: Iff22b0eaa319065b06795b381c4d6072f8087da8
2014-06-12 12:43:03 -04:00
Brad Miller (WPI)
3c5d46c2ae Merge "Added support for digital and analog IO pins on the MXP" 2014-06-12 06:39:25 -07:00
thomasclark
29c4534c58 Added support for digital and analog IO pins on the MXP
Change-Id: I3a4e14ceab885d19a615d6cd45f22a2250ad2856
2014-06-12 09:09:46 -04:00
Jonathan Leitschuh
8b19137ca6 WPILibJ More Integration Tests
Refactors the MotorEncoderTest to make use of the parameterized testing framework
Adds a test for the Preferences Class
Updates the TiltPanCameraTest to work
Makes the TimerTest use math for long values
Adds a Button Test to Test the internal Button
Speeds up the FakeCounterSource/FakeEncoderSource to decrease test time
Moves the AbstractComsSetup Block to a static method so that it only runs once
Updates the logging.properties class so that tests are quieter

Change-Id: I70b39f34122e6398f406a63e6ef04cde9fbe95ef
2014-06-11 14:43:59 -04:00
Jonathan Leitschuh
85d9ead4e2 Sets the default PIDSourceParameter to be kDistance so there is no null pointer exception
Change-Id: Ice4889ea3f6fd5afe6984f9715758a178222837f
2014-06-11 11:11:01 -04:00
Jonathan Leitschuh
59a1fb2c08 Makes the PIDController completely thread safe and ensures that freeing the PID Loop truly clears it [artf2567]
Change-Id: I96502e1d58bb4353ab5f53086dd275f3c372a7af
2014-06-10 15:44:18 -04:00