Commit Graph

53 Commits

Author SHA1 Message Date
Brad Miller (WPI)
c11f194cbf Merge "Allow dataRecieved to be null in I2C transaction (fixes artf3603)" 2014-10-02 11:48:22 -07: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
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
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
Thomas Clark
a548b14b7e Add a getDeviceNumber method to CANJaguar
[artf3613]

Change-Id: Idc01c0d27740bbb575f00de6065a7ced52f787e1
2014-09-24 14:37:07 -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
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
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
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
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
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
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
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
Colby Skeggs
0f93247641 Completed artf2675 - rename SimpleRobot -> SampleRobot.
Change-Id: I23fc503f64fa6a715867f4b92f9d03e21f6c5f82
2014-08-08 10:50:16 -07: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
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
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
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
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
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
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 (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
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
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
Colby Skeggs
0bb13d86ea Completed artf2662: removed Start()/Stop() in Encoders and Counters.
Change-Id: I11954bb5f66e54461455637d79013c1071f5d00f
2014-07-31 10:31:36 -04:00
Thomas Clark
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
60a294fbad Removed the old "parsing" interfaces
Change-Id: I94ff79f36d5b61f90c2f242fa06816bf3a3b7ac2
2014-07-29 17:34:39 -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
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
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
Joe Ross
5a3889a3aa Correct voltage range in javadocs for RoboRIO
Change-Id: I6049fac62bb4f1fb15364bd26d0511d0603c0aee
2014-07-28 09:34:48 -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
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
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
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