Compare commits

...

308 Commits

Author SHA1 Message Date
Brad Miller
cad83ed3ca Bump the version number for the windows toolchains to force them to reload.
Change-Id: Ib095d5c1caf51739cc1b5bee1680592e0cfc34de
2014-09-18 17:18:03 -04:00
Kevin O'Connor
62d6579428 Add missing semi-colon to cproject file
Change-Id: I540730c3a4be32c6a636296ce36aab5b230afc8a
2014-09-16 00:50:43 -04:00
Brad Miller (WPI)
1d7b17a2ba Merge "Add quotes around linker flag path to libs (fixes artf2390 / artf3453)" 2014-09-15 09:17:01 -07:00
Brad Miller
738859c4ea Fixed bug where mac toolchains always reinstall on Eclipse start
Change-Id: Id94631162efe5766feedac2979264fe17e09b5eb
2014-09-14 15:31:56 -04:00
Patrick Plenefisch
127ff0ac0a Fixing extraction recursion: use provided version
Change-Id: I0aa0a66eae85a43df308b4c0dafbe6b953ffad5c
2014-09-14 15:31:50 -04:00
Patrick Plenefisch
472f51fc73 Add version=current to global wpilib.properties file on any property save
Change-Id: I6dc6eeac27ab97be567450c90f50ace7da6679b7
2014-09-13 18:36:02 -04:00
Brad Miller (WPI)
0f0850ca95 Merge "Update to v14 headers and libraries" 2014-09-11 08:12:45 -07:00
Thomas Clark
ab27f795b7 Update to v14 headers and libraries
Change-Id: Ibc28fc73c36acf6d9d15b3f255cbf93ad6ad70a8
2014-09-10 14:43:53 -04:00
Thomas Clark
b16a037759 Store preferences in a directory writable by lvuser
Change-Id: I1ed43968c2be76bfcb050a115f59517c398efff3
2014-09-10 14:05:51 -04:00
Brad Miller
1e812ac4d9 Added comments to the compressor class per artf3527.
Change-Id: I48d0d16242da064e8502e6fbddccca82dc680044

Updated comments with a few more details

Change-Id: Icab1698f2ea4e2032e50cbf5ac63341ba5ee1dcf
2014-09-10 12:02:13 -04:00
Brad Miller (WPI)
ecc6815f68 Merge "Fix status buffer allocation in SolenoidBase" 2014-09-10 08:57:53 -07:00
Brad Miller (WPI)
ca9f5a676d Merge "Make all channel errors throw IndexOutOfBounds" 2014-09-10 08:57:35 -07:00
Thomas Clark
debf9e0ee9 Make all channel errors throw IndexOutOfBounds
Only relay and PWM channels out of range used to throw
IndexOutOfBoundsExceptions, but Resource would catch the error
first in most cases.

Change-Id: I8feb0daf378e181f982203d46bf5a10dbde4a02e
2014-09-10 11:54:57 -04:00
Thomas Clark
15abbb36c2 Fix status buffer allocation in SolenoidBase
This fixes [artf3488] and [artf3506]

Change-Id: I6e89fc7bfc8d6c38a4bbf364a0fad412ab54e225
2014-09-10 11:36:50 -04:00
Kevin O'Connor
d9b974300f Add quotes around linker flag path to libs (fixes artf2390 / artf3453)
Change-Id: I0d4aac49edb0e93f0bfd2cc8937eca476deafc4c
2014-09-08 14:45:08 -04:00
Brad Miller
e60baf41a9 Added the "version=current" property to allow projects to correctly reference the updated installation
Change-Id: Ia6f45fab6b1d279e89129d9a0350b8aa7cf8c98a
2014-09-06 23:50:06 +00:00
Brad Miller (WPI)
09cb3a22cd Merge "Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524" 2014-09-06 15:47:07 -07:00
Brad Miller
27ecd35834 Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524 2014-09-06 18:41:05 -04:00
Patrick Plenefisch
ff6d180305 Revert "Fixing java version number to be current"
This reverts commit 410b739c23.
2014-09-06 18:19:25 -04:00
Patrick Plenefisch
410b739c23 Fixing java version number to be current
Change-Id: I4d124921f5735cc2a7ff24eba10246eb9e57a67b
2014-09-06 17:23:06 -04:00
Thomas Clark
2144b853d1 Set the cpp-version variable per-project
Set cpp-version in the build.properties of each C++ project, instead of
globally in wpilib.properties.  It's 'current' by default.

Change-Id: I4618131be14390f51763b39aa751aa110f7af56f
2014-09-03 16:37:33 -04:00
Thomas Clark (WPI)
f87c517e6d Merge "Remove Version number from zips" 2014-08-31 14:56:00 -07:00
Patrick Plenefisch
77dac9bd77 Remove Version number from zips
Change-Id: Ifc9ba2e47a61f2d545b7c4b40c327b661b4f48ba
2014-08-31 17:55:19 -04:00
Thomas Clark (WPI)
56cf287b39 Merge "require pthread and rt lib for Itests" 2014-08-31 13:29:36 -07:00
Patrick Plenefisch
dc970d9a6b require pthread and rt lib for Itests
Fixing simulation flags

Change-Id: I33dcd07096bf7a4813248bb9dd809144661a78fd
2014-08-31 15:42:57 -04:00
Joe Ross
da2ea9ea87 remove/fix references to cRIO documentation.
Edited comments related to sidecar, breakout, 9472. Some references were
to unused methods in simulation that were removed.

Change-Id: I99b6fe9e8cb982831ffbf29177f84e2f9f71ef47
2014-08-30 08:56:06 -07:00
Jonathan Leitschuh
b1ace79379 Fixes the MotorEncoderTest sometimes failing because a counter registers movement from the jaguar after reset.
Change-Id: I65b24e59a902637b19b24c08f0a02b86621c5590
2014-08-29 16:46:08 -04:00
Jonathan Leitschuh
2a8ade093a Adds the ability to run test classes with --repeat rule.
Fixes a bug in several tests where --repeat wouldn't work due to multiple teardown calls.

Change-Id: I26f9350e9c7da6e9b0aefd1ecefb7e8d8975a641
2014-08-29 16:34:03 -04:00
Brad Miller (WPI)
b7458e7ba6 Merge "Make Talon the default speed controller for RobotDrive" 2014-08-29 10:53:30 -07:00
Thomas Clark
3fddee51c2 Make Talon the default speed controller for RobotDrive
Change-Id: I87047e11efb26f5081a3e23dc8f36fa9bb76a88c
2014-08-29 13:00:48 -04:00
Brad Miller (WPI)
21967fcb24 Merge "Fixes testing framework typos & adds rule to keep unix line endings for .sh" 2014-08-29 09:56:51 -07:00
Thomas Clark
9b896eab70 Make DoubleSolenoid work in Java [artf3457]
Make DoubleSolenoid and Solenoid use SolenoidBase, like in C++.

Add an integration tests for double solenoids.

Change-Id: I9a7ff562d65a564c5adabfa73f85f23ad466215b
2014-08-29 12:50:44 -04:00
Thomas Clark (WPI)
f439adc2a3 Merge "fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat" 2014-08-29 09:38:51 -07:00
Jonathan Leitschuh
67cb854676 Fixes testing framework typos & adds rule to keep unix line endings for .sh
Change-Id: I33826b879ba2dce7da88aa399d37f711a6612d86
2014-08-29 11:40:03 -04:00
Brad Miller (WPI)
ef7c554029 Merge "Wrap CPP Lib and Include paths in quotes (fixes artf2390)" 2014-08-27 13:07:52 -07:00
Brad Miller (WPI)
359b4ec86b Merge "Added support for 32-bit builds." 2014-08-27 13:06:30 -07:00
Brad Miller (WPI)
21153fc63f Merge "Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called" 2014-08-27 13:05:04 -07:00
Alex Henning
daa8bd67ef Added support for 32-bit builds.
Change-Id: I609844b3c72ca9d016a43a7b0e288abb4dc2400e
Note: Jenkins probably needs to be restarted to get proper sbuild permissions.
2014-08-27 15:46:41 -04:00
Kevin O'Connor
e5e568fa73 Wrap CPP Lib and Include paths in quotes (fixes artf2390)
Change-Id: Ied08c559140ecb28a41f61d968a37cd772255b8c
2014-08-27 15:27:18 -04:00
Kevin O'Connor
c9f6fcd969 Fix artf3447 Java only runs teleop - Correct off by one error in Control Word compares
Change-Id: I5965008ac75a9c3cc3a3473fa775729421b8957c
2014-08-27 15:22:20 -04:00
Kevin O'Connor
778620b0a9 Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called
Change-Id: I863ba263b822a60f46a04f4de2e3c570df5f317d
2014-08-27 15:14:22 -04:00
Kevin O'Connor
d58c6f0c0f Merge "Kill program before debugging C++ so file upload doesn't fail" 2014-08-27 11:44:45 -07:00
Jonathan Leitschuh
a14d854211 Cpp tests without color for jenkins. Fixes startDS to not kill the driver station.
Change-Id: I538aae4e2d6d94f0f510203d2d4cb9f40ffa4303
2014-08-26 14:26:11 -04:00
Fred Silberberg (WPI)
c5fc1dc5be Merge "Change SampleRobot template to use 0 based PWM" 2014-08-26 10:35:43 -07:00
Jonathan Leitschuh
cded5351df Test scripts have permission to run and fixes sshpass.
Updates vagrant file to have sshpass by default.
Adds configuration for setting up the network in bridged mode so that the scripts can use mdns to connect to the roboRIO.

Change-Id: I7274a24c772790c9495e8a1c083385ef528044a6
2014-08-26 12:56:10 -04:00
Jonathan Leitschuh
47169e0ce1 Adds test scripts to deploy, run and retrieve results from integration tests.
Adds a simple script for jenkins to run to retrieve the test results from.
Adds a script that allows developers to download and run tests from a specific language easily.
Adds a script that allows the tests to be run from within an ssh session on the roborio.

Change-Id: Ibe6ddc4e1dcbb8192e6552c3901e96f6907a8020
2014-08-26 11:20:02 -04:00
Brad Miller (WPI)
4ef798a0c0 Merge "Updates gitignore to use a file generated using http://www.gitignore.io" 2014-08-26 08:08:11 -07:00
Jonathan Leitschuh
7ec8d4e9a3 Updates gitignore to use a file generated using http://www.gitignore.io
Removes more OSX/Windows/Linux files.
Adds gitignores for cmake, Gradle, and Maven

Change-Id: I96ada2ef360770975f4afc068985cd6a21880a5f
2014-08-26 11:05:43 -04:00
Omar Zrien
17e7fc8f20 fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat
Change-Id: I0bdcf073637a47a9e6864f6d561cc812a1d5b021
2014-08-24 19:57:40 -04:00
Joe Ross
023f955a56 Change SampleRobot template to use 0 based PWM
Change-Id: Ia299db32ba724e5a5ddc2e9a3c0dbb5d8acbb08f
2014-08-23 15:06:31 -07:00
Alex Henning (WPI)
52e358c180 Merge "Add Preferences to simulation" 2014-08-23 11:12:34 -07:00
Kevin O'Connor
7638e2b6e5 Kill program before debugging C++ so file upload doesn't fail
Change-Id: Ibd4fdb6cbf491f20d66f36c4fb84753a1abbfd1e
2014-08-21 17:19:23 -04:00
Jonathan Leitschuh
f9ab84d912 Integration tests now run with the Ant Junit test framework.
Removes TestNG as it wasn't reporting all of the tests correctly. Adds Ant as a dependency and uses it to run the JUnit tests so that tests are output in a way that Jenkins understands.

Change-Id: Ie98358476cebe94f233e687195a0fced8723a878
2014-08-21 15:29:17 -04:00
Joe Ross
04fadb85f5 Add Preferences to simulation
Change-Id: Id2891dac25ab6a929b5b90164cc5ecef49f40906
2014-08-20 21:07:12 -07:00
Brad Miller (WPI)
698b371b16 Merge "Add OI and RobotMap files to Command Project template (fixes artf2407)" 2014-08-20 13:41:50 -07:00
Brad Miller (WPI)
6dde2c2b4c Merge "Adds interrupts to Java" 2014-08-20 13:39:47 -07:00
Jonathan Leitschuh
8ba0eada17 Adds interrupts to Java
Implements the JNI bindings for java
Adds integration tests for Digital Inputs and AnalogTriggers.
Adds the ability to get the value and message from errno in java using the HALUtil JNI class.

Change-Id: I853529fdab9744ce95ee15d4cc73dc3953265552
2014-08-20 16:10:40 -04:00
Kevin O'Connor
bf5eaf657e Add OI and RobotMap files to Command Project template (fixes artf2407)
Change-Id: Ia3fb2a03b6435ae74bd70ad856a41a2c15f22f5a
2014-08-20 14:35:04 -04:00
Kevin O'Connor
3baaea5a44 Squashed commit of the following:
commit b4589d75b682d5bb99a98e9af975dd5c03a574dc
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Aug 19 17:15:12 2014 -0400

    Make CPP debugging from menu item work.

    Change-Id: I5bda07e088560adabbb9bc5fbfce9bd9456f7e1f

commit aaa832376700156abb1002ce7ad9334c4983be43
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Aug 19 17:13:22 2014 -0400

    Change CPP debug to use mDNS (artf3410)

    Change-Id: I01b97e1754c2abd4d18b41ab2f890b1b5470d616

