mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Compare commits
98 Commits
test-tag
...
jenkins-st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad83ed3ca | ||
|
|
62d6579428 | ||
|
|
1d7b17a2ba | ||
|
|
738859c4ea | ||
|
|
127ff0ac0a | ||
|
|
472f51fc73 | ||
|
|
0f0850ca95 | ||
|
|
ab27f795b7 | ||
|
|
b16a037759 | ||
|
|
1e812ac4d9 | ||
|
|
ecc6815f68 | ||
|
|
ca9f5a676d | ||
|
|
debf9e0ee9 | ||
|
|
15abbb36c2 | ||
|
|
d9b974300f | ||
|
|
e60baf41a9 | ||
|
|
09cb3a22cd | ||
|
|
27ecd35834 | ||
|
|
ff6d180305 | ||
|
|
410b739c23 | ||
|
|
2144b853d1 | ||
|
|
f87c517e6d | ||
|
|
77dac9bd77 | ||
|
|
56cf287b39 | ||
|
|
dc970d9a6b | ||
|
|
da2ea9ea87 | ||
|
|
b1ace79379 | ||
|
|
2a8ade093a | ||
|
|
b7458e7ba6 | ||
|
|
3fddee51c2 | ||
|
|
21967fcb24 | ||
|
|
9b896eab70 | ||
|
|
f439adc2a3 | ||
|
|
67cb854676 | ||
|
|
ef7c554029 | ||
|
|
359b4ec86b | ||
|
|
21153fc63f | ||
|
|
daa8bd67ef | ||
|
|
e5e568fa73 | ||
|
|
c9f6fcd969 | ||
|
|
778620b0a9 | ||
|
|
d58c6f0c0f | ||
|
|
a14d854211 | ||
|
|
c5fc1dc5be | ||
|
|
cded5351df | ||
|
|
47169e0ce1 | ||
|
|
4ef798a0c0 | ||
|
|
7ec8d4e9a3 | ||
|
|
17e7fc8f20 | ||
|
|
023f955a56 | ||
|
|
52e358c180 | ||
|
|
7638e2b6e5 | ||
|
|
f9ab84d912 | ||
|
|
04fadb85f5 | ||
|
|
698b371b16 | ||
|
|
6dde2c2b4c | ||
|
|
8ba0eada17 | ||
|
|
bf5eaf657e | ||
|
|
3baaea5a44 | ||
|
|
2cc937f5e1 | ||
|
|
23b6a980c2 | ||
|
|
89b80db2d0 | ||
|
|
1f27d36884 | ||
|
|
125dfac8b4 | ||
|
|
4215d1c79b | ||
|
|
dddba82d18 | ||
|
|
78e2a8d1b9 | ||
|
|
687bc44ae5 | ||
|
|
c82a94b268 | ||
|
|
d407fe546f | ||
|
|
699949fdf4 | ||
|
|
6d89974016 | ||
|
|
e523157507 | ||
|
|
3eba1c4688 | ||
|
|
d466d17edd | ||
|
|
9dfd6bde9d | ||
|
|
eded28ebfa | ||
|
|
777dc2113d | ||
|
|
174f2c0e23 | ||
|
|
434caf81d7 | ||
|
|
9327170069 | ||
|
|
597e209c09 | ||
|
|
ad1ace1022 | ||
|
|
70d09de2e9 | ||
|
|
f7e1753e03 | ||
|
|
df3f3cc0e1 | ||
|
|
25308e2442 | ||
|
|
6b3e2690d0 | ||
|
|
ae10d43900 | ||
|
|
d4e377fc0e | ||
|
|
9126646fef | ||
|
|
d3f632486f | ||
|
|
268459206f | ||
|
|
df390c275d | ||
|
|
1742634a96 | ||
|
|
0f8f83500b | ||
|
|
d5c73c95dc | ||
|
|
ca7dc5d6ac |
158
.gitignore
vendored
158
.gitignore
vendored
@@ -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
125
Vagrantfile
vendored
Normal 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
|
||||
@@ -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
61
bootstrap.sh
Normal 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"
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=""${workspace_loc:/${ProjName}}/src""/>
|
||||
<listOptionValue builtIn="false" value="$cpp-location/include"/>
|
||||
<listOptionValue builtIn="false" value=""$cpp-location/include""/>
|
||||
</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=""$cpp-location/lib""/>
|
||||
</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,"$cpp-location/lib"" 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=""${workspace_loc:/${ProjName}}/src""/>
|
||||
<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"/>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define $classname_H
|
||||
|
||||
#include "../CommandBase.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class $classname: public CommandBase
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define $classname_H
|
||||
|
||||
#include "Commands/CommandGroup.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class $classname: public CommandGroup
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define EXAMPLE_COMMAND_H
|
||||
|
||||
#include "../CommandBase.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class ExampleCommand: public CommandBase
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef DriveTrain_H
|
||||
#define DriveTrain_H
|
||||
|
||||
#include "Commands/Subsystem.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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'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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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'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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}};
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include "errno.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
typedef void (*InterruptHandlerFunction)(uint32_t interruptAssertedMask, void *param);
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -110,7 +110,7 @@ CTR_Code PDP::GetChannelCurrent(UINT8 idx, double ¤t)
|
||||
}
|
||||
}
|
||||
/* 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
1
jenkins/README
Normal file
@@ -0,0 +1 @@
|
||||
This directory contains special jenkins build options.
|
||||
2
jenkins/docs/.gitignore
vendored
Normal file
2
jenkins/docs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
build/
|
||||
site/
|
||||
32
jenkins/docs/Makefile
Normal file
32
jenkins/docs/Makefile
Normal 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
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
Reference in New Issue
Block a user