Compare commits

...

153 Commits

Author SHA1 Message Date
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
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
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
312 changed files with 14496 additions and 2423 deletions

5
.gitignore vendored
View File

@@ -17,8 +17,9 @@ test-reports
# Added by the users of vagrant
jdk-7u45-linux-arm-vfp-sflt.gz
# IntelliJ
*.iml
.idea/
# Created by http://www.gitignore.io

View File

@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.8)
project(All-WPILib)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter -fPIC")
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
list(REMOVE_ITEM NI_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/ni-libraries/libwpi.so ${CMAKE_CURRENT_SOURCE_DIR}/ni-libraries/libwpi_2015.so)

View File

@@ -52,4 +52,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="edu.wpi.first.wpilib.plugins.riolog"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -33,6 +33,14 @@
toolbarPath="WPILib"
tooltip="Launch the SmartDashboard to get feedback from the robot.">
</action>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunSimulationSmartDashboardAction"
icon="icons/smartdashboard16x16.png"
id="edu.wpi.first.wpilib.plugins.core.actions.RunSimulationSmartDashboardAction"
label="Run S&amp;imulation SmartDashboard"
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
tooltip="Launch the SmartDashboard to get feedback from a simulated robot.">
</action>
<action
class="edu.wpi.first.wpilib.plugins.core.actions.RunRobotBuilderAction"
icon="icons/robotbuilder16x16.png"

View File

@@ -85,6 +85,20 @@
<outputDirectory>${tools-zip}</outputDirectory>
<destFileName>SmartDashboard.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilib.networktables</groupId>
<artifactId>OutlineViewer</artifactId>
<version>1.0.0-SNAPSHOT</version>
<outputDirectory>${tools-zip}</outputDirectory>
<destFileName>OutlineViewer.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilib</groupId>
<artifactId>java-installer</artifactId>
<version>1.0-SNAPSHOT</version>
<outputDirectory>${tools-zip}</outputDirectory>
<destFileName>java-installer.jar</destFileName>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
@@ -194,5 +208,10 @@
<artifactId>SmartDashboard</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilib.networktables</groupId>
<artifactId>OutlineViewer</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,77 @@
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 RunSimulationSmartDashboardAction implements IWorkbenchWindowActionDelegate {
/**
* The constructor.
*/
public RunSimulationSmartDashboardAction() {
}
/**
* 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[] files = dir.listFiles(new FilenameFilter() {
@Override public boolean accept(File dir, String name) {
return name.startsWith("SmartDashboard") && name.endsWith(".jar");
}
});
if (files == null || files.length < 1) return;
String[] cmd = {"java", "-jar", files[0].getAbsolutePath(), "-ip", "localhost"};
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

@@ -8,8 +8,6 @@ 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;
@@ -17,6 +15,7 @@ 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 org.eclipse.jface.dialogs.MessageDialog;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
@@ -117,7 +116,7 @@ public abstract class AbstractInstaller {
protected void install() throws InstallException {
if(installLocation.exists()) {
if(!removeFileHandler(installLocation, true)) {
JOptionPane.showMessageDialog(null,
MessageDialog.openError(null, "Error",
String.format("Could not update the old wpilib folder.%n"
+ "Please close any WPILib tools and restart Eclipse."));
}

View File

@@ -0,0 +1,43 @@
package edu.wpi.first.wpilib.plugins.core.launching;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.dialogs.MessageDialog;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public class SimulationNotification {
private static final String URL = "https://wpilib.screenstepslive.com/s/4485/m/23353";
private static final String SIMULATION_UNSUPPORTED_MSG =
"Simulation is unsupported on your current setup.\n" +
"For more information see: " + URL;
public static void showUnsupported() {
String title = "Simulation Unsupported";
String message = SIMULATION_UNSUPPORTED_MSG;
MessageDialog.openError(null, title, message);
try {
Desktop.getDesktop().browse(new URI(URL));
} catch (IOException e) {
WPILibCore.logError("Can't open "+URL, e);
} catch (URISyntaxException e) {
WPILibCore.logError("Can't open "+URL, e);
}
}
public static boolean supportsSimulation() {
String[] cmd = {"frcsim", "--version"};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
return true;
} catch (CoreException e) {
return false;
}
}
}

View File

@@ -36,10 +36,10 @@ public abstract class ExampleWizard extends Wizard implements INewWizard {
*/
protected abstract void doFinish(IExampleProject ex, String teamNumber) throws CoreException;
protected abstract IWizardPage getDetailsPage();
protected abstract IWizardPage getDetailsPage(INewProjectInfo info);
public abstract IExampleProject makeExampleProject(String name, String description,
List<String> tags, List<String> folders, List<IExampleProject.ExportFile> files);
List<String> tags, String world, List<String> folders, List<IExampleProject.ExportFile> files);
public abstract URL getResourceURL();
@@ -60,7 +60,7 @@ public abstract class ExampleWizard extends Wizard implements INewWizard {
}
page1 = new ExampleWizardChoicePage(this, selection);
addPage(page1);
page2 = getDetailsPage();
page2 = getDetailsPage(page1);
addPage(page2);
}

View File

@@ -6,6 +6,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.swing.event.ChangeListener;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -36,11 +37,12 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
* OR with the extension that matches the expected one (mpe).
*/
public class ExampleWizardChoicePage extends WizardPage {
public class ExampleWizardChoicePage extends WizardPage implements INewProjectInfo {
private Tree exampleTree;
private Browser descriptionText;
private IExampleProject selectedExample;
private ExampleWizard parent;
private ChangeListener listener;
/**
* Constructor for SampleNewWizardPage.
@@ -89,6 +91,20 @@ public class ExampleWizardChoicePage extends WizardPage {
dialogChanged();
setControl(container);
}
public String getName() {
if (selectedExample != null) {
return selectedExample.getName();
}
return "";
}
public String getWorld() {
if (selectedExample != null) {
return selectedExample.getWorld();
}
return "";
}
/**
* Tests if the current workbench selection is a suitable container to use.
@@ -137,7 +153,6 @@ public class ExampleWizardChoicePage extends WizardPage {
/**
* Ensures that both text fields are set.
*/
private void dialogChanged() {
if (exampleTree.getSelection().length > 0) {
Object selectedData = exampleTree.getSelection()[0].getData();
@@ -157,6 +172,7 @@ public class ExampleWizardChoicePage extends WizardPage {
return;
}
listener.stateChanged(null);
updateStatus(null);
}
@@ -211,6 +227,11 @@ public class ExampleWizardChoicePage extends WizardPage {
tags.add(tagElementList.item(i).getTextContent());
}
}
String world = "";
if (element.getElementsByTagName("world") != null &&
element.getElementsByTagName("world").item(0) != null) {
world = element.getElementsByTagName("world").item(0).getTextContent();
}
List<String> packages = new ArrayList<String>();
tagsElement = element.getElementsByTagName("packages").item(0);
if (tagsElement.getNodeType() == Node.ELEMENT_NODE) {
@@ -231,10 +252,15 @@ public class ExampleWizardChoicePage extends WizardPage {
}
}
}
return parent.makeExampleProject(name, description, tags, packages, files);
return parent.makeExampleProject(name, description, tags, world, packages, files);
}
public IExampleProject getExampleProject() {
return selectedExample;
}
@Override
public void registerChangeListener(ChangeListener listener) {
this.listener = listener;
}
}

View File

@@ -14,4 +14,10 @@ public interface IExampleProject extends ProjectType {
this.destination = destination;
}
}
/**
* @return The world file to use for simulation, if empty
* the default is used.
*/
String getWorld();
}

View File

@@ -0,0 +1,24 @@
package edu.wpi.first.wpilib.plugins.core.wizards;
import javax.swing.event.ChangeListener;
public interface INewProjectInfo {
String getName();
String getWorld();
void registerChangeListener(ChangeListener changeListener);
public static INewProjectInfo Null = new INewProjectInfo() {
@Override
public String getWorld() {
return "";
}
@Override
public String getName() {
return "";
}
@Override
public void registerChangeListener(ChangeListener changeListener) {}
};
}

View File