Change-Id: I405bd1808d301f650f9293c60db161205ee6e704
2014-08-19 17:20:15 -04:00
Jonathan Leitschuh
2cc937f5e1 Fixes debugging in Java
When deploying a Java program in debug mode any previous running programs should be properly removed. [artf3408]
This should link with (https://usfirst.collab.net/sf/go/artf3408?nav=1&_pagenum=2&returnUrlKey=1408475631056)

[artf3415] is still an issue until NI resolves it.
This should link with (https://usfirst.collab.net/sf/go/artf3415?nav=1&_pagenum=1&returnUrlKey=1408475758258)

Change-Id: Ica9639b5a406b70be4d51aa4e45ffef56baddc93
2014-08-19 15:16:55 -04:00
Brad Miller (WPI)
23b6a980c2 Merge "Uses ${ant.java.version} for javac when compiling" 2014-08-18 14:32:10 -07:00
Thomas Clark
89b80db2d0 Merge "Fix PIDError property" 2014-08-18 13:32:52 -07:00
Thomas Clark
1f27d36884 Fix PIDError property
Change-Id: I3ea040ae4e0520a231bab95390746eba4315fd8d
2014-08-18 16:29:41 -04:00
Thomas Clark
125dfac8b4 Merge "Fix Java IT build" 2014-08-18 13:00:12 -07:00
Thomas Clark
4215d1c79b Fix Java IT build
The Java ITs should have jcommander as a dependency

Change-Id: Ide03fb245d21b21643bf7a9de6248db12dc54460
2014-08-18 15:52:13 -04:00
Kevin O'Connor
dddba82d18 Fix artf3337 - add include to define int32_t in CounterBase.h
Change-Id: Ia6ce4e57a36d628fb9f61e1ac8c3d3101e22f165
2014-08-18 14:19:13 -04:00
Jonathan Leitschuh
78e2a8d1b9 Uses ${ant.java.version} for javac when compiling
This uses the ant jvm version variable to compile teams robot projects.

Change-Id: I4f5b704e5230c1bd09323abea6c4044c709c3eff
2014-08-18 11:42:28 -04:00
Thomas Clark
687bc44ae5 Add new CTRE classes and update PDP tests
Change-Id: I489091c5b8b0f1f9890e5104bf01e40ae53cf6ce
2014-08-18 10:32:26 -04:00
Jonathan Leitschuh (WPI)
c82a94b268 Merge "Make Java tests run with TestNG" 2014-08-18 07:17:11 -07:00
Alex Henning (WPI)
d407fe546f Merge "Fixes for simulation parallel builds." 2014-08-17 17:23:44 -07:00
Alex Henning
699949fdf4 Fixes for simulation parallel builds.
Change-Id: I2b2385b6677a892fd1fd8a0c4b6f995418c33900
2014-08-17 19:48:08 -04:00
Thomas Clark
6d89974016 Make Java tests run with TestNG
TestNG generates xml reports that Jenkins can use, JUnit does not without
Ant or Maven.

To run the tests, deploy the Jar and run:
    /usr/local/frc/JRE/bin/java -jar wpilibJavaIntegrationTests-0.1.0-SNAPSHOT.jar -junit -testclass edu.wpi.first.wpilibj.test.TestSuite

Change-Id: I9e8a7dcab775f9c5ad1905afa798cd9191e25438
2014-08-15 16:40:56 -04:00
Brad Miller (WPI)
e523157507 Merge "Fixed bug with joystick buttons/axes out of range." 2014-08-15 10:03:02 -07:00
Brad Miller (WPI)
3eba1c4688 Merge "Add delays to make C++ ITs more reliable" 2014-08-15 10:00:30 -07:00
Thomas Clark
d466d17edd Add delays to make C++ ITs more reliable
Also disable PCM tests until it's actually wired right

Change-Id: I431031f66aaaa87fa201e577fedef5a1952c1bb4
2014-08-15 11:22:01 -04:00
Jonathan Leitschuh
9dfd6bde9d Adds a Vagrant configuration file and setup script
Vagrant allows developers to install Vagrant and their choice of virtual box in which to develop.
This provides a consistent environment where anyone can devlop WPIlib without having to go through a lengthy setup process.

Change-Id: Iced863d307f0e6a761441f17c3de377594197c38
2014-08-15 10:56:31 -04:00
Alex Henning
eded28ebfa Fixed bug with joystick buttons/axes out of range.
Change-Id: I85f0a9f47dfbb786f850c1f382c0e18a4e4b8254
2014-08-15 10:29:39 -04:00
Thomas Clark (WPI)
777dc2113d Merge "Updated installer to point to the new location." 2014-08-14 08:01:56 -07:00
Thomas Clark (WPI)
174f2c0e23 Merge "Increased build speed + caching of debs." 2014-08-14 08:01:23 -07:00
Thomas Clark (WPI)
434caf81d7 Merge "Add back SampleRobot Template Add GettingStarted example based on IterativeRobot" 2014-08-14 08:00:53 -07:00
Thomas Clark (WPI)
9327170069 Merge "Beginning of gradle conversion." 2014-08-14 08:00:03 -07:00
Kevin O'Connor
597e209c09 Add back SampleRobot Template
Add GettingStarted example based on IterativeRobot

Change-Id: Ic8caec4f62b7bdbaae7fafedfec5859b2f936809
2014-08-14 07:51:20 -04:00
Alex Henning
ad1ace1022 Increased build speed + caching of debs.
Make sure to add -j to improve build time by 10 minutes or more.

Change-Id: If2838a4042592fbfd1a0f40882efd7dd70270266
2014-08-13 18:22:40 -04:00
Alex Henning
70d09de2e9 Fixed frcsim script to have the proper LOAD_LIBRARY_PATH.
Change-Id: I83bdf3edcf5e69e1b5b358f92af26b8749039c7d
2014-08-13 15:22:36 -04:00
Thomas Clark
f7e1753e03 Fix C++ linker settings
Change-Id: I980e00968b0b465e6bba26a6586e23cc4e20f320
2014-08-13 11:56:36 -04:00
Alex Henning
df3f3cc0e1 Updated installer to point to the new location.
Change-Id: Id5f11a2952511bb781a4b4b38bcdcac1ec3ae2b0
2014-08-13 11:16:22 -04:00
Alex Henning
25308e2442 Beginning of gradle conversion.
Change-Id: Ic9690af60cd53b5237cd8c05d41598a94f6025f1
2014-08-12 17:25:10 -04:00
Alex Henning
6b3e2690d0 Fixed placement of libWPILibAthena.a
Change-Id: Ie50de30bcf911149d18d96e2b510b34424177e15
2014-08-12 17:15:44 -04:00
Alex Henning
ae10d43900 Fixes for examples and Gazebo 3.1.
Change-Id: Ie41a29b4b8f5cee87357f44adb45f54e03487622
2014-08-12 15:47:10 -04:00
Thomas Clark (WPI)
d4e377fc0e Merge "Adds the Trigger template and adds WPILib.h import to all templates" 2014-08-12 12:33:46 -07:00
Jonathan Leitschuh
9126646fef Adds the Trigger template and adds WPILib.h import to all templates
Change-Id: Ibaecc4802822cf4c0a4a5bf9ddc960b96e40d1e9
2014-08-12 15:32:29 -04:00
Thomas Clark (WPI)
d3f632486f Merge "Added support for Jenkins to generate doxygen." 2014-08-12 12:22:53 -07:00
Alex Henning
268459206f Added support for Jenkins to generate doxygen.
Change-Id: I2febfe42cc9301446f796376cfe8e1ef6744f19a
2014-08-12 15:22:16 -04:00
Thomas Clark (WPI)
df390c275d Merge "Merged sources in wpilibJavaFinal." 2014-08-12 12:09:31 -07:00
Jonathan Leitschuh (WPI)
1742634a96 Merge "Fix the example programs" 2014-08-12 12:06:42 -07:00
Alex Henning
0f8f83500b Merged sources in wpilibJavaFinal.
Change-Id: Iab8d079716eae3e5631cf7a62d6e88340e55e03c
2014-08-12 14:59:16 -04:00
Thomas Clark
d5c73c95dc Fix the example programs
Remove the test examples that don't do anything helpful

Fix the PacGoat and GearsBot examples to compile

Change-Id: Ic11ca7a97a5b52524fe60dc24fcec6ecfae7ebb7
2014-08-12 14:52:22 -04:00
Alex Henning
ca7dc5d6ac Removed excessive linking.
Change-Id: Iffc8517da2a4d6b67612b6076023211c07768714
2014-08-12 12:07:09 -04:00
Alex Henning
66e1f2a184 Fixed a few bugs with C++ due to the merge.
Change-Id: I6c5120ff502b40ecba0884f5a3631fa91822cfd4
2014-08-12 10:12:55 -04:00
Alex Henning
1301d76d61 Fixes for HLUsageReporting due to Jonathan's exceptions.
Change-Id: I28d6719d0b8f5a71186f6a764c9541277aea6237
2014-08-11 14:59:21 -04:00
Thomas Clark
a72ea14f92 Removed Simple Robot template option
Remove the option in Eclipse to make a "Simple Robot" project, since
there is no more simple robot template and the resulting project isn't
even generated correctly.

Change-Id: I06a9db8c7f5fb82b7be3eadb1f91813321a36119
2014-08-11 12:01:38 -04:00
Thomas Clark
14b2f14669 Merge "Implement DriverStation::GetBatteryVoltage" 2014-08-11 08:56:52 -07:00
Thomas Clark
d2cd5f3571 Implement DriverStation::GetBatteryVoltage
Make the GetBatteryVoltage method work using the new tPower header

Change-Id: If504f8a46f3f7f737f0b729b72fc6b5da0d29ff9
2014-08-11 11:56:10 -04:00
Jonathan Leitschuh (WPI)
7ecde3a33a Merge "Fix the default C++ linker settings" 2014-08-11 08:55:50 -07:00
Alex Henning (WPI)
81143fc534 Merge "Adds Exception throwing the basic robot systems are not properly initialized." 2014-08-11 08:53:37 -07:00
Thomas Clark
c58a86a3ab Fix the default C++ linker settings
Change-Id: I839b67fa6e9798f980db05f5a4ff9c8f47c32424
2014-08-11 11:27:48 -04:00
Alex Henning (WPI)
2f655bb49d Merge "Fixed bug with plugins not including all simulation dependencies." 2014-08-11 08:22:15 -07:00
Alex Henning
657054c9e2 Fixed bug with plugins not including all simulation dependencies.
Change-Id: I34c84c6cd4d918039726aa2efb81efbcf98dd593
2014-08-11 11:20:07 -04:00
Kacper Puczydlowski
f4d542b212 Add FakeEncoderTest for C++
Change-Id: Ic030a1d055a03f5b245e19e6466af05e72dd7deb
2014-08-11 11:15:42 -04:00
Alex Henning
8db11a4c6c Fix to deal with the certificates on collabnet having expired.
Change-Id: I0c7580f06107d59dfc32b343304529b17763c7fa
2014-08-11 08:13:08 -04:00
Joe Ross
14d784bca1 Fix import, resolves artf3339
Change-Id: I0abed3495ffc35161793f3a6140fb21872004866
2014-08-10 17:01:31 -07:00
Alex Henning
7c8124d76c Allowed sharing of common C++ code between RoboRIO and Simulation.
Change-Id: I8bf2bda9df389c13ae0567a62dbf0ca931ceb6f8
2014-08-08 18:36:03 -04:00
Thomas Clark (WPI)
b371600f0f Merge "Completed artf2675 - rename SimpleRobot -> SampleRobot." 2014-08-08 12:39:14 -07:00
Thomas Clark (WPI)
6c3b002a87 Merge "Refactors the CANJaguar tests to be more straightforward." 2014-08-08 12:14:24 -07:00
Colby Skeggs
0f93247641 Completed artf2675 - rename SimpleRobot -> SampleRobot.
Change-Id: I23fc503f64fa6a715867f4b92f9d03e21f6c5f82
2014-08-08 10:50:16 -07:00
Jonathan Leitschuh
54439e7198 Refactors the CANJaguar tests to be more straightforward.
Adds a brownout test from C++ (Ignored)

Change-Id: I81e04e20fb08cd9da7401d9c0e9fa6faf1fff0de
2014-08-08 12:10:56 -04:00
Thomas Clark
5b8279f404 Remove old driver station code
We don't need to send status data from the user program anymore

Change-Id: Ifbdb037cfb4e36681914dd7a3a2f5c56cbead6a2
2014-08-08 11:23:03 -04:00
Thomas Clark
8abbcf53f4 Update to the v13 headers and libraries
Add all of the most recent headers and .SOs

Also make DriverStation work with the new FRC comm protocol, using the new
functions for getting status data

Change-Id: I1c7fc5f90e72c5fbebf87d9923ce0967ed0ef3bc

Initial HAL support for v13 ds

Change-Id: I9a7f37ef8e24241598fa3981cb3df30c07c52e0f

New ds stuff in the HAL

Change-Id: I025910625453baf63f79f49bbc70ba8b2f093f50

New ds stuff in C++

Joysticks are still todo

Driver station IO is pulled out

Change-Id: I1bb59037c097713bd943e7bef00e12f67f13c3ac

New ds works in C++ and Java.  Joysticks still todo

Change-Id: Ic93f8686856761badc592eceaf05964f52355578

Make joysticks work again with the v13 image protocol

Change-Id: Ief7ee95d3398c2262ca07ab7d60499af3c8f60f7
2014-08-07 16:37:02 -04:00
Thomas Clark (WPI)
b8eeeabbb5 Merge "Removes encoder.start() from the example programs" 2014-08-07 13:18:42 -07:00
Jonathan Leitschuh
9a2bd8c49b Removes encoder.start() from the example programs
Change-Id: I26a9901a978481bb37fdb6eac6a2457c2ca990b8
2014-08-07 16:17:35 -04:00
Thomas Clark
4db634b342 Fix PCM channel indexes
The channels are fixed to correspond with the little-endian beta firmware

Change-Id: I1de0588c74a0e070c647fc2e5e629e47df3b663d
2014-08-07 13:20:39 -04:00
Thomas Clark (WPI)
57e670c18d Merge "Move PWM allocation to HAL to allow for checking against DIO allocation Re-number MXP DIO to match pinout (include SPI and I2C pins) (fixes artf2664) Change PWM MXP mapping to accommodate DIO re-mapping This re-implementation also fixes artf2668 for C++ and Java Change the test bench to reflect this change also" 2014-08-07 07:45:28 -07:00
Kevin O'Connor
59473ab7a7 Move PWM allocation to HAL to allow for checking against DIO allocation
Re-number MXP DIO to match pinout (include SPI and I2C pins) (fixes artf2664)
Change PWM MXP mapping to accommodate DIO re-mapping
This re-implementation also fixes artf2668 for C++ and Java
Change the test bench to reflect this change also

Change-Id: If30bd6a85a9f1f619fbde06a4ecd595a15fd28f7
2014-08-07 10:43:50 -04:00
Jonathan Leitschuh (WPI)
d1d4c75210 Merge "Fixed interrupt freeing in C++" 2014-08-06 06:57:11 -07:00
Thomas Clark
2356008d8c Fixed interrupt freeing in C++
When interrupts are cancelled on any interruptable class, the resource is now
freed.  Previously, the resource was only freed if the object is destructed
before CancelInterrupts() is called, so it was impossible to create and
destruct more than 8 interrupts.

The interrupts resource object is now in InterruptableSensorBase instead of
SensorBase.

A synchronous interrupt integration test was added.

Change-Id: I0806176340cecd4c1480dd8f043474cc05919f24
2014-08-06 09:46:50 -04:00
Thomas Clark
deb335d96d Fixed DoubleSolenoid, added a double solenoid test
Change-Id: I161337c8b528be7662650889d6ab7bcd2bbe2704

Fixed double solenoid, added a C++ test

Change-Id: Ib0821155efce85be87d354fc8e197fcc4deabd7c
2014-08-05 15:29:02 -04:00
Thomas Clark
1ce03b9c46 DoubleSolenoid works in C++ now
Change-Id: I75130f816efe8ef9c82e936bba834609c470f379
2014-08-05 14:42:37 -04:00
Thomas Clark
a09f75934a The output range can be set on a PIDSubSystem
Also, mimimum -> minimum in PIDController.h

Change-Id: I0cdfdca6ca2bdf2c2a40ee524cc925281069fcf4
2014-08-05 14:03:02 -04:00
Jonathan Leitschuh
aab98c0638 Adds Exception throwing the basic robot systems are not properly initialized.
Adds a BaseSystemNotInitalizedException to be thrown in the event that HLUsageRepoting, RobotState or Timer does not have its static implementation set.

Change-Id: I66fde262baa1a9d32d1df9fafa08ba3173bcbb72
2014-08-05 13:44:21 -04:00
Jonathan Leitschuh (WPI)
741e28b855 Merge "Added version numbers to maven plugins" 2014-08-05 10:29:31 -07:00
Thomas Clark
f817f6d041 Added version numbers to maven plugins
The version numbers for several maven plugins were unspecified before, which
caused a bunch of warnings before.

Change-Id: I7e2e05ccf3e2f10b24010576eb78192e9d891120
2014-08-05 13:29:01 -04:00
Thomas Clark (WPI)
7442a7ed7d Merge "Only update FRC Java Projects (fixes artf2627)" 2014-08-05 10:19:01 -07:00
Jonathan Leitschuh (WPI)
765198f5f5 Merge "Updated some comments that mention the cRIO" 2014-08-05 10:18:25 -07:00
Thomas Clark
ed08ab2989 Fixed voltage range checking and error message
Change-Id: I7ba05eb27f3d82bfd37f6b407fe39e0ab9cf5bf0
2014-08-05 13:16:10 -04:00
Jonathan Leitschuh (WPI)
4b22742cdc Merge "Cleaned up C++ compiler warnings" 2014-08-05 09:13:40 -07:00
Alex Henning (WPI)
45f93e9aba Merge "Added support for building debs on jenkins." 2014-08-05 09:04:04 -07:00
Alex Henning
049377c9ea Added support for building debs on jenkins.
Change-Id: Iec732b3a0d036e53e02e377b830f8af6b8eaf731
2014-08-05 11:54:15 -04:00
Thomas Clark
f4ace4a36d Cleaned up C++ compiler warnings
All C++ projects now build without warnings with -Wall and -Wextra

Change-Id: Idb6cf8b78274a30453e98c1e8edabcfb2a7fffb6
2014-08-05 11:51:00 -04:00
Thomas Clark
9ff420547a Updated some comments that mention the cRIO
Change-Id: Ib5e3c34fa2db83f48ca88153e8f4c834b31291f5
2014-08-05 11:17:38 -04:00
Jonathan Leitschuh (WPI)
1be31431bc Merge "Removed the User LED functions" 2014-08-05 07:37:03 -07:00
Thomas Clark
32cafd0efc Removed the User LED functions
There is no "User" LED on the RoboRIO, these functions didn't
do anything.

Change-Id: I8d2eaf0efde90cc444503a79f26d591ddaaa6322
2014-08-05 10:35:00 -04:00
Jonathan Leitschuh (WPI)
0216d1b336 Merge "Gyro deadband defaults to 0" 2014-08-05 07:31:29 -07:00
Thomas Clark
43c566bd86 Gyro deadband defaults to 0
The gyro class no longer attempts to set a default deadband, but it still
has an optional SetDeadband() method.

The gyro integration tests were modified and still pass consistently.

Change-Id: I08a97b00b98b49b0a3c63306fcc809857523af2b
2014-08-05 10:25:42 -04:00
Thomas Clark
b86c747226 Only set up once in the C++ tests
TestEnvironment::SetUp() will only initialize the first time it's called.
This allows the --gtest_repeat flag to be used to automatically repeat
the tests.

Change-Id: I20c857a37a88f48114d74ae68518d4a9d724d012
2014-08-05 09:29:07 -04:00
Thomas Clark
60a3fd0698 Added gyro deadbands
During calibration, the Gyro class sets the accumulator deadband to contain
whatever the farthest sample from the center was.  The integration test
passes now.

A SetDeadBand method was added to the Gyro class for teams to set their own
deadbands.

Change-Id: Idbe4c279e2991b4daed4d4cf3bfaf605d4ee25c0
2014-08-04 17:44:04 -04:00
Kevin O'Connor
b86c114939 Only update FRC Java Projects (fixes artf2627)
Change-Id: I62715ab5ed01d1d6c6ee1a877fad3d12a5c0219b
2014-08-04 16:35:28 -04:00
Jonathan Leitschuh (WPI)
14f201cd36 Merge "getAnalogAverageValue should use a 32-bit int" 2014-08-04 13:17:07 -07:00
Thomas Clark
c49ea255b9 getAnalogAverageValue should use a 32-bit int
getAnalogAverageValue gets a 32-bit integer and returns it as an int32_t,
but previously it stored the intermediate value as a 16-bit int.

Change-Id: I0a8b0cd3b3ff9b1ff40ad7942170f633c44c127b
2014-08-04 16:08:58 -04:00
Kevin O'Connor
065e1c24eb Update plugin menu text and make template menu options only show for correct language (fixes artf2408)
Change-Id: I13b80ab43aa79bd1aa8d12b7a8331a602a976bd0
2014-08-04 16:05:24 -04:00
Kevin O'Connor
ecdb77e4be Update plugin target to use mDNS (causes Java debug to now use mDNS)
Change-Id: I570b6e99282583b343e3dcb7f072a707726804e3
2014-08-04 16:01:53 -04:00
Jonathan Leitschuh (WPI)
10aad6d1c8 Merge "Fixed a few more small TODOs" 2014-08-04 12:41:34 -07:00
Thomas Clark
e73c8d06eb Fixed a few more small TODOs
Timer::Get now compensates for the FPGA time rolling over after 71 minutes

UltraSonic::Ping doesn't bother disabling automatic mode, since it asserts
that it's not in automatic mode on the line before.

Change-Id: I6b0f45327c453abd8a846ec8da0f9676e210d909
2014-08-04 15:25:41 -04:00
Thomas Clark
dc341a448e Fixed a few simple SmartDashboard FIXMEs and TODOs
SmartDashboard does usage reporting now (or will when it's implemented
in the HAL).

Global errors are raised in C++ when problems happen, since there is
no SmartDashboard instance.  Previously, no error reporting was done
at all.

GetData was uncommented.

Change-Id: I3331eb9f09924d1d0028e3fa041f0cf68caa5cf5
2014-08-04 14:43:31 -04:00
Thomas Clark
d521eb79b9 Analog interrupts in C++
Analog interrupts now work in C++.

The interrupts Resource was moved from a global in DigitalInput
to a static member of SensorBase.

An analog interrupt IT was added, and the digital interrupt one modified
to prevent a linker error.

Change-Id: I9a300daafed15e9666a4ccb405a509615e3dbb06
2014-08-04 13:45:16 -04:00
Thomas Clark (WPI)
f57a2dc5a9 Merge "Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)" 2014-08-04 07:54:23 -07:00
Kevin O'Connor
7006d1ebc4 Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)
Change-Id: I3223868968ae1d55314d76018a5dd98eaac14255
2014-08-04 10:52:37 -04:00
Thomas Clark (WPI)
c32e5707d4 Merge "Remove extra semi-colon" 2014-08-04 07:47:26 -07:00
Jonathan Leitschuh (WPI)
c27da3587d Merge "Added an interrupt test for C++" 2014-08-04 07:25:30 -07:00
Joe Ross
f18cccbc30 Remove extra semi-colon
Change-Id: I90052addd8ea499ce794d110b6945e9c7d7379cf
2014-08-03 18:08:03 -07:00
Thomas Clark
b91b681430 Added an interrupt test for C++
Change-Id: Ib2f3c575907848082c5d382144bb0462efa64107
2014-08-01 18:11:02 -04:00
Thomas Clark
b26667f866 Fixed the PCM test solenoid numbers
The numbering of the PCM channels is different in the latest firmware

Change-Id: Ib7cb5e69f7b6f076a424358ff61653a4c8ad33af
2014-08-01 17:18:46 -04:00
Thomas Clark
792e3b6ccc Removed modules from the HAL and JNI bindings
Modules aren't used anymore in wpilibc and wpilibj, so the hal functions
that references them and and JNI bindings for these functions have been
pulled out.

Both Counter classes were also modified because they still referenced
modules.

Change-Id: Ic01feb145a4ed5f08cd55f140867c721f5ee7b10
2014-08-01 15:01:28 -04:00
Jonathan Leitschuh
fd4379a946 Makes the Counter.Mode an enum and adds Null Checking
Adds null checking to the AnalogTrigger, AnalogTriggerOutput, and Counter classes

Change-Id: I09e962db36dbde0479a73a47c9998de03cd6bbb5
2014-08-01 13:41:34 -04:00
Jonathan Leitschuh
a40cdf5197 Implements the AnalogTriggerType as an enumeration
Change-Id: I411104a0bec733dc0b3854470c36366f3aec7bd6
2014-08-01 12:51:26 -04:00
Thomas Clark
ba4e74d299 AnalogTrigger support in Java
Analog triggers now work in Java.

Integration tests for analog triggers are included.

A message in the C++ analog trigger IT was fixed.

Change-Id: I50007c6901b8391d32c0e81becdbe18e48a7840f
2014-08-01 12:39:19 -04:00
Jonathan Leitschuh
38583789be Fixes the TiltPanCamera test (now GyroTest)
Change-Id: I3e954e60162ce84372a2dea39803437589aaaf00
2014-07-31 16:08:14 -04:00
Thomas Clark (WPI)
45e43b627f Merge "Changes the name of the AccelerometerTest to BuiltInAccelerometerTest" 2014-07-31 13:03:48 -07:00
Jonathan Leitschuh
e837d9083a Changes the name of the AccelerometerTest to BuiltInAccelerometerTest
Change-Id: Iabbfa8c4f3688a126443993b861018068f1969c4
2014-07-31 16:03:11 -04:00
Jonathan Leitschuh (WPI)
e0e2b498a5 Merge "Accumulators wait for the next sample after reset" 2014-07-31 12:54:26 -07:00
Thomas Clark
8fe888dbc9 Accumulators wait for the next sample after reset
Analog accumulators now wait for the amount of time a full sample
(including oversampling and averaging) lasts after
AnalogInput::ResetAccumulator() is called, so they don't return
old values after being reset.

This delay should be microseconds long and will only happen
when an accumulator is reset.

A new test is is the C++ TiltPanCameraTest that tests this behavior
with the Gyro class.

Change-Id: I1b3ffdeec187959f95c5e637a6d428c9a4bc2cf4
2014-07-31 15:46:14 -04:00
Thomas Clark (WPI)
41bb0da4e6 Merge "Fixes bugs with the Gyro" 2014-07-31 12:41:40 -07:00
Jonathan Leitschuh
97ade3606e Fixes bugs with the Gyro
If the gyro was initialized with an analog input the gyro class would not be calibrated properly.
Removes unnecessary type casting.

Change-Id: I6baa72919019a33cce7d3074f8477104cbe65396
2014-07-31 15:32:03 -04:00
Jonathan Leitschuh (WPI)
2735406bfb Merge "Added a Java internal accelerometer test" 2014-07-31 11:25:26 -07:00
Thomas Clark
ab04e19aae Added a Java internal accelerometer test
Change-Id: I9cae930bbae97af6461d13776cbfc9bb87e0cac4
2014-07-31 10:59:41 -04:00
Thomas Clark (WPI)
a58288ae6d Merge "Refactors the RobotBase Setup into a method." 2014-07-31 07:39:35 -07:00
Jonathan Leitschuh
7905259e21 Refactors the RobotBase Setup into a method.
This allows the robot base setup to be used for the robot base as well as the setup for the test system.

Change-Id: I2f8e37d42c84001f4b4eff2afd7c3e1d73785d7c
2014-07-31 10:37:39 -04:00
Thomas Clark (WPI)
f018689d0e Merge "Completed artf2662: removed Start()/Stop() in Encoders and Counters." 2014-07-31 07:32:35 -07:00
Colby Skeggs
0bb13d86ea Completed artf2662: removed Start()/Stop() in Encoders and Counters.
Change-Id: I11954bb5f66e54461455637d79013c1071f5d00f
2014-07-31 10:31:36 -04:00
Jonathan Leitschuh (WPI)
526df3679a Merge "Added a C++ Preferences test" 2014-07-31 06:36:20 -07:00
Thomas Clark
d8da3e5f1f Added a C++ Preferences test
Change-Id: I6c210535dcfad7c75ff4c04ee6446147efb2fc57
2014-07-30 17:33:26 -04:00
Jonathan Leitschuh
c0af235050 Removes the dependency-reduced-pom.xml from the repository.
Also adds this file to the .gitignore

Change-Id: I731c58d4f8a96531e61598e281a769e6b13e2e86
2014-07-30 14:08:21 -04:00
Jonathan Leitschuh (WPI)
7f6ca6824e Merge "HALInitialize should be the first thing called" 2014-07-30 08:50:09 -07:00
Thomas Clark
231bb55b2a HALInitialize should be the first thing called
Constructing a new HardwareTimer before HALInitialize is called
causes segfaults sometimes in user programs, since getFPGATime assumes
that the tGlobal objected was constructed.  This problem did not appear
in integration tests, where the calls were in the correct order.

Change-Id: I95471e9e8ad7bc5d48a65893856089e35c0b091a
2014-07-30 11:26:50 -04:00
Thomas Clark
76e488061d Removed cRIO tests, NetBeans stuff, and Ant stuff
Change-Id: I066e73916ac944e3145554a49051fb3a92d8c16d
2014-07-30 10:45:58 -04:00
Thomas Clark (WPI)
5e8ea38465 Merge "Fixes the PDP test." 2014-07-30 07:35:15 -07:00
Thomas Clark
a5b72d62a1 Remove the last obsolete interface
Change-Id: I5921968b3064af53f716858092c2da3ea7522362
2014-07-29 18:01:17 -04:00
Jonathan Leitschuh
a5e15b16fd Fixes the PDP test.
Switches the PDP test to use the MotorEncoderFixture.
Also adds helpful output information when running MotorEncoderTests by displaying the current MotorEncoder under test

Change-Id: I1d14986a6ff0ebfffa87d2fd8077d7dd1eef50e3
2014-07-29 18:01:00 -04:00
Jonathan Leitschuh (WPI)
264c38a674 Merge "Removed the old "parsing" interfaces" 2014-07-29 14:45:55 -07:00
Thomas Clark (WPI)
20de3abe80 Merge "Updates the TimerTest to give a clearer output." 2014-07-29 14:42:51 -07:00
Jonathan Leitschuh
3536d47835 Updates the TimerTest to give a clearer output.
Change-Id: I4d6685392e4e3cb21b8a24607904d0c888658855
2014-07-29 17:41:57 -04:00
Thomas Clark
60a294fbad Removed the old "parsing" interfaces
Change-Id: I94ff79f36d5b61f90c2f242fa06816bf3a3b7ac2
2014-07-29 17:34:39 -04:00
Jonathan Leitschuh (WPI)
dc42a1129f Merge "The LiveWindow instance isn't a global static" 2014-07-29 14:00:31 -07:00
Thomas Clark
386dc1f16b Added AnalogTrigger tests
Change-Id: I60c3e576e100632635278e80743975daf238e904
2014-07-29 16:48:28 -04:00
Thomas Clark
038478e437 The LiveWindow instance isn't a global static
The LiveWindow singleton instance shouldn't be a global static
variable, since the order that global statics are constructed is
undefined, and it's required by other constructors.

Change-Id: I2edccc1f723f0ea41b1347379b3e3778a50afcdc
2014-07-29 16:12:23 -04:00
Thomas Clark (WPI)
26e90a988b Merge "Adds/Updates CANJava Testing Framework." 2014-07-29 12:57:08 -07:00
Jonathan Leitschuh (WPI)
d5cd47bfa1 Merge "Minor updates to the C++ CANJaguar ITs" 2014-07-29 12:52:17 -07:00
Jonathan Leitschuh
1e35ef7802 Adds/Updates CANJava Testing Framework.
Change-Id: Iabd80ebd365a05063985fa45ce62849ced17c096
2014-07-29 15:50:31 -04:00
Jonathan Leitschuh (WPI)
65607b5bc1 Merge "Fixed CANJaguar::GetOutputVoltage for negative voltages" 2014-07-29 12:48:56 -07:00
Thomas Clark
30c0cc0561 Minor updates to the C++ CANJaguar ITs
Some tests are more explicitly named now, and negative values are
tested with both voltage and current control.

Change-Id: I316ccfb7670a341e2f13f4ed3a514f283625409e
2014-07-29 15:47:45 -04:00
Jonathan Leitschuh
92bd697417 Fixes a bug where the testing framework would never set the implementation for the libraries.
Change-Id: I8f745ebd870c8dacf28b0459e3d5128195fcbb87
2014-07-29 15:30:33 -04:00
Thomas Clark
ed0df5432f Fixed CANJaguar::GetOutputVoltage for negative voltages
Previously, negative output voltages were unpacked incorrectly.

Now, they're requested as percentages, unpacked, and then scaled
in software based on the bus voltage.  The output voltage and
bus voltage shouldn't ever be out of sync, since they're in
the same message.

Change-Id: I745fffd0faa6cbaab967240271e6cfa8653212e2
2014-07-29 15:25:35 -04:00
Thomas Clark
6deb196e90 Support for the "USER" button on the RoboRIO
You can get the state of the USER button with GetUserButton() in
C++ or Utility.getUserButton() in java.

Change-Id: I923e62cab5e621ef43fed503acab5c0d751264fb
2014-07-29 14:42:08 -04:00
Jonathan Leitschuh (WPI)
8b612f713b Merge "CANJaguar::Disable stops periodic setpoints" 2014-07-29 08:39:12 -07:00
Thomas Clark
d66bafb687 CANJaguar::Disable stops periodic setpoints
Calling CANJaguar::Disable() now makes NetComms stop periodic
setpoint messages, so the motor actually stops until EnableControl()
is called again.

Change-Id: Ib4eb4ad5f729be5c74e799f02ed000511de1e03d
2014-07-29 11:09:37 -04:00
Alex Henning (WPI)
78d2ccd299 Merge "Added stack traces and better error reporting in C++" 2014-07-29 07:27:12 -07:00
Thomas Clark (WPI)
06d59447be Merge "Adds missing Javadocs and @Overrides annotations to the PIDController in Java" 2014-07-29 07:25:34 -07:00
Jonathan Leitschuh
3475a4a8c6 Adds missing Javadocs and @Overrides annotations to the PIDController in Java
Change-Id: I61bf9a31c238b44012d01d4fae11971cc7951d54
2014-07-29 10:19:54 -04:00
Thomas Clark (WPI)
6af242b556 Merge "Fixes for javadoc eclipse plugin." 2014-07-29 07:13:00 -07:00
Alex Henning
c72e704396 Fixes for javadoc eclipse plugin.
Change-Id: I629a8b22acc2073b97b3b478c8b9d52b03cfa353
2014-07-29 10:01:23 -04:00
Thomas Clark
89fe909ae6 Added stack traces and better error reporting in C++
When an error is reported or an assertion fails in C++, a line is now
printed with information about where the error occured, and a stack trace
is printed.

The stacktrace isn't implemented in the HAL because it's not
hardware-dependent, so StackTrace.hpp and StackTrace.cpp are gone.

The Eclipse project template is modified to include "-export-dynamic" in
the linker options, which is necessary for stack traces.

Change-Id: Ie86c14185b13ed603d0fe6467e87ba4f731b1913
2014-07-28 16:35:45 -04:00
Joe Ross
c1d8e4ef4b Make AnalogInput PIDGet return an average voltage. artf2391 for Java.
Equivalent to Ia7f06ca2
Previously it returned a raw value instead of a voltage.

Change-Id: I6f1bcf8fdd7f98ae62ed991f29fec35f4ffb4098
2014-07-28 08:04:10 -07:00
Alex Henning (WPI)
338120c3a5 Merge "Fixed wpi_setErrnoError to print the error name" 2014-07-28 07:05:51 -07:00
Alex Henning (WPI)
a7efbe0d7a Merge "Fixed Preferences in C++" 2014-07-28 07:04:13 -07:00
Thomas Clark (WPI)
4c78280308 Merge "Correct voltage range in javadocs for RoboRIO" 2014-07-28 06:37:02 -07:00
Joe Ross
5a3889a3aa Correct voltage range in javadocs for RoboRIO
Change-Id: I6049fac62bb4f1fb15364bd26d0511d0603c0aee
2014-07-28 09:34:48 -04:00
Thomas Clark (WPI)
2fd4964b62 Merge "ADXL345_I2C: Make constructor explicit." 2014-07-28 06:26:10 -07:00
Thomas Clark (WPI)
6ae6394548 Merge "AnalogPotentiometer: Make constructors explicit." 2014-07-28 06:25:43 -07:00
Peter Johnson
310151132d AnalogPotentiometer: Make constructors explicit.
The second and third arguments have default values, so it needs to
be explicit.

Change-Id: I893a45d750291f96983bef6b753d91f10c44d2ab
2014-07-28 00:01:42 -07:00
Peter Johnson
7f4e1e39ae ADXL345_I2C: Make constructor explicit.
The second argument has a default value, so it needs to be explicit.

Change-Id: I5c38f8f55f9c21576835c005acd8d80fe6864140
2014-07-27 23:59:59 -07:00
Peter Johnson
eebdc3d20c BuiltInAccelerometer: Add virtual destructor.
Change-Id: I38e5ca92ba6c5b395366cfd8ea35acd2a08dbdac
2014-07-27 23:52:00 -07:00
Thomas Clark
980ea96b05 Fixed Preferences in C++
The file name was never updated from the old path, a deadlock occured
sometimes.  A "resource not found" message was also set when fopen()
returns an error, which should be an errno message because it's a C
library error.

Change-Id: Ic913a08f6f5d73219cb6625198f5a4519c039956
2014-07-25 17:03:28 -04:00
Thomas Clark
1038f98e83 Fixed wpi_setErrnoError to print the error name
Previously, wpi_setErrnoError and wpi_setErrnoErrorWithContext
always printed "Unknown errno" whenever a C library error
occured.

Change-Id: Ib235138eea0e83b0d7462dfd6e834e3499e3b0c5
2014-07-25 16:52:00 -04:00
Thomas Clark
326aa2e85c Fixed a typo with the tGlobal commit
Change-Id: Ic801e9f73235cd24e9f57484c8af892c9c125075
2014-07-25 13:08:52 -04:00
Thomas Clark
6071fc7fb3 Fixed CANJaguar percent scaling issue [artf2637]
Percent mode used to be scaled incorrectly in Java because the
max output voltage was initialized to a wrong value.

Change-Id: If88bb2f1d198e13b1724afc62a522fbf91a14b5b
2014-07-25 13:01:24 -04:00
thomasclark
f958b65ba6 CANJaguar can be disabled [artf2647]
The CANJaguar class now stores a controlEnabled flag.  When disabled, it
won't verify the control mode, which involves sending enable messages.

Change-Id: I8baa48eec31de6b4d3fee2b5a074320542a1bbef
2014-07-25 12:59:47 -04:00
Brad Miller (WPI)
f4f7588cfb Merge "A few small changes to the C++ ITs" 2014-07-25 08:54:42 -07:00
Brad Miller (WPI)
80ecff6bdb Merge "AnalogInput::PIDGet returns an average voltage[artf2391]" 2014-07-25 08:52:16 -07:00
Brad Miller (WPI)
e487c950e9 Merge "Only create one tGlobal object" 2014-07-25 08:51:32 -07:00
Thomas Clark
191e9d5d6b AnalogInput::PIDGet returns an average voltage[artf2391]
Previously it returned a raw value instead of a voltage.

Change-Id: Ia7f06ca24a6c79468c7be89a07c615d7015ffef9
2014-07-25 09:41:06 -04:00
thomasclark
40fc8326aa Only create one tGlobal object
This fixes a problem with getFPGATime() blocking for around 1 second
each time it's called.

Change-Id: I8aafb725889c231ffb2c91e7cb4bbb8110474a9d
2014-07-24 18:30:13 -04:00
thomasclark
fdbe750d3d A few small changes to the C++ ITs
A PDP channel number is correct now, the deploy script was changed to
kill Java programs before running and ignore useless messages,
the "Waiting for enable" message is only printed once, and the accelerometer
test is more robust.

Change-Id: I2226140d8c3e44c452e039c27f4f1cf11c952c42
2014-07-24 18:22:31 -04:00
Jonathan Leitschuh
3ec797a8cf Updates the CANJaguar to free itself before throwing an exception in the constructor. This allows it to be allocated later without throwing an Allocation exception.
Change-Id: Ifbd15fecad92fa17a1c4b92d444b67221dacb4b5
2014-07-24 16:55:27 -04:00
Jonathan Leitschuh
78e6cf7208 Updates the AbstractComsSetup message to report JUnits multiple exceptions correctly.
Adds a simple logger to the AbstractComsSetup that prints messages to the console based on the log level.
Replaces all System.out prints with TestBench.out()

Change-Id: Ieb7acfe51aa2febe9cfd3883f8a33094c9b72a6e
2014-07-24 15:01:44 -04:00
Jonathan Leitschuh
2481e98bc8 Fixes a deallocation of the Relay resource when calling free. Changes fake "Enum Classes" into real Enumerations
Change-Id: I9d5a4760235adc9e02e41040c9973316e1f32da2
2014-07-24 13:59:21 -04:00
thomasclark
c81d510ebe CANJaguar::ChangeControlMode marks the controlmode as unverified
This previous caused a bug where the Jaguar would sometimes
behave as if it were in the wrong mode, even when everything was
verfied.

Change-Id: Id5b96e0f7e64066eaaa0e5be4ba53fca76ba0703
2014-07-24 13:54:01 -04:00
Thomas Clark (WPI)
3fb4159101 Merge "Added missing call to m_ds.waitForData()" 2014-07-24 10:41:17 -07:00
Alex Henning
2e1bd171a5 Added missing call to m_ds.waitForData()
It was accidentally deleted in a previous commit[1] and none of our
tests caught it. As a result iterative robot loops run too fast (using
extra CPU).

[1] https://usfirst.collab.net/gerrit/gitweb?p=wpilibj.git;a=blobdiff;f=WPILibJ/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java;h=0e936de8ec86a76e0a63ddbfc65ec2b88bc71725;hp=d4c5d38a14e29c926389ba1ae84fcbd09ee51f19;hb=HEAD;hpb=726ac3a3d272310b367b25f3c7e15ba6d07b957d;tflink=projects.wpilib/scm.WPILibJ

Change-Id: I663f8619406f26b7fa6fc12bce4444657b829d9f
2014-07-24 12:02:50 -04:00
Alex Henning (WPI)
25e7a077c1 Merge "Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp." 2014-07-24 08:59:51 -07:00
Colby Skeggs
dc48dc7f7b Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp.
Change-Id: Ic00fcd5026ce0570c79a65be178e45eeb94b3deb
2014-07-24 11:54:46 -04:00
Colby Skeggs
2dd45c3ea6 Fixed FRCSim artf2619, and misc reformatting.
Change-Id: I7133f46f88f7e2cb2451c2a6714daa8f3f368b40
2014-07-23 14:43:11 -07:00
Jonathan Leitschuh (WPI)
461e359484 Merge "Remove the Kinect code from C++" 2014-07-23 13:57:20 -07:00
thomasclark
78dac49cf6 Remove the Kinect code from C++
Change-Id: Ifef909a8948f1d0f881bf394b9a3ba925644306f
2014-07-23 16:55:45 -04:00
thomasclark
66ba9a728e Fixed some bugs with CANJaguar verification in Java
Change-Id: I5f6510d53c806845f6bae5eb8fd9ebbc8fde054e
2014-07-23 16:33:57 -04:00
Jonathan Leitschuh (WPI)
c3d1e80a62 Merge "Fixed some bugs with CANJaguar verification in C++" 2014-07-23 12:48:17 -07:00
Jonathan Leitschuh (WPI)
01ca19f78f Merge "Added a Jaguar brownout test in C++, cleaned up some C++ tests" 2014-07-23 12:46:27 -07:00
thomasclark
202bfb2959 Added a Jaguar brownout test in C++, cleaned up some C++ tests
Change-Id: I8fe26c0c3fab35bf783f6c5dfe0c16a991ec06cd
2014-07-23 15:24:39 -04:00
thomasclark
b0369342e9 Fixed some bugs with CANJaguar verification in C++
Change-Id: I3f17c090e26c6019523eb92eb47714464aa01baf
2014-07-23 15:22:26 -04:00
Alex Henning
26d101caf9 Restructure WPILibJ to share code.
wpilibJavaDevices now contains RoboRIO specific code and wpilibJava has
shared high level information. The restructuring was mostly just copy
and paste. The three big exceptions are Timer, RobotState and
HLUsageReporting. Those require some dependencies injection since that
appears to be the cleanest way to share the code.

Change-Id: Ie7011e32bc95953a87801a9905b3bfec7f8de285
2014-07-23 14:11:52 -04:00
Jonathan Leitschuh
e84e0ebab8 Updates the TestBench to use parameters to run specific test methods or test/suite classes.
Updates the test bench to only print "Waiting for enable" on one line with a counter.
Updates all SubSuites to extend the AbstractTestSuite class.
Also includes a small set of tests to prove the validity of the base AbstractTestSuite

Change-Id: I447ca2537a08c84ab1d69fa200cb8125b448a589
2014-07-23 10:43:42 -04:00
Jonathan Leitschuh (WPI)
0704a697ce Merge "Updated the C++ TiltPanCameraTest" 2014-07-23 07:02:46 -07:00
Jonathan Leitschuh (WPI)
13f97bb6e3 Merge "Added an Accelerometer interface" 2014-07-23 06:57:42 -07:00
thomasclark
5eddb69aa0 Updated the C++ TiltPanCameraTest
The gyro sensitivity is fixed, the Accelerometer interface is
now used, and some tolerances are adjusted.

Change-Id: Iac1f3c4fbae3be923bd97692684ff72cd2f623f9
2014-07-23 09:36:27 -04:00
thomasclark
41c2b9402c Added an Accelerometer interface
ADXL345_I2C, ADXL345_SPI, and BuiltInAccelerometer implement this interface.

The analog accelerometer class Accelerometer was renamed to
AnalogAccelerometer.

Change-Id: Iaae79d582a24c36c372f5fd4ea6df37be289b9c1
2014-07-22 18:04:00 -04:00
Jonathan Leitschuh (WPI)
99632e003b Merge "Fixed the Command-Based Robot template [artf2550]" 2014-07-22 11:00:46 -07:00
thomasclark
fe12394c93 Fixed the Command-Based Robot template [artf2550]
Change-Id: I49361a70fd19d59fbeb9e22a8f65de875fa5a04a
2014-07-22 13:57:45 -04:00
Jonathan Leitschuh (WPI)
fbf196763f Merge "Removed AnalogModule, DigitalModule, and Module from C++" 2014-07-22 10:53:21 -07:00
thomasclark
b5fb35c0c4 Removed AnalogModule, DigitalModule, and Module from Java
Change-Id: I42c58237f1e14d0ebae1c7266aecda00d51eeae1
2014-07-22 13:33:00 -04:00
Alex Henning (WPI)
48e8b2136e Merge "Add support for downloading models hosted on FIRSTForge." 2014-07-22 09:54:23 -07:00
Alex Henning (WPI)
e962c770bb Merge "Fixed installation of frc_gazebo_plugins and a few minor fixes." 2014-07-21 14:12:38 -07:00
Alex Henning
1b7a352cbb Add support for downloading models hosted on FIRSTForge.
Change-Id: I191dc2620b5907316fbc38275d68c568656fa863
Completes: artf2620
2014-07-21 17:09:29 -04:00
thomasclark
1a77cea13a Removed AnalogModule, DigitalModule, and Module from C++
The HAL calls from Analog/DigitalModule are now directly in the classes
that use them.

Change-Id: I1cf879ab2979be903d03ab8282dfe5a5e7ae9443
2014-07-21 16:32:36 -04:00
Alex Henning
afa39deec5 Fixed installation of frc_gazebo_plugins and a few minor fixes.
Change-Id: I1cb30acb69526455469ad890dfee8edd42958a5d
2014-07-21 14:55:43 -04:00
Jonathan Leitschuh
f27e16735f Adds resource tracking to CANJaguar in C++
Change-Id: I0d562af5e9f4f50f79d61db15ff25eaf4dae00d5
2014-07-21 14:36:43 -04:00
Thomas Clark (WPI)
d8a5ced015 Merge "Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()" 2014-07-21 08:23:59 -07:00
Jonathan Leitschuh
8fe606a4b1 Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()
Change-Id: I6ed75428d31df219daf55969e9cd019bf9e0e117
2014-07-21 11:21:36 -04:00
thomasclark
6053a0cc24 Added BuiltInAccelerometer in Java and updated C++
Change-Id: I5a3360c51334e85da6a15fd640f9420bc3b64dca
2014-07-21 10:09:41 -04:00
Jonathan Leitschuh (WPI)
be106b3527 Merge "Added a C++ built-in accelerometer class" 2014-07-21 06:11:59 -07:00
Jonathan Leitschuh (WPI)
ebaf2ef058 Merge "Added HAL methods for using the built-in accelerometer" 2014-07-21 06:02:32 -07:00
thomasclark
9f1a9a07c9 Added a C++ built-in accelerometer class
Change-Id: I80cee788912277f06ac4bdda40261f160de0cbaa
2014-07-21 08:57:03 -04:00
thomasclark
ec2a455bc7 Added HAL methods for using the built-in accelerometer
Change-Id: I5372f5df9b29c546dab3913fcf983a7a9a5427dc
2014-07-21 08:49:51 -04:00
Jonathan Leitschuh
3d740a9a25 Adds Resource tracking to CANJaguar
Change-Id: Ic5da91d378d997f57c65b3bace5fcfd24485dddb
2014-07-18 15:00:59 -04:00
Thomas Clark (WPI)
1dd1e0be1e Merge "Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value." 2014-07-17 12:55:24 -07:00
Jonathan Leitschuh
437e3ff266 Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value.
Change-Id: I3a3b368d429dc5cd00baf94ccd80a676a10cbb48
2014-07-17 15:51:01 -04:00
Jonathan Leitschuh (WPI)
f373c8708d Merge "The camera fixture tests now include an SPI accelerometer test" 2014-07-17 12:48:32 -07:00
thomasclark
54a657a7d4 The camera fixture tests now include an SPI accelerometer test
Change-Id: I5dae746541d1d0e29f7d7c140a8fed8418502f45
2014-07-17 15:44:51 -04:00
Kevin O'Connor
60d8508a65 Fix artf2636 Don't consume ByteBuffer when checking class specific status
Change-Id: I94e46bd436cc8fd41c7550f1135287027e8be9c4
2014-07-17 15:22:53 -04:00
Kevin O'Connor
02a28c8f04 Add allocation checking for I2C MXP. Update DIO counts in Lib layer until resource checking moves down to HAL
Change-Id: I0abe80bcbe9cbbc81f0887a1cd1a3aa0862df5f1
2014-07-17 15:22:53 -04:00
Kevin O'Connor
b128828977 Update Digital Pin count to reflect full 16 DIO on MXP
Change-Id: I180dee11c2c2a7e0585f153ba4b1832bce2bd6d3
2014-07-17 15:22:52 -04:00
Kevin O'Connor
1a1a12316b Remove JNA hack no longer being used
Change-Id: If85d24003524af71d47115ac0ef31ebc88b70f42
2014-07-17 15:22:51 -04:00
Thomas Clark (WPI)
d0fdb3e704 Merge "Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API." 2014-07-17 12:16:14 -07:00
Jonathan Leitschuh (WPI)
5d2e20eaec Merge "More CANJaguar integration tests" 2014-07-17 11:39:26 -07:00
Jonathan Leitschuh
fc0eb4e956 Adds/updates the documentation for the CANJaguar Classes for C++ & Java.
Also removes private unused methods in Java and an unused constructor.

Change-Id: I0a810a4839a5c6752872d947239dd9305141672e
2014-07-17 14:36:51 -04:00
thomasclark
968b69d37d More CANJaguar integration tests
Change-Id: I92e6bb7ee0e7d43c1468650e2c69bb8f46a0154d
2014-07-16 16:45:52 -04:00
Kevin O'Connor
343c7f4f3e Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API.
Change-Id: I9b2c05a05cbe443331a5b6da6a6d7c7be751a5e7
2014-07-16 16:34:37 -04:00
Jonathan Leitschuh (WPI)
80c5c09f77 Merge "Encoders and counters work on the MXP" 2014-07-16 12:10:30 -07:00
thomasclark
cb9df310dc Encoders and counters work on the MXP
Change-Id: Ifeb0533dde53a1ccba841b29e2b86f6f4a1bb33f
2014-07-16 15:06:08 -04:00
thomasclark
f566c087dc Fix a few wrong messages in CANJaguar
Change-Id: I8e1a8fa9b0c20a40e060a8319dbbd605173dc407
2014-07-16 10:27:17 -04:00
Brad Miller (WPI)
7ca1b498e4 Merge "Added generic CAN methods to the HAL" 2014-07-11 12:09:46 -07:00
thomasclark
8bba58b9ab Added generic CAN methods to the HAL
Packing, unpacking, caching, receiving, and sending CAN messages can be done
with a thin wrapper around CANSessionMux now, removing the need for duplicated
code between different CAN devices and languages.

Change-Id: If40181e479f45a443db7a1c264437f7f89ff54d9
2014-07-11 11:38:22 -04:00
Colby Skeggs
8ae64a12ea Removed modules from the simulation infrastructure and refactored FRCPlugin.
Pneumatics still have CAN modules. The refactored code is now eight
plugins for sensors and actuators. There is some code reuse that should
be refactored out, but that level of abstraction will wait until we
figure out how these plugins are integrating with gazebo proper.

Change-Id: I357e695ef05af6dda83a39ba60380686bd57d11a
Closes: artf2610, artf2623
2014-07-07 13:33:34 -07:00
Alex Henning (WPI)
3b4718fc92 Merge "Fixed FRCSim artf2609 - double ports handled wrong." 2014-07-07 12:22:39 -07:00
Alex Henning (WPI)
5800af49bc Merge "Fixed FRCSim artf2599." 2014-07-07 11:46:49 -07:00
Thomas Clark (WPI)
63fc4f6cfb Merge "Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework." 2014-07-03 13:20:50 -07:00
Jonathan Leitschuh
8b770ffb41 Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework.
Change-Id: I1452cace993a5ea8bdd87797d3125cd353b9218f
2014-07-03 15:38:04 -04:00
Colby Skeggs
55fde6b616 Fixed FRCSim artf2609 - double ports handled wrong.
Change-Id: I2dc59c8d3113f3024d237763eb4e2f94bb85ff1a
2014-07-03 12:23:29 -07:00
Colby Skeggs
5ddacb43c1 Fixed FRCSim artf2599.
Made the wpilibC++Sim codebase's motor control as
similar to the wpilibC++ motor control as possible.

Change-Id: I5510d952cb40c4a3def210f46a566d7102d604ee
2014-07-02 15:43:12 -07:00
Brad Miller (WPI)
65c3c0ba09 Merge "Updated the HAL, wpilibj, and wpilibc for PCM and PDP" 2014-07-02 14:04:51 -07:00
Brad Miller (WPI)
fc3ed33f77 Merge "PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API. CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters. Some template magic to make the PDP and PCM getters/setters easy to stamp out." 2014-07-02 14:04:35 -07:00
thomasclark
255a3a5b12 Updated the HAL, wpilibj, and wpilibc for PCM and PDP
Removed #if 0...#endif from PCM.cpp

Change-Id: I2d117c87a3fa10bddebf83706f79c2e767d22a0d

Update the HAL to the PCM/PDP changes

Change-Id: If554b650e263f174e90864f1e9ffba91daf20f7e

Update C++ to the PCM/PDP changes

Change-Id: Ia3114d4526be1dc5cc2f74fd8f7ab44f204d15f2

Updated PCM/PDP in Java

Change-Id: I8fe03afbcb1739d555e86abc0eaae1e12313d490
2014-07-02 16:49:36 -04:00
Omar Zrien
0ef5c3adfa PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API.
CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters.
Some template magic to make the PDP and PCM getters/setters easy to stamp out.

Change-Id: Ibdd0745af070756a282df5074504491fadfde336
2014-07-02 16:48:55 -04:00
Brad Miller (WPI)
37ebcabc4a Merge "Fixed periodic voltage status message" 2014-07-02 10:42:04 -07:00
Brad Miller (WPI)
244ee8d920 Merge "Fixed C++ deploy in Eclipse" 2014-07-02 10:41:36 -07:00
thomasclark
b97d2eb0c3 Fixed periodic voltage status message
Previously, the voltage was requested as a percentage and decoded as
a number of volts, which resulted in values being scaled wrong. The
correct message is requested now.

Change-Id: I5e81c7a4a2e2698f2e8a84ba747217e0e14f7676
2014-07-02 12:14:49 -04:00
thomasclark
ae8d22b0f2 Fixed C++ deploy in Eclipse
Eclipse now runs an ant script to deploy C++ programs, which runs the
robot program with the run-at-startup system

Change-Id: I3e63967ebc40ad3c38aa561fd303ca3c577fd2a2
2014-07-01 17:04:28 -04:00
Brad Miller (WPI)
ff8016c088 Merge "Fixes CounterTest for C++" 2014-07-01 13:01:10 -07:00
Brad Miller (WPI)
f0fb3023ad Merge "CANJaguar uses periodic status updates [artf2621]" 2014-07-01 13:00:15 -07:00
Kacper Puczydlowski
1d33edffee Fixes CounterTest for C++
Change-Id: I3446561cd255c56edd3f284a45ec4fd7efaf84e6
2014-07-01 14:16:53 -04:00
thomasclark
5bd546f1fd CANJaguar uses periodic status updates [artf2621]
All status data is now in 3 messages automatically sent periodically
by the Jaguar, removing the need to send several hundred requests
every second.

The C++ integration test was also updated to be more robust against
timing problems.

Change-Id: I13bacc6c8173ea1a2291a96ad3bd80ff5b18d16f
2014-07-01 12:02:44 -04:00
942 changed files with 30579 additions and 33835 deletions

159
.gitignore vendored
View File

@@ -1,20 +1,82 @@
# WPIlib Specific
wpilibc/build/
hal/build/
networktables/cpp/build/
build/
networktables/OutlineViewer/nbproject/private
*~
target/
dist/
bin/
.project
.cproject
.settings/
.classpath
**/dependency-reduced-pom.xml
#Java File extentions
# Created by the jenkins test script
test-reports
# Added by the users of vagrant
jdk-7u45-linux-arm-vfp-sflt.gz
# Created by http://www.gitignore.io
### Linux ###
*~
# KDE directory preferences
.directory
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Java ###
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
@@ -22,3 +84,90 @@ bin/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### C++ ###
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Compiled Dynamic libraries
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
### CMake ###
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
### Vagrant ###
.vagrant/
### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse

View File

@@ -1,13 +0,0 @@
syntax: re
^\.hgignore$
.*/target(?:/|$)
.*/dist(?:/|$)
eclipse-plugins/.*/bin(?:/|$)
syntax: glob
wpilibc/build/
hal/build/
networktables/cpp/build/
build/
networktables/OutlineViewer/nbproject/private
*~

View File

@@ -1,10 +1,11 @@
cmake_minimum_required(VERSION 2.8)
project(All-WPILib)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wextra -Wno-unused-parameter -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wall -Wextra -Wno-unused-parameter -fPIC")
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
get_filename_component(WPILIB_INCLUDES wpilibc/wpilibC++/include REALPATH)
get_filename_component(HAL_API_INCLUDES hal/include REALPATH)
get_filename_component(NWT_API_INCLUDES networktables/cpp/include REALPATH)
add_subdirectory(hal)

125
Vagrantfile vendored Normal file
View File

@@ -0,0 +1,125 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "puphpet/ubuntu1404-x64"
# Run the bootstrap.sh shell script to setup the enviroment
config.vm.provision :shell, path: "bootstrap.sh"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
config.vm.network "public_network", bridge: 'en0'
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.
# Enable provisioning with CFEngine. CFEngine Community packages are
# automatically installed. For example, configure the host as a
# policy server and optionally a policy file to run:
#
# config.vm.provision "cfengine" do |cf|
# cf.am_policy_hub = true
# # cf.run_file = "motd.cf"
# end
#
# You can also configure and bootstrap a client to an existing
# policy server:
#
# config.vm.provision "cfengine" do |cf|
# cf.policy_server_address = "10.0.2.15"
# end
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file default.pp in the manifests_path directory.
#
# config.vm.provision "puppet" do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# end
# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision "chef_solo" do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { mysql_password: "foo" }
# end
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
end

View File

@@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 2.8)
INCLUDE(CMakeForceCompiler)
set(ARM_PREFIX arm-none-linux-gnueabi)
#set(ARM_PREFIX arm-frc-linux-gnueabi)
set(CMAKE_SYSTEM_NAME Linux)
CMAKE_FORCE_CXX_COMPILER(${ARM_PREFIX}-g++ GNU)
CMAKE_FORCE_C_COMPILER(${ARM_PREFIX}-gcc GNU)
set(CMAKE_CXX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -Wall -Wno-psabi" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g" CACHE STRING "" FORCE) # still want debugging for release?
#SET(CMAKE_FIND_ROOT_PATH /usr/arm-frc-linux-gnueabi)
SET(CMAKE_FIND_ROOT_PATH $ENV{USER_HOME}/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/arm-none-linux-gnueabi/libc)

