Commit Graph

210 Commits

Author SHA1 Message Date
Brad Miller (WPI)
445eafefb3 Merge "More Java nivision wrapper fixes." 2015-01-16 07:34:33 -08:00
Brad Miller (WPI)
2228361f39 Merge "Add SetCANJaguarSyncGroup to RobotDrive" 2015-01-16 07:32:57 -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
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
Brad Miller (WPI)
cff103d15e Merge "Add encoder indexing in Java" 2015-01-12 12:48:39 -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
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
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)
ff71aca572 Merge "Update docs to add missing channel numbers" 2015-01-08 13:44:32 -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
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
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
Brad Miller (WPI)
91b9812482 Merge "Add PDP LiveWindow code" 2014-12-30 11:57:28 -08: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
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
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
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
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
Omar Zrien
aae20ddbff Artifact artf3945 : CANTalon : Motor Safety Object never feed
Change-Id: I6894399d0eb7c36ff698639862fa6ad045a70db8
2014-12-21 16:47:03 -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
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
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
Omar Zrien
bea9eb0efa renamed param to match function name.
Change-Id: I89c483691e0f99a6d20bed1271209a8141e71c0e
2014-12-16 20:05:30 -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
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