@@ -39,6 +39,7 @@ public class NewProjectMainPage extends WizardPage {
private boolean showPackage;
private boolean showProjectTypes;
private TeamNumberPage teamNumberPage;
private INewProjectInfo info;
/**
* Constructor for SampleNewWizardPage.
@@ -46,17 +47,20 @@ public class NewProjectMainPage extends WizardPage {
*
* @param pageName
*/
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage, INewProjectInfo info) {
super("wizardPage");
this.teamNumberPage = teamNumberPage;
showPackage = true;
showProjectTypes = false;
this.info = info;
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
System.out.println(info.getName() +" -- "+ info.getWorld());
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
@@ -130,7 +134,7 @@ public class NewProjectMainPage extends WizardPage {
comp.setLayout(groupLayout);
worldText = new Text(comp, SWT.BORDER | SWT.SINGLE);
worldText.setLayoutData(gd);
worldText.setText("/usr/share/frcsim/worlds/GearsBotDemo.world");
worldText.setText("/usr/share/frcsim/worlds/GearsBotDemo.world");
worldText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
@@ -161,11 +165,18 @@ public class NewProjectMainPage extends WizardPage {
@Override public void stateChanged(ChangeEvent e) {
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
}
});
}
}
info.registerChangeListener(new ChangeListener() {
@Override public void stateChanged(ChangeEvent e) {
projectNameText.setText(info.getName());
if (!"".equals(info.getWorld())) {
worldText.setText(info.getWorld());
}
}
});
}
/**

View File

@@ -5,6 +5,7 @@ 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.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
@@ -48,4 +49,8 @@ public class ProjectComboField {
combo.addModifyListener(modifyListener);
}
public void addSelectionListener(SelectionListener selectionListener) {
combo.addSelectionListener(selectionListener);
}
}

View File

@@ -80,6 +80,12 @@ public class ProjectCreationUtils {
}
} catch (CoreException e) {
WPILibCore.logError("Can't create new project.", e);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "Error creating project! This may occur if a project of the same name with different case exists in the Workspace");
}
});
}
}else {
Display.getDefault().syncExec(new Runnable() {

View File

@@ -28,6 +28,7 @@
<option id="gnu.cpp.compiler.option.debugging.level.969129918" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.394786621" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${WPILIB}/cpp/current/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.1060340803" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
@@ -40,6 +41,7 @@
<option id="gnu.cpp.link.option.paths.1566479969" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${WPILIB}/cpp/current/lib&quot;"/>
</option>
<option id="gnu.cpp.link.option.flags.675338432" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.132949138" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
@@ -55,55 +57,6 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.300115601">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.300115601" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.300115601" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.300115601." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.2008160346" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release">
<option id="cdt.managedbuild.option.gnu.cross.prefix.511797597" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="arm-frc-linux-gnueabi-" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2130959809" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/$project}/Release" id="cdt.managedbuild.builder.gnu.cross.1554116591" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.985086840" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.2030238370" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.188807954" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.884664323" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1342658383" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1371546365" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1242574722" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1782227077" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1397048702" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.716979188" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.126686576" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.886832650" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1915412749" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.671283127" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" moduleId="org.eclipse.cdt.core.settings" name="Simulate">
<externalSettings/>
@@ -129,7 +82,7 @@
<listOptionValue builtIn="false" value="${WPILIB}/cpp/current/sim/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.1"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.0"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.2"/>
</option>
<option id="gnu.cpp.compiler.option.optimization.level.1648211502" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.937474733" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
@@ -143,9 +96,7 @@
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.2094820582" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<option id="gnu.cpp.link.option.libs.1563598353" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="WPILibSim"/>
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="gazebo"/>
<listOptionValue builtIn="false" value="gazebo_transport"/>
<listOptionValue builtIn="false" value="gazebo_msgs"/>
@@ -182,12 +133,6 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.c.compiler.1261239456;cdt.managedbuild.tool.gnu.c.compiler.input.1793678673">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.300115601;cdt.managedbuild.config.gnu.cross.exe.release.300115601.;cdt.managedbuild.tool.gnu.cross.c.compiler.985086840;cdt.managedbuild.tool.gnu.c.compiler.input.884664323">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.300115601;cdt.managedbuild.config.gnu.cross.exe.release.300115601.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1342658383;cdt.managedbuild.tool.gnu.cpp.compiler.input.1782227077">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1505235107;cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
@@ -197,9 +142,6 @@
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/$project"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/$project"/>
</configuration>
<configuration configurationName="Simulate">
<resource resourceType="PROJECT" workspacePath="/$project"/>
</configuration>

View File

@@ -1,20 +1,3 @@
# Deployment information
username=admin
password=
deploy.dir=/home/admin
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
command.dir=/home/lvuser/
# Libraries to use
wpilib=${user.home}/wpilib/cpp/${cpp-version}
wpilib.lib=${wpilib}/lib
# Ant support
wpilib.ant.dir=${wpilib}/ant
jsch.jar=${wpilib.ant.dir}/jsch-0.1.50.jar
classloadertask.jar=${wpilib.ant.dir}/ant-classloadertask.jar
# Build information
out=FRCUserProgram
src.dir=src

View File

@@ -21,6 +21,7 @@
<property file="${user.home}/wpilib/wpilib.properties"/>
<property file="build.properties"/>
<property file="${user.home}/wpilib/cpp/${version}/ant/build.properties"/>
<import file="${wpilib.ant.dir}/build.xml"/>

View File

@@ -23,7 +23,8 @@ private:
void AutonomousInit()
{
autonomousCommand->Start();
if (autonomousCommand != NULL)
autonomousCommand->Start();
}
void AutonomousPeriodic()
@@ -37,7 +38,8 @@ private:
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
autonomousCommand->Cancel();
if (autonomousCommand != NULL)
autonomousCommand->Cancel();
}
void TeleopPeriodic()

View File

@@ -28,7 +28,7 @@ public:
*/
void OperatorControl()
{
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time

View File

@@ -27,7 +27,7 @@ public:
*/
void OperatorControl()
{
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
// Get the current going through channel 7, in Amperes.
// The PDP returns the current in increments of 0.125A.

View File

@@ -0,0 +1,38 @@
#include "WPILib.h"
/**
* This sample shows how to use the new CANTalon to just run a motor in a basic
* throttle mode, in the same manner as you might control a traditional PWM
* controlled motor.
*
*/
class Robot : public SampleRobot {
CANTalon m_motor;
Joystick m_stick;
// update every 0.01 seconds/10 milliseconds.
// The talon only receives control packets every 10ms.
double kUpdatePeriod = 0.010;
public:
Robot()
: m_motor(1), // Initialize the Talon as device 1. Use the roboRIO web
// interface to change the device number on the talons.
m_stick(0)
{}
/**
* Runs the motor from the output of a Joystick.
*/
void OperatorControl() {
while (IsOperatorControl() && IsEnabled()) {
// Takes a number from -1.0 (full reverse) to +1.0 (full forwards).
m_motor.Set(m_stick.GetY());
Wait(kUpdatePeriod); // Wait a bit so that the loop doesn't lock everything up.
}
}
};
START_ROBOT_CLASS(Robot);

View File

@@ -0,0 +1,63 @@
#include "WPILib.h"
/**
* This is a quick sample program to show how to use the new Talon SRX over CAN.
* This particular sample demonstrates running a basic PID control loop with an
* analog potentiometer.
*
*/
class Robot : public SampleRobot {
CANTalon m_motor;
public:
Robot()
: m_motor(1) // Initialize the Talon as device 1. Use the roboRIO web
// interface to change the device number on the m_motors.
{
// This sets the mode of the m_motor. The options are:
// kPercentVbus: basic throttle; no closed-loop.
// kCurrent: Runs the motor with the specified current if possible.
// kSpeed: Runs a PID control loop to keep the motor going at a constant
// speed using the specified sensor.
// kPosition: Runs a PID control loop to move the motor to a specified move
// the motor to a specified sensor position.
// kVoltage: Runs the m_motor at a constant voltage, if possible.
// kFollower: The m_motor will run at the same throttle as the specified other talon.
m_motor.SetControlMode(CANSpeedController::kPosition);
// This command allows you to specify which feedback device to use when doing
// closed-loop control. The options are:
// AnalogPot: Basic analog potentiometer
// QuadEncoder: Quadrature Encoder
// AnalogEncoder: Analog Encoder
// EncRising: Counts the rising edges of the QuadA pin (allows use of a
// non-quadrature encoder)
// EncFalling: Same as EncRising, but counts on falling edges.
m_motor.SetFeedbackDevice(CANTalon::AnalogPot);
// This sets the basic P, I , and D values (F, Izone, and rampRate can also
// be set, but are ignored here).
// These must all be positive floating point numbers (SetSensorDirection will
// multiply the sensor values by negative one in case your sensor is flipped
// relative to your motor).
// These values are in units of throttle / sensor_units where throttle ranges
// from -1023 to +1023 and sensor units are from 0 - 1023 for analog
// potentiometers, encoder ticks for encoders, and position / 10ms for
// speeds.
m_motor.SetPID(1.0, 0.0, 0.0);
}
/**
* Runs the motor from the output of a Joystick.
*/
void OperatorControl() {
while (IsOperatorControl() && IsEnabled()) {
// In closed loop mode, this sets the goal in the units mentioned above.
// Since we are using an analog potentiometer, this will try to go to
// the middle of the potentiometer range.
m_motor.Set(512);
Wait(5.0);
}
}
};
START_ROBOT_CLASS(Robot);

View File

@@ -66,7 +66,7 @@ public:
*/
void OperatorControl()
{
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
// Retrieve the net displacement of the Encoder since the lsat Reset.
SmartDashboard::PutNumber("Encoder Distance", m_encoder.GetDistance());

View File

@@ -13,7 +13,7 @@ private:
SpeedController* motor;
Potentiometer* pot;
static const double kP_real = 4, kI_real = 0.07,
static constexpr double kP_real = 4, kI_real = 0.07,
kP_simulation = 18, kI_simulation = 0.2;
public:

View File

@@ -13,7 +13,7 @@ private:
SpeedController* motor;
Potentiometer* pot; // TODO: Make Potentiometer
static const double kP_real = 1, kP_simulation = 0.05;
static constexpr double kP_real = 1, kP_simulation = 0.05;
public:
Wrist();

View File

@@ -0,0 +1,40 @@
#include "WPILib.h"
/**
* Uses IMAQdx to manually acquire a new image each frame, and annotate the image by drawing
* a circle on it, and show it on the FRC Dashboard.
*/
class IntermediateVisionRobot : public SampleRobot
{
IMAQdxSession session;
Image *frame;
public:
void RobotInit() override {
// create an image
frame = imaqCreateImage(IMAQ_IMAGE_RGB, 0);
// open the camera
IMAQdxOpenCamera("cam1", IMAQdxCameraControlModeController, &session);
IMAQdxConfigureGrab(session);
}
void OperatorControl() override {
// acquire images
IMAQdxStartAcquisition(session);
// grab an image, draw the circle, and provide it for the camera server which will
// in turn send it to the dashboard.
while(IsOperatorControl() && IsEnabled()) {
IMAQdxGrab(session, frame, true, NULL);
imaqDrawShapeOnImage(frame, frame, { 10, 10, 100, 100 }, DrawMode::IMAQ_DRAW_VALUE, ShapeMode::IMAQ_SHAPE_OVAL, 0.0f);
CameraServer::GetInstance()->SetImage(frame);
}
// stop image acquisition
IMAQdxStopAcquisition(session);
}
};
START_ROBOT_CLASS(IntermediateVisionRobot);

View File

@@ -34,7 +34,7 @@ public:
void OperatorControl()
{
robotDrive.SetSafetyEnabled(false);
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.
// This sample does not use field-oriented drive, so the gyro input is set to zero.

View File

@@ -31,7 +31,7 @@ public:
* Runs the motor from the output of a Joystick.
*/
void OperatorControl() {
while (IsOperatorControl()) {
while (IsOperatorControl() && IsEnabled()) {
// Set the motor controller's output.
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
m_motor.Set(m_stick.GetY());

View File

@@ -39,7 +39,7 @@ public:
* Simultaneously displays encoder values on the SmartDashboard.
*/
void OperatorControl() {
while (IsOperatorControl()) {
while (IsOperatorControl() && IsEnabled()) {
// Set the motor controller's output.
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
m_motor.Set(m_stick.GetY());

View File

@@ -12,8 +12,8 @@ private:
double driveForwardSpeed;
double distance;
double error;
static const double TOLERANCE = .1;
static const double KP = -1.0 / 5.0;
static constexpr double TOLERANCE = .1;
static constexpr double KP = -1.0 / 5.0;
void init(double dist, double maxSpeed);
public:
DriveForward();

View File

@@ -13,9 +13,9 @@ class Collector: public Subsystem
{
public:
// Constants for some useful speeds
static const double FORWARD = 1;
static const double STOP = 0;
static const double REVERSE = -1;
static constexpr double FORWARD = 1;
static constexpr double STOP = 0;
static constexpr double REVERSE = -1;
private:
// Subsystem devices

View File

@@ -12,10 +12,10 @@ class Pivot: public PIDSubsystem
{
public:
// Constants for some useful angles
static const double COLLECT = 105;
static const double LOW_GOAL = 90;
static const double SHOOT = 45;
static const double SHOOT_NEAR = 30;
static constexpr double COLLECT = 105;
static constexpr double LOW_GOAL = 90;
static constexpr double SHOOT = 45;
static constexpr double SHOOT_NEAR = 30;
private:
// Subsystem devices

View File

@@ -17,7 +17,7 @@ private:
Compressor* compressor;
#endif
static const double MAX_PRESSURE = 2.55;
static constexpr double MAX_PRESSURE = 2.55;
public:
Pneumatics();

View File

@@ -0,0 +1,22 @@
#include "WPILib.h"
/**
* Uses the CameraServer class to automatically capture video from a USB webcam
* and send it to the FRC dashboard without doing any vision processing. This
* is the easiest way to get camera images to the dashboard. Just add this to the
* RobotInit() method in your program.
*/
class QuickVisionRobot : public SampleRobot
{
public:
void RobotInit() override {
CameraServer::GetInstance()->SetQuality(75);
CameraServer::GetInstance()->StartAutomaticCapture();
}
void OperatorControl() override {
}
};
START_ROBOT_CLASS(QuickVisionRobot);

View File

@@ -39,7 +39,7 @@ public:
*/
void OperatorControl()
{
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
// Retrieve the button values. GetRawButton will return
// true if the button is pressed and false if not.

View File

@@ -51,7 +51,7 @@ public:
*/
void OperatorControl()
{
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
// The output of GetRawButton is true/false depending on whether
// the button is pressed; Set takes a boolean for for whether to

View File

@@ -87,7 +87,12 @@
<description>Example programs that demonstrate the use of the various commonly used sensors on FRC robots</description>
</tagDescription>
<example>
<tagDescription>
<name>Vision</name>
<description>Example programs that demonstrate the use of a camera for image acquisition and processing</description>
</tagDescription>
<example>
<name>Motor Controller</name>
<description>Demonstrate controlling a single motor with a Joystick.</description>
<tags>
@@ -123,6 +128,40 @@
</files>
</example>
<example>
<name>CAN Talon SRX</name>
<description>Quick demo of running the SRX at a given throttle value.</description>
<tags>
<tag>Robot and Motor</tag>
<tag>Digital</tag>
<tag>Actuators</tag>
<tag>Complete List</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/CANTalon/src/Robot.cpp" destination="src/Robot.cpp"></file>
</files>
</example>
<example>
<name>CAN Talon SRX PID</name>
<description>Quick demo of running the SRX with a PID loop.</description>
<tags>
<tag>Robot and Motor</tag>
<tag>Digital</tag>
<tag>Actuators</tag>
<tag>Complete List</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/CANTalonPID/src/Robot.cpp" destination="src/Robot.cpp"></file>
</files>
</example>
<example>
<name>Relay</name>
<description>Demonstrate controlling a Relay from Joystick buttons.</description>
@@ -240,8 +279,45 @@
destination="src/Robot.cpp"></file>
</files>
</example>
<example>
<example>
<name>Simple vision program</name>
<description>The minimal program to acquire images from an attached USB camera on the robot
and send them to the dashboard.</description>
<tags>
<tag>Vision</tag>
<tag>Complete List</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/QuickVision/src/Robot.cpp"
destination="src/Robot.cpp"></file>
</files>
</example>
<example>
<name>Intermediate vision</name>
<description>An example program that acquires images from an attached USB camera and adds some
annotation to the image as you might do for showing operators the result of some image
recognition, and sends it to the dashboard for display.
</description>
<tags>
<tag>Vision</tag>
<tag>Complete List</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/IntermediateVision/src/Robot.cpp"
destination="src/Robot.cpp"></file>
</files>
</example>
<example>
<name>GearsBot</name>
<description>A fully functional example CommandBased program for
WPIs GearsBot robot. This code can run on your computer if it
@@ -250,6 +326,7 @@
<tag>CommandBased Robot</tag>
<tag>Complete List</tag>
</tags>
<world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
<packages>
<package>src</package>
<package>src/Commands</package>
@@ -333,7 +410,8 @@
<tags>
<tag>CommandBased Robot</tag>
<tag>Complete List</tag>
</tags>
</tags>
<world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
<packages>
<package>src</package>
<package>src/Commands</package>

View File

@@ -40,7 +40,7 @@ public:
void OperatorControl()
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl())
while (IsOperatorControl() && IsEnabled())
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time

View File

@@ -154,7 +154,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
"Debug/FRCUserProgram");
config.setAttribute("org.eclipse.cdt.dsf.gdb.DEBUG_NAME", "arm-frc-linux-gnueabi-gdb");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/lvuser/FRCUserProgram");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, remote_connection);
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false);
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, "2345");

View File

@@ -43,8 +43,8 @@ public class RSEUtils {
RSECorePlugin.getTheCoreRegistry().getSystemTypeById("org.eclipse.rse.systemtype.ssh");
host = registry.createHost(profile.getName(), systemType, connectionName, hostName,
"The remote target for debugging the robot for team "+teamNumber+".");
host.setDefaultUserId("admin");
SystemSignonInformation info = new SystemSignonInformation(hostName, "admin",
host.setDefaultUserId("lvuser");
SystemSignonInformation info = new SystemSignonInformation(hostName, "lvuser",
"", systemType);
PasswordPersistenceManager.getInstance().add(info, true, false);
} catch (Exception e) {

View File

@@ -18,6 +18,7 @@ import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.PlatformUI;
import edu.wpi.first.wpilib.plugins.core.launching.AntLauncher;
import edu.wpi.first.wpilib.plugins.core.launching.SimulationNotification;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
/**
@@ -79,7 +80,12 @@ public class SimulateLaunchShortcut implements ILaunchShortcut {
* @param activeProj The project that the script will be run on/from
* @param mode The mode it will be run in (ILaunchManager.RUN_MODE or ILaunchManager.DEBUG_MODE)
*/
public void runConfig(IProject activeProj, String mode){
public void runConfig(IProject activeProj, String mode) {
if (!SimulationNotification.supportsSimulation()) {
SimulationNotification.showUnsupported();
return;
}
String targets = "simulate";
if(mode.equals(ILaunchManager.RUN_MODE)){

View File

@@ -7,16 +7,17 @@ import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
import edu.wpi.first.wpilib.plugins.cpp.wizards.newproject.CPPProjectType;
public class ExampleCPPProject extends CPPProjectType implements IExampleProject {
private String name, description;
private String name, description, world;
private List<String> tags;
private List<String> directories;
private List<ExportFile> files;
public ExampleCPPProject(String name, String description, List<String> tags,
List<String> directories, List<ExportFile> files) {
String world, List<String> directories, List<ExportFile> files) {
this.name = name;
this.description = description;
this.tags = tags;
this.world = world;
this.directories = directories;
this.files = files;
}
@@ -32,6 +33,10 @@ public class ExampleCPPProject extends CPPProjectType implements IExampleProject
public List<String> getTags() {
return tags;
}
public String getWorld() {
return world;
}
@Override
public String[] getFolders(String packageName) {

View File

@@ -11,6 +11,7 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject.ExportFile;
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
@@ -38,9 +39,9 @@ public class ExampleCPPWizard extends ExampleWizard {
}
@Override
protected IWizardPage getDetailsPage() {
protected IWizardPage getDetailsPage(INewProjectInfo info) {
if (detailsPage != null) return detailsPage;
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage(), info);
detailsPage.setTitle("Create Example Robot C++ Project");
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
detailsPage.setShowPackage(false);
@@ -49,8 +50,8 @@ public class ExampleCPPWizard extends ExampleWizard {
@Override
public IExampleProject makeExampleProject(String name, String description,
List<String> tags, List<String> folders, List<ExportFile> files) {
return new ExampleCPPProject(name, description, tags, folders, files);
List<String> tags, String world, List<String> folders, List<ExportFile> files) {
return new ExampleCPPProject(name, description, tags, world, folders, files);
}
@Override

View File

@@ -15,6 +15,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
@@ -56,7 +57,7 @@ public class NewCPPWizard extends Wizard implements INewWizard {
teamNumberPage = new TeamNumberPage(selection);
addPage(teamNumberPage);
}
page = new NewProjectMainPage(selection, teamNumberPage);
page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null);
page.setTitle("Create New Robot C++ Project");
page.setDescription("This wizard creates a new Robot C++ Project configured to use WPILib for programming FRC robots.");
page.setShowPackage(false);

View File

@@ -0,0 +1,16 @@
# Deployment information
username=lvuser
password=
deploy.dir=/home/lvuser
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
command.dir=/home/lvuser/
# Libraries to use
wpilib=${user.home}/wpilib/cpp/${cpp-version}
wpilib.lib=${wpilib}/lib
roboRIOAllowedImages=20
# Ant support
wpilib.ant.dir=${wpilib}/ant
jsch.jar=${wpilib.ant.dir}/jsch-0.1.50.jar
classloadertask.jar=${wpilib.ant.dir}/ant-classloadertask.jar

View File

@@ -19,11 +19,42 @@
<!-- Targets -->
<target name="get-target-ip">
<property name="ant.enable.asserts" value="true"/>
<property name="target" value="roboRIO-${team-number}.local" />
<echo>Target: ${target}</echo>
<echo>Trying Target: ${target}</echo>
<if>
<isreachable host="${target}" timeout="5"/>
<then>
<echo>roboRIO found via mDNS</echo>
</then>
<else>
<var name="target" unset="true"/>
<echo> roboRIO not found via mDNS, falling back to static USB</echo>
<property name="target" value="172.22.11.2"/>
<if>
<isreachable host="${target}" timeout="5"/>
<then>
<echo>roboRIO found via static USB</echo>
</then>
<else>
<var name="target" unset="true"/>
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
<property name="target" value="10.${ip.upper}.${ip.lower}.2"/>
<echo>roboRIO not found via USB, falling back to static address of ${target}</echo>
<assert name="roboRIOFound" message="roboRIO not found, please check that the roboRIO is connected, imaged and that the team number is set properly in Eclipse">
<bool>
<isreachable host="${target}" timeout="5"/>
</bool>
</assert>
<echo>roboRIO found via Ethernet static</echo>
</else>
</if>
</else>
</if>
</target>
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
<target name="deploy" depends="get-target-ip, dependencies" description="Deploy the progam and start it running.">
<sshexec host="${target}"
username="${username}"
password="${password}"
@@ -42,11 +73,6 @@
trust="true"
command=". /etc/profile.d/natinst-path.sh; chmod a+x ${deploy.dir}/${out}; ${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="tail -F -n 0 ${deploy.log.file}"/>
</target>
<target name="kill-program" depends="get-target-ip" description="Kill the currently running FRC program">
@@ -57,28 +83,6 @@
command="/usr/local/frc/bin/frcKillRobot.sh"/>
</target>
<target name="debug-deploy" depends="get-target-ip" description="Deploy the jar and start the program running in debug mode.">
<echo>[athena-deploy] Killing running program</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="killall FRCUserProgram; sleep 1"/>
<echo>[athena-debug-deploy] Copying code over.</echo>
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<scp file="${wpilib.ant.dir}/debugcppprogram" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<scp file="${wpilib.ant.dir}/debugjavaprogram" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<echo>[athena-debug-deploy] Starting program.</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="chmod a+x debug*program; ${deploy.debug.command}"/>
</target>
<!-- Simulation support -->
<target name="simulate">
<parallel>
@@ -102,4 +106,21 @@
</sequential>
</parallel>
</target>
<target name="dependencies" depends="get-target-ip">
<property name="ant.enable.asserts" value="true"/>
<post to="http://${target}/nisysapi/server" logfile="sysProps.xml" verbose="false" encoding="UTF-16LE" append="false">
<prop name="Function" value="GetPropertiesOfItem"/>
<prop name="Plugins" value="nisyscfg"/>
<prop name="Items" value="system"/>
</post>
<loadfile srcFile="sysProps.xml" encoding="UTF-16LE" property="roboRIOSysValues"/>
<propertyregex property="roboRIOImage" input="${roboRIOSysValues}" regexp="FRC_roboRIO_2015_v([0-9]+)" select="\1" defaultValue="ImageRegExFail"/>
<assert message="roboRIO Image does not match plugin, allowed image version: ${roboRIOAllowedImages}">
<bool>
<contains string="${roboRIOAllowedImages}" substring="${roboRIOImage}"/>
</bool>
</assert>
<echo>roboRIO image version validated</echo>
</target>
</project>

View File

@@ -1 +1 @@
/home/admin/FRCUserProgram
/usr/local/frc/bin/netconsole-host /home/lvuser/FRCUserProgram

View File

@@ -38,7 +38,7 @@ public class Robot extends IterativeRobot {
public void autonomousInit() {
// schedule the autonomous command (example)
autonomousCommand.start();
if (autonomousCommand != null) autonomousCommand.start();
}
/**
@@ -53,7 +53,15 @@ public class Robot extends IterativeRobot {
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
autonomousCommand.cancel();
if (autonomousCommand != null) autonomousCommand.cancel();
}
/**
* This function is called when the disabled button is hit.
* You can use it to reset subsystems before shutting down.
*/
public void disabledInit(){
}
/**

View File

@@ -0,0 +1,37 @@
package $package;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Timer;
/**
* This is a short sample program demonstrating how to use the basic throttle
* mode of the new CAN Talon.
*/
public class Robot extends SampleRobot {
CANTalon motor;
public Robot() {
motor = new CANTalon(1); // Initialize the CanTalonSRX on device 1.
}
/**
* Runs the motor.
*/
public void operatorControl() {
while (isOperatorControl() && isEnabled()) {
// Set the motor's output to half power.
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed
// going forward)
motor.set(0.5);
Timer.delay(0.01); // Note that the CANTalon only receives updates every
// 10ms, so updating more quickly would not gain you
// anything.
}
motor.disable();
}
}

View File

@@ -0,0 +1,62 @@
package $package;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Timer;
/**
* This is a short sample program demonstrating how to use the Talon SRX over
* CAN to run a closed-loop PID controller with an analog potentiometer.
*/
public class Robot extends SampleRobot {
CANTalon motor;
public Robot() {
motor = new CANTalon(1); // Initialize the CanTalonSRX on device 1.
// This sets the mode of the m_motor. The options are:
// PercentVbus: basic throttle; no closed-loop.
// Current: Runs the motor with the specified current if possible.
// Speed: Runs a PID control loop to keep the motor going at a constant
// speed using the specified sensor.
// Position: Runs a PID control loop to move the motor to a specified move
// the motor to a specified sensor position.
// Voltage: Runs the m_motor at a constant voltage, if possible.
// Follower: The m_motor will run at the same throttle as the specified
// other talon.
motor.changeControlMode(CANTalon.ControlMode.Position);
// This command allows you to specify which feedback device to use when doing
// closed-loop control. The options are:
// AnalogPot: Basic analog potentiometer
// QuadEncoder: Quadrature Encoder
// AnalogEncoder: Analog Encoder
// EncRising: Counts the rising edges of the QuadA pin (allows use of a
// non-quadrature encoder)
// EncFalling: Same as EncRising, but counts on falling edges.
motor.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
// This sets the basic P, I , and D values (F, Izone, and rampRate can also
// be set, but are ignored here).
// These must all be positive floating point numbers (reverseSensor will
// multiply the sensor values by negative one in case your sensor is flipped
// relative to your motor).
// These values are in units of throttle / sensor_units where throttle ranges
// from -1023 to +1023 and sensor units are from 0 - 1023 for analog
// potentiometers, encoder ticks for encoders, and position / 10ms for
// speeds.
motor.setPID(1.0, 0.0, 0.0);
}
public void operatorControl() {
while (isOperatorControl() && isEnabled()) {
// In closed loop mode, this sets the goal in the units mentioned above.
// Since we are using an analog potentiometer, this will try to go to
// the middle of the potentiometer range.
motor.set(512);
Timer.delay(5.0);
}
}
}

View File

@@ -39,7 +39,7 @@ public class Robot extends SampleRobot {
*/
public void operatorControl() {
robotDrive.setSafetyEnabled(true);
while (isOperatorControl()) {
while (isOperatorControl() && isEnabled()) {
// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.
// This sample does not use field-oriented drive, so the gyro input is set to zero.

View File

@@ -32,7 +32,7 @@ public class Robot extends SampleRobot {
* Runs the motor from a joystick.
*/
public void operatorControl() {
while (isOperatorControl()) {
while (isOperatorControl() && isEnabled()) {
// Set the motor's output.
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed going forward)
motor.set(stick.getY());

View File

@@ -37,7 +37,7 @@ public class Robot extends SampleRobot {
*/
public void operatorControl() {
myRobot.setSafetyEnabled(true);
while (isOperatorControl()) {
while (isOperatorControl() && isEnabled()) {
myRobot.tankDrive(leftStick, rightStick);
Timer.delay(0.005); // wait for a motor update time
}

View File

@@ -154,6 +154,40 @@
</files>
</example>
<example>
<name>CAN Talon SRX</name>
<description>Demonstrate running a Talon SRX with the basic throttle mode.</description>
<tags>
<tag>Actuators</tag>
<tag>Complete List</tag>
<tag>Robot and Motor</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/CANTalon/src/org/usfirst/frc/team190/robot/Robot.java"
destination="src/$package-dir/Robot.java"></file>
</files>
</example>
<example>
<name>CAN Talon SRX PID</name>
<description>Demonstrate running a Talon SRX with PID Closed Loop control.</description>
<tags>
<tag>Actuators</tag>
<tag>Complete List</tag>
<tag>Robot and Motor</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/CANTalonPID/src/org/usfirst/frc/team190/robot/Robot.java"
destination="src/$package-dir/Robot.java"></file>
</files>
</example>
<tagDescription>
<name>CommandBased Robot</name>
@@ -166,6 +200,7 @@
<tags>
<tag>CommandBased Robot</tag>
</tags>
<world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
<packages>
<package>src/$package-dir</package>
<package>src/$package-dir/commands</package>
@@ -198,6 +233,7 @@
<tags>
<tag>CommandBased Robot</tag>
</tags>
<world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
<packages>
<package>src/$package-dir</package>
<package>src/$package-dir/commands</package>

View File

@@ -48,7 +48,7 @@ public class Robot extends SampleRobot {
*/
public void operatorControl() {
myRobot.setSafetyEnabled(true);
while (isOperatorControl()) {
while (isOperatorControl() && isEnabled()) {
myRobot.arcadeDrive(stick); // drive with arcade style (use right stick)
Timer.delay(0.005); // wait for a motor update time
}

View File

@@ -2,6 +2,7 @@ package edu.wpi.first.wpilib.plugins.java.launching;
import java.io.File;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
@@ -15,8 +16,6 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jdt.core.IJavaElement;
@@ -37,13 +36,13 @@ import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
@SuppressWarnings("restriction")
public abstract class JavaLaunchShortcut implements ILaunchShortcut {
private static final int DEBUG_ATTACH_ATTEMPTS = 20;
private static final int DEBUG_ATTACH_RETRY_DELAY_SEC = 2;
//Class constants - used to delineate types for launch shortcuts
public static final String DEPLOY_TYPE = "edu.wpi.first.wpilib.plugins.core.deploy";
private static final String ANT_SERVER_THREAD_NAME = "Ant Build Server Connection";
// NOTE: This string must be changed if the port is changed.
private static final String DEBUG_START_TEXT = "Listening for transport dt_socket at address: 8348";
private static ILaunch lastDeploy = null;
/**
@@ -155,11 +154,9 @@ public abstract class JavaLaunchShortcut implements ILaunchShortcut {
lastDeploy = AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), targets, null, mode);
if((mode.equals(ILaunchManager.DEBUG_MODE))&&(getLaunchType().equals(DEPLOY_TYPE))) {
ILaunchConfigurationWorkingCopy config;
try {
config = getRemoteDebugConfig(activeProj);
startDebugConfig(config, lastDeploy);
} catch (CoreException e) {
startDebugConfig(getRemoteDebugConfig(activeProj));
} catch (CoreException | InterruptedException e) {
WPILibJavaPlugin.logError("Debug attach failed", e);
}
}
@@ -190,20 +187,28 @@ public abstract class JavaLaunchShortcut implements ILaunchShortcut {
return WPILibCore.getDefault().getTargetIP(proj);
}
private void startDebugConfig(final ILaunchConfigurationWorkingCopy config, ILaunch deploy) throws CoreException {
IStreamListener listener = new IStreamListener() {
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
if (text.contains(DEBUG_START_TEXT)) {
try {
config.launch(ILaunchManager.DEBUG_MODE, null);
} catch (CoreException e) {
WPILibJavaPlugin.logError("Error starting debug config..", e);
}
monitor.removeListener(this);
private void startDebugConfig(final ILaunchConfigurationWorkingCopy config)
throws CoreException, InterruptedException {
int remainingAttempts = DEBUG_ATTACH_ATTEMPTS;
// Retry until success or rethrow of exception on failure
while (true) {
try {
WPILibJavaPlugin.logInfo("Attemping to attach debugger...");
config.launch(ILaunchManager.DEBUG_MODE, null);
WPILibJavaPlugin.logInfo("Debugger attached.");
break;
} catch (CoreException e) {
if (--remainingAttempts > 0) {
String errorMsg = MessageFormat.format("Unable to attach debugger. "
+ "{0} attempts remain - waiting {1} second(s) before retrying...",
remainingAttempts, DEBUG_ATTACH_RETRY_DELAY_SEC);
WPILibJavaPlugin.logError(errorMsg, null);
Thread.sleep(DEBUG_ATTACH_RETRY_DELAY_SEC * 1000);
} else {
throw e;
}
}
};
deploy.getProcesses()[0].getStreamsProxy().getOutputStreamMonitor().addListener(listener);
}
}
}

View File

@@ -2,6 +2,8 @@ package edu.wpi.first.wpilib.plugins.java.launching;
import org.eclipse.core.resources.IProject;
import edu.wpi.first.wpilib.plugins.core.launching.SimulationNotification;
public class SimulateLaunchShortcut extends JavaLaunchShortcut {
@@ -11,7 +13,11 @@ public class SimulateLaunchShortcut extends JavaLaunchShortcut {
* @param mode The mode it will be run in (ILaunchManager.RUN_MODE or ILaunchManager.DEBUG_MODE)
*/
public void runConfig(IProject activeProj, String mode){
runConfigHelper(activeProj, mode, "simulate", "debug-simulate");
if (SimulationNotification.supportsSimulation()) {
runConfigHelper(activeProj, mode, "simulate", "debug-simulate");
} else {
SimulationNotification.showUnsupported();
}
}
protected String getHostname(IProject proj) {

View File

@@ -7,16 +7,17 @@ import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
import edu.wpi.first.wpilib.plugins.java.wizards.newproject.JavaProjectType;
public class ExampleJavaProject extends JavaProjectType implements IExampleProject {
private String name, description;
private String name, description, world;
private List<String> tags;
private List<String> packages;
private List<ExportFile> files;
public ExampleJavaProject(String name, String description, List<String> tags,
List<String> packages, List<ExportFile> files) {
String world, List<String> packages, List<ExportFile> files) {
this.name = name;
this.description = description;
this.tags = tags;
this.world = world;
this.packages = packages;
this.files = files;
}
@@ -32,6 +33,10 @@ public class ExampleJavaProject extends JavaProjectType implements IExampleProje
public List<String> getTags() {
return tags;
}
public String getWorld() {
return world;
}
@Override
public String[] getFolders(String packageName) {

View File

@@ -10,6 +10,7 @@ import org.eclipse.jface.wizard.IWizardPage;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject.ExportFile;
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
@@ -40,9 +41,9 @@ public class ExampleJavaWizard extends ExampleWizard {
}
@Override
protected IWizardPage getDetailsPage() {
protected IWizardPage getDetailsPage(INewProjectInfo info) {
if (detailsPage != null) return detailsPage;
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage(), info);
detailsPage.setTitle("Create Example Robot Java Project");
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
return detailsPage;
@@ -50,8 +51,8 @@ public class ExampleJavaWizard extends ExampleWizard {
@Override
public IExampleProject makeExampleProject(String name, String description,
List<String> tags, List<String> folders, List<ExportFile> files) {
return new ExampleJavaProject(name, description, tags, folders, files);
List<String> tags, String world, List<String> folders, List<ExportFile> files) {
return new ExampleJavaProject(name, description, tags, world, folders, files);
}
@Override

View File

@@ -11,7 +11,9 @@ 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.SelectionEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -76,6 +78,15 @@ public class FileTemplateWizardMainPage extends WizardPage {
});
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
projectsCombo.setLayoutData(gd);
projectsCombo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e){
if (project == null){
project = projectsCombo.getProject();
}
packageText.setText(getDefaultPackage());
}
public void widgetDefaultSelected(SelectionEvent e){}
});
projectsCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
@@ -116,6 +127,7 @@ public class FileTemplateWizardMainPage extends WizardPage {
*/
private void initialize() {
WPILibJavaPlugin.logInfo("initialize");
projectsCombo.setProject(project);
packageText.setText(getDefaultPackage());
}
@@ -130,7 +142,7 @@ public class FileTemplateWizardMainPage extends WizardPage {
// Update the default package if necessary
if (project == null || !project.equals(projectsCombo.getProject())) {
String oldDefault = getDefaultPackage();
String oldDefault = getDefaultPackage();
project = projectsCombo.getProject();
if (packageString.equals(oldDefault)) {
packageText.setText(getDefaultPackage());
@@ -200,4 +212,4 @@ public class FileTemplateWizardMainPage extends WizardPage {
if (defaultPackage != null) return defaultPackage;
else return "";
}
}
}

View File

@@ -15,6 +15,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
@@ -56,7 +57,7 @@ public class NewJavaWizard extends Wizard implements INewWizard {
teamNumberPage = new TeamNumberPage(selection);
addPage(teamNumberPage);
}
page = new NewProjectMainPage(selection, teamNumberPage);
page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null);
page.setProjectTypes(JavaProjectType.TYPES);
page.setTitle("Create New Robot Java Project");
page.setDescription("This wizard creates a new Robot Java Project configured to use WPILib for programming FRC robots.");

View File

@@ -1,14 +1,13 @@
# Deployment information
username=admin
username=lvuser
password=
deploy.dir=/home/admin
deploy.dir=/home/lvuser
deploy.kill.command=. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
deploy.log.command=tail -F -n 0 ${deploy.log.file}
debug.flag.dir=/tmp/
debug.flag.command=chown lvuser:ni ${debug.flag.dir}frcdebug
command.dir=/home/lvuser/
version=current
roboRIOJRE.dir=/usr/local/frc/JRE
# Libraries to use
wpilib=${user.home}/wpilib/java/${version}
@@ -21,6 +20,7 @@ networktables.sources=${wpilib.lib}/NetworkTables-sources.jar
#jnaerator.jar=${wpilib.lib}/jnaerator-runtime.jar
#classpath=${wpilib.jar}:${networktables.jar}:${jna.jar}:${jnaerator.jar}
classpath=${wpilib.jar}:${networktables.jar}
roboRIOAllowedImages=20
# Ant support
wpilib.ant.dir=${wpilib}/ant

View File

@@ -19,8 +19,39 @@
<!-- Targets -->
<target name="get-target-ip">
<property name="ant.enable.asserts" value="true"/>
<property name="target" value="roboRIO-${team-number}.local" />
<echo>Target: ${target}</echo>
<echo>Trying Target: ${target}</echo>
<if>
<isreachable host="${target}" timeout="5"/>
<then>
<echo>roboRIO found via mDNS</echo>
</then>
<else>
<var name="target" unset="true"/>
<echo> roboRIO not found via mDNS, falling back to static USB</echo>
<property name="target" value="172.22.11.2"/>
<if>
<isreachable host="${target}" timeout="5"/>
<then>
<echo>roboRIO found via static USB</echo>
</then>
<else>
<var name="target" unset="true"/>
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
<property name="target" value="10.${ip.upper}.${ip.lower}.2"/>
<echo>roboRIO not found via USB, falling back to static address of ${target}</echo>
<assert name="roboRIOFound" message="roboRIO not found, please check that the roboRIO is connected, imaged and that the team number is set properly in Eclipse">
<bool>
<isreachable host="${target}" timeout="5"/>
</bool>
</assert>
<echo>roboRIO found via Ethernet static</echo>
</else>
</if>
</else>
</if>
</target>
<target name="compile" description="Compile the source code.">
@@ -66,7 +97,11 @@
</jar>
</target>
<target name="deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
<!-- We're running a clean here to get around a known ant issue where it does not detected changed constant variables.
To get around this, we're recompiling the entire project, which is not an issue for most teams. If this is an issue
for you, you can remove the clean here, just be sure to do a full rebuild after you've changed any constants.
Reference: http://stackoverflow.com/questions/6430001/ant-doesnt-recompile-constants -->
<target name="deploy" depends="clean,jar,get-target-ip,dependencies" description="Deploy the jar and start the program running.">
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
@@ -78,14 +113,9 @@
trust="true"
command="${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
</target>
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
<target name="debug-deploy" depends="jar,get-target-ip,dependencies" description="Deploy the jar and start the program running.">
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
<!-- The remoteDebugCommand file is used by /usr/local/frc/bin/frcRunRobot.sh on the roboRIO -->
@@ -105,11 +135,6 @@
trust="true"
command="${deploy.kill.command}"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
</target>
<!-- Simulate -->
@@ -180,4 +205,28 @@
</sequential>
</parallel>
</target>
<target name="dependencies" depends="get-target-ip">
<property name="ant.enable.asserts" value="true"/>
<post to="http://${target}/nisysapi/server" logfile="sysProps.xml" verbose="false" encoding="UTF-16LE" append="false">
<prop name="Function" value="GetPropertiesOfItem"/>
<prop name="Plugins" value="nisyscfg"/>
<prop name="Items" value="system"/>
</post>
<loadfile srcFile="sysProps.xml" encoding="UTF-16LE" property="roboRIOSysValues"/>
<propertyregex property="roboRIOImage" input="${roboRIOSysValues}" regexp="FRC_roboRIO_2015_v([0-9]+)" select="\1" defaultValue="ImageRegExFail"/>
<assert message="roboRIO Image does not match plugin, allowed image version: ${roboRIOAllowedImages}">
<bool>
<contains string="${roboRIOAllowedImages}" substring="${roboRIOImage}"/>
</bool>
</assert>
<echo>roboRIO image version validated</echo>
<echo>Checking for JRE. If this fails install the JRE using these instructions: http://wpilib.screenstepslive.com/s/4485/m/13809/l/243933-installing-java-8-on-the-roborio-java-only</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
failonerror="true"
command="test -d ${roboRIOJRE.dir}"/>
</target>
</project>

View File

@@ -1,3 +1,2 @@
/usr/local/frc/JRE/bin/java
-jar /home/admin/FRCUserProgram.jar
/usr/local/frc/bin/netconsole-host /usr/local/frc/JRE/bin/java -jar /home/lvuser/FRCUserProgram.jar

View File

@@ -1,3 +1,2 @@
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y
-jar /home/admin/FRCUserProgram.jar
/usr/local/frc/bin/netconsole-host /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar /home/lvuser/FRCUserProgram.jar

View File

@@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WPILib_Riolog
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.riolog;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: netconsole2.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: WPI & FIRST

View File

@@ -0,0 +1,13 @@
Riolog
This is an Eclipse plugin that receives and displays text from UDP port 6666. It
defines a new view that displays the received text.
To compile, open project in an Eclipse instance with the appropriate plugin
development tools, and Export as a deployable plugin/fragment.
To install, copy the resulting jar file into $eclipse/dropins/, and start
Eclipse (-clean may be necessary).
To enable, go to Window>Show View>Other... and choose General>Riolog.

View File

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

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<contexts>
<context id="text" title="Riolog">
<description>This is the context help for the Riolog It was generated by a PDE template.</description>
<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
<enablement>
<with variable="platform">
<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
</with>
</enablement>
</topic>
</context>
</contexts>

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.views">
<view
name="Riolog"
icon="icons/riolog.png"
category="org.eclipse.ui"
class="netconsole2.views.RiologView"
id="netconsole2.views.RiologView">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
ratio="0.5"
relative="org.eclipse.ui.views.ProblemView"
relationship="right"
id="netconsole2.views.RiologView">
</view>
</perspectiveExtension>
</extension>
<extension
point="org.eclipse.help.contexts">
<contexts
file="contexts.xml">
</contexts>
</extension>
</plugin>

View File

@@ -0,0 +1,15 @@
<?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.riolog</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

@@ -0,0 +1,61 @@
package netconsole2;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "riolog"; //$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;
}
/*
* (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;
}
/**
* 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);
}
}

View File

@@ -0,0 +1,414 @@
package netconsole2.views;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
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.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
public class RiologView extends ViewPart {
public static Action confAction(String name, String tooltip, String img,
Action e) {
e.setText(name);
e.setToolTipText(tooltip);
e.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(img));
return e;
}
public static byte[] getPacket(DatagramSocket socket, DatagramPacket buf) {
try {
socket.receive(buf);
} catch (IOException e) {
return null;
}
byte[] ret = new byte[buf.getLength()];
System.arraycopy(buf.getData(), 0, ret, 0, ret.length);
return ret;
}
public static DatagramSocket makeRecvSocket() {
DatagramSocket socket = null;
try {
socket = new DatagramSocket(null);
socket.setReuseAddress(true);
socket.bind(new InetSocketAddress(6666));
} catch (SocketException e) {
e.printStackTrace();
socket.close();
return null;
}
return socket;
}
public static Thread startDaemonThread(Runnable r, String name) {
Thread t = new Thread(r, name);
t.setDaemon(true);
t.start();
return t;
}
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "netconsole2.views.RiologView";
Text text;
Thread listener;
Thread transferer;
volatile DatagramSocket socket_hook = null;
volatile boolean discard = false;
volatile boolean paused = false;
volatile boolean cleanup = false;
private Action clearAction;
private Action pauseAction;
private Action discardAction;
private Action unpauseAction;
private Action undiscardAction;
private Button discardButton;
private Button pauseButton;
/**
* The constructor.
*/
public RiologView() {
}
private void contributeToActionBars() {
IActionBars bars = getViewSite().getActionBars();
fillLocalPullDown(bars.getMenuManager());
fillLocalToolBar(bars.getToolBarManager());
}
/**
* This is a callback that will allow us to create the viewer and initialize
* it.
*/
public void createPartControl(Composite parent) {
GridLayout glayout = new GridLayout();
glayout.numColumns = 1;
parent.setLayout(glayout);
text = new Text(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL
| SWT.READ_ONLY);
{
GridData gdata = new GridData();
gdata.grabExcessVerticalSpace = true;
gdata.grabExcessHorizontalSpace = true;
gdata.horizontalAlignment = SWT.FILL;
gdata.verticalAlignment = SWT.FILL;
text.setLayoutData(gdata);
}
Composite row = new Composite(parent, SWT.NONE);
row.setLayout(new FillLayout(SWT.HORIZONTAL));
{
GridData gdata = new GridData();
gdata.grabExcessVerticalSpace = false;
gdata.grabExcessHorizontalSpace = true;
gdata.horizontalAlignment = SWT.FILL;
gdata.verticalAlignment = SWT.CENTER;
row.setLayoutData(gdata);
}
// Create the help context id for the viewer's control
PlatformUI.getWorkbench().getHelpSystem()
.setHelp(parent, "netconsole2.text");
makeActions();
makeButtons(row);
hookContextMenu();
contributeToActionBars();
startListening();
}
public void makeButtons(Composite parent) {
pauseButton = new Button(parent, SWT.TOGGLE);
pauseButton.setText(pauseAction.getText());
pauseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (pauseButton.getSelection()) {
pauseAction.run();
} else {
unpauseAction.run();
}
}
});
discardButton = new Button(parent, SWT.TOGGLE);
discardButton.setText(discardAction.getText());
discardButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (discardButton.getSelection()) {
discardAction.run();
} else {
undiscardAction.run();
}
}
});
Button clearButton = new Button(parent, SWT.PUSH);
clearButton.setText(clearAction.getText());
clearButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
clearAction.run();
}
});
}
@Override
public void dispose() {
stopListening();
super.dispose();
}
private void fillContextMenu(IMenuManager manager) {
manager.add(pauseAction);
manager.add(unpauseAction);
manager.add(new Separator());
manager.add(clearAction);
manager.add(new Separator());
manager.add(discardAction);
manager.add(undiscardAction);
manager.add(new Separator());
manager.add(confAction("Copy", "Copy selected text",
ISharedImages.IMG_TOOL_COPY, new Action() {
@Override
public void run() {
text.copy();
}
}));
manager.add(confAction("Select All", "Select all text", "",
new Action() {
@Override
public void run() {
text.selectAll();
}
}));
}
private void fillLocalPullDown(IMenuManager manager) {
manager.add(pauseAction);
manager.add(unpauseAction);
manager.add(new Separator());
manager.add(clearAction);
manager.add(new Separator());
manager.add(discardAction);
manager.add(undiscardAction);
}
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(pauseAction);
manager.add(unpauseAction);
manager.add(new Separator());
manager.add(clearAction);
manager.add(new Separator());
manager.add(discardAction);
manager.add(undiscardAction);
}
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
RiologView.this.fillContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(text);
text.setMenu(menu);
}
private void makeActions() {
clearAction = confAction("Clear Log", "Empty the textbox",
ISharedImages.IMG_ETOOL_CLEAR, new Action() {
public void run() {
text.setText("");
}
});
pauseAction = confAction("Pause Display",
"Stop adding packets to the textbox",
ISharedImages.IMG_ELCL_STOP, new Action() {
public void run() {
pauseAction.setEnabled(false);
unpauseAction.setEnabled(true);
pauseButton.setSelection(true);
pauseButton.setText("Show 0 Packets");
paused = true;
}
});
pauseAction.setEnabled(true);
unpauseAction = confAction("Continue Display",
"Continue adding packets to the textbox",
ISharedImages.IMG_TOOL_FORWARD, new Action() {
public void run() {
paused = false;
transferer.interrupt();
pauseAction.setEnabled(true);
unpauseAction.setEnabled(false);
pauseButton.setSelection(false);
pauseButton.setText(pauseAction.getText());
}
});
unpauseAction.setEnabled(false);
discardAction = confAction("Discard Incoming",
"Drop all incoming packets", ISharedImages.IMG_ETOOL_DELETE,
new Action() {
public void run() {
discard = true;
discardAction.setEnabled(false);
undiscardAction.setEnabled(true);
discardButton.setSelection(true);
discardButton.setText(undiscardAction.getText());
}
});
discardAction.setEnabled(true);
undiscardAction = confAction("Accept Incoming",
"Accept all incoming packets", ISharedImages.IMG_OBJ_ADD,
new Action() {
public void run() {
discard = false;
discardAction.setEnabled(true);
undiscardAction.setEnabled(false);
discardButton.setSelection(false);
discardButton.setText(discardAction.getText());
}
});
undiscardAction.setEnabled(false);
}
/**
* Passing the focus request to the viewer's control.
*/
public void setFocus() {
text.setFocus();
}
public static String drainToString(ArrayList<byte[]> arr) {
int netlength = 0;
for (byte[] b : arr) {
netlength += b.length;
}
byte[] sum = new byte[netlength];
int mark = 0;
for (int i=0;i<arr.size();i++) {
byte[] b = arr.get(i);
System.arraycopy(b, 0, sum, mark, b.length);
arr.set(i, null);
mark += b.length;
}
arr.clear();
return new String(sum);
}
void startListening() {
final BlockingQueue<byte[]> queue = new LinkedBlockingQueue<>();
listener = startDaemonThread(new Runnable() {
@Override
public void run() {
DatagramSocket socket = makeRecvSocket();
if (socket == null)
return;
socket_hook = socket;
byte[] buf = new byte[4096];
DatagramPacket datagram = new DatagramPacket(buf, buf.length);
while (!Thread.interrupted()) {
byte[] s = getPacket(socket, datagram);
if (s != null && !discard) {
try {
queue.put(s);
} catch (InterruptedException e) {
socket.close();
return;
}
}
}
socket.close();
}
}, "Riolog-Listener");
transferer = startDaemonThread(new Runnable() {
@Override
public void run() {
final ArrayList<byte[]> temp = new ArrayList<>();
while (!cleanup) {
try {
temp.add(queue.take());
} catch (InterruptedException e) {
if (cleanup) {
return;
}
}
queue.drainTo(temp);
if (!paused) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
if (text.isDisposed())
return;
text.append(drainToString(temp));
}
});
} else {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
if (paused) {
if (temp.size() == 1) {
pauseButton.setText("Show 1 Packet\u2002");
} else {
pauseButton.setText("Show " + String.valueOf(temp.size()) + " Packets");
}
}
}
});
}
}
}
}, "Riolog-Transfer");
}
void stopListening() {
cleanup = true;
if (socket_hook != null) {
socket_hook.close();
}
listener.interrupt();
transferer.interrupt();
}
}

View File

@@ -14,12 +14,13 @@
<module>edu.wpi.first.wpilib.plugins.cpp.feature</module>
<module>edu.wpi.first.wpilib.plugins.java</module>
<module>edu.wpi.first.wpilib.plugins.java.feature</module>
<module>edu.wpi.first.wpilib.plugins.riolog</module>
<module>edu.wpi.first.wpilib.plugins.updatesite</module>
</modules>
<properties>
<!-- local-repository>C:/Users/wpilibj-buildmaster/maven-repository</local-repository-->
<tycho-version>0.18.1</tycho-version>
<tycho-version>0.21.0</tycho-version>
</properties>
<repositories>

View File

@@ -45,3 +45,16 @@
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE "HAL: Attempted to read AnalogTrigger pulse output."
#define PARAMETER_OUT_OF_RANGE -1028
#define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
#define VI_ERROR_SYSTEM_ERROR_MESSAGE "HAL - VISA: System Error";
#define VI_ERROR_INV_OBJECT_MESSAGE "HAL - VISA: Invalid Object"
#define VI_ERROR_RSRC_LOCKED_MESSAGE "HAL - VISA: Resource Locked"
#define VI_ERROR_RSRC_NFOUND_MESSAGE "HAL - VISA: Resource Not Found"
#define VI_ERROR_INV_RSRC_NAME_MESSAGE "HAL - VISA: Invalid Resource Name"
#define VI_ERROR_QUEUE_OVERFLOW_MESSAGE "HAL - VISA: Queue Overflow"
#define VI_ERROR_IO_MESSAGE "HAL - VISA: General IO Error"
#define VI_ERROR_ASRL_PARITY_MESSAGE "HAL - VISA: Parity Error"
#define VI_ERROR_ASRL_FRAMING_MESSAGE "HAL - VISA: Framing Error"
#define VI_ERROR_ASRL_OVERRUN_MESSAGE "HAL - VISA: Buffer Overrun Error"
#define VI_ERROR_RSRC_BUSY_MESSAGE "HAL - VISA: Resource Busy"
#define VI_ERROR_INV_PARAMETER_MESSAGE "HAL - VISA: Invalid Parameter"

View File

@@ -14,7 +14,6 @@
#include "Accelerometer.hpp"
#include "Analog.hpp"
#include "CAN.hpp"
#include "Compressor.hpp"
#include "Digital.hpp"
#include "Solenoid.hpp"
@@ -23,6 +22,7 @@
#include "Errors.hpp"
#include "PDP.hpp"
#include "Power.hpp"
#include "SerialPort.hpp"
#include "Utilities.hpp"
#include "Semaphore.hpp"
@@ -177,7 +177,20 @@ struct HALJoystickPOVs {
int16_t povs[kMaxJoystickPOVs];
};
typedef uint32_t HALJoystickButtons;
struct HALJoystickButtons {
uint32_t buttons;
uint8_t count;
};
struct HALJoystickDescriptor {
uint8_t isXbox;
uint8_t type;
char name[256];
uint8_t axisCount;
uint8_t axisTypes;
uint8_t buttonCount;
uint8_t povCount;
};
inline float intToFloat(int value)
{
@@ -212,9 +225,15 @@ extern "C"
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes);
int HALGetJoystickPOVs(uint8_t joystickNum, HALJoystickPOVs *povs);
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons);
int HALGetJoystickDescriptor(uint8_t joystickNum, HALJoystickDescriptor *desc);
int HALSetJoystickOutputs(uint8_t joystickNum, uint32_t outputs, uint16_t leftRumble, uint16_t rightRumble);
int HALGetMatchTime(float *matchTime);
void HALSetNewDataSem(pthread_mutex_t *);
void HALSetNewDataSem(pthread_cond_t *);
bool HALGetSystemActive(int32_t *status);
bool HALGetBrownedOut(int32_t *status);
int HALInitialize(int mode = 0);
void HALNetworkCommunicationObserveUserProgramStarting();

View File

@@ -11,4 +11,9 @@ extern "C"
double getPDPTemperature(int32_t *status);
double getPDPVoltage(int32_t *status);
double getPDPChannelCurrent(uint8_t channel, int32_t *status);
double getPDPTotalCurrent(int32_t *status);
double getPDPTotalPower(int32_t *status);
double getPDPTotalEnergy(int32_t *status);
void resetPDPTotalEnergy(int32_t *status);
void clearPDPStickyFaults(int32_t *status);
}

View File

@@ -8,8 +8,14 @@ extern "C"
float getVinCurrent(int32_t *status);
float getUserVoltage6V(int32_t *status);
float getUserCurrent6V(int32_t *status);
bool getUserActive6V(int32_t *status);
int getUserCurrentFaults6V(int32_t *status);
float getUserVoltage5V(int32_t *status);
float getUserCurrent5V(int32_t *status);
bool getUserActive5V(int32_t *status);
int getUserCurrentFaults5V(int32_t *status);
float getUserVoltage3V3(int32_t *status);
float getUserCurrent3V3(int32_t *status);
bool getUserActive3V3(int32_t *status);
int getUserCurrentFaults3V3(int32_t *status);
}

View File

@@ -46,7 +46,7 @@ extern "C"
MULTIWAIT_ID initializeMultiWait();
void deleteMultiWait(MULTIWAIT_ID sem);
int8_t takeMultiWait(MULTIWAIT_ID sem, int32_t timeout);
int8_t takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m, int32_t timeout);
int8_t giveMultiWait(MULTIWAIT_ID sem);
}

View File

@@ -0,0 +1,29 @@
#pragma once
#ifdef __vxworks
#include <vxWorks.h>
#else
#include <stdint.h>
#endif
extern "C"
{
void serialInitializePort(uint8_t port, int32_t *status);
void serialSetBaudRate(uint8_t port, uint32_t baud, int32_t *status);
void serialSetDataBits(uint8_t port, uint8_t bits, int32_t *status);
void serialSetParity(uint8_t port, uint8_t parity, int32_t *status);
void serialSetStopBits(uint8_t port, uint8_t stopBits, int32_t *status);
void serialSetWriteMode(uint8_t port, uint8_t mode, int32_t *status);
void serialSetFlowControl(uint8_t port, uint8_t flow, int32_t *status);
void serialSetTimeout(uint8_t port, float timeout, int32_t *status);
void serialEnableTermination(uint8_t port, char terminator, int32_t *status);
void serialDisableTermination(uint8_t port, int32_t *status);
void serialSetReadBufferSize(uint8_t port, uint32_t size, int32_t *status);
void serialSetWriteBufferSize(uint8_t port, uint32_t size, int32_t *status);
int32_t serialGetBytesReceived(uint8_t port, int32_t *status);
uint32_t serialRead(uint8_t port, char* buffer, int32_t count, int32_t *status);
uint32_t serialWrite(uint8_t port, const char *buffer, int32_t count, int32_t *status);
void serialFlush(uint8_t port, int32_t *status);
void serialClear(uint8_t port, int32_t *status);
void serialClose(uint8_t port, int32_t *status);
}

View File

@@ -1,232 +0,0 @@
#include "HAL/CAN.hpp"
#include <map>
struct CANMessage
{
uint8_t data[8];
};
static std::map<uint32_t, CANMessage> outgoingMessages;
static std::map<uint32_t, CANMessage> incomingMessages;
static const uint32_t kFullMessageIDMask = 0x1fffffff;
/**
* Gets the data from the outgoing hashmap and calls
* CANSessionMux...sendMessage.
*/
void canTxSend(uint32_t arbID, uint8_t length, int32_t period)
{
CANMessage &message = outgoingMessages[arbID];
int32_t status;
FRC_NetworkCommunication_CANSessionMux_sendMessage(
arbID, message.data, length, period, &status);
}
/**
* Updates a field in the outgoing hashmap.
*
* This is called every time an single byte field changes in a message.data,
* such as when a setter on a CAN device is called.
*/
void canTxPackInt8(uint32_t arbID, uint8_t offset, uint8_t value)
{
CANMessage &message = outgoingMessages[arbID];
message.data[offset] = value;
}
/**
* Updates a field in the outgoing hashmap.
*
* This is called every time a short integer field changes in a message.data,
* such as when a setter on a CAN device is called.
*/
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value)
{
CANMessage &message = outgoingMessages[arbID];
*(uint16_t *)(message.data + offset) = value;
}
/**
* Updates a field in the outgoing hashmap.
*
* This is called every time a long integer field changes in a message.data,
* such as when a setter on a CAN device is called.
*/
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value)
{
CANMessage &message = outgoingMessages[arbID];
*(uint32_t *)(message.data + offset) = value;
}
/**
* Updates a field in the outgoing hashmap.
*
* This is called every time an 8.8 fixed point field changes in a message,
* such as when a setter on a CAN device is called.
*/
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value)
{
int16_t raw = value * 255.0;
canTxPackInt16(arbID, offset, raw);
}
/**
* Updates a field in the outgoing hashmap.
*
* This is called every time a 16.16 fixed point field changes in a message,
* such as when a setter on a CAN device is called.
*/
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value)
{
int32_t raw = value * 65535.0;
canTxPackInt32(arbID, offset, raw);
}
/**
* Unpack a field from the outgoing hashmap.
*
* This is called in getters for configuration data.
*/
uint8_t canTxUnpackInt8(uint32_t arbID, uint8_t offset)
{
CANMessage &message = outgoingMessages[arbID];
return message.data[offset];
}
/**
* Unpack a field from the outgoing hashmap.
*
* This is called in getters for configuration data.
*/
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset)
{
CANMessage &message = outgoingMessages[arbID];
return *reinterpret_cast<uint16_t *>(message.data + offset);
}
/**
* Unpack a field from the outgoing hashmap.
*
* This is called in getters for configuration data.
*/
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset)
{
CANMessage &message = outgoingMessages[arbID];
return *reinterpret_cast<uint32_t *>(message.data + offset);
}
/**
* Unpack a field from the outgoing hashmap.
*
* This is called in getters for configuration data.
*/
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset)
{
int16_t raw = canTxUnpackInt16(arbID, offset);
return raw / 255.0;
}
/**
* Unpack a field from the outgoing hashmap.
*
* This is called in getters for configuration data.
*/
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset)
{
int32_t raw = canTxUnpackInt32(arbID, offset);
return raw / 65535.0;
}
/**
* Get data from CANSessionMux (if it's available) and put it in the incoming
* hashmap.
*
* @return true if there's new data. Otherwise, the last received value should
* still be in the hashmap.
*/
bool canRxReceive(uint32_t arbID)
{
CANMessage &message = incomingMessages[arbID];
uint8_t length;
uint32_t timestamp;
int32_t status;
FRC_NetworkCommunication_CANSessionMux_receiveMessage(
&arbID, kFullMessageIDMask, message.data, &length, &timestamp, &status);
return status != ERR_CANSessionMux_MessageNotFound;
}
/**
* Unpack a field from the incoming hashmap.
*
* This is called in getters for status data.
*/
uint8_t canRxUnpackInt8(uint32_t arbID, uint8_t offset)
{
CANMessage &message = incomingMessages[arbID];
return message.data[offset];
}
/**
* Unpack a field from the incoming hashmap.
*
* This is called in getters for status data.
*/
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset)
{
CANMessage &message = incomingMessages[arbID];
return *reinterpret_cast<uint16_t *>(message.data + offset);
}
/**
* Unpack a field from the incoming hashmap.
*
* This is called in getters for status data.
*/
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset)
{
CANMessage &message = incomingMessages[arbID];
return *reinterpret_cast<uint32_t *>(message.data + offset);
}
/**
* Unpack a field from the incoming hashmap.
*
* This is called in getters for status data.
*/
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset)
{
int16_t raw = canRxUnpackInt16(arbID, offset);
return raw / 255.0;
}
/**
* Unpack a field from the incoming hashmap.
*
* This is called in getters for status data.
*/
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset)
{
int32_t raw = canRxUnpackInt32(arbID, offset);
return raw / 65535.0;
}