61
bootstrap.sh Normal file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# Update the apt-get repository list
apt-get update
# Download and install Java
apt-get --yes --force-yes install default-jre
apt-get --yes --force-yes install default-jdk
# Install Maven
apt-get --yes --force-yes install maven
# Install git-review
apt-get --yes --force-yes install python-pip
apt-get --yes --force-yes install python-setuptools
easy_install pip
yes | pip install git-review
# Download and install the gcc linux arm-toolchains
# Get the 32 bit c library
apt-get --yes --force-yes install libc6-i386
# Download the tool to unzip .zip files
apt-get --yes --force-yes install unzip
# The variables associated with the toolchains
TOOL_VER="1.0.1"
TOOL_DIR=~/../home/vagrant/wpilib/toolchains
# Create the toolchains directory
mkdir -p $TOOL_DIR
# Download the toolchains to this directory
wget -P ${TOOL_DIR}/ http://first.wpi.edu/FRC/c/maven/edu/wpi/first/wpilib/plugins/cpp/toolchains/linux/${TOOL_VER}/linux-${TOOL_VER}.zip
# Unzip the file
unzip -q ${TOOL_DIR}/linux-${TOOL_VER}.zip -d ${TOOL_DIR}/
# Remove the unneeded zip file
rm ${TOOL_DIR}/linux-${TOOL_VER}.zip
# Change the name of the directory
mv -f $TOOL_DIR/linux-${TOOL_VER} ${TOOL_DIR}/arm-none-linux-gnueabi-4.4.1
chown -R vagrant $TOOL_DIR/arm-none-linux-gnueabi-4.4.1
# Add the arm toolchains to the path variable
echo 'PATH=$PATH:/home/vagrant/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/' >> /home/vagrant/.bashrc
# Install the jdk-linux-arm-vfp-sflt
# Create the target directory for the jdk
mkdir -p /home/vagrant/jdk-linux-arm-vfp-sflt/
# Unzip the jdk into this new directory
tar -xzf /vagrant/jdk-7u45-linux-arm-vfp-sflt.gz -C /home/vagrant/jdk-linux-arm-vfp-sflt/
# Install sshpass for the test system
apt-get --yes --force-yes install sshpass
# Keep this at the end of this file
printf "\n\n"
printf "Your virtual enviroment is now nearly set-up.\n"
printf "You can access your enviroment using 'vagrant ssh'.\n"
printf "Please run 'cd /vagrant' to navigate to the repository.\n"
printf "Once you have navigated there please run 'git review -s' to complete the setup of git review.\n"

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
# Temporary method to deploy C++ integration tests to the RoboRIO
if [ $(which sshpass) ]
then
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram $*
else
ssh admin@10.1.90.2 killall FRCUserProgram
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
ssh admin@10.1.90.2 ./FRCUserProgram $*
fi

