Compare commits

...

98 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
205 changed files with 9206 additions and 1470 deletions

158
.gitignore vendored
View File

@@ -1,21 +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
@@ -23,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

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,18 +0,0 @@
#!/usr/bin/env bash
# Temporary method to deploy C++ integration tests to the RoboRIO
if [ $(which sshpass) ]
then
# Send stderr to /dev/null - the only thing printed to it is the login prompt
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram java 2> /dev/null
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin 2> /dev/null
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $* 2> /dev/null
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 --gtest_color=yes $*
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.");
@@ -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,7 +35,7 @@ public class NewProjectMainPage extends WizardPage {
private Text worldText;
private Button worldButton;
Button iterativeRobot, commandRobot;
Button iterativeRobot, commandRobot, sampleRobot;
private boolean showPackage;
private boolean showProjectTypes;
private TeamNumberPage teamNumberPage;
@@ -109,6 +109,12 @@ public class NewProjectMainPage extends WizardPage {
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);
@@ -214,6 +220,7 @@ public class NewProjectMainPage extends WizardPage {
public ProjectType getProjectType() {
if (!showProjectTypes) return null;
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);
}

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

@@ -29,17 +29,16 @@
<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="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/include"/>
<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="WPILib"/>
<listOptionValue builtIn="false" value="WPILibAthena"/>
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="HALAthena"/>
@@ -58,7 +57,7 @@
<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>
@@ -155,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"/>

View File

@@ -27,3 +27,6 @@ sim.exe=Simulate/${out}
wpilib.sim=${wpilib}/sim
sim.tools=${wpilib.sim}/tools
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

@@ -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.

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

@@ -17,7 +17,7 @@ class Robot: public SampleRobot
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);

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

@@ -111,6 +111,11 @@ public class DeployLaunchShortcut implements ILaunchShortcut
// 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 {
@@ -139,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,
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

@@ -38,10 +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.ITERATIVE, ITERATIVE);
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
put(ProjectType.SAMPLE, SAMPLE);
}};
@Override

View File

@@ -46,7 +46,15 @@
username="${username}"
password="${password}"
trust="true"
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
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.">

View File

@@ -157,15 +157,6 @@
</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

View File

@@ -92,7 +92,7 @@
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
<outputDirectory>${java-zip}/lib</outputDirectory>
@@ -107,6 +107,13 @@
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
@@ -329,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>
@@ -361,6 +374,12 @@
</dependency>
<!-- Javadoc -->
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>

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

@@ -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

@@ -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

@@ -3,6 +3,9 @@ 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.
@@ -25,7 +28,7 @@ public class Robot extends SampleRobot {
Joystick stick;
public Robot() {
myRobot = new RobotDrive(1, 2);
myRobot = new RobotDrive(0, 1);
myRobot.setExpiration(0.1);
stick = new Joystick(1);
}

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);

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