View File

@@ -242,7 +242,7 @@ void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t
/**
* Allocate a DO PWM Generator.
* Allocate PWM generators so that they are not accidently reused.
* Allocate PWM generators so that they are not accidentally reused.
*
* @return PWM Generator refnum
*/
@@ -299,12 +299,12 @@ void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
if(id < 4)
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
else
digitalSystem->writePWMDutyCycleB(id - 3, (uint8_t)rawDutyCycle, status);
digitalSystem->writePWMDutyCycleB(id - 4, (uint8_t)rawDutyCycle, status);
}
}
/**
* Configure which DO channel the PWM siganl is output on
* Configure which DO channel the PWM signal is output on
*
* @param pwmGenerator The generator index reserved by AllocateDO_PWM()
* @param channel The Digital Output channel to output on

View File

@@ -4,6 +4,6 @@
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
#define __RoboRIO_FRC_ChipObject_Aliases_h__
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_9
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_A
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__

View File

@@ -0,0 +1,15 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_C0EF_1_1_0_nInterfaceGlobals_h__
#define __nFRC_C0EF_1_1_0_nInterfaceGlobals_h__
namespace nFPGA
{
namespace nFRC_C0EF_1_1_0
{
extern unsigned int g_currentTargetClass;
}
}
#endif // __nFRC_C0EF_1_1_0_nInterfaceGlobals_h__

View File

@@ -1,15 +1,15 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_9_nInterfaceGlobals_h__
#ifndef __nFRC_2015_1_0_A_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_A_nInterfaceGlobals_h__
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
extern unsigned int g_currentTargetClass;
}
}
#endif // __nFRC_2015_1_0_9_nInterfaceGlobals_h__
#endif // __nFRC_2015_1_0_A_nInterfaceGlobals_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_AI_h__
#define __nFRC_2015_1_0_9_AI_h__
#ifndef __nFRC_2015_1_0_A_AI_h__
#define __nFRC_2015_1_0_A_AI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAI
@@ -140,4 +140,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_AI_h__
#endif // __nFRC_2015_1_0_A_AI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_AO_h__
#define __nFRC_2015_1_0_9_AO_h__
#ifndef __nFRC_2015_1_0_A_AO_h__
#define __nFRC_2015_1_0_A_AO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAO
@@ -47,4 +47,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_AO_h__
#endif // __nFRC_2015_1_0_A_AO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Accel_h__
#define __nFRC_2015_1_0_9_Accel_h__
#ifndef __nFRC_2015_1_0_A_Accel_h__
#define __nFRC_2015_1_0_A_Accel_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAccel
@@ -99,4 +99,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Accel_h__
#endif // __nFRC_2015_1_0_A_Accel_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Accumulator_h__
#define __nFRC_2015_1_0_9_Accumulator_h__
#ifndef __nFRC_2015_1_0_A_Accumulator_h__
#define __nFRC_2015_1_0_A_Accumulator_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAccumulator
@@ -84,4 +84,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Accumulator_h__
#endif // __nFRC_2015_1_0_A_Accumulator_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Alarm_h__
#define __nFRC_2015_1_0_9_Alarm_h__
#ifndef __nFRC_2015_1_0_A_Alarm_h__
#define __nFRC_2015_1_0_A_Alarm_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAlarm
@@ -54,4 +54,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Alarm_h__
#endif // __nFRC_2015_1_0_A_Alarm_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_AnalogTrigger_h__
#define __nFRC_2015_1_0_9_AnalogTrigger_h__
#ifndef __nFRC_2015_1_0_A_AnalogTrigger_h__
#define __nFRC_2015_1_0_A_AnalogTrigger_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tAnalogTrigger
@@ -126,4 +126,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_AnalogTrigger_h__
#endif // __nFRC_2015_1_0_A_AnalogTrigger_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_BIST_h__
#define __nFRC_2015_1_0_9_BIST_h__
#ifndef __nFRC_2015_1_0_A_BIST_h__
#define __nFRC_2015_1_0_A_BIST_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tBIST
@@ -87,4 +87,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_BIST_h__
#endif // __nFRC_2015_1_0_A_BIST_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Counter_h__
#define __nFRC_2015_1_0_9_Counter_h__
#ifndef __nFRC_2015_1_0_A_Counter_h__
#define __nFRC_2015_1_0_A_Counter_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tCounter
@@ -216,4 +216,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Counter_h__
#endif // __nFRC_2015_1_0_A_Counter_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_DIO_h__
#define __nFRC_2015_1_0_9_DIO_h__
#ifndef __nFRC_2015_1_0_A_DIO_h__
#define __nFRC_2015_1_0_A_DIO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tDIO
@@ -245,4 +245,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_DIO_h__
#endif // __nFRC_2015_1_0_A_DIO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_DMA_h__
#define __nFRC_2015_1_0_9_DMA_h__
#ifndef __nFRC_2015_1_0_A_DMA_h__
#define __nFRC_2015_1_0_A_DMA_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tDMA
@@ -185,4 +185,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_DMA_h__
#endif // __nFRC_2015_1_0_A_DMA_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Encoder_h__
#define __nFRC_2015_1_0_9_Encoder_h__
#ifndef __nFRC_2015_1_0_A_Encoder_h__
#define __nFRC_2015_1_0_A_Encoder_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tEncoder
@@ -24,7 +24,7 @@ public:
typedef enum
{
kNumSystems = 4,
kNumSystems = 8,
} tIfaceConstants;
typedef
@@ -196,4 +196,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Encoder_h__
#endif // __nFRC_2015_1_0_A_Encoder_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Global_h__
#define __nFRC_2015_1_0_9_Global_h__
#ifndef __nFRC_2015_1_0_A_Global_h__
#define __nFRC_2015_1_0_A_Global_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tGlobal
@@ -101,4 +101,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Global_h__
#endif // __nFRC_2015_1_0_A_Global_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_9_Interrupt_h__
#define __nFRC_2015_1_0_9_Interrupt_h__
#ifndef __nFRC_2015_1_0_A_Interrupt_h__
#define __nFRC_2015_1_0_A_Interrupt_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_9
namespace nFRC_2015_1_0_A
{
class tInterrupt
@@ -97,4 +97,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_9_Interrupt_h__
#endif // __nFRC_2015_1_0_A_Interrupt_h__

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