View File

@@ -105,6 +105,7 @@ public class WPILibCore extends AbstractUIPlugin {
public void saveGlobalProperties(Properties props) {
try {
props.setProperty("version", "current");
props.store(new FileOutputStream(new File(WPILibCore.getDefault()
.getWPILibBaseDir() + "/wpilib.properties")),
"Don't add new properties, they will be deleted by the eclipse plugin.");
@@ -124,7 +125,7 @@ public class WPILibCore extends AbstractUIPlugin {
return target;
else {
int teamNumber = getTeamNumber(project);
return "10." + (teamNumber / 100) + "." + (teamNumber % 100) + ".2";
return "roborio-" + teamNumber + ".local";
}
}
@@ -133,7 +134,7 @@ public class WPILibCore extends AbstractUIPlugin {
}
public String getDefaultVersion() {
return "2013-test-0.4";
return "0.2";
}
public String getCurrentVersion() {

View File

@@ -22,12 +22,12 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public abstract class AbstractInstaller {
protected File installLocation;
protected String version;
protected String version, installedVersion;
public AbstractInstaller(String version) {
this.installLocation = new File(WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + getFeatureName() + File.separator + version);
public AbstractInstaller(String version, String installedVersion, String path) {
this.installLocation = new File(path);
this.version = version;
this.installedVersion = installedVersion;
}
/**
@@ -55,7 +55,7 @@ public abstract class AbstractInstaller {
WPILibCore.logInfo("Installing "+getFeatureName()+" if necessary");
if (!isInstalled()) {
WPILibCore.logInfo("Install necessary");
WPILibCore.logInfo("Install necessary for " + getFeatureName());
try {
install();
} catch (InstallException e) {
@@ -64,9 +64,9 @@ public abstract class AbstractInstaller {
getErrorMessage(e));
}
}
updateInstalledVersion(version);
WPILibCore.logInfo("Installed");
WPILibCore.logInfo("Installed" + getFeatureName());
return Status.OK_STATUS;
}
@@ -105,7 +105,7 @@ public abstract class AbstractInstaller {
* @return True for is there and newer, false otherwise.
*/
protected boolean isInstalled() {
return installLocation.exists();
return installLocation.exists() && !version.contains("DEVELOPMENT") && version.equals(installedVersion);
}
/**
@@ -138,7 +138,7 @@ public abstract class AbstractInstaller {
}
// Call 'unzip'
final String[] cmd = {"unzip", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
final String[] cmd = {"unzip" , "-o", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
WPILibCore.logInfo("unzip "+tmpFile.getAbsolutePath()+" -d "+installLocation.getAbsolutePath());
final Process unzipProcess = DebugPlugin.exec(cmd, installLocation);
try (final InputStream is = unzipProcess.getInputStream()) {

View File

@@ -1,8 +1,6 @@
package edu.wpi.first.wpilib.plugins.core.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
@@ -11,7 +9,7 @@ import edu.wpi.first.wpilib.plugins.core.preferences.PreferenceConstants;
public class ToolsInstaller extends AbstractInstaller {
public ToolsInstaller(String version) {
super(version);
super(version, WPILibCore.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLS_VERSION), WPILibCore.getDefault().getWPILibBaseDir() + "/tools");
}
@Override
@@ -22,13 +20,8 @@ public class ToolsInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCore.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLS_VERSION)) {
WPILibCore.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
}
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
}
@Override

View File

@@ -19,7 +19,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
IPreferenceStore store = WPILibCore.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.TEAM_NUMBER,
WPILibCore.getDefault().getProjectProperties(null).getProperty("team-number", "0"));
store.setDefault(PreferenceConstants.TOOLS_VERSION, WPILibCore.getDefault().getDefaultVersion());
store.setDefault(PreferenceConstants.UPDATE_TOOLS_VERSION, true);
String val = store.getString(PreferenceConstants.TOOLS_VERSION);
if (!store.contains(PreferenceConstants.TOOLS_VERSION) && val != null)
store.setValue(PreferenceConstants.TOOLS_VERSION, "none");
}
}

View File

@@ -35,15 +35,15 @@ public class NewProjectMainPage extends WizardPage {
private Text worldText;
private Button worldButton;
Button simpleRobot, iterativeRobot, commandRobot;
Button iterativeRobot, commandRobot, sampleRobot;
private boolean showPackage;
private boolean showProjectTypes;
private TeamNumberPage teamNumberPage;
/**
* Constructor for SampleNewWizardPage.
* @param teamNumberPage
*
* @param teamNumberPage
*
* @param pageName
*/
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
@@ -77,7 +77,7 @@ public class NewProjectMainPage extends WizardPage {
if (showPackage) {
label = new Label(container, SWT.NULL);
label.setText("&Package:");
packageText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
packageText.setLayoutData(gd);
@@ -87,7 +87,7 @@ public class NewProjectMainPage extends WizardPage {
}
});
}
if (showProjectTypes) {
Group projectTypeGroup = new Group(container, SWT.BORDER);
projectTypeGroup.setText("Project Type");
@@ -97,31 +97,29 @@ public class NewProjectMainPage extends WizardPage {
GridLayout groupLayout = new GridLayout();
groupLayout.numColumns = 1;
projectTypeGroup.setLayout(groupLayout);
simpleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
//simpleRobot.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
simpleRobot.setText("Simple Robot: A flexible robot project intended for robots that implement basic functionality. Can also be used as a starting point for teams with a custom framework.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
simpleRobot.setLayoutData(gd);
simpleRobot.setSelection(true);
iterativeRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
iterativeRobot.setText("Iterative Robot: A robot project that allows robots to be implemented in an iterative manner.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
iterativeRobot.setLayoutData(gd);
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
commandRobot.setLayoutData(gd);
sampleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
sampleRobot.setText("Sample Robot: A robot project used for small sample programs or for highly advanced programs with more complete control over program flow");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
sampleRobot.setLayoutData(gd);
}
label = new Label(container, SWT.NULL);
label.setText("Simulation &World:");
Composite comp = new Composite(container, SWT.NULL);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -144,7 +142,7 @@ public class NewProjectMainPage extends WizardPage {
browse();
}
});
initialize();
dialogChanged();
setControl(container);
@@ -162,7 +160,7 @@ public class NewProjectMainPage extends WizardPage {
@Override public void stateChanged(ChangeEvent e) {
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
}
});
}
@@ -174,7 +172,7 @@ public class NewProjectMainPage extends WizardPage {
*/
private void dialogChanged() {
String projectName = getProjectName();
String packageString = "";
if (showPackage) packageString = getPackage();
@@ -190,7 +188,7 @@ public class NewProjectMainPage extends WizardPage {
updateStatus("Must be valid java package");
return;
}
updateStatus(null);
}
@@ -203,7 +201,7 @@ public class NewProjectMainPage extends WizardPage {
String result = dialog.open();
if (result != null) {
worldText.setText(result);
}
}
}
private void updateStatus(String message) {
@@ -218,11 +216,11 @@ public class NewProjectMainPage extends WizardPage {
public String getPackage() {
return packageText.getText();
}
public ProjectType getProjectType() {
if (!showProjectTypes) return null;
else if (simpleRobot.getSelection()) return types.get(ProjectType.SIMPLE);
else if (iterativeRobot.getSelection()) return types.get(ProjectType.ITERATIVE);
else if (sampleRobot.getSelection()) return types.get(ProjectType.SAMPLE);
else return types.get(ProjectType.COMMAND_BASED);
}
@@ -237,7 +235,7 @@ public class NewProjectMainPage extends WizardPage {
public void setShowProjectTypes(boolean bool) {
showProjectTypes = bool;
}
public void setProjectTypes(Map<String, ProjectType> types) {
showProjectTypes = true;
this.types = types;

View File

@@ -4,7 +4,7 @@ import java.net.URL;
import java.util.Map;
public interface ProjectType {
String SIMPLE = "SIMPLE";
String SAMPLE = "SAMPLE";
String ITERATIVE = "ITERATIVE";
String COMMAND_BASED = "COMMAND_BASED";

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
return "4.4.1-csery-gcc";
}
/*

View File

@@ -11,7 +11,8 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version);
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
}
@Override
@@ -21,11 +22,8 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
}
@Override

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
return "4.4.1-csery-gcc";
}
/*

View File

@@ -11,7 +11,9 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version);
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED),
WPILibCPPPlugin.getDefault().getToolchain());
}
@Override
@@ -21,16 +23,12 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
}
@Override
protected InputStream getInstallResourceStream() {
return ToolchainInstaller.class.getResourceAsStream("/resources/toolchain.zip");
}
}

View File

@@ -2,7 +2,7 @@
<feature
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature"
label="Windows Toolchain for Robot C++ Development"
version="0.2.0"
version="0.3.0"
provider-name="Worcester Polytechnic Institute"
os="win32">

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<packaging>eclipse-feature</packaging>
<parent>

View File

@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Windows
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.cpp.toolchains.windows;singleton:=true
Bundle-Version: 0.2.0
Bundle-Version: 0.3.0
Bundle-Activator: edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.windows</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<packaging>eclipse-plugin</packaging>
<parent>

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
return "4.4.1-csery-gcc";
}
/*

View File

@@ -11,7 +11,8 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version);
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
}
@Override
@@ -21,11 +22,8 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
}
@Override

View File

@@ -67,12 +67,21 @@
type="new"
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandWizard">
<enablement>
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="org.eclipse.cdt.ui.CPerspective">
</equals>
</with>
<with
variable="selection">
<iterate>
<and>
<test
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.core.resources.projectNature">
</test>
<test
value="org.eclipse.cdt.core.cnature"
property="org.eclipse.core.resources.projectNature">
</test>
</and>
</iterate>
</with>
</enablement>
</commonWizard>
<commonWizard
@@ -80,12 +89,21 @@
type="new"
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandGroupWizard">
<enablement>
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="org.eclipse.cdt.ui.CPerspective">
</equals>
</with>
<with
variable="selection">
<iterate>
<and>
<test
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.core.resources.projectNature">
</test>
<test
value="org.eclipse.cdt.core.cnature"
property="org.eclipse.core.resources.projectNature">
</test>
</and>
</iterate>
</with>
</enablement>
</commonWizard>
<commonWizard
@@ -93,12 +111,21 @@
type="new"
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.SubsystemWizard">
<enablement>
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="org.eclipse.cdt.ui.CPerspective">
</equals>
</with>
<with
variable="selection">
<iterate>
<and>
<test
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.core.resources.projectNature">
</test>
<test
value="org.eclipse.cdt.core.cnature"
property="org.eclipse.core.resources.projectNature">
</test>
</and>
</iterate>
</with>
</enablement>
</commonWizard>
<commonWizard
@@ -106,12 +133,21 @@
type="new"
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.PIDSubsystemWizard">
<enablement>
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="org.eclipse.cdt.ui.CPerspective">
</equals>
</with>
<with
variable="selection">
<iterate>
<and>
<test
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.core.resources.projectNature">
</test>
<test
value="org.eclipse.cdt.core.cnature"
property="org.eclipse.core.resources.projectNature">
</test>
</and>
</iterate>
</with>
</enablement>
</commonWizard>
<commonWizard
@@ -119,12 +155,21 @@
type="new"
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.TriggerWizard">
<enablement>
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="org.eclipse.cdt.ui.CPerspective">
</equals>
</with>
<with
variable="selection">
<iterate>
<and>
<test
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.core.resources.projectNature">
</test>
<test
value="org.eclipse.cdt.core.cnature"
property="org.eclipse.core.resources.projectNature">
</test>
</and>
</iterate>
</with>
</enablement>
</commonWizard>
</extension>
@@ -147,10 +192,10 @@
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
class="edu.wpi.first.wpilib.plugins.cpp.launching.DeployLaunchShortcut"
description="Deploy the WPILib project to the athena board."
description="Deploy the WPILib project to the roboRIO"
icon="resources/icons/wpi.ico"
id="edu.wpi.first.wpilib.plugins.cpp.launching.deploy"
label="WPILib Deploy Configure Builder"
label="WPILib C++ Deploy"
modes="run,debug">
<contextualLaunch>
<enablement>
@@ -172,20 +217,20 @@
</enablement>
</contextualLaunch>
<description
description="Deploy the WPILib project to the athena board."
description="Deploy the WPILib project to the roboRIO"
mode="run">
</description>
<description
description="Deploy the WPILib project to the athena board and debug it."
description="Deploy the WPILib project to the roboRIO"
mode="debug">
</description>
</shortcut>
<shortcut
class="edu.wpi.first.wpilib.plugins.cpp.launching.SimulateLaunchShortcut"
description="Test the WPILib project using the Gazebo simulator."
icon="resources/icons/wpi.ico"
icon="resources/icons/Gazebo.png"
id="edu.wpi.first.wpilib.plugins.cpp.launching.simulate"
label="WPILib Simulate"
label="WPILib C++ Simulation"
modes="run,debug">
<contextualLaunch>
<enablement>

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

View File

@@ -28,20 +28,21 @@
<option id="gnu.cpp.compiler.option.optimization.level.549514425" 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.1682909384" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1597382905" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="$cpp-location/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="&quot;$cpp-location/include&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.963785380" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1367166630" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1568604896" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option id="gnu.cpp.link.option.paths.1928585110" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="$cpp-location/lib"/>
<listOptionValue builtIn="false" value="&quot;$cpp-location/lib&quot;"/>
</option>
<option id="gnu.cpp.link.option.libs.1072058280" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="WPILibAthena"/>
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="HALAthena"/>
<listOptionValue builtIn="false" value="NetworkTables"/>
<listOptionValue builtIn="false" value="FRC_FPGA_ChipObject"/>
<listOptionValue builtIn="false" value="FRC_NetworkCommunication"/>
<listOptionValue builtIn="false" value="i2c"/>
<listOptionValue builtIn="false" value="ni_emb"/>
@@ -56,8 +57,9 @@
<listOptionValue builtIn="false" value="dl"/>
<listOptionValue builtIn="false" value="pthread"/>
</option>
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,$cpp-location/lib" valueType="string"/>
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,&quot;$cpp-location/lib&quot;" valueType="string"/>
<option id="gnu.cpp.link.option.other.1891020896" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" valueType="stringList">
<listOptionValue builtIn="false" value="-export-dynamic"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1757265359" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -152,7 +154,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/sim/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.0"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.1"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.0"/>
</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"/>
@@ -167,7 +169,9 @@
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" 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"/>

View File

@@ -2,8 +2,9 @@
username=admin
password=
deploy.dir=/home/admin
deploy.run.command=./runcppprogram
deploy.debug.command=./debugcppprogram
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}
@@ -21,8 +22,11 @@ build.dir=build
out.exe=Debug/${out}
# Simulation
simulation.world.file=$world
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
sim.exe=Simulate/${out}
wpilib.sim=${wpilib}/sim
sim.tools=${wpilib.sim}/tools
sim.lib=${wpilib.sim}/lib
sim.lib=${wpilib.sim}/lib
# Use the current C++ library by default
cpp-version=current

View File

@@ -2,6 +2,7 @@
#define $classname_H
#include "../CommandBase.h"
#include "WPILib.h"
class $classname: public CommandBase
{

View File

@@ -6,7 +6,7 @@
ExampleSubsystem* CommandBase::examplesubsystem = NULL;
OI* CommandBase::oi = NULL;
CommandBase::CommandBase(std::string name) :
CommandBase::CommandBase(char const *name) :
Command(name)
{
}

View File

@@ -5,6 +5,7 @@
#include "Commands/Command.h"
#include "Subsystems/ExampleSubsystem.h"
#include "OI.h"
#include "WPILib.h"
/**
* The base for all commands. All atomic commands should subclass CommandBase.
@@ -14,7 +15,7 @@
class CommandBase: public Command
{
public:
CommandBase(std::string name);
CommandBase(char const *name);
CommandBase();
static void init();
// Create a single static instance of all of your subsystems

View File

@@ -2,6 +2,7 @@
#define $classname_H
#include "Commands/CommandGroup.h"
#include "WPILib.h"
class $classname: public CommandGroup
{

View File

@@ -2,6 +2,7 @@
#define EXAMPLE_COMMAND_H
#include "../CommandBase.h"
#include "WPILib.h"
class ExampleCommand: public CommandBase
{

View File

@@ -3,9 +3,6 @@
#include "SmartDashboard/SmartDashboard.h"
#include "LiveWindow/LiveWindow.h"
#@autogenerated_code("pid", "")
#parse("${exporter-path}PIDSubsystem-pid.cpp")
#end
$classname::$classname() :
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
{

View File

@@ -1,6 +1,7 @@
#ifndef ROBOTMAP_H
#define ROBOTMAP_H
#include "WPILib.h"
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into

View File

@@ -1,15 +1,12 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
#include "$classname.h"
/**
* New and improved C++
*/
public class $classname extends Trigger
$classname::$classname()
{
public:
bool get()
{
return false;
}
}
bool $classname::Get()
{
return false;
}

View File

@@ -1,9 +1,13 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
#ifndef $classname_H
#define $classname_H
public class $classname extends Trigger
#include "WPILib.h"
class $classname: public Trigger
{
public:
bool get();
}
$classname();
bool Get();
};
#endif

View File

@@ -26,9 +26,6 @@ DriveTrain::DriveTrain() : Subsystem("DriveTrain") {
right_encoder->SetDistancePerPulse((double) (4.0/12.0*M_PI) / 360.0);
#endif
left_encoder->Start();
right_encoder->Start();
rangefinder = new AnalogInput(6);
gyro = new Gyro(1);

View File

@@ -1,7 +1,6 @@
#ifndef DriveTrain_H
#define DriveTrain_H
#include "Commands/Subsystem.h"
#include "WPILib.h"
/**

View File

@@ -0,0 +1,59 @@
#include "WPILib.h"
class Robot: public IterativeRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
LiveWindow *lw;
int autoLoopCounter;
public:
Robot() :
myRobot(0, 1), // these must be initialized in the same order
stick(1), // as they are declared above.
lw(NULL),
autoLoopCounter(0)
{
myRobot.SetExpiration(0.1);
}
private:
void RobotInit()
{
lw = LiveWindow::GetInstance();
}
void AutonomousInit()
{
autoLoopCounter = 0;
}
void AutonomousPeriodic()
{
if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
{
myRobot.Drive(-0.5, 0.0); // drive forwards half speed
autoLoopCounter++;
} else {
myRobot.Drive(0.0, 0.0); // stop robot
}
}
void TeleopInit()
{
}
void TeleopPeriodic()
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
}
void TestPeriodic()
{
lw->Run();
}
};
START_ROBOT_CLASS(Robot);

View File

@@ -1,24 +0,0 @@
#include <networktables/NetworkTable.h>
#include <iostream>
using namespace std;
// This is a simple robot program
int main()
{
NetworkTable::SetServerMode();
NetworkTable::SetTeam(190);
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
cout << "Started up" << endl;
long i = 0;
while (true)
{
cout << i << endl;
table->PutNumber("i", i);
i++;
sleep(1);
}
return 0;
}

View File

@@ -9,7 +9,7 @@
* points than get none. When called sequentially, this command will block until
* the hot goal is detected or until it is timed out.
*/
class CheckForHotGoal : Command {
class CheckForHotGoal : public Command {
public:
CheckForHotGoal(double time);
void Initialize();

View File

@@ -6,6 +6,7 @@
#include "Commands/SetPivotSetpoint.h"
#include "Commands/DriveForward.h"
#include "Commands/Shoot.h"
#include "Commands/CheckForHotGoal.h"
DriveAndShootAutonomous::DriveAndShootAutonomous() {
AddSequential(new CloseClaw());

View File

@@ -43,8 +43,6 @@ DriveTrain::DriveTrain() :
leftEncoder->SetDistancePerPulse((4.0/*in*/*M_PI)/(360.0*12.0/*in/ft*/));
#endif
rightEncoder->Start();
leftEncoder->Start();
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Right Encoder", rightEncoder);
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Left Encoder", leftEncoder);

View File

@@ -1,17 +0,0 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
@@ -10,47 +11,34 @@
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>Getting Started with C++</name>
<description>Examples for getting started with FRC C++</description>
</tagDescription>
<example>
<name>Getting Started</name>
<description>An example program which demonstrates the simplest autonomous and
teleoperated routines.</description>
<tags>
<tag>Getting Started with C++</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/GettingStarted/src/Robot.cpp"
destination="src/Robot.cpp"></file>
</files>
</example>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<example>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.cpp" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>GearsBot</name>
@@ -59,7 +47,6 @@
supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src</package>
@@ -137,14 +124,12 @@
destination="src/Subsystems/Wrist.h"></file>
</files>
</example>
<example>
<name>PacGoat</name>
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src</package>

View File

@@ -1,19 +1,23 @@
#include "WPILib.h"
/**
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* This is a demo program showing the use of the RobotDrive class.
* The SampleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
* don't. Unless you know what you are doing, complex code will be much more difficult under
* this system. Use IterativeRobot or Command-Based instead if you're new.
*/
class Robot: public SimpleRobot
class Robot: public SampleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
public:
Robot() :
myRobot(1, 2), // these must be initialized in the same order
myRobot(0, 1), // these must be initialized in the same order
stick(1) // as they are declared above.
{
myRobot.SetExpiration(0.1);
@@ -31,7 +35,7 @@ public:
}
/**
* Runs the motors with arcade steering.
* Runs the motors with arcade steering.
*/
void OperatorControl()
{
@@ -48,7 +52,6 @@ public:
*/
void Test()
{
}
};

View File

@@ -58,13 +58,9 @@ public class WPILibCPPPlugin extends AbstractUIPlugin implements IStartup {
return plugin;
}
public String getDefaultToolchainVersion() {
return "arm-none-linux-gnueabi-4.4.1";
}
public String getToolchain() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "toolchains" + File.separator + getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_VERSION);
+ File.separator + "toolchains" + File.separator + "current";
}
public String getCurrentVersion() {
@@ -82,7 +78,7 @@ public class WPILibCPPPlugin extends AbstractUIPlugin implements IStartup {
public String getCPPDir() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "cpp" + File.separator + getPreferenceStore().getString(PreferenceConstants.LIBRARY_VERSION);
+ File.separator + "cpp" + File.separator + "current";
}
@Override

View File

@@ -1,11 +1,6 @@
package edu.wpi.first.wpilib.plugins.cpp.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
@@ -19,28 +14,23 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class CPPInstaller extends AbstractInstaller {
public CPPInstaller(String version) {
super(version);
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED), WPILibCPPPlugin.getDefault().getCPPDir());
}
@Override
protected String getFeatureName() {
return "cpp";
}
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_LIBRARY_VERSION)) {
WPILibCPPPlugin.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("cpp-version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.LIBRARY_VERSION, version);
}
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.LIBRARY_INSTALLED,
version);
}
@Override
protected InputStream getInstallResourceStream() {
return CPPInstaller.class.getResourceAsStream("/resources/cpp.zip");
}
@Override
protected String getFeatureName()
{
return "cpp";
}
}

View File

@@ -3,6 +3,7 @@ package edu.wpi.first.wpilib.plugins.cpp.launching;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.io.File;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.executables.Executable;
@@ -28,12 +29,13 @@ import org.eclipse.ui.PlatformUI;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
import edu.wpi.first.wpilib.plugins.core.launching.AntLauncher;
/**
* Launch shortcut base functionality, common for deploying to the robot.
* Retrieves the project the operation is being called on, and runs the correct
* ant targets based on polymorphically determined data values
*
*
* @author Ryan O'Meara
* @author Alex Henning
*/
@@ -46,7 +48,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
/**
* Returns the launch type of the shortcut that was used, one of the
* constants defined in BaseLaunchShortcut
*
*
* @return Launch shortcut type
*/
public String getLaunchType()
@@ -91,7 +93,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
}
/**
*
*
* @param activeProj
* The project that the script will be run on/from
* @param mode
@@ -99,23 +101,39 @@ public class DeployLaunchShortcut implements ILaunchShortcut
* ILaunchManager.DEBUG_MODE)
*/
public void runConfig(IProject activeProj, String mode, Shell shell) {
// TODO: figure out UI issues. that's why this is undocumented
ILaunchConfigurationWorkingCopy config;
try {
config = getRemoteDebugConfig(activeProj);
//config.doSave(); // NOTE: For debugging
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
//config.launch(mode, new NullProgressMonitor(), false, true);
DebugUITools.launch(config, mode);
} catch (CoreException e) {
WPILibCPPPlugin.logError("Debug attach failed.", e);
if(mode.equals(ILaunchManager.RUN_MODE)) {
// Regular deploys are done with an ant script for now, for both
// C++ and Java.
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
WPILibCPPPlugin.logInfo("Targets: deploy, Mode: " + mode);
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "deploy", null, mode);
} else {
// Debug deploys are done with the Eclipse Remote System Explorer,
// which lets it work with Eclipse's C++ debugger.
// Kill running program before using RSE as RSE can't
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
WPILibCPPPlugin.logInfo("Targets: kill-program, Mode: " + mode);
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "kill-program", null, mode);
// TODO: figure out UI issues. that's why this is undocumented
ILaunchConfigurationWorkingCopy config;
try {
config = getRemoteDebugConfig(activeProj);
//config.doSave(); // NOTE: For debugging
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
//config.launch(mode, new NullProgressMonitor(), false, true);
DebugUITools.launch(config, mode);
} catch (CoreException e) {
WPILibCPPPlugin.logError("Debug attach failed.", e);
}
try {
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
} catch (Exception e) {}
}
try {
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
} catch (Exception e) {}
}
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException
@@ -126,21 +144,37 @@ public class DeployLaunchShortcut implements ILaunchShortcut
String remote_connection = RSEUtils.getTarget(teamNumber).getName();
ILaunchConfigurationWorkingCopy config = type.newInstance(null, activeProj.getName());
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, "");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "org.eclipse.rse.remotecdt.RemoteGDBDebugger");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_REGISTER_GROUPS, "");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, "run");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, "main");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, true);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
Collection<Executable> exes = ExecutablesManager.getExecutablesManager().getExecutablesForProject(activeProj);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
exes.size() > 0 ? exes.toArray(new Executable[0])[0].getPath().makeRelativeTo(activeProj.getLocation()).toString():
"Debug/FRCUserProgram");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, WPILibCPPPlugin.getDefault().getToolchain() + "/bin/arm-none-linux-gnueabi-gdb");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, remote_connection);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "gdbserver");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false);
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, "2345");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, "gdbserver");
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, WPILibCPPPlugin.getDefault().getToolchain() + "/bin/arm-none-linux-gnueabi-gdb");
List<String> solibs = new ArrayList<>();
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/lib");
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/usr/lib");
solibs.add(WPILibCPPPlugin.getDefault().getCPPDir() + "/lib");
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, solibs);
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true);
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false);
config.doSave();
return config;
}
}