@@ -32,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>
@@ -76,25 +76,35 @@
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; ${deploy.kill.command};"/>
command="${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="tail -F -s 0 -n 0 ${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

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

View File

@@ -4,6 +4,6 @@
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
#define __RoboRIO_FRC_ChipObject_Aliases_h__
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_7
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_8
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_Encoder_h__
#define __nFRC_2015_1_0_7_Encoder_h__
#ifndef __nFRC_2015_1_0_8_Encoder_h__
#define __nFRC_2015_1_0_8_Encoder_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tEncoder
@@ -196,4 +196,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_Encoder_h__
#endif // __nFRC_2015_1_0_8_Encoder_h__

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_PWM_h__
#define __nFRC_2015_1_0_7_PWM_h__
#ifndef __nFRC_2015_1_0_8_PWM_h__
#define __nFRC_2015_1_0_8_PWM_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tPWM
@@ -80,6 +80,15 @@ public:
virtual unsigned char readPeriodScaleHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumZeroLatchElements = 20,
} tZeroLatch_IfaceConstants;
virtual void writeZeroLatch(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
virtual bool readZeroLatch(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
@@ -108,4 +117,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_PWM_h__
#endif // __nFRC_2015_1_0_8_PWM_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_Power_h__
#define __nFRC_2015_1_0_7_Power_h__
#ifndef __nFRC_2015_1_0_8_Power_h__
#define __nFRC_2015_1_0_8_Power_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tPower
@@ -214,4 +214,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_Power_h__
#endif // __nFRC_2015_1_0_8_Power_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_Relay_h__
#define __nFRC_2015_1_0_7_Relay_h__
#ifndef __nFRC_2015_1_0_8_Relay_h__
#define __nFRC_2015_1_0_8_Relay_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tRelay
@@ -65,4 +65,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_Relay_h__
#endif // __nFRC_2015_1_0_8_Relay_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_SPI_h__
#define __nFRC_2015_1_0_7_SPI_h__
#ifndef __nFRC_2015_1_0_8_SPI_h__
#define __nFRC_2015_1_0_8_SPI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tSPI
@@ -65,4 +65,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_SPI_h__
#endif // __nFRC_2015_1_0_8_SPI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_7_SysWatchdog_h__
#define __nFRC_2015_1_0_7_SysWatchdog_h__
#ifndef __nFRC_2015_1_0_8_SysWatchdog_h__
#define __nFRC_2015_1_0_8_SysWatchdog_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_7
namespace nFRC_2015_1_0_8
{
class tSysWatchdog
@@ -98,4 +98,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_7_SysWatchdog_h__
#endif // __nFRC_2015_1_0_8_SysWatchdog_h__

View File

@@ -52,8 +52,10 @@ void enableInterrupts(void* interrupt_pointer, int32_t *status)
*/
void disableInterrupts(void* interrupt_pointer, int32_t *status)
{
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
anInterrupt->manager->disable(status);
}
/**

View File

@@ -88,6 +88,11 @@ private:
uint32_t arbId;
uint8_t toSend[8];
uint32_t periodMs;
txJob_t() : arbId(0),periodMs(0)
{
for(int i=0;i<sizeof(toSend);++i)
toSend[i] = 0;
}
};
class rxEvent_t{

View File

@@ -101,8 +101,7 @@ PCM::PCM(UINT8 deviceNumber): CtreCanNode(deviceNumber)
RegisterRx(STATUS_DEBUG | deviceNumber );
RegisterTx(CONTROL_1 | deviceNumber, kCANPeriod);
/* enable close loop */
CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());
toFill->closedLoopEnable = 1;
SetClosedLoopControl(1);
}
/* PCM D'tor
*/
@@ -216,7 +215,7 @@ CTR_Code PCM::GetCompressorCurrent(float &status)
uint32_t temp =(rx->compressorCurrentTop6);
temp <<= 4;
temp |= rx->compressorCurrentBtm4;
status = 20.1612903225806 * temp;
status = temp * 0.03125; /* 5.5 fixed pt value in Amps */
return rx.err;
}
@@ -230,7 +229,7 @@ CTR_Code PCM::GetSolenoidVoltage(float &status)
uint32_t raw =(rx->solenoidVoltageTop8);
raw <<= 2;
raw |= rx->solenoidVoltageBtm2;
status = (double) raw * 24.7800586510264 / 1000;
status = (double) raw * 0.03125; /* 5.5 fixed pt value in Volts */
return rx.err;
}
@@ -297,7 +296,7 @@ CTR_Code PCM::GetSolenoidStickyFault(bool &status)
CTR_Code PCM::GetBatteryVoltage(float &status)
{
GET_PCM_STATUS();
status = (float)rx->battVoltage * ((59.0420332355816) / 1000.0);;
status = (float)rx->battVoltage * 0.05 + 4.0; /* 50mV per unit plus 4V. */
return rx.err;
}
/* Return status of module enable/disable

View File

@@ -110,7 +110,7 @@ CTR_Code PDP::GetChannelCurrent(UINT8 idx, double &current)
}
}
/* convert to amps */
current = 0.06724511900000001*raw + 1.527114967;
current = (double)raw * 0.125; /* 7.3 fixed pt value in Amps */
/* signal caller with success */
return retval;
}
@@ -118,14 +118,14 @@ CTR_Code PDP::GetVoltage(double &voltage)
{
GET_STATUS3();
uint32_t raw = rx->busVoltage;
voltage = 0.0554413328606877 * raw;
voltage = (double)raw * 0.05 + 4.0; /* 50mV per unit plus 4V. */;
return rx.err;
}
CTR_Code PDP::GetTemperature(double &tempC)
{
GET_STATUS3();
uint32_t raw = rx->temp;
tempC = ((double)raw-67.8564500484966)*1.03250836957542;
tempC = (double)raw * 1.03250836957542 - 67.8564500484966;
return rx.err;
}
//------------------ C interface --------------------------------------------//

1
jenkins/README Normal file
View File

@@ -0,0 +1 @@
This directory contains special jenkins build options.

2
jenkins/docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
build/
site/

32
jenkins/docs/Makefile Normal file
View File

@@ -0,0 +1,32 @@
allwpilib=../..
version=DEVELOPMENT
all: java cpp site
java:
mkdir -p build/java/
mkdir -p site/java/
cp -r $(allwpilib)/wpilibj/wpilibJava/src/main/java/* build/java/
cp -r $(allwpilib)/wpilibj/wpilibJavaDevices/src/main/java/* build/java/
# cp -r $(allwpilib)/networktables/java/src/main/java/* build/java/
( cat java.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
cpp:
mkdir -p build/cpp/
mkdir -p site/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++/src build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++/include build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++Devices/src build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++Devices/include build/cpp/
# cp -r $(allwpilib)/networktables/cpp/lib build/cpp/
# cp -r $(allwpilib)/networktables/cpp/include build/cpp/
( cat cpp.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
# TODO: HAL
site:
mkdir -p build/site/
clean:
rm -rf build/
rm -rf site/

2305
jenkins/docs/cpp.doxy Normal file

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