Commit Graph

141 Commits

Author SHA1 Message Date
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
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
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
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
9056edf932 commented out system.out.prints in CANTalon.set()
Change-Id: I85bc50c5f1ee7364395eb28d03e3845fe70649c0
2014-12-06 13:39:49 -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
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)
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
Brad Miller (WPI)
5e6cd0bf9e Merge "Implement Joystick Outputs and Rumble (fixes artf3807)" 2014-12-05 11:42:14 -08: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
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
Kevin O'Connor
36c53667cd Require Jaguar version v108 or higher.
Change-Id: Ib3a29a9182a776771db8b45bf82df3168e800277
2014-12-04 14:15:01 -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
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
fa229f2b13 Added java joystick message spam fix (artf3836)
Change-Id: I1e29aea00dc61574272f47fc3e1bcd98bd825d22
2014-12-03 11:05:49 -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
Brad Miller (WPI)
b59f4141c4 Merge "Open scope for gyro methods. Fixes FirstForge artf1699." 2014-11-28 08:34:15 -08: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
James Kuszmaul
7b371f6d7c Added Omar's new CanTalonSRX code.
I also updated the C++ and Java code some. For C++, this meant making it
compile and adding in the framework for the closed-loop control of the
motor. For Java, I updated the JNI bindings with SWIG and created an
GetTemperature accessor function to demonstrate how to use the accessors
because swig does funny stuff with pass-by-reference functions.

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

Change-Id: Iae2f74693ca6b80bf7d5aca0625c66aa6e0b7f85

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

Change-Id: I3acb27d6fd5568d88931e0d678c09973d436735d
2014-11-26 11:55:37 -05:00
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
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
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
Fred Silberberg (WPI)
c7a90b2ccc Merge "Fix write when used with long byte array." 2014-11-17 11:56:51 -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
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
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
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
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
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