View File

@@ -16,8 +16,10 @@ public class RSEUtils {
public static IHost getTarget(int teamNumber) {
// The ip address based on the team number
String hostName = "10."+(teamNumber/100)+"."+(teamNumber%100)+".2";
String connectionName = hostName; //"Team "+teamNumber;
//String hostName = "10."+(teamNumber/100)+"."+(teamNumber%100)+".2";
//String connectionName = hostName; //"Team "+teamNumber;
String hostName = "roboRIO-" + teamNumber + ".local";
String connectionName = hostName;
// get the singleton RSE registry
try {

View File

@@ -1,118 +0,0 @@
package edu.wpi.first.wpilib.plugins.cpp.preferences;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.preferences.ComboFieldEditor;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
/**
* This class represents a preference page that
* is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
* us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
* are stored in the preference store that belongs to
* the main plug-in class. That way, preferences can
* be accessed directly via the preference store.
*/
public class CPPPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
ComboFieldEditor toolchainVersionEditor;
BooleanFieldEditor autoUpdateToolchainEditor;
private ComboFieldEditor wpiLibVersionEditor;
private BooleanFieldEditor autoUpdateEditor;
public CPPPreferencePage() {
super(GRID);
setPreferenceStore(WPILibCPPPlugin.getDefault().getPreferenceStore());
setDescription("Change workspace level settings for C++.");
}
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
* of preferences. Each field editor knows how to save and
* restore itself.
*/
public void createFieldEditors() {
wpiLibVersionEditor = new ComboFieldEditor(PreferenceConstants.LIBRARY_VERSION,
"&Library Version:", getFieldEditorParent(), getInstalledVersions());
addField(wpiLibVersionEditor);
autoUpdateEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_LIBRARY_VERSION,
"&Auto Update Library Version", getFieldEditorParent());
addField(autoUpdateEditor);
toolchainVersionEditor = new ComboFieldEditor(PreferenceConstants.TOOLCHAIN_VERSION,
"&Toolchain Version:", getFieldEditorParent(), getInstalledToolchains());
addField(toolchainVersionEditor);
autoUpdateToolchainEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION,
"&Auto Update Toolchain Version", getFieldEditorParent());
addField(autoUpdateToolchainEditor);
}
private List<String> getInstalledVersions() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"cpp")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
private List<String> getInstalledToolchains() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"toolchains")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
WPILibCPPPlugin.logInfo("Preferences initialized.");
Properties props = WPILibCore.getDefault().getProjectProperties(null);
getPreferenceStore().setValue(PreferenceConstants.LIBRARY_VERSION,
props.getProperty("cpp-version", WPILibCPPPlugin.getDefault().getCurrentVersion()));
}
@Override public void performApply() {
performOk();
}
@Override public boolean performOk() {
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("cpp-version", wpiLibVersionEditor.getChoice());
WPILibCore.getDefault().saveGlobalProperties(props);
return super.performOk();
}
}

View File

@@ -4,8 +4,6 @@ package edu.wpi.first.wpilib.plugins.cpp.preferences;
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String LIBRARY_VERSION = "libraryVersionPreference";
public static final String UPDATE_LIBRARY_VERSION = "udpateLibraryVersionPreference";
public static final String TOOLCHAIN_VERSION = "toolchainVersionPreference";
public static final String UPDATE_TOOLCHAIN_VERSION = "udpateToolchainVersionPreference";
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
public static final String TOOLCHAIN_INSTALLED = "toolchainVersion_current";
}

View File

@@ -18,11 +18,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibCPPPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.LIBRARY_VERSION,
WPILibCore.getDefault().getProjectProperties(null)
.getProperty("cpp-version", WPILibCPPPlugin.getDefault().getCurrentVersion()));
store.setDefault(PreferenceConstants.UPDATE_LIBRARY_VERSION, true);
store.setDefault(PreferenceConstants.TOOLCHAIN_VERSION, WPILibCPPPlugin.getDefault().getDefaultToolchainVersion());
store.setDefault(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION, true);
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
store.setValue(PreferenceConstants.LIBRARY_INSTALLED,
"none");
}
}

View File

@@ -8,13 +8,6 @@ import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
public class CPPProjectType implements ProjectType {
static ProjectType SIMPLE = new CPPProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/Robot.cpp", "simple/Robot.cpp");
return files;
}
};
static ProjectType ITERATIVE = new CPPProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
@@ -45,11 +38,18 @@ public class CPPProjectType implements ProjectType {
return files;
}
};
static ProjectType SAMPLE = new CPPProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/Robot.cpp", "sample/Robot.cpp");
return files;
}
};
@SuppressWarnings("serial")
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
put(ProjectType.SIMPLE, SIMPLE);
put(ProjectType.ITERATIVE, ITERATIVE);
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
put(ProjectType.SAMPLE, SAMPLE);
}};
@Override

View File

@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="athena-project-build" default="deploy">
<property file="${wpilib.ant.dir}/../so.properties"/>
<property name="opkg.name" value="wpilib" />
<property name="opkg.arch" value="armv7a-vfp" />
<!-- Load Tasks -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
@@ -23,107 +19,42 @@
<!-- Targets -->
<target name="get-target-ip">
<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>Target IP: ${target}</echo>
<property name="target" value="roboRIO-${team-number}.local" />
<echo>Target: ${target}</echo>
</target>
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="rm ${deploy.dir}/FRCUserProgram" />
username="${username}"
password="${password}"
trust="true"
failonerror="no"
command="rm ${deploy.dir}/FRCUserProgram" />
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="opkg info wpilib |grep Version | awk '{printf $2}'"
outputproperty="installedWpilibSo"/>
<if>
<equals arg1="${installedWpilibSo}" arg2="${cpp-sos}" />
<then>
<echo>Found version of WPILib: ${installedWpilibSo} (latest)</echo>
</then>
<else>
<echo>Found version of WPILib: ${installedWpilibSo}</echo>
<echo>Upgrading WPILib to ${cpp-sos}...</echo>
<delete>
<fileset dir="${wpilib.ant.dir}">
<include name="data.tar*" />
<include name="control*" />
<include name="post*" />
<include name="md5sums" />
<include name="*.deb" />
</fileset>
</delete>
<tar destfile="${wpilib.ant.dir}/data.tar">
<tarfileset dir="${wpilib.ant.dir}/../lib" username="root" group="admin" uid="0" gid="0"
prefix="usr/local/frc/lib">
<include name="libWPILibAthena.so" />
<include name="libNetworkTables.so" />
<include name="libHALAthena.so" />
</tarfileset>
</tar>
<gzip destfile="${wpilib.ant.dir}/data.tar.gz" src="${wpilib.ant.dir}/data.tar"/>
<echo file="${wpilib.ant.dir}/debian-binary">2.0</echo>
<echo file="${wpilib.ant.dir}/control">Package: ${opkg.name}
Version: ${cpp-sos}
Section: devel
Priority: optional
Architecture: ${opkg.arch}
Depends: libc6 (>= 2.11.1-r7), libgcc1 (>= 4.4.1)
Maintainer: Brad Miller &gt;bamiller@wpi.edu&lt;
Description: WPILib, NetworkTables and HAL for RoboRIO target
.
This package contains the shared objects for WPILib, NetworkTables, and HAL for the 2015 target on the RoboRIO
</echo>
<echo file="${wpilib.ant.dir}/postinst">#!/bin/sh
ldconfig
</echo>
<echo file="${wpilib.ant.dir}/postrm">#!/bin/sh
ldconfig
</echo>
<checksum property="md5.wpilib" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libWPILibAthena.so" />
<checksum property="md5.nwt" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libNetworkTables.so" />
<checksum property="md5.hal" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libHALAthena.so" />
<echo file="${wpilib.ant.dir}/md5sums">${md5.wpilib} usr/local/frc/lib/libWPILibAthena.so
${md5.nwt} usr/local/frc/lib/libNetworkTables.so
${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
<tar destfile="${wpilib.ant.dir}/control.tar">
<tarfileset dir="${wpilib.ant.dir}" username="root" group="admin" uid="0" gid="0"
prefix="">
<include name="control" />
<include name="md5sums" />
</tarfileset>
<tarfileset dir="${wpilib.ant.dir}" filemode="755" username="root" group="admin" uid="0" gid="0"
prefix="">
<include name="postinst" />
<include name="postrm" />
</tarfileset>
</tar>
<gzip destfile="${wpilib.ant.dir}/control.tar.gz" src="${wpilib.ant.dir}/control.tar"/>
<exec command="${wpilib.ant.dir}\..\..\..\toolchains\arm-none-linux-gnueabi-4.4.1\bin\arm-none-linux-gnueabi-ar -r ${opkg.name}_${cpp-sos}_${opkg.arch}.deb debian-binary control.tar.gz data.tar.gz" dir="${wpilib.ant.dir}"/>
<scp file="${wpilib.ant.dir}/${opkg.name}_${cpp-sos}_${opkg.arch}.deb" todir="${username}@${target}:/tmp"
password="${password}" trust="true"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="opkg install /tmp/${opkg.name}_${cpp-sos}_${opkg.arch}.deb; sh -c 'rm -rf /tmp/wpilib*.deb'"/>
</else>
</if>
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>
<echo>[athena-deploy] Starting program.</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="chmod +x ${deploy.dir}/FRCUserProgram; ${deploy.dir}/FRCUserProgram"/>
username="${username}"
password="${password}"
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">
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
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.">
@@ -171,4 +102,4 @@ ${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
</sequential>
</parallel>
</target>
</project>
</project>

View File

@@ -0,0 +1 @@
/home/admin/FRCUserProgram

View File

@@ -67,10 +67,16 @@
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandWizard">
<enablement>
<with variable="selection"><iterate>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<and>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<test
args="org.eclipse.jdt.core.javanature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
</and>
</iterate></with>
</enablement>
</commonWizard>
@@ -80,10 +86,16 @@
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandGroupWizard">
<enablement>
<with variable="selection"><iterate>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<and>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<test
args="org.eclipse.jdt.core.javanature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
</and>
</iterate></with>
</enablement>
</commonWizard>
@@ -93,10 +105,16 @@
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.SubsystemWizard">
<enablement>
<with variable="selection"><iterate>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<and>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<test
args="org.eclipse.jdt.core.javanature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
</and>
</iterate></with>
</enablement>
</commonWizard>
@@ -106,10 +124,16 @@
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.PIDSubsystemWizard">
<enablement>
<with variable="selection"><iterate>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<and>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<test
args="org.eclipse.jdt.core.javanature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
</and>
</iterate></with>
</enablement>
</commonWizard>
@@ -119,23 +143,20 @@
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.TriggerWizard">
<enablement>
<with variable="selection"><iterate>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<and>
<test
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
<test
args="org.eclipse.jdt.core.javanature"
property="org.eclipse.jdt.launching.hasProjectNature">
</test>
</and>
</iterate></with>
</enablement>
</commonWizard>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="edu.wpi.first.wpilib.plugins.core.preferences.WPILibPreferencePage"
class="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
id="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
name="Java Preferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
@@ -146,10 +167,10 @@
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
class="edu.wpi.first.wpilib.plugins.java.launching.DeployLaunchShortcut"
description="Deploy the WPILib project to the athena board."
description="Deploy the WPILib project to the roboRIO"
icon="resources/icons/wpi.ico"
id="edu.wpi.first.wpilib.plugins.java.launching.deploy"
label="WPILib Deploy"
label="WPILib Java Deploy"
modes="run,debug">
<contextualLaunch>
<enablement>
@@ -171,11 +192,11 @@
</enablement>
</contextualLaunch>
<description
description="Deploy the WPILib project to the athena board."
description="Deploy the WPILib project to the roboRIO board."
mode="run">
</description>
<description
description="Deploy the WPILib project to the athena board and debug it."
description="Deploy the WPILib project to the roboRIO board and debug it."
mode="debug">
</description>
</shortcut>
@@ -184,7 +205,7 @@
description="Test your WPILib program with the Gazebo simulator."
icon="resources/icons/Gazebo.png"
id="edu.wpi.first.wpilib.plugins.java.launching.simulate"
label="WPILib Simulation"
label="WPILib Java Simulation"
modes="run,debug">
<contextualLaunch>
<enablement>

View File

@@ -92,7 +92,7 @@
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
<outputDirectory>${java-zip}/lib</outputDirectory>
@@ -100,6 +100,13 @@
</artifactItem>
<!-- Javadoc -->
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
@@ -132,6 +139,12 @@
<artifactId>JavaGazebo</artifactId>
<version>0.1.0-SNAPSHOT</version>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaSim</artifactId>
@@ -323,6 +336,12 @@
<version>0.1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<!-- dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
@@ -348,6 +367,11 @@
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<!-- Javadoc -->
<dependency>
@@ -356,5 +380,11 @@
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,38 @@
package $package;
import edu.wpi.first.wpilibj.buttons.Button;
import $package.commands.ExampleCommand;
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
*/
public class OI {
//// CREATING BUTTONS
// One type of button is a joystick button which is any button on a joystick.
// You create one by telling it which joystick it's on and which button
// number it is.
// Joystick stick = new Joystick(port);
// Button button = new JoystickButton(stick, buttonNumber);
// There are a few additional built in buttons you can use. Additionally,
// by subclassing Button you can create custom triggers and bind those to
// commands the same as any other Button.
//// TRIGGERING COMMANDS WITH BUTTONS
// Once you have a button, it's trivial to bind it to a button in one of
// three ways:
// Start the command when the button is pressed and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenPressed(new ExampleCommand());
// Run the command while the button is being held down and interrupt it once
// the button is released.
// button.whileHeld(new ExampleCommand());
// Start the command when the button is released and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenReleased(new ExampleCommand());
}

View File

@@ -18,6 +18,7 @@ import $package.subsystems.ExampleSubsystem;
public class Robot extends IterativeRobot {
public static final ExampleSubsystem exampleSubsystem = new ExampleSubsystem();
public static OI oi;
Command autonomousCommand;
@@ -26,6 +27,7 @@ public class Robot extends IterativeRobot {
* used for any initialization code.
*/
public void robotInit() {
oi = new OI();
// instantiate the command used for the autonomous period
autonomousCommand = new ExampleCommand();
}

View File

@@ -0,0 +1,18 @@
package $package;
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into
* to a variable name. This provides flexibility changing wiring, makes checking
* the wiring easier and significantly reduces the number of magic numbers
* floating around.
*/
public class RobotMap {
// For example to map the left and right motors, you could define the
// following variables to use with your drivetrain subsystem.
// public static final int leftMotor = 1;
// public static final int rightMotor = 2;
// If you are using multiple modules, make sure to define both the port
// number and the module. For example you with a rangefinder:
// public static final int rangefinderPort = 1;
// public static final int rangefinderModule = 1;
}

View File

@@ -1,6 +1,6 @@
package $package;
import edu.wpi.first.wpilibj.command.Trigger;
import edu.wpi.first.wpilibj.buttons.Trigger;
/**
*

View File

@@ -51,9 +51,6 @@ public class DriveTrain extends Subsystem {
left_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
right_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
}
left_encoder.start();
right_encoder.start();
rangefinder = new AnalogInput(6);
gyro = new Gyro(1);

View File

@@ -0,0 +1,69 @@
package $package;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot {
RobotDrive myRobot;
Joystick stick;
int autoLoopCounter;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
myRobot = new RobotDrive(0,1);
stick = new Joystick(1);
}
/**
* This function is run once each time the robot enters autonomous mode
*/
public void autonomousInit() {
autoLoopCounter = 0;
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
{
myRobot.drive(-0.5, 0.0); // drive forwards half speed
autoLoopCounter++;
} else {
myRobot.drive(0.0, 0.0); // stop robot
}
}
/**
* This function is called once each time the robot enters tele-operated mode
*/
public void teleopInit(){
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
myRobot.arcadeDrive(stick);
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
LiveWindow.run();
}
}

View File

@@ -1,39 +0,0 @@
package $package;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
/**
* An example of a network table counter.
*
* @author Team $team-number
*/
public class Robot {
private static NetworkTable table;
/**
* @param args
*/
public static void main(String[] args) {
NetworkTable.setServerMode();
NetworkTable.setTeam(190);
table = NetworkTable.getTable("SmartDashboard");
System.out.println("Started up");
long i = 0;
while (true) {
System.out.println(i);
table.putNumber("i", i);
i++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

View File

@@ -33,7 +33,7 @@ public class Robot extends IterativeRobot {
public static Collector collector;
public static Shooter shooter;
public static Pneumatics pneumatics;
public static Pivot pivot;;
public static Pivot pivot;
public SendableChooser autoChooser;
public SendableChooser autonomousDirectionChooser;

View File

@@ -63,8 +63,6 @@ public class DriveTrain extends Subsystem {
leftEncoder.setDistancePerPulse((4.0/*in*/*Math.PI)/(360.0*12.0/*in/ft*/));
}
rightEncoder.start();
leftEncoder.start();
LiveWindow.addSensor("DriveTrain", "Right Encoder", rightEncoder);
LiveWindow.addSensor("DriveTrain", "Left Encoder", leftEncoder);

View File

@@ -1,17 +0,0 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,63 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
</tagDescription>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<tagDescription>
<name>Network Tables</name>
<description>Examples of how to use Network Tables to accomplish a
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>Getting Started with Java</name>
<description>Examples for getting started with FRC Java</description>
</tagDescription>
<example>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
<name>Getting Started</name>
<description>An example program which demonstrates the simplest autonomous and
teleoperated routines.</description>
<tags>
<tag>Getting Started with Java</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/GettingStarted/src/org/usfirst/frc/team190/robot/Robot.java"
destination="src/$package-dir/Robot.java"></file>
</files>
</example>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<example>
<name>GearsBot</name>
<description>A fully functional example CommandBased program for WPIs GearsBot robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src/$package-dir</package>
@@ -90,8 +76,6 @@
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src/$package-dir</package>

View File

@@ -0,0 +1,62 @@
package $package;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
/**
* This is a demo program showing the use of the RobotDrive class.
* The SampleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SampleRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
* don't. Unless you know what you are doing, complex code will be much more difficult under
* this system. Use IterativeRobot or Command-Based instead if you're new.
*/
public class Robot extends SampleRobot {
RobotDrive myRobot;
Joystick stick;
public Robot() {
myRobot = new RobotDrive(0, 1);
myRobot.setExpiration(0.1);
stick = new Joystick(1);
}
/**
* Drive left & right motors for 2 seconds then stop
*/
public void autonomous() {
myRobot.setSafetyEnabled(false);
myRobot.drive(-0.5, 0.0); // drive forwards half speed
Timer.delay(2.0); // for 2 seconds
myRobot.drive(0.0, 0.0); // stop robot
}
/**
* Runs the motors with arcade steering.
*/
public void operatorControl() {
myRobot.setSafetyEnabled(true);
while (isOperatorControl()) {
myRobot.arcadeDrive(stick); // drive with arcade style (use right stick)
Timer.delay(0.005); // wait for a motor update time
}
}
/**
* Runs during test mode
*/
public void test() {
}
}

View File

@@ -1,35 +0,0 @@
package $package;
import edu.wpi.first.wpilibj.SimpleRobot;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SimpleRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends SimpleRobot {
/**
* This function is called once each time the robot enters autonomous mode.
*/
public void autonomous() {
}
/**
* This function is called once each time the robot enters operator control.
*/
public void operatorControl() {
}
/**
* This function is called once each time the robot enters test mode.
*/
public void test() {
}
}

View File

@@ -78,12 +78,16 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
return "DEVELOPMENT";
}
}
public String getJavaPath() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "java" + File.separator + "current";
}
public Properties getProjectProperties(IProject project) {
Properties defaults = WPILibCore.getDefault().getProjectProperties(project);
Properties props;
try {
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/"+getCurrentVersion()+"/ant/build.properties");
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/current/ant/build.properties");
props = new AntPropertiesParser(new FileInputStream(file)).getProperties(defaults);
} catch (Exception e) {
WPILibJavaPlugin.logError("Error getting properties.", e);
@@ -100,11 +104,15 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
IProject[] projects = root.getProjects();
// Loop over all projects
for (IProject project : projects) {
try {
updateVariables(project);
} catch (CoreException e) {
WPILibJavaPlugin.logError("Error updating projects.", e);
}
try {
if(project.hasNature("edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature")){
WPILibJavaPlugin.logInfo("Updating project");
updateVariables(project);
} else {
}
} catch (CoreException e) {
WPILibJavaPlugin.logError("Error updating projects.", e);
}
}
}

View File

@@ -1,11 +1,8 @@
package edu.wpi.first.wpilib.plugins.java.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
import edu.wpi.first.wpilib.plugins.java.preferences.PreferenceConstants;
@@ -19,7 +16,9 @@ import edu.wpi.first.wpilib.plugins.java.preferences.PreferenceConstants;
public class JavaInstaller extends AbstractInstaller {
public JavaInstaller(String version) {
super(version);
super(version,
WPILibJavaPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED),
WPILibJavaPlugin.getDefault().getJavaPath());
}
@Override
@@ -30,14 +29,7 @@ public class JavaInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibJavaPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_LIBRARY_VERSION)) {
WPILibJavaPlugin.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.LIBRARY_VERSION, version);
}
WPILibJavaPlugin.getDefault().updateProjects();
prefs.setValue(PreferenceConstants.LIBRARY_INSTALLED, version);
}
@Override

View File

@@ -1,96 +0,0 @@
package edu.wpi.first.wpilib.plugins.java.preferences;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.preferences.ComboFieldEditor;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
/**
* This class represents a preference page that
* is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
* us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
* are stored in the preference store that belongs to
* the main plug-in class. That way, preferences can
* be accessed directly via the preference store.
*/
public class JavaPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
ComboFieldEditor wpiLibVersionEditor;
BooleanFieldEditor autoUpdateEditor;
public JavaPreferencePage() {
super(GRID);
setPreferenceStore(WPILibJavaPlugin.getDefault().getPreferenceStore());
setDescription("Change workspace level settings for Java.");
}
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
* of preferences. Each field editor knows how to save and
* restore itself.
*/
public void createFieldEditors() {
wpiLibVersionEditor = new ComboFieldEditor(PreferenceConstants.LIBRARY_VERSION,
"&Library Version:", getFieldEditorParent(), getInstalledVersions());
addField(wpiLibVersionEditor);
autoUpdateEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_LIBRARY_VERSION,
"&Auto Update Library Version", getFieldEditorParent());
addField(autoUpdateEditor);
}
private List<String> getInstalledVersions() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"java")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
WPILibJavaPlugin.logInfo("Preferences initialized.");
Properties props = WPILibCore.getDefault().getProjectProperties(null);
getPreferenceStore().setValue(PreferenceConstants.LIBRARY_VERSION,
props.getProperty("version", WPILibJavaPlugin.getDefault().getCurrentVersion()));
}
@Override public void performApply() {
performOk();
}
@Override public boolean performOk() {
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", wpiLibVersionEditor.getChoice());
WPILibCore.getDefault().saveGlobalProperties(props);
WPILibJavaPlugin.getDefault().updateProjects();
return super.performOk();
}
}

View File

@@ -4,6 +4,5 @@ package edu.wpi.first.wpilib.plugins.java.preferences;
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String LIBRARY_VERSION = "libraryVersionPreference";
public static final String UPDATE_LIBRARY_VERSION = "udpateLibraryVersionPreference";
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
}

View File

@@ -18,9 +18,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibJavaPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.LIBRARY_VERSION,
WPILibCore.getDefault().getProjectProperties(null)
.getProperty("version", WPILibJavaPlugin.getDefault().getCurrentVersion()));
store.setDefault(PreferenceConstants.UPDATE_LIBRARY_VERSION, true);
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
store.setValue(PreferenceConstants.LIBRARY_INSTALLED, "none");
}
}

View File

@@ -8,10 +8,10 @@ import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
public class JavaProjectType implements ProjectType {
static ProjectType SIMPLE = new JavaProjectType() {
static ProjectType SAMPLE = new JavaProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "simple/Robot.java");
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "sample/Robot.java");
return files;
}
};
@@ -33,6 +33,8 @@ public class JavaProjectType implements ProjectType {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "command-based/Robot.java");
files.put("src/"+packageName.replace(".", "/")+"/RobotMap.java", "command-based/RobotMap.java");
files.put("src/"+packageName.replace(".", "/")+"/OI.java", "command-based/OI.java");
files.put("src/"+packageName.replace(".", "/")+"/commands/ExampleCommand.java", "command-based/ExampleCommand.java");
files.put("src/"+packageName.replace(".", "/")+"/subsystems/ExampleSubsystem.java", "command-based/ExampleSubsystem.java");
return files;
@@ -40,7 +42,7 @@ public class JavaProjectType implements ProjectType {
};
@SuppressWarnings("serial")
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
put(ProjectType.SIMPLE, SIMPLE);
put(ProjectType.SAMPLE, SAMPLE);
put(ProjectType.ITERATIVE, ITERATIVE);
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
}};

View File

@@ -2,10 +2,12 @@
username=admin
password=
deploy.dir=/home/admin
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.debug.command = /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar ${deploy.dir}/FRCUserProgram.jar
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/
command.dir=/home/lvuser/
version=current
# Libraries to use
wpilib=${user.home}/wpilib/java/${version}

View File

@@ -19,10 +19,8 @@
<!-- Targets -->
<target name="get-target-ip">
<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>Target IP: ${target}</echo>
<property name="target" value="roboRIO-${team-number}.local" />
<echo>Target: ${target}</echo>
</target>
<target name="compile" description="Compile the source code.">
@@ -34,9 +32,9 @@
includeAntRuntime="no"
includeJavaRuntime="no"
classpath="${classpath}"
target="1.7"
source="1.7"
compiler="javac1.7"
target="${ant.java.version}"
source="${ant.java.version}"
compiler="javac${ant.java.version}"
debug="true">
</javac>
</target>
@@ -78,25 +76,35 @@
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; chmod a+x run*program; ${deploy.kill.command};"/>
command="${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="tail -f -s 0 -n 1 ${deploy.log.file}"/>
command="${deploy.log.command}"/>
</target>
<target name="debug-deploy" depends="get-target-ip,jar" 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 -->
<scp file="${wpilib.ant.dir}/robotDebugCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
<!-- The frcdebug file is used as a flag for /usr/local/frc/bin/frcRunRobot.sh to run the robot program in debug mode -->
<scp file="${wpilib.ant.dir}/frcdebug" todir="${username}@${target}:${debug.flag.dir}" password="${password}" trust="true"/>
<echo>[athena-deploy] Starting program.</echo>
<echo>[athena-deploy] Starting Debug program.</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; ${deploy.debug.command}"/>
username="${username}"
password="${password}"
trust="true"
command="${deploy.kill.command}"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
</target>
<!-- Simulate -->

View File

@@ -0,0 +1,2 @@
# This file is used as a flag to determine if debugging should be used.
# It is uploaded to the robot when launched in debug mode and should be removed automatically once used.

View File

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

View File

@@ -12,7 +12,7 @@
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature_0.2.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature" version="0.2.0">
<category name="edu.wpi.first.wpilib.plugins.cpp.toolchains"/>
</feature>
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature_0.2.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature" version="0.2.0">
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature_0.3.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature" version="0.3.0">
<category name="edu.wpi.first.wpilib.plugins.cpp.toolchains"/>
</feature>
<category-def name="edu.wpi.first.wpilib.plugins" label="WPILib Robot Development">

View File

@@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 2.8)
project(HAL)
file(GLOB_RECURSE SRC_FILES lib/Athena/*.cpp)
include_directories(lib/Athena include)
include_directories(lib/Athena lib/Athena/FRC_FPGA_ChipObject include)
add_library(HALAthena STATIC ${SRC_FILES})
target_link_libraries(HALAthena ${NI_LIBS})
INSTALL(TARGETS HALAthena ARCHIVE DESTINATION lib COMPONENT lib)
INSTALL(FILES ${NI_LIBS} DESTINATION lib COMPONENT ni_lib)
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
# lib/ c m gcc_s ld-linux
# usr/lib stdc++
# usr/lib
# FRC_NetworkCommunication FRC_FPGA_ChipObject RoboRIO_FRC_ChipObject

View File

@@ -0,0 +1,15 @@
#pragma once
enum AccelerometerRange {
kRange_2G = 0,
kRange_4G = 1,
kRange_8G = 2,
};
extern "C" {
void setAccelerometerActive(bool);
void setAccelerometerRange(AccelerometerRange);
double getAccelerometerX();
double getAccelerometerY();
double getAccelerometerZ();
}

View File

@@ -26,11 +26,9 @@ extern "C"
void* initializeAnalogInputPort(void* port_pointer, int32_t *status);
bool checkAnalogModule(uint8_t module);
bool checkAnalogInputChannel(uint32_t pin);
void setAnalogSampleRate(double samplesPerSecond, int32_t *status);
float getAnalogSampleRate(int32_t *status);
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status);
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status);
void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status);
void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
@@ -71,14 +69,11 @@ extern "C"
//// Float JNA Hack
// Float
int getAnalogSampleRateIntHack(int32_t *status);
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status);
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status);
int getAnalogAverageVoltageIntHack(void* analog_port_pointer, int32_t *status);
// Doubles
void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status);
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond,
int32_t *status);
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status);
void setAnalogTriggerLimitsVoltageIntHack(void* analog_trigger_pointer, int lower, int upper,
int32_t *status);

View File

@@ -1,15 +1,26 @@
#pragma once
#ifdef __vxworks
#include <vxWorks.h>
#else
#include <stdint.h>
#endif
#include "NetworkCommunication/CANSessionMux.h"
extern "C"
{
void JaguarCANSendMessage(uint32_t messageID, const uint8_t *data, uint8_t dataSize,
int32_t *status);
void JaguarCANReceiveMessage(uint32_t *messageID, uint8_t *data, uint8_t *dataSize,
uint32_t timeoutMs, int32_t *status);
}
void canTxSend(uint32_t arbID, uint8_t length, int32_t period = CAN_SEND_PERIOD_NO_REPEAT);
void canTxPackInt8 (uint32_t arbID, uint8_t offset, uint8_t value);
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value);
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value);
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value);
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value);
uint8_t canTxUnpackInt8 (uint32_t arbID, uint8_t offset);
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset);
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset);
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset);
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset);
bool canRxReceive(uint32_t arbID);
uint8_t canRxUnpackInt8 (uint32_t arbID, uint8_t offset);
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset);
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset);
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset);
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset);

View File

@@ -4,6 +4,7 @@
#else
#include <stdint.h>
#endif
#include "HAL/cpp/Synchronized.hpp"
enum Mode
{
@@ -12,40 +13,23 @@ enum Mode
kPulseLength = 2,
kExternalDirection = 3
};
enum tSPIConstants
{
kReceiveFIFODepth = 512,
kTransmitFIFODepth = 512
};
enum tFrameMode
{
kChipSelect,
kPreLatchPulse,
kPostLatchPulse,
kPreAndPostLatchPulse
};
extern "C"
{
void* initializeDigitalPort(void* port_pointer, int32_t *status);
bool checkDigitalModule(uint8_t module);
bool checkPWMChannel(void* digital_port_pointer);
bool checkRelayChannel(void* digital_port_pointer);
void setPWM(void* digital_port_pointer, unsigned short value, int32_t *status);
bool allocatePWMChannel(void* digital_port_pointer, int32_t *status);
void freePWMChannel(void* digital_port_pointer, int32_t *status);
unsigned short getPWM(void* digital_port_pointer, int32_t *status);
void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t *status);
void* allocatePWM(int32_t *status);
void* allocatePWMWithModule(uint8_t module, int32_t *status);
void freePWM(void* pwmGenerator, int32_t *status);
void freePWMWithModule(uint8_t module, void* pwmGenerator, int32_t *status);
void setPWMRate(double rate, int32_t *status);
void setPWMRateWithModule(uint8_t module, double rate, int32_t *status);
void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status);
void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCycle,
int32_t *status);
void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status);
void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t pin,
int32_t *status);
void setRelayForward(void* digital_port_pointer, bool on, int32_t *status);
void setRelayReverse(void* digital_port_pointer, bool on, int32_t *status);
@@ -60,18 +44,15 @@ extern "C"
void pulse(void* digital_port_pointer, double pulseLength, int32_t *status);
bool isPulsing(void* digital_port_pointer, int32_t *status);
bool isAnyPulsing(int32_t *status);
bool isAnyPulsingWithModule(uint8_t module, int32_t *status);
void* initializeCounter(Mode mode, uint32_t *index, int32_t *status);
void freeCounter(void* counter_pointer, int32_t *status);
void setCounterAverageSize(void* counter_pointer, int32_t size, int32_t *status);
void setCounterUpSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
bool analogTrigger, int32_t *status); // TODO: Without Module
void setCounterUpSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
void setCounterUpSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
int32_t *status);
void clearCounterUpSource(void* counter_pointer, int32_t *status);
void setCounterDownSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
bool analogTrigger, int32_t *status); // TODO: Without Module
void setCounterDownSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
void setCounterDownSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
int32_t *status);
void clearCounterDownSource(void* counter_pointer, int32_t *status);
@@ -110,48 +91,30 @@ extern "C"
uint32_t getEncoderSamplesToAverage(void* encoder_pointer, int32_t *status);
uint16_t getLoopTiming(int32_t *status);
uint16_t getLoopTimingWithModule(uint8_t module, int32_t *status);
void* initializeSPI(uint8_t sclk_routing_module, uint32_t sclk_routing_pin,
uint8_t mosi_routing_module, uint32_t mosi_routing_pin, uint8_t miso_routing_module,
uint32_t miso_routing_pin, int32_t *status);
void cleanSPI(void* spi_pointer, int32_t *status);
void setSPIBitsPerWord(void* spi_pointer, uint32_t bits, int32_t *status);
uint32_t getSPIBitsPerWord(void* spi_pointer, int32_t *status);
void setSPIClockRate(void* spi_pointer, double hz, int32_t *status);
void setSPIMSBFirst(void* spi_pointer, int32_t *status);
void setSPILSBFirst(void* spi_pointer, int32_t *status);
void setSPISampleDataOnFalling(void* spi_pointer, int32_t *status);
void setSPISampleDataOnRising(void* spi_pointer, int32_t *status);
void setSPISlaveSelect(void* spi_pointer, uint8_t ss_routing_module, uint32_t ss_routing_pin,
int32_t *status);
void setSPILatchMode(void* spi_pointer, tFrameMode mode, int32_t *status);
tFrameMode getSPILatchMode(void* spi_pointer, int32_t *status);
void setSPIFramePolarity(void* spi_pointer, bool activeLow, int32_t *status);
bool getSPIFramePolarity(void* spi_pointer, int32_t *status);
void setSPIClockActiveLow(void* spi_pointer, int32_t *status);
void setSPIClockActiveHigh(void* spi_pointer, int32_t *status);
void applySPIConfig(void* spi_pointer, int32_t *status);
uint16_t getSPIOutputFIFOAvailable(void* spi_pointer, int32_t *status);
uint16_t getSPINumReceived(void* spi_pointer, int32_t *status);
bool isSPIDone(void* spi_pointer, int32_t *status);
bool hadSPIReceiveOverflow(void* spi_pointer, int32_t *status);
void writeSPI(void* spi_pointer, uint32_t data, int32_t *status);
uint32_t readSPI(void* spi_pointer, bool initiate, int32_t *status);
void resetSPI(void* spi_pointer, int32_t *status);
void clearSPIReceivedData(void* spi_pointer, int32_t *status);
void spiInitialize(uint8_t port, int32_t *status);
int32_t spiTransaction(uint8_t port, uint8_t *dataToSend, uint8_t *dataReceived, uint8_t size);
int32_t spiWrite(uint8_t port, uint8_t* dataToSend, uint8_t sendSize);
int32_t spiRead(uint8_t port, uint8_t *buffer, uint8_t count);
void spiClose(uint8_t port);
void spiSetSpeed(uint8_t port, uint32_t speed);
void spiSetBitsPerWord(uint8_t port, uint8_t bpw);
void spiSetOpts(uint8_t port, int msb_first, int sample_on_trailing, int clk_idle_high);
void spiSetChipSelectActiveHigh(uint8_t port, int32_t *status);
void spiSetChipSelectActiveLow(uint8_t port, int32_t *status);
int32_t spiGetHandle(uint8_t port);
void spiSetHandle(uint8_t port, int32_t handle);
MUTEX_ID spiGetSemaphore(uint8_t port);
void spiSetSemaphore(uint8_t port, MUTEX_ID semaphore);
void i2CInitialize(uint8_t port, int32_t *status);
int i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
int i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
int i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
int32_t i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
int32_t i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
int32_t i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
void i2CClose(uint8_t port);
//// Float JNA Hack
// double
void setPWMRateIntHack(int rate, int32_t *status);
void setPWMRateWithModuleIntHack(uint8_t module, int32_t rate, int32_t *status);
void setPWMDutyCycleIntHack(void* pwmGenerator, int32_t dutyCycle, int32_t *status);
void setPWMDutyCycleWithModuleIntHack(uint8_t module, void* pwmGenerator, int32_t dutyCycle,
int32_t *status);
}

View File

@@ -3,7 +3,7 @@
#define SAMPLE_RATE_TOO_HIGH 1
#define SAMPLE_RATE_TOO_HIGH_MESSAGE "Analog module sample rate is too high"
#define VOLTAGE_OUT_OF_RANGE 2
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [-10; 10]"
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [0; 5]"
#define LOOP_TIMING_ERROR 4
#define LOOP_TIMING_ERROR_MESSAGE "Digital module loop timing is not the expected value"
#define SPI_WRITE_NO_MOSI 12

View File

@@ -12,7 +12,9 @@
#endif
#include <cmath>
#include "Accelerometer.hpp"
#include "Analog.hpp"
#include "CAN.hpp"
#include "Compressor.hpp"
#include "Digital.hpp"
#include "Solenoid.hpp"
@@ -20,6 +22,7 @@
#include "Interrupts.hpp"
#include "Errors.hpp"
#include "PDP.hpp"
#include "Power.hpp"
#include "Utilities.hpp"
#include "Semaphore.hpp"
@@ -28,7 +31,6 @@
#define HAL_IO_CONFIG_DATA_SIZE 32
#define HAL_SYS_STATUS_DATA_SIZE 44
#define HAL_USER_STATUS_DATA_SIZE (984 - HAL_IO_CONFIG_DATA_SIZE - HAL_SYS_STATUS_DATA_SIZE)
#define HAL_USER_DS_LCD_DATA_SIZE 128
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
@@ -140,119 +142,32 @@ namespace HALUsageReporting
};
}
struct HALCommonControlData
{
uint16_t packetIndex;
union
{
uint8_t control;
#ifndef __vxworks
struct
{
uint8_t checkVersions :1;
uint8_t test :1;
uint8_t resync :1;
uint8_t fmsAttached :1;
uint8_t autonomous :1;
uint8_t enabled :1;
uint8_t notEStop :1;
uint8_t reset :1;
};
#else
struct
{
uint8_t reset : 1;
uint8_t notEStop : 1;
uint8_t enabled : 1;
uint8_t autonomous : 1;
uint8_t fmsAttached:1;
uint8_t resync : 1;
uint8_t test :1;
uint8_t checkVersions :1;
};
#endif
};
uint8_t dsDigitalIn;
uint16_t teamID;
char dsID_Alliance;
char dsID_Position;
union
{
int8_t stick0Axes[6];
struct
{ // TODO: ???
int8_t stick0Axis1;
int8_t stick0Axis2;
int8_t stick0Axis3;
int8_t stick0Axis4;
int8_t stick0Axis5;
int8_t stick0Axis6;
};
};
uint16_t stick0Buttons; // Left-most 4 bits are unused
union
{
int8_t stick1Axes[6];
struct
{ // TODO: ???
int8_t stick1Axis1;
int8_t stick1Axis2;
int8_t stick1Axis3;
int8_t stick1Axis4;
int8_t stick1Axis5;
int8_t stick1Axis6;
};
};
uint16_t stick1Buttons; // Left-most 4 bits are unused
union
{
int8_t stick2Axes[6];
struct
{ // TODO: ???
int8_t stick2Axis1;
int8_t stick2Axis2;
int8_t stick2Axis3;
int8_t stick2Axis4;
int8_t stick2Axis5;
int8_t stick2Axis6;
};
};
uint16_t stick2Buttons; // Left-most 4 bits are unused
union
{
int8_t stick3Axes[6];
struct
{ // TODO: ???
int8_t stick3Axis1;
int8_t stick3Axis2;
int8_t stick3Axis3;
int8_t stick3Axis4;
int8_t stick3Axis5;
int8_t stick3Axis6;
};
};
uint16_t stick3Buttons; // Left-most 4 bits are unused
//Analog inputs are 10 bit right-justified
uint16_t analog1;
uint16_t analog2;
uint16_t analog3;
uint16_t analog4;
uint64_t cRIOChecksum;
uint32_t FPGAChecksum0;
uint32_t FPGAChecksum1;
uint32_t FPGAChecksum2;
uint32_t FPGAChecksum3;
char versionData[8];
struct HALControlWord {
uint32_t enabled : 1;
uint32_t autonomous : 1;
uint32_t test :1;
uint32_t eStop : 1;
uint32_t fmsAttached:1;
uint32_t dsAttached:1;
uint32_t control_reserved : 26;
};
enum HALAllianceStationID {
kHALAllianceStationID_red1,
kHALAllianceStationID_red2,
kHALAllianceStationID_red3,
kHALAllianceStationID_blue1,
kHALAllianceStationID_blue2,
kHALAllianceStationID_blue3,
};
struct HALJoystickAxes {
uint16_t count;
int16_t axes[6];
};
typedef uint32_t HALJoystickButtons;
inline float intToFloat(int value)
{
return (float)value;
@@ -278,18 +193,16 @@ extern "C"
uint32_t getFPGARevision(int32_t *status);
uint32_t getFPGATime(int32_t *status);
void setFPGALED(uint32_t state, int32_t *status);
int32_t getFPGALED(int32_t *status);
bool getFPGAButton(int32_t *status);
int HALSetErrorData(const char *errors, int errorsLength, int wait_ms);
int HALSetUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
int HALOverrideIOConfig(const char *ioConfig, int wait_ms);
int HALGetDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
int HALGetCommonControlData(HALCommonControlData *data, int wait_ms);
int HALGetControlWord(HALControlWord *data);
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes, uint8_t maxAxes);
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
void HALSetNewDataSem(pthread_mutex_t *);
int HALSetStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
const char *userDataHigh, int userDataHighLength, const char *userDataLow,
int userDataLowLength, int wait_ms);
int HALInitialize(int mode = 0);
void HALNetworkCommunicationObserveUserProgramStarting();
@@ -311,4 +224,3 @@ extern "C"
void EDVR_CreateReference();
void Occur();
}

View File

@@ -6,6 +6,9 @@
#include <stdint.h>
#endif
#include <iostream>
#include "errno.h"
extern "C"
{
typedef void (*InterruptHandlerFunction)(uint32_t interruptAssertedMask, void *param);

15
hal/include/HAL/Power.hpp Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
extern "C"
{
float getVinVoltage(int32_t *status);
float getVinCurrent(int32_t *status);
float getUserVoltage6V(int32_t *status);
float getUserCurrent6V(int32_t *status);
float getUserVoltage5V(int32_t *status);
float getUserCurrent5V(int32_t *status);
float getUserVoltage3V3(int32_t *status);
float getUserCurrent3V3(int32_t *status);
}

View File

@@ -1,13 +0,0 @@
#pragma once
#ifdef __vxworks
#include <vxWorks.h>
#else
#include <stdint.h>
#endif
extern "C"
{
void printCurrentStackTrace();
bool getErrnoToName(int32_t errNo, char* name);
}

View File

@@ -0,0 +1,234 @@
#include "HAL/Accelerometer.hpp"
#include "ChipObject.h"
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
// The 7-bit I2C address with a 0 "send" bit
static const uint8_t kSendAddress = (0x1c << 1) | 0;
// The 7-bit I2C address with a 1 "receive" bit
static const uint8_t kReceiveAddress = (0x1c << 1) | 1;
static const uint8_t kControlTxRx = 1;
static const uint8_t kControlStart = 2;
static const uint8_t kControlStop = 4;
static tAccel *accel = 0;
static AccelerometerRange accelerometerRange;
// Register addresses
enum Register {
kReg_Status = 0x00,
kReg_OutXMSB = 0x01,
kReg_OutXLSB = 0x02,
kReg_OutYMSB = 0x03,
kReg_OutYLSB = 0x04,
kReg_OutZMSB = 0x05,
kReg_OutZLSB = 0x06,
kReg_Sysmod = 0x0B,
kReg_IntSource = 0x0C,
kReg_WhoAmI = 0x0D,
kReg_XYZDataCfg = 0x0E,
kReg_HPFilterCutoff = 0x0F,
kReg_PLStatus = 0x10,
kReg_PLCfg = 0x11,
kReg_PLCount = 0x12,
kReg_PLBfZcomp = 0x13,
kReg_PLThsReg = 0x14,
kReg_FFMtCfg = 0x15,
kReg_FFMtSrc = 0x16,
kReg_FFMtThs = 0x17,
kReg_FFMtCount = 0x18,
kReg_TransientCfg = 0x1D,
kReg_TransientSrc = 0x1E,
kReg_TransientThs = 0x1F,
kReg_TransientCount = 0x20,
kReg_PulseCfg = 0x21,
kReg_PulseSrc = 0x22,
kReg_PulseThsx = 0x23,
kReg_PulseThsy = 0x24,
kReg_PulseThsz = 0x25,
kReg_PulseTmlt = 0x26,
kReg_PulseLtcy = 0x27,
kReg_PulseWind = 0x28,
kReg_ASlpCount = 0x29,
kReg_CtrlReg1 = 0x2A,
kReg_CtrlReg2 = 0x2B,
kReg_CtrlReg3 = 0x2C,
kReg_CtrlReg4 = 0x2D,
kReg_CtrlReg5 = 0x2E,
kReg_OffX = 0x2F,
kReg_OffY = 0x30,
kReg_OffZ = 0x31
};
extern "C" uint32_t getFPGATime(int32_t *status);
static void writeRegister(Register reg, uint8_t data);
static uint8_t readRegister(Register reg);
/**
* Initialize the accelerometer.
*/
static void initializeAccelerometer() {
int32_t status;
if(!accel) {
accel = tAccel::create(&status);
// Enable I2C
accel->writeCNFG(1, &status);
// Set the counter to 100 kbps
accel->writeCNTR(213, &status);
// The device identification number should be 0x2a
assert(readRegister(kReg_WhoAmI) == 0x2a);
}
}
static void writeRegister(Register reg, uint8_t data) {
int32_t status = 0;
uint32_t initialTime;
accel->writeADDR(kSendAddress, &status);
// Send a start transmit/receive message with the register address
accel->writeCNTL(kControlStart | kControlTxRx, &status);
accel->writeDATO(reg, &status);
accel->strobeGO(&status);
// Execute and wait until it's done (up to a millisecond)
initialTime = getFPGATime(&status);
while(accel->readSTAT(&status) & 1) {
if(getFPGATime(&status) > initialTime + 1000) break;
}
// Send a stop transmit/receive message with the data
accel->writeCNTL(kControlStop | kControlTxRx, &status);
accel->writeDATO(data, &status);
accel->strobeGO(&status);
// Execute and wait until it's done (up to a millisecond)
initialTime = getFPGATime(&status);
while(accel->readSTAT(&status) & 1) {
if(getFPGATime(&status) > initialTime + 1000) break;
}
fflush(stdout);
}
static uint8_t readRegister(Register reg) {
int32_t status = 0;
uint32_t initialTime;
// Send a start transmit/receive message with the register address
accel->writeADDR(kSendAddress, &status);
accel->writeCNTL(kControlStart | kControlTxRx, &status);
accel->writeDATO(reg, &status);
accel->strobeGO(&status);
// Execute and wait until it's done (up to a millisecond)
initialTime = getFPGATime(&status);
while(accel->readSTAT(&status) & 1) {
if(getFPGATime(&status) > initialTime + 1000) break;
}
// Receive a message with the data and stop
accel->writeADDR(kReceiveAddress, &status);
accel->writeCNTL(kControlStart | kControlStop | kControlTxRx, &status);
accel->strobeGO(&status);
// Execute and wait until it's done (up to a millisecond)
initialTime = getFPGATime(&status);
while(accel->readSTAT(&status) & 1) {
if(getFPGATime(&status) > initialTime + 1000) break;
}
fflush(stdout);
return accel->readDATI(&status);
}
/**
* Convert a 12-bit raw acceleration value into a scaled double in units of
* 1 g-force, taking into account the accelerometer range.
*/
static double unpackAxis(int16_t raw) {
// The raw value is actually 12 bits, not 16, so we need to propogate the
// 2's complement sign bit to the unused 4 bits for this to work with
// negative numbers.
raw <<= 4;
raw >>= 4;
switch(accelerometerRange) {
case kRange_2G: return raw / 1024.0;
case kRange_4G: return raw / 512.0;
case kRange_8G: return raw / 256.0;
default: return 0.0;
}
}
/**
* Set the accelerometer to active or standby mode. It must be in standby
* mode to change any configuration.
*/
void setAccelerometerActive(bool active) {
initializeAccelerometer();
uint8_t ctrlReg1 = readRegister(kReg_CtrlReg1);
ctrlReg1 &= ~1; // Clear the existing active bit
writeRegister(kReg_CtrlReg1, ctrlReg1 | (active? 1 : 0));
}
/**
* Set the range of values that can be measured (either 2, 4, or 8 g-forces).
* The accelerometer should be in standby mode when this is called.
*/
void setAccelerometerRange(AccelerometerRange range) {
initializeAccelerometer();
accelerometerRange = range;
uint8_t xyzDataCfg = readRegister(kReg_XYZDataCfg);
xyzDataCfg &= ~3; // Clear the existing two range bits
writeRegister(kReg_XYZDataCfg, xyzDataCfg | range);
}
/**
* Get the x-axis acceleration
*
* This is a floating point value in units of 1 g-force
*/
double getAccelerometerX() {
initializeAccelerometer();
int raw = (readRegister(kReg_OutXMSB) << 4) | (readRegister(kReg_OutXLSB) >> 4);
return unpackAxis(raw);
}
/**
* Get the y-axis acceleration
*
* This is a floating point value in units of 1 g-force
*/
double getAccelerometerY() {
initializeAccelerometer();
int raw = (readRegister(kReg_OutYMSB) << 4) | (readRegister(kReg_OutYLSB) >> 4);
return unpackAxis(raw);
}
/**
* Get the z-axis acceleration
*
* This is a floating point value in units of 1 g-force
*/
double getAccelerometerZ() {
initializeAccelerometer();
int raw = (readRegister(kReg_OutZMSB) << 4) | (readRegister(kReg_OutZLSB) >> 4);
return unpackAxis(raw);
}

View File

@@ -102,7 +102,7 @@ bool checkAnalogModule(uint8_t module) {
* @return Analog channel is valid
*/
bool checkAnalogInputChannel(uint32_t pin) {
if (pin >= 0 && pin < kAnalogInputPins)
if (pin < kAnalogInputPins)
return true;
return false;
}
@@ -115,7 +115,7 @@ bool checkAnalogInputChannel(uint32_t pin) {
* @return Analog channel is valid
*/
bool checkAnalogOutputChannel(uint32_t pin) {
if (pin >= 0 && pin < kAnalogOutputPins)
if (pin < kAnalogOutputPins)
return true;
return false;
}
@@ -185,40 +185,6 @@ float getAnalogSampleRate(int32_t *status) {
return (float)kTimebase / (float)ticksPerSample;
}
/**
* Set the sample rate on the module.
*
* This is a global setting for the module and effects all channels.
*
* @param module The module to use
* @param samplesPerSecond The number of samples per channel per second.
*/
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status) {
if (checkAnalogModule(module)) {
setAnalogSampleRate(samplesPerSecond, status);
} else {
// XXX: Set error status
}
}
/**
* Get the current sample rate on the module.
*
* This assumes one entry in the scan list.
* This is a global setting for the module and effects all channels.
*
* @param module The module to use
* @return Sample rate.
*/
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status) {
if (checkAnalogModule(module)) {
return getAnalogSampleRate(status);
} else {
return -1; // XXX: Set error status
}
}
/**
* Set the number of averaging bits.
*
@@ -283,7 +249,7 @@ uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) {
/**
* Get a sample straight from the channel on this module.
*
* The sample is a 12-bit value representing the -10V to 10V range of the A/D converter in the module.
* The sample is a 12-bit value representing the 0V to 5V range of the A/D converter in the module.
* The units are in A/D converter codes. Use GetVoltage() to get the analog value in calibrated units.
*
* @param analog_port_pointer Pointer to the analog port to use.
@@ -322,7 +288,7 @@ int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) {
*/
int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
int16_t value;
int32_t value;
checkAnalogInputChannel(port->port.pin);
tAI::tReadSelect readSelect;
@@ -333,7 +299,7 @@ int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
Synchronized sync(analogRegisterWindowSemaphore);
analogInputSystem->writeReadSelect(readSelect, status);
analogInputSystem->strobeLatchOutput(status);
value = (int16_t) analogInputSystem->readOutput(status);
value = (int32_t) analogInputSystem->readOutput(status);
}
return value;
@@ -387,12 +353,12 @@ float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) {
* @return The raw value for the channel.
*/
int32_t getAnalogVoltsToValue(void* analog_port_pointer, double voltage, int32_t *status) {
if (voltage > 10.0) {
voltage = 10.0;
if (voltage > 5.0) {
voltage = 5.0;
*status = VOLTAGE_OUT_OF_RANGE;
}
if (voltage < -10.0) {
voltage = -10.0;
if (voltage < 0.0) {
voltage = 0.0;
*status = VOLTAGE_OUT_OF_RANGE;
}
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
@@ -736,10 +702,6 @@ int getAnalogSampleRateIntHack(int32_t *status) {
return floatToInt(getAnalogSampleRate(status));
}
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status) {
return floatToInt(getAnalogSampleRateWithModuleIntHack(module, status));
}
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status) {
return floatToInt(getAnalogVoltage(analog_port_pointer, status));
}
@@ -754,10 +716,6 @@ void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status) {
setAnalogSampleRate(intToFloat(samplesPerSecond), status);
}
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond, int32_t *status) {
setAnalogSampleRateWithModule(module, intToFloat(samplesPerSecond), status);
}
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status) {
return getAnalogVoltsToValue(analog_port_pointer, intToFloat(voltage), status);
}

232
hal/lib/Athena/CAN.cpp Normal file
View File

@@ -0,0 +1,232 @@
#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

@@ -4,33 +4,35 @@
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#pragma once
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#include <stdint.h>
#include "ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
#include "ChipObject/tDMAManager.h"
#include "ChipObject/tInterruptManager.h"
#include "ChipObject/tSystem.h"
#include "ChipObject/tSystemInterface.h"
#include "ChipObject/nInterfaceGlobals.h"
#include "ChipObject/tAccel.h"
#include "ChipObject/tAccumulator.h"
#include "ChipObject/tAI.h"
#include "ChipObject/tAlarm.h"
#include "ChipObject/tAnalogTrigger.h"
#include "ChipObject/tAO.h"
#include "ChipObject/tBIST.h"
#include "ChipObject/tCounter.h"
#include "ChipObject/tDIO.h"
#include "ChipObject/tDMA.h"
#include "ChipObject/tEncoder.h"
#include "ChipObject/tGlobal.h"
#include "ChipObject/tInterrupt.h"
#include "ChipObject/tPower.h"
#include "ChipObject/tPWM.h"
#include "ChipObject/tRelay.h"
#include "ChipObject/tSPI.h"
#include "ChipObject/tSysWatchdog.h"
#include "FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
#include "FRC_FPGA_ChipObject/tDMAManager.h"
#include "FRC_FPGA_ChipObject/tInterruptManager.h"
#include "FRC_FPGA_ChipObject/tSystem.h"
#include "FRC_FPGA_ChipObject/tSystemInterface.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h"
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h"
// FIXME: these should not be here!
using namespace nFPGA;

View File

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

View File

@@ -1,107 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_5_Power_h__
#define __nFRC_2015_1_0_5_Power_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_5
{
class tPower
{
public:
tPower(){}
virtual ~tPower(){}
virtual tSystemInterface* getSystemInterface() = 0;
static tPower* create(tRioStatusCode *status);
typedef enum
{
kNumSystems = 1,
} tIfaceConstants;
typedef
union{
struct{
#ifdef __vxworks
unsigned User3V3 : 8;
unsigned User5V : 8;
unsigned User6V : 8;
#else
unsigned User6V : 8;
unsigned User5V : 8;
unsigned User3V3 : 8;
#endif
};
struct{
unsigned value : 24;
};
} tStatus;
typedef
union{
struct{
#ifdef __vxworks
unsigned User3V3 : 1;
unsigned User5V : 1;
unsigned User6V : 1;
#else
unsigned User6V : 1;
unsigned User5V : 1;
unsigned User3V3 : 1;
#endif
};
struct{
unsigned value : 3;
};
} tDisable;
typedef enum
{
} tStatus_IfaceConstants;
virtual tStatus readStatus(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
typedef enum
{
} tDisable_IfaceConstants;
virtual void writeDisable(tDisable value, tRioStatusCode *status) = 0;
virtual void writeDisable_User3V3(bool value, tRioStatusCode *status) = 0;
virtual void writeDisable_User5V(bool value, tRioStatusCode *status) = 0;
virtual void writeDisable_User6V(bool value, tRioStatusCode *status) = 0;
virtual tDisable readDisable(tRioStatusCode *status) = 0;
virtual bool readDisable_User3V3(tRioStatusCode *status) = 0;
virtual bool readDisable_User5V(tRioStatusCode *status) = 0;
virtual bool readDisable_User6V(tRioStatusCode *status) = 0;
typedef enum
{
} tIndicateOutOfRange_IfaceConstants;
virtual void writeIndicateOutOfRange(bool value, tRioStatusCode *status) = 0;
virtual bool readIndicateOutOfRange(tRioStatusCode *status) = 0;
private:
tPower(const tPower&);
void operator=(const tPower&);
};
}
}
#endif // __nFRC_2015_1_0_5_Power_h__

View File

@@ -2,21 +2,20 @@
#include "ctre/PCM.h"
#include <iostream>
static const int NUM_PCMS = 2;
extern PCM *modules[NUM_PCMS];
extern void initializePCM();
static const int NUM_MODULE_NUMBERS = 63;
extern PCM *modules[NUM_MODULE_NUMBERS];
extern void initializePCM(int module);
void *initializeCompressor(uint8_t module) {
initializePCM();
initializePCM(module);
return modules[module - 1];
return modules[module];
}
bool checkCompressorModule(uint8_t module) {
return module > 0 and module <= NUM_PCMS;
return module < NUM_MODULE_NUMBERS;
}
bool getCompressor(void *pcm_pointer, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
bool value;

File diff suppressed because it is too large Load Diff

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