mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Compare commits
308 Commits
2014-simul
...
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 | ||
|
|
66e1f2a184 | ||
|
|
1301d76d61 | ||
|
|
a72ea14f92 | ||
|
|
14b2f14669 | ||
|
|
d2cd5f3571 | ||
|
|
7ecde3a33a | ||
|
|
81143fc534 | ||
|
|
c58a86a3ab | ||
|
|
2f655bb49d | ||
|
|
657054c9e2 | ||
|
|
f4d542b212 | ||
|
|
8db11a4c6c | ||
|
|
14d784bca1 | ||
|
|
7c8124d76c | ||
|
|
b371600f0f | ||
|
|
6c3b002a87 | ||
|
|
0f93247641 | ||
|
|
54439e7198 | ||
|
|
5b8279f404 | ||
|
|
8abbcf53f4 | ||
|
|
b8eeeabbb5 | ||
|
|
9a2bd8c49b | ||
|
|
4db634b342 | ||
|
|
57e670c18d | ||
|
|
59473ab7a7 | ||
|
|
d1d4c75210 | ||
|
|
2356008d8c | ||
|
|
deb335d96d | ||
|
|
1ce03b9c46 | ||
|
|
a09f75934a | ||
|
|
aab98c0638 | ||
|
|
741e28b855 | ||
|
|
f817f6d041 | ||
|
|
7442a7ed7d | ||
|
|
765198f5f5 | ||
|
|
ed08ab2989 | ||
|
|
4b22742cdc | ||
|
|
45f93e9aba | ||
|
|
049377c9ea | ||
|
|
f4ace4a36d | ||
|
|
9ff420547a | ||
|
|
1be31431bc | ||
|
|
32cafd0efc | ||
|
|
0216d1b336 | ||
|
|
43c566bd86 | ||
|
|
b86c747226 | ||
|
|
60a3fd0698 | ||
|
|
b86c114939 | ||
|
|
14f201cd36 | ||
|
|
c49ea255b9 | ||
|
|
065e1c24eb | ||
|
|
ecdb77e4be | ||
|
|
10aad6d1c8 | ||
|
|
e73c8d06eb | ||
|
|
dc341a448e | ||
|
|
d521eb79b9 | ||
|
|
f57a2dc5a9 | ||
|
|
7006d1ebc4 | ||
|
|
c32e5707d4 | ||
|
|
c27da3587d | ||
|
|
f18cccbc30 | ||
|
|
b91b681430 | ||
|
|
b26667f866 | ||
|
|
792e3b6ccc | ||
|
|
fd4379a946 | ||
|
|
a40cdf5197 | ||
|
|
ba4e74d299 | ||
|
|
38583789be | ||
|
|
45e43b627f | ||
|
|
e837d9083a | ||
|
|
e0e2b498a5 | ||
|
|
8fe888dbc9 | ||
|
|
41bb0da4e6 | ||
|
|
97ade3606e | ||
|
|
2735406bfb | ||
|
|
ab04e19aae | ||
|
|
a58288ae6d | ||
|
|
7905259e21 | ||
|
|
f018689d0e | ||
|
|
0bb13d86ea | ||
|
|
526df3679a | ||
|
|
d8da3e5f1f | ||
|
|
c0af235050 | ||
|
|
7f6ca6824e | ||
|
|
231bb55b2a | ||
|
|
76e488061d | ||
|
|
5e8ea38465 | ||
|
|
a5b72d62a1 | ||
|
|
a5e15b16fd | ||
|
|
264c38a674 | ||
|
|
20de3abe80 | ||
|
|
3536d47835 | ||
|
|
60a294fbad | ||
|
|
dc42a1129f | ||
|
|
386dc1f16b | ||
|
|
038478e437 | ||
|
|
26e90a988b | ||
|
|
d5cd47bfa1 | ||
|
|
1e35ef7802 | ||
|
|
65607b5bc1 | ||
|
|
30c0cc0561 | ||
|
|
92bd697417 | ||
|
|
ed0df5432f | ||
|
|
6deb196e90 | ||
|
|
8b612f713b | ||
|
|
d66bafb687 | ||
|
|
78d2ccd299 | ||
|
|
06d59447be | ||
|
|
3475a4a8c6 | ||
|
|
6af242b556 | ||
|
|
c72e704396 | ||
|
|
89fe909ae6 | ||
|
|
c1d8e4ef4b | ||
|
|
338120c3a5 | ||
|
|
a7efbe0d7a | ||
|
|
4c78280308 | ||
|
|
5a3889a3aa | ||
|
|
2fd4964b62 | ||
|
|
6ae6394548 | ||
|
|
310151132d | ||
|
|
7f4e1e39ae | ||
|
|
eebdc3d20c | ||
|
|
980ea96b05 | ||
|
|
1038f98e83 | ||
|
|
326aa2e85c | ||
|
|
6071fc7fb3 | ||
|
|
f958b65ba6 | ||
|
|
f4f7588cfb | ||
|
|
80ecff6bdb | ||
|
|
e487c950e9 | ||
|
|
191e9d5d6b | ||
|
|
40fc8326aa | ||
|
|
fdbe750d3d | ||
|
|
3ec797a8cf | ||
|
|
78e6cf7208 | ||
|
|
2481e98bc8 | ||
|
|
c81d510ebe | ||
|
|
3fb4159101 | ||
|
|
2e1bd171a5 | ||
|
|
25e7a077c1 | ||
|
|
dc48dc7f7b | ||
|
|
2dd45c3ea6 | ||
|
|
461e359484 | ||
|
|
78dac49cf6 | ||
|
|
66ba9a728e | ||
|
|
c3d1e80a62 | ||
|
|
01ca19f78f | ||
|
|
202bfb2959 | ||
|
|
b0369342e9 | ||
|
|
26d101caf9 | ||
|
|
e84e0ebab8 | ||
|
|
0704a697ce | ||
|
|
13f97bb6e3 | ||
|
|
5eddb69aa0 | ||
|
|
41c2b9402c | ||
|
|
99632e003b | ||
|
|
fe12394c93 | ||
|
|
fbf196763f | ||
|
|
b5fb35c0c4 | ||
|
|
48e8b2136e | ||
|
|
e962c770bb | ||
|
|
1b7a352cbb | ||
|
|
1a77cea13a | ||
|
|
afa39deec5 | ||
|
|
f27e16735f | ||
|
|
d8a5ced015 | ||
|
|
8fe606a4b1 | ||
|
|
6053a0cc24 | ||
|
|
be106b3527 | ||
|
|
ebaf2ef058 | ||
|
|
9f1a9a07c9 | ||
|
|
ec2a455bc7 | ||
|
|
3d740a9a25 | ||
|
|
1dd1e0be1e | ||
|
|
437e3ff266 | ||
|
|
f373c8708d | ||
|
|
54a657a7d4 | ||
|
|
60d8508a65 | ||
|
|
02a28c8f04 | ||
|
|
b128828977 | ||
|
|
1a1a12316b | ||
|
|
d0fdb3e704 | ||
|
|
5d2e20eaec | ||
|
|
fc0eb4e956 | ||
|
|
968b69d37d | ||
|
|
343c7f4f3e | ||
|
|
80c5c09f77 | ||
|
|
cb9df310dc | ||
|
|
f566c087dc | ||
|
|
7ca1b498e4 | ||
|
|
8bba58b9ab | ||
|
|
8ae64a12ea | ||
|
|
3b4718fc92 | ||
|
|
5800af49bc | ||
|
|
63fc4f6cfb | ||
|
|
8b770ffb41 | ||
|
|
55fde6b616 | ||
|
|
5ddacb43c1 | ||
|
|
65c3c0ba09 | ||
|
|
fc3ed33f77 | ||
|
|
255a3a5b12 | ||
|
|
0ef5c3adfa | ||
|
|
37ebcabc4a | ||
|
|
244ee8d920 | ||
|
|
b97d2eb0c3 | ||
|
|
ae8d22b0f2 | ||
|
|
ff8016c088 | ||
|
|
f0fb3023ad | ||
|
|
1d33edffee | ||
|
|
5bd546f1fd |
159
.gitignore
vendored
159
.gitignore
vendored
@@ -1,20 +1,82 @@
|
||||
# WPIlib Specific
|
||||
|
||||
wpilibc/build/
|
||||
hal/build/
|
||||
networktables/cpp/build/
|
||||
build/
|
||||
networktables/OutlineViewer/nbproject/private
|
||||
*~
|
||||
target/
|
||||
dist/
|
||||
bin/
|
||||
.project
|
||||
.cproject
|
||||
.settings/
|
||||
.classpath
|
||||
**/dependency-reduced-pom.xml
|
||||
|
||||
#Java File extentions
|
||||
# Created by the jenkins test script
|
||||
test-reports
|
||||
|
||||
# Added by the users of vagrant
|
||||
jdk-7u45-linux-arm-vfp-sflt.gz
|
||||
|
||||
|
||||
|
||||
|
||||
# Created by http://www.gitignore.io
|
||||
|
||||
### Linux ###
|
||||
*~
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
|
||||
### Windows ###
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
|
||||
### OSX ###
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
### Java ###
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
@@ -22,3 +84,90 @@ bin/
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
|
||||
### C++ ###
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
|
||||
|
||||
### CMake ###
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
|
||||
|
||||
### Gradle ###
|
||||
.gradle
|
||||
build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
|
||||
### Vagrant ###
|
||||
.vagrant/
|
||||
|
||||
|
||||
### Eclipse ###
|
||||
*.pydevproject
|
||||
.metadata
|
||||
.gradle
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
13
.hgignore
13
.hgignore
@@ -1,13 +0,0 @@
|
||||
syntax: re
|
||||
^\.hgignore$
|
||||
.*/target(?:/|$)
|
||||
.*/dist(?:/|$)
|
||||
eclipse-plugins/.*/bin(?:/|$)
|
||||
|
||||
syntax: glob
|
||||
wpilibc/build/
|
||||
hal/build/
|
||||
networktables/cpp/build/
|
||||
build/
|
||||
networktables/OutlineViewer/nbproject/private
|
||||
*~
|
||||
@@ -1,10 +1,11 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(All-WPILib)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wextra -Wno-unused-parameter -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wall -Wextra -Wno-unused-parameter -fPIC")
|
||||
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
|
||||
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
|
||||
get_filename_component(WPILIB_INCLUDES wpilibc/wpilibC++/include REALPATH)
|
||||
get_filename_component(HAL_API_INCLUDES hal/include REALPATH)
|
||||
get_filename_component(NWT_API_INCLUDES networktables/cpp/include REALPATH)
|
||||
add_subdirectory(hal)
|
||||
|
||||
125
Vagrantfile
vendored
Normal file
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,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Temporary method to deploy C++ integration tests to the RoboRIO
|
||||
|
||||
if [ $(which sshpass) ]
|
||||
then
|
||||
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram
|
||||
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
|
||||
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram $*
|
||||
else
|
||||
ssh admin@10.1.90.2 killall FRCUserProgram
|
||||
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
|
||||
ssh admin@10.1.90.2 ./FRCUserProgram $*
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
|
||||
public void saveGlobalProperties(Properties props) {
|
||||
try {
|
||||
props.setProperty("version", "current");
|
||||
props.store(new FileOutputStream(new File(WPILibCore.getDefault()
|
||||
.getWPILibBaseDir() + "/wpilib.properties")),
|
||||
"Don't add new properties, they will be deleted by the eclipse plugin.");
|
||||
@@ -124,7 +125,7 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
return target;
|
||||
else {
|
||||
int teamNumber = getTeamNumber(project);
|
||||
return "10." + (teamNumber / 100) + "." + (teamNumber % 100) + ".2";
|
||||
return "roborio-" + teamNumber + ".local";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
}
|
||||
|
||||
public String getDefaultVersion() {
|
||||
return "2013-test-0.4";
|
||||
return "0.2";
|
||||
}
|
||||
|
||||
public String getCurrentVersion() {
|
||||
|
||||
@@ -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,15 +35,15 @@ public class NewProjectMainPage extends WizardPage {
|
||||
private Text worldText;
|
||||
private Button worldButton;
|
||||
|
||||
Button simpleRobot, iterativeRobot, commandRobot;
|
||||
Button iterativeRobot, commandRobot, sampleRobot;
|
||||
private boolean showPackage;
|
||||
private boolean showProjectTypes;
|
||||
private TeamNumberPage teamNumberPage;
|
||||
|
||||
/**
|
||||
* Constructor for SampleNewWizardPage.
|
||||
* @param teamNumberPage
|
||||
*
|
||||
* @param teamNumberPage
|
||||
*
|
||||
* @param pageName
|
||||
*/
|
||||
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
|
||||
@@ -77,7 +77,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
if (showPackage) {
|
||||
label = new Label(container, SWT.NULL);
|
||||
label.setText("&Package:");
|
||||
|
||||
|
||||
packageText = new Text(container, SWT.BORDER | SWT.SINGLE);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
packageText.setLayoutData(gd);
|
||||
@@ -87,7 +87,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (showProjectTypes) {
|
||||
Group projectTypeGroup = new Group(container, SWT.BORDER);
|
||||
projectTypeGroup.setText("Project Type");
|
||||
@@ -97,31 +97,29 @@ public class NewProjectMainPage extends WizardPage {
|
||||
GridLayout groupLayout = new GridLayout();
|
||||
groupLayout.numColumns = 1;
|
||||
projectTypeGroup.setLayout(groupLayout);
|
||||
|
||||
simpleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
//simpleRobot.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
|
||||
simpleRobot.setText("Simple Robot: A flexible robot project intended for robots that implement basic functionality. Can also be used as a starting point for teams with a custom framework.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
simpleRobot.setLayoutData(gd);
|
||||
simpleRobot.setSelection(true);
|
||||
|
||||
|
||||
iterativeRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
iterativeRobot.setText("Iterative Robot: A robot project that allows robots to be implemented in an iterative manner.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
iterativeRobot.setLayoutData(gd);
|
||||
|
||||
|
||||
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
commandRobot.setLayoutData(gd);
|
||||
|
||||
sampleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
sampleRobot.setText("Sample Robot: A robot project used for small sample programs or for highly advanced programs with more complete control over program flow");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
sampleRobot.setLayoutData(gd);
|
||||
}
|
||||
|
||||
label = new Label(container, SWT.NULL);
|
||||
label.setText("Simulation &World:");
|
||||
|
||||
|
||||
|
||||
Composite comp = new Composite(container, SWT.NULL);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
@@ -144,7 +142,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
browse();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
initialize();
|
||||
dialogChanged();
|
||||
setControl(container);
|
||||
@@ -162,7 +160,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
@Override public void stateChanged(ChangeEvent e) {
|
||||
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
|
||||
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -174,7 +172,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
*/
|
||||
private void dialogChanged() {
|
||||
String projectName = getProjectName();
|
||||
|
||||
|
||||
String packageString = "";
|
||||
if (showPackage) packageString = getPackage();
|
||||
|
||||
@@ -190,7 +188,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
updateStatus("Must be valid java package");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
updateStatus(null);
|
||||
}
|
||||
|
||||
@@ -203,7 +201,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
String result = dialog.open();
|
||||
if (result != null) {
|
||||
worldText.setText(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStatus(String message) {
|
||||
@@ -218,11 +216,11 @@ public class NewProjectMainPage extends WizardPage {
|
||||
public String getPackage() {
|
||||
return packageText.getText();
|
||||
}
|
||||
|
||||
|
||||
public ProjectType getProjectType() {
|
||||
if (!showProjectTypes) return null;
|
||||
else if (simpleRobot.getSelection()) return types.get(ProjectType.SIMPLE);
|
||||
else if (iterativeRobot.getSelection()) return types.get(ProjectType.ITERATIVE);
|
||||
else if (sampleRobot.getSelection()) return types.get(ProjectType.SAMPLE);
|
||||
else return types.get(ProjectType.COMMAND_BASED);
|
||||
}
|
||||
|
||||
@@ -237,7 +235,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
public void setShowProjectTypes(boolean bool) {
|
||||
showProjectTypes = bool;
|
||||
}
|
||||
|
||||
|
||||
public void setProjectTypes(Map<String, ProjectType> types) {
|
||||
showProjectTypes = true;
|
||||
this.types = types;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -67,12 +67,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -80,12 +89,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandGroupWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -93,12 +111,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.SubsystemWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -106,12 +133,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.PIDSubsystemWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -119,12 +155,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.TriggerWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
</extension>
|
||||
@@ -147,10 +192,10 @@
|
||||
point="org.eclipse.debug.ui.launchShortcuts">
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.cpp.launching.DeployLaunchShortcut"
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
icon="resources/icons/wpi.ico"
|
||||
id="edu.wpi.first.wpilib.plugins.cpp.launching.deploy"
|
||||
label="WPILib Deploy Configure Builder"
|
||||
label="WPILib C++ Deploy"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
@@ -172,20 +217,20 @@
|
||||
</enablement>
|
||||
</contextualLaunch>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
mode="run">
|
||||
</description>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board and debug it."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
mode="debug">
|
||||
</description>
|
||||
</shortcut>
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.cpp.launching.SimulateLaunchShortcut"
|
||||
description="Test the WPILib project using the Gazebo simulator."
|
||||
icon="resources/icons/wpi.ico"
|
||||
icon="resources/icons/Gazebo.png"
|
||||
id="edu.wpi.first.wpilib.plugins.cpp.launching.simulate"
|
||||
label="WPILib Simulate"
|
||||
label="WPILib C++ Simulation"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 780 B |
@@ -28,20 +28,21 @@
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.549514425" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.1682909384" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1597382905" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="$cpp-location/include"/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}/src""/>
|
||||
<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="WPILibAthena"/>
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="HALAthena"/>
|
||||
<listOptionValue builtIn="false" value="NetworkTables"/>
|
||||
<listOptionValue builtIn="false" value="FRC_FPGA_ChipObject"/>
|
||||
<listOptionValue builtIn="false" value="FRC_NetworkCommunication"/>
|
||||
<listOptionValue builtIn="false" value="i2c"/>
|
||||
<listOptionValue builtIn="false" value="ni_emb"/>
|
||||
@@ -56,8 +57,9 @@
|
||||
<listOptionValue builtIn="false" value="dl"/>
|
||||
<listOptionValue builtIn="false" value="pthread"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,$cpp-location/lib" valueType="string"/>
|
||||
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,"$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>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1757265359" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
@@ -152,7 +154,7 @@
|
||||
<listOptionValue builtIn="false" value=""${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"/>
|
||||
@@ -167,7 +169,9 @@
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
|
||||
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cpp.linker.base.2094820582" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
|
||||
<option id="gnu.cpp.link.option.libs.1563598353" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="WPILibSim"/>
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="gazebo"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_transport"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_msgs"/>
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
username=admin
|
||||
password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.run.command=./runcppprogram
|
||||
deploy.debug.command=./debugcppprogram
|
||||
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
|
||||
command.dir=/home/lvuser/
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/cpp/${cpp-version}
|
||||
@@ -21,8 +22,11 @@ build.dir=build
|
||||
out.exe=Debug/${out}
|
||||
|
||||
# Simulation
|
||||
simulation.world.file=$world
|
||||
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
|
||||
sim.exe=Simulate/${out}
|
||||
wpilib.sim=${wpilib}/sim
|
||||
sim.tools=${wpilib.sim}/tools
|
||||
sim.lib=${wpilib.sim}/lib
|
||||
sim.lib=${wpilib.sim}/lib
|
||||
|
||||
# Use the current C++ library by default
|
||||
cpp-version=current
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define $classname_H
|
||||
|
||||
#include "../CommandBase.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class $classname: public CommandBase
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
ExampleSubsystem* CommandBase::examplesubsystem = NULL;
|
||||
OI* CommandBase::oi = NULL;
|
||||
|
||||
CommandBase::CommandBase(std::string name) :
|
||||
CommandBase::CommandBase(char const *name) :
|
||||
Command(name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Commands/Command.h"
|
||||
#include "Subsystems/ExampleSubsystem.h"
|
||||
#include "OI.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* The base for all commands. All atomic commands should subclass CommandBase.
|
||||
@@ -14,7 +15,7 @@
|
||||
class CommandBase: public Command
|
||||
{
|
||||
public:
|
||||
CommandBase(std::string name);
|
||||
CommandBase(char const *name);
|
||||
CommandBase();
|
||||
static void init();
|
||||
// Create a single static instance of all of your subsystems
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the RobotBase class.
|
||||
* The SimpleRobot class is the base of a robot application that will automatically call your
|
||||
* This is a demo program showing the use of the RobotDrive class.
|
||||
* The SampleRobot class is the base of a robot application that will automatically call your
|
||||
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
|
||||
* the driver station or the field controls.
|
||||
*
|
||||
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
|
||||
* don't. Unless you know what you are doing, complex code will be much more difficult under
|
||||
* this system. Use IterativeRobot or Command-Based instead if you're new.
|
||||
*/
|
||||
class Robot: public SimpleRobot
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
RobotDrive myRobot; // robot drive system
|
||||
Joystick stick; // only joystick
|
||||
|
||||
public:
|
||||
Robot() :
|
||||
myRobot(1, 2), // these must be initialized in the same order
|
||||
myRobot(0, 1), // these must be initialized in the same order
|
||||
stick(1) // as they are declared above.
|
||||
{
|
||||
myRobot.SetExpiration(0.1);
|
||||
@@ -31,7 +35,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motors with arcade steering.
|
||||
* Runs the motors with arcade steering.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
@@ -48,7 +52,6 @@ public:
|
||||
*/
|
||||
void Test()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package edu.wpi.first.wpilib.plugins.cpp.launching;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.debug.core.executables.Executable;
|
||||
@@ -28,12 +29,13 @@ import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
import edu.wpi.first.wpilib.plugins.core.launching.AntLauncher;
|
||||
|
||||
/**
|
||||
* Launch shortcut base functionality, common for deploying to the robot.
|
||||
* Retrieves the project the operation is being called on, and runs the correct
|
||||
* ant targets based on polymorphically determined data values
|
||||
*
|
||||
*
|
||||
* @author Ryan O'Meara
|
||||
* @author Alex Henning
|
||||
*/
|
||||
@@ -46,7 +48,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
/**
|
||||
* Returns the launch type of the shortcut that was used, one of the
|
||||
* constants defined in BaseLaunchShortcut
|
||||
*
|
||||
*
|
||||
* @return Launch shortcut type
|
||||
*/
|
||||
public String getLaunchType()
|
||||
@@ -91,7 +93,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param activeProj
|
||||
* The project that the script will be run on/from
|
||||
* @param mode
|
||||
@@ -99,23 +101,39 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
* ILaunchManager.DEBUG_MODE)
|
||||
*/
|
||||
public void runConfig(IProject activeProj, String mode, Shell shell) {
|
||||
// TODO: figure out UI issues. that's why this is undocumented
|
||||
ILaunchConfigurationWorkingCopy config;
|
||||
try {
|
||||
config = getRemoteDebugConfig(activeProj);
|
||||
//config.doSave(); // NOTE: For debugging
|
||||
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
|
||||
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
|
||||
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
|
||||
//config.launch(mode, new NullProgressMonitor(), false, true);
|
||||
DebugUITools.launch(config, mode);
|
||||
} catch (CoreException e) {
|
||||
WPILibCPPPlugin.logError("Debug attach failed.", e);
|
||||
if(mode.equals(ILaunchManager.RUN_MODE)) {
|
||||
// Regular deploys are done with an ant script for now, for both
|
||||
// C++ and Java.
|
||||
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
|
||||
WPILibCPPPlugin.logInfo("Targets: deploy, Mode: " + mode);
|
||||
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "deploy", null, mode);
|
||||
} else {
|
||||
// Debug deploys are done with the Eclipse Remote System Explorer,
|
||||
// which lets it work with Eclipse's C++ debugger.
|
||||
|
||||
// Kill running program before using RSE as RSE can't
|
||||
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
|
||||
WPILibCPPPlugin.logInfo("Targets: kill-program, Mode: " + mode);
|
||||
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "kill-program", null, mode);
|
||||
|
||||
// TODO: figure out UI issues. that's why this is undocumented
|
||||
ILaunchConfigurationWorkingCopy config;
|
||||
try {
|
||||
config = getRemoteDebugConfig(activeProj);
|
||||
//config.doSave(); // NOTE: For debugging
|
||||
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
|
||||
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
|
||||
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
|
||||
//config.launch(mode, new NullProgressMonitor(), false, true);
|
||||
DebugUITools.launch(config, mode);
|
||||
} catch (CoreException e) {
|
||||
WPILibCPPPlugin.logError("Debug attach failed.", e);
|
||||
}
|
||||
|
||||
try {
|
||||
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
try {
|
||||
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException
|
||||
@@ -126,21 +144,37 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
String remote_connection = RSEUtils.getTarget(teamNumber).getName();
|
||||
|
||||
ILaunchConfigurationWorkingCopy config = type.newInstance(null, activeProj.getName());
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, "");
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "org.eclipse.rse.remotecdt.RemoteGDBDebugger");
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_REGISTER_GROUPS, "");
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, "run");
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, "main");
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, true);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
|
||||
Collection<Executable> exes = ExecutablesManager.getExecutablesManager().getExecutablesForProject(activeProj);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||
exes.size() > 0 ? exes.toArray(new Executable[0])[0].getPath().makeRelativeTo(activeProj.getLocation()).toString():
|
||||
"Debug/FRCUserProgram");
|
||||
|
||||
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
|
||||
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, WPILibCPPPlugin.getDefault().getToolchain() + "/bin/arm-none-linux-gnueabi-gdb");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, remote_connection);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "gdbserver");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false);
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, "2345");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, "gdbserver");
|
||||
|
||||
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, WPILibCPPPlugin.getDefault().getToolchain() + "/bin/arm-none-linux-gnueabi-gdb");
|
||||
List<String> solibs = new ArrayList<>();
|
||||
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/lib");
|
||||
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/usr/lib");
|
||||
solibs.add(WPILibCPPPlugin.getDefault().getCPPDir() + "/lib");
|
||||
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, solibs);
|
||||
|
||||
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true);
|
||||
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false);
|
||||
config.doSave();
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,6 @@ import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
|
||||
public class CPPProjectType implements ProjectType {
|
||||
static ProjectType SIMPLE = new CPPProjectType() {
|
||||
@Override public Map<String, String> getFiles(String packageName) {
|
||||
Map<String, String> files = super.getFiles(packageName);
|
||||
files.put("src/Robot.cpp", "simple/Robot.cpp");
|
||||
return files;
|
||||
}
|
||||
};
|
||||
static ProjectType ITERATIVE = new CPPProjectType() {
|
||||
@Override public Map<String, String> getFiles(String packageName) {
|
||||
Map<String, String> files = super.getFiles(packageName);
|
||||
@@ -45,11 +38,18 @@ public class CPPProjectType implements ProjectType {
|
||||
return files;
|
||||
}
|
||||
};
|
||||
static ProjectType SAMPLE = new CPPProjectType() {
|
||||
@Override public Map<String, String> getFiles(String packageName) {
|
||||
Map<String, String> files = super.getFiles(packageName);
|
||||
files.put("src/Robot.cpp", "sample/Robot.cpp");
|
||||
return files;
|
||||
}
|
||||
};
|
||||
@SuppressWarnings("serial")
|
||||
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
|
||||
put(ProjectType.SIMPLE, SIMPLE);
|
||||
put(ProjectType.ITERATIVE, ITERATIVE);
|
||||
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
|
||||
put(ProjectType.SAMPLE, SAMPLE);
|
||||
}};
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project name="athena-project-build" default="deploy">
|
||||
|
||||
<property file="${wpilib.ant.dir}/../so.properties"/>
|
||||
<property name="opkg.name" value="wpilib" />
|
||||
<property name="opkg.arch" value="armv7a-vfp" />
|
||||
|
||||
|
||||
<!-- Load Tasks -->
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
@@ -23,107 +19,42 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2" />
|
||||
<echo>Target IP: ${target}</echo>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="rm ${deploy.dir}/FRCUserProgram" />
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
failonerror="no"
|
||||
command="rm ${deploy.dir}/FRCUserProgram" />
|
||||
|
||||
<echo>[athena-deploy] Copying code over.</echo>
|
||||
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="opkg info wpilib |grep Version | awk '{printf $2}'"
|
||||
outputproperty="installedWpilibSo"/>
|
||||
<if>
|
||||
<equals arg1="${installedWpilibSo}" arg2="${cpp-sos}" />
|
||||
<then>
|
||||
|
||||
<echo>Found version of WPILib: ${installedWpilibSo} (latest)</echo>
|
||||
</then>
|
||||
<else>
|
||||
<echo>Found version of WPILib: ${installedWpilibSo}</echo>
|
||||
<echo>Upgrading WPILib to ${cpp-sos}...</echo>
|
||||
<delete>
|
||||
<fileset dir="${wpilib.ant.dir}">
|
||||
<include name="data.tar*" />
|
||||
<include name="control*" />
|
||||
<include name="post*" />
|
||||
<include name="md5sums" />
|
||||
<include name="*.deb" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<tar destfile="${wpilib.ant.dir}/data.tar">
|
||||
<tarfileset dir="${wpilib.ant.dir}/../lib" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="usr/local/frc/lib">
|
||||
<include name="libWPILibAthena.so" />
|
||||
<include name="libNetworkTables.so" />
|
||||
<include name="libHALAthena.so" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${wpilib.ant.dir}/data.tar.gz" src="${wpilib.ant.dir}/data.tar"/>
|
||||
<echo file="${wpilib.ant.dir}/debian-binary">2.0</echo>
|
||||
<echo file="${wpilib.ant.dir}/control">Package: ${opkg.name}
|
||||
Version: ${cpp-sos}
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Architecture: ${opkg.arch}
|
||||
Depends: libc6 (>= 2.11.1-r7), libgcc1 (>= 4.4.1)
|
||||
Maintainer: Brad Miller >bamiller@wpi.edu<
|
||||
Description: WPILib, NetworkTables and HAL for RoboRIO target
|
||||
.
|
||||
This package contains the shared objects for WPILib, NetworkTables, and HAL for the 2015 target on the RoboRIO
|
||||
</echo>
|
||||
<echo file="${wpilib.ant.dir}/postinst">#!/bin/sh
|
||||
ldconfig
|
||||
</echo>
|
||||
<echo file="${wpilib.ant.dir}/postrm">#!/bin/sh
|
||||
ldconfig
|
||||
</echo>
|
||||
<checksum property="md5.wpilib" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libWPILibAthena.so" />
|
||||
<checksum property="md5.nwt" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libNetworkTables.so" />
|
||||
<checksum property="md5.hal" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libHALAthena.so" />
|
||||
<echo file="${wpilib.ant.dir}/md5sums">${md5.wpilib} usr/local/frc/lib/libWPILibAthena.so
|
||||
${md5.nwt} usr/local/frc/lib/libNetworkTables.so
|
||||
${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
|
||||
<tar destfile="${wpilib.ant.dir}/control.tar">
|
||||
<tarfileset dir="${wpilib.ant.dir}" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="">
|
||||
<include name="control" />
|
||||
<include name="md5sums" />
|
||||
</tarfileset>
|
||||
<tarfileset dir="${wpilib.ant.dir}" filemode="755" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="">
|
||||
<include name="postinst" />
|
||||
<include name="postrm" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${wpilib.ant.dir}/control.tar.gz" src="${wpilib.ant.dir}/control.tar"/>
|
||||
<exec command="${wpilib.ant.dir}\..\..\..\toolchains\arm-none-linux-gnueabi-4.4.1\bin\arm-none-linux-gnueabi-ar -r ${opkg.name}_${cpp-sos}_${opkg.arch}.deb debian-binary control.tar.gz data.tar.gz" dir="${wpilib.ant.dir}"/>
|
||||
<scp file="${wpilib.ant.dir}/${opkg.name}_${cpp-sos}_${opkg.arch}.deb" todir="${username}@${target}:/tmp"
|
||||
password="${password}" trust="true"/>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="opkg install /tmp/${opkg.name}_${cpp-sos}_${opkg.arch}.deb; sh -c 'rm -rf /tmp/wpilib*.deb'"/>
|
||||
</else>
|
||||
</if>
|
||||
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>
|
||||
|
||||
<echo>[athena-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="chmod +x ${deploy.dir}/FRCUserProgram; ${deploy.dir}/FRCUserProgram"/>
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; chmod a+x ${deploy.dir}/${out}; ${deploy.kill.command};"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="tail -F -n 0 ${deploy.log.file}"/>
|
||||
</target>
|
||||
|
||||
<target name="kill-program" depends="get-target-ip" description="Kill the currently running FRC program">
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="/usr/local/frc/bin/frcKillRobot.sh"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip" description="Deploy the jar and start the program running in debug mode.">
|
||||
@@ -171,4 +102,4 @@ ${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
|
||||
</sequential>
|
||||
</parallel>
|
||||
</target>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/home/admin/FRCUserProgram
|
||||
@@ -67,10 +67,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -80,10 +86,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandGroupWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -93,10 +105,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.SubsystemWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -106,10 +124,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.PIDSubsystemWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -119,23 +143,20 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.TriggerWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="edu.wpi.first.wpilib.plugins.core.preferences.WPILibPreferencePage"
|
||||
class="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
|
||||
id="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
|
||||
name="Java Preferences">
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.runtime.preferences">
|
||||
<initializer
|
||||
@@ -146,10 +167,10 @@
|
||||
point="org.eclipse.debug.ui.launchShortcuts">
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.java.launching.DeployLaunchShortcut"
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
icon="resources/icons/wpi.ico"
|
||||
id="edu.wpi.first.wpilib.plugins.java.launching.deploy"
|
||||
label="WPILib Deploy"
|
||||
label="WPILib Java Deploy"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
@@ -171,11 +192,11 @@
|
||||
</enablement>
|
||||
</contextualLaunch>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO board."
|
||||
mode="run">
|
||||
</description>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board and debug it."
|
||||
description="Deploy the WPILib project to the roboRIO board and debug it."
|
||||
mode="debug">
|
||||
</description>
|
||||
</shortcut>
|
||||
@@ -184,7 +205,7 @@
|
||||
description="Test your WPILib program with the Gazebo simulator."
|
||||
icon="resources/icons/Gazebo.png"
|
||||
id="edu.wpi.first.wpilib.plugins.java.launching.simulate"
|
||||
label="WPILib Simulation"
|
||||
label="WPILib Java Simulation"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<artifactId>wpilibJavaFinal</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<classifier>sources</classifier>
|
||||
<outputDirectory>${java-zip}/lib</outputDirectory>
|
||||
@@ -100,6 +100,13 @@
|
||||
</artifactItem>
|
||||
|
||||
<!-- Javadoc -->
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
@@ -132,6 +139,12 @@
|
||||
<artifactId>JavaGazebo</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaSim</artifactId>
|
||||
@@ -323,6 +336,12 @@
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaFinal</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<classifier>sources</classifier>
|
||||
</dependency>
|
||||
<!-- dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
@@ -348,6 +367,11 @@
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Javadoc -->
|
||||
<dependency>
|
||||
@@ -356,5 +380,11 @@
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Trigger;
|
||||
import edu.wpi.first.wpilibj.buttons.Trigger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -51,9 +51,6 @@ public class DriveTrain extends Subsystem {
|
||||
left_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
|
||||
right_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
|
||||
}
|
||||
|
||||
left_encoder.start();
|
||||
right_encoder.start();
|
||||
|
||||
rangefinder = new AnalogInput(6);
|
||||
gyro = new Gyro(1);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class Robot extends IterativeRobot {
|
||||
public static Collector collector;
|
||||
public static Shooter shooter;
|
||||
public static Pneumatics pneumatics;
|
||||
public static Pivot pivot;;
|
||||
public static Pivot pivot;
|
||||
|
||||
public SendableChooser autoChooser;
|
||||
public SendableChooser autonomousDirectionChooser;
|
||||
|
||||
@@ -63,8 +63,6 @@ public class DriveTrain extends Subsystem {
|
||||
leftEncoder.setDistancePerPulse((4.0/*in*/*Math.PI)/(360.0*12.0/*in/ft*/));
|
||||
}
|
||||
|
||||
rightEncoder.start();
|
||||
leftEncoder.start();
|
||||
LiveWindow.addSensor("DriveTrain", "Right Encoder", rightEncoder);
|
||||
LiveWindow.addSensor("DriveTrain", "Left Encoder", leftEncoder);
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
import edu.wpi.first.wpilibj.RobotDrive;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the RobotDrive class.
|
||||
* The SampleRobot class is the base of a robot application that will automatically call your
|
||||
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
|
||||
* the driver station or the field controls.
|
||||
*
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the SampleRobot
|
||||
* documentation. If you change the name of this class or the package after
|
||||
* creating this project, you must also update the manifest file in the resource
|
||||
* directory.
|
||||
*
|
||||
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
|
||||
* don't. Unless you know what you are doing, complex code will be much more difficult under
|
||||
* this system. Use IterativeRobot or Command-Based instead if you're new.
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
RobotDrive myRobot;
|
||||
Joystick stick;
|
||||
|
||||
public Robot() {
|
||||
myRobot = new RobotDrive(0, 1);
|
||||
myRobot.setExpiration(0.1);
|
||||
stick = new Joystick(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drive left & right motors for 2 seconds then stop
|
||||
*/
|
||||
public void autonomous() {
|
||||
myRobot.setSafetyEnabled(false);
|
||||
myRobot.drive(-0.5, 0.0); // drive forwards half speed
|
||||
Timer.delay(2.0); // for 2 seconds
|
||||
myRobot.drive(0.0, 0.0); // stop robot
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motors with arcade steering.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
myRobot.setSafetyEnabled(true);
|
||||
while (isOperatorControl()) {
|
||||
myRobot.arcadeDrive(stick); // drive with arcade style (use right stick)
|
||||
Timer.delay(0.005); // wait for a motor update time
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs during test mode
|
||||
*/
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SimpleRobot;
|
||||
|
||||
/**
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the SimpleRobot
|
||||
* documentation. If you change the name of this class or the package after
|
||||
* creating this project, you must also update the manifest file in the resource
|
||||
* directory.
|
||||
*/
|
||||
public class Robot extends SimpleRobot {
|
||||
/**
|
||||
* This function is called once each time the robot enters autonomous mode.
|
||||
*/
|
||||
public void autonomous() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called once each time the robot enters operator control.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called once each time the robot enters test mode.
|
||||
*/
|
||||
public void test() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -78,12 +78,16 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
|
||||
return "DEVELOPMENT";
|
||||
}
|
||||
}
|
||||
public String getJavaPath() {
|
||||
return WPILibCore.getDefault().getWPILibBaseDir()
|
||||
+ File.separator + "java" + File.separator + "current";
|
||||
}
|
||||
|
||||
public Properties getProjectProperties(IProject project) {
|
||||
Properties defaults = WPILibCore.getDefault().getProjectProperties(project);
|
||||
Properties props;
|
||||
try {
|
||||
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/"+getCurrentVersion()+"/ant/build.properties");
|
||||
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/current/ant/build.properties");
|
||||
props = new AntPropertiesParser(new FileInputStream(file)).getProperties(defaults);
|
||||
} catch (Exception e) {
|
||||
WPILibJavaPlugin.logError("Error getting properties.", e);
|
||||
@@ -100,11 +104,15 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
|
||||
IProject[] projects = root.getProjects();
|
||||
// Loop over all projects
|
||||
for (IProject project : projects) {
|
||||
try {
|
||||
updateVariables(project);
|
||||
} catch (CoreException e) {
|
||||
WPILibJavaPlugin.logError("Error updating projects.", e);
|
||||
}
|
||||
try {
|
||||
if(project.hasNature("edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature")){
|
||||
WPILibJavaPlugin.logInfo("Updating project");
|
||||
updateVariables(project);
|
||||
} else {
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
WPILibJavaPlugin.logError("Error updating projects.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2" />
|
||||
<echo>Target IP: ${target}</echo>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
</target>
|
||||
|
||||
<target name="compile" description="Compile the source code.">
|
||||
@@ -34,9 +32,9 @@
|
||||
includeAntRuntime="no"
|
||||
includeJavaRuntime="no"
|
||||
classpath="${classpath}"
|
||||
target="1.7"
|
||||
source="1.7"
|
||||
compiler="javac1.7"
|
||||
target="${ant.java.version}"
|
||||
source="${ant.java.version}"
|
||||
compiler="javac${ant.java.version}"
|
||||
debug="true">
|
||||
</javac>
|
||||
</target>
|
||||
@@ -78,25 +76,35 @@
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; chmod a+x run*program; ${deploy.kill.command};"/>
|
||||
command="${deploy.kill.command};"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="tail -f -s 0 -n 1 ${deploy.log.file}"/>
|
||||
command="${deploy.log.command}"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
|
||||
<echo>[athena-deploy] Copying code over.</echo>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
|
||||
<!-- The remoteDebugCommand file is used by /usr/local/frc/bin/frcRunRobot.sh on the roboRIO -->
|
||||
<scp file="${wpilib.ant.dir}/robotDebugCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
|
||||
<!-- The frcdebug file is used as a flag for /usr/local/frc/bin/frcRunRobot.sh to run the robot program in debug mode -->
|
||||
<scp file="${wpilib.ant.dir}/frcdebug" todir="${username}@${target}:${debug.flag.dir}" password="${password}" trust="true"/>
|
||||
|
||||
<echo>[athena-deploy] Starting program.</echo>
|
||||
<echo>[athena-deploy] Starting Debug program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; ${deploy.debug.command}"/>
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="${deploy.kill.command}"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="${deploy.log.command}"/>
|
||||
</target>
|
||||
|
||||
<!-- Simulate -->
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 2.8)
|
||||
project(HAL)
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES lib/Athena/*.cpp)
|
||||
include_directories(lib/Athena include)
|
||||
include_directories(lib/Athena lib/Athena/FRC_FPGA_ChipObject include)
|
||||
add_library(HALAthena STATIC ${SRC_FILES})
|
||||
target_link_libraries(HALAthena ${NI_LIBS})
|
||||
INSTALL(TARGETS HALAthena ARCHIVE DESTINATION lib COMPONENT lib)
|
||||
INSTALL(FILES ${NI_LIBS} DESTINATION lib COMPONENT ni_lib)
|
||||
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
|
||||
# lib/ c m gcc_s ld-linux
|
||||
# usr/lib stdc++
|
||||
# usr/lib
|
||||
# FRC_NetworkCommunication FRC_FPGA_ChipObject RoboRIO_FRC_ChipObject
|
||||
|
||||
|
||||
15
hal/include/HAL/Accelerometer.hpp
Normal file
15
hal/include/HAL/Accelerometer.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
enum AccelerometerRange {
|
||||
kRange_2G = 0,
|
||||
kRange_4G = 1,
|
||||
kRange_8G = 2,
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void setAccelerometerActive(bool);
|
||||
void setAccelerometerRange(AccelerometerRange);
|
||||
double getAccelerometerX();
|
||||
double getAccelerometerY();
|
||||
double getAccelerometerZ();
|
||||
}
|
||||
@@ -26,11 +26,9 @@ extern "C"
|
||||
void* initializeAnalogInputPort(void* port_pointer, int32_t *status);
|
||||
bool checkAnalogModule(uint8_t module);
|
||||
bool checkAnalogInputChannel(uint32_t pin);
|
||||
|
||||
|
||||
void setAnalogSampleRate(double samplesPerSecond, int32_t *status);
|
||||
float getAnalogSampleRate(int32_t *status);
|
||||
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status);
|
||||
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status);
|
||||
void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
|
||||
uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status);
|
||||
void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
|
||||
@@ -71,14 +69,11 @@ extern "C"
|
||||
//// Float JNA Hack
|
||||
// Float
|
||||
int getAnalogSampleRateIntHack(int32_t *status);
|
||||
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status);
|
||||
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status);
|
||||
int getAnalogAverageVoltageIntHack(void* analog_port_pointer, int32_t *status);
|
||||
|
||||
// Doubles
|
||||
void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status);
|
||||
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond,
|
||||
int32_t *status);
|
||||
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status);
|
||||
void setAnalogTriggerLimitsVoltageIntHack(void* analog_trigger_pointer, int lower, int upper,
|
||||
int32_t *status);
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "NetworkCommunication/CANSessionMux.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void JaguarCANSendMessage(uint32_t messageID, const uint8_t *data, uint8_t dataSize,
|
||||
int32_t *status);
|
||||
void JaguarCANReceiveMessage(uint32_t *messageID, uint8_t *data, uint8_t *dataSize,
|
||||
uint32_t timeoutMs, int32_t *status);
|
||||
}
|
||||
void canTxSend(uint32_t arbID, uint8_t length, int32_t period = CAN_SEND_PERIOD_NO_REPEAT);
|
||||
|
||||
void canTxPackInt8 (uint32_t arbID, uint8_t offset, uint8_t value);
|
||||
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value);
|
||||
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value);
|
||||
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value);
|
||||
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value);
|
||||
|
||||
uint8_t canTxUnpackInt8 (uint32_t arbID, uint8_t offset);
|
||||
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset);
|
||||
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset);
|
||||
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset);
|
||||
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset);
|
||||
|
||||
bool canRxReceive(uint32_t arbID);
|
||||
|
||||
uint8_t canRxUnpackInt8 (uint32_t arbID, uint8_t offset);
|
||||
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset);
|
||||
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset);
|
||||
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset);
|
||||
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "HAL/cpp/Synchronized.hpp"
|
||||
|
||||
enum Mode
|
||||
{
|
||||
@@ -12,40 +13,23 @@ enum Mode
|
||||
kPulseLength = 2,
|
||||
kExternalDirection = 3
|
||||
};
|
||||
enum tSPIConstants
|
||||
{
|
||||
kReceiveFIFODepth = 512,
|
||||
kTransmitFIFODepth = 512
|
||||
};
|
||||
enum tFrameMode
|
||||
{
|
||||
kChipSelect,
|
||||
kPreLatchPulse,
|
||||
kPostLatchPulse,
|
||||
kPreAndPostLatchPulse
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void* initializeDigitalPort(void* port_pointer, int32_t *status);
|
||||
bool checkDigitalModule(uint8_t module);
|
||||
bool checkPWMChannel(void* digital_port_pointer);
|
||||
bool checkRelayChannel(void* digital_port_pointer);
|
||||
|
||||
void setPWM(void* digital_port_pointer, unsigned short value, int32_t *status);
|
||||
bool allocatePWMChannel(void* digital_port_pointer, int32_t *status);
|
||||
void freePWMChannel(void* digital_port_pointer, int32_t *status);
|
||||
unsigned short getPWM(void* digital_port_pointer, int32_t *status);
|
||||
void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t *status);
|
||||
void* allocatePWM(int32_t *status);
|
||||
void* allocatePWMWithModule(uint8_t module, int32_t *status);
|
||||
void freePWM(void* pwmGenerator, int32_t *status);
|
||||
void freePWMWithModule(uint8_t module, void* pwmGenerator, int32_t *status);
|
||||
void setPWMRate(double rate, int32_t *status);
|
||||
void setPWMRateWithModule(uint8_t module, double rate, int32_t *status);
|
||||
void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status);
|
||||
void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCycle,
|
||||
int32_t *status);
|
||||
void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status);
|
||||
void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t pin,
|
||||
int32_t *status);
|
||||
|
||||
void setRelayForward(void* digital_port_pointer, bool on, int32_t *status);
|
||||
void setRelayReverse(void* digital_port_pointer, bool on, int32_t *status);
|
||||
@@ -60,18 +44,15 @@ extern "C"
|
||||
void pulse(void* digital_port_pointer, double pulseLength, int32_t *status);
|
||||
bool isPulsing(void* digital_port_pointer, int32_t *status);
|
||||
bool isAnyPulsing(int32_t *status);
|
||||
bool isAnyPulsingWithModule(uint8_t module, int32_t *status);
|
||||
|
||||
void* initializeCounter(Mode mode, uint32_t *index, int32_t *status);
|
||||
void freeCounter(void* counter_pointer, int32_t *status);
|
||||
void setCounterAverageSize(void* counter_pointer, int32_t size, int32_t *status);
|
||||
void setCounterUpSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
|
||||
bool analogTrigger, int32_t *status); // TODO: Without Module
|
||||
void setCounterUpSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
|
||||
void setCounterUpSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
|
||||
int32_t *status);
|
||||
void clearCounterUpSource(void* counter_pointer, int32_t *status);
|
||||
void setCounterDownSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
|
||||
bool analogTrigger, int32_t *status); // TODO: Without Module
|
||||
void setCounterDownSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
|
||||
void setCounterDownSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
|
||||
int32_t *status);
|
||||
void clearCounterDownSource(void* counter_pointer, int32_t *status);
|
||||
@@ -110,48 +91,30 @@ extern "C"
|
||||
uint32_t getEncoderSamplesToAverage(void* encoder_pointer, int32_t *status);
|
||||
|
||||
uint16_t getLoopTiming(int32_t *status);
|
||||
uint16_t getLoopTimingWithModule(uint8_t module, int32_t *status);
|
||||
|
||||
void* initializeSPI(uint8_t sclk_routing_module, uint32_t sclk_routing_pin,
|
||||
uint8_t mosi_routing_module, uint32_t mosi_routing_pin, uint8_t miso_routing_module,
|
||||
uint32_t miso_routing_pin, int32_t *status);
|
||||
void cleanSPI(void* spi_pointer, int32_t *status);
|
||||
void setSPIBitsPerWord(void* spi_pointer, uint32_t bits, int32_t *status);
|
||||
uint32_t getSPIBitsPerWord(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockRate(void* spi_pointer, double hz, int32_t *status);
|
||||
void setSPIMSBFirst(void* spi_pointer, int32_t *status);
|
||||
void setSPILSBFirst(void* spi_pointer, int32_t *status);
|
||||
void setSPISampleDataOnFalling(void* spi_pointer, int32_t *status);
|
||||
void setSPISampleDataOnRising(void* spi_pointer, int32_t *status);
|
||||
void setSPISlaveSelect(void* spi_pointer, uint8_t ss_routing_module, uint32_t ss_routing_pin,
|
||||
int32_t *status);
|
||||
void setSPILatchMode(void* spi_pointer, tFrameMode mode, int32_t *status);
|
||||
tFrameMode getSPILatchMode(void* spi_pointer, int32_t *status);
|
||||
void setSPIFramePolarity(void* spi_pointer, bool activeLow, int32_t *status);
|
||||
bool getSPIFramePolarity(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockActiveLow(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockActiveHigh(void* spi_pointer, int32_t *status);
|
||||
void applySPIConfig(void* spi_pointer, int32_t *status);
|
||||
uint16_t getSPIOutputFIFOAvailable(void* spi_pointer, int32_t *status);
|
||||
uint16_t getSPINumReceived(void* spi_pointer, int32_t *status);
|
||||
bool isSPIDone(void* spi_pointer, int32_t *status);
|
||||
bool hadSPIReceiveOverflow(void* spi_pointer, int32_t *status);
|
||||
void writeSPI(void* spi_pointer, uint32_t data, int32_t *status);
|
||||
uint32_t readSPI(void* spi_pointer, bool initiate, int32_t *status);
|
||||
void resetSPI(void* spi_pointer, int32_t *status);
|
||||
void clearSPIReceivedData(void* spi_pointer, int32_t *status);
|
||||
void spiInitialize(uint8_t port, int32_t *status);
|
||||
int32_t spiTransaction(uint8_t port, uint8_t *dataToSend, uint8_t *dataReceived, uint8_t size);
|
||||
int32_t spiWrite(uint8_t port, uint8_t* dataToSend, uint8_t sendSize);
|
||||
int32_t spiRead(uint8_t port, uint8_t *buffer, uint8_t count);
|
||||
void spiClose(uint8_t port);
|
||||
void spiSetSpeed(uint8_t port, uint32_t speed);
|
||||
void spiSetBitsPerWord(uint8_t port, uint8_t bpw);
|
||||
void spiSetOpts(uint8_t port, int msb_first, int sample_on_trailing, int clk_idle_high);
|
||||
void spiSetChipSelectActiveHigh(uint8_t port, int32_t *status);
|
||||
void spiSetChipSelectActiveLow(uint8_t port, int32_t *status);
|
||||
int32_t spiGetHandle(uint8_t port);
|
||||
void spiSetHandle(uint8_t port, int32_t handle);
|
||||
MUTEX_ID spiGetSemaphore(uint8_t port);
|
||||
void spiSetSemaphore(uint8_t port, MUTEX_ID semaphore);
|
||||
|
||||
void i2CInitialize(uint8_t port, int32_t *status);
|
||||
int i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
|
||||
int i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
|
||||
int i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
|
||||
int32_t i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
|
||||
int32_t i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
|
||||
int32_t i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
|
||||
void i2CClose(uint8_t port);
|
||||
|
||||
//// Float JNA Hack
|
||||
// double
|
||||
void setPWMRateIntHack(int rate, int32_t *status);
|
||||
void setPWMRateWithModuleIntHack(uint8_t module, int32_t rate, int32_t *status);
|
||||
void setPWMDutyCycleIntHack(void* pwmGenerator, int32_t dutyCycle, int32_t *status);
|
||||
void setPWMDutyCycleWithModuleIntHack(uint8_t module, void* pwmGenerator, int32_t dutyCycle,
|
||||
int32_t *status);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define SAMPLE_RATE_TOO_HIGH 1
|
||||
#define SAMPLE_RATE_TOO_HIGH_MESSAGE "Analog module sample rate is too high"
|
||||
#define VOLTAGE_OUT_OF_RANGE 2
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [-10; 10]"
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [0; 5]"
|
||||
#define LOOP_TIMING_ERROR 4
|
||||
#define LOOP_TIMING_ERROR_MESSAGE "Digital module loop timing is not the expected value"
|
||||
#define SPI_WRITE_NO_MOSI 12
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
#endif
|
||||
#include <cmath>
|
||||
|
||||
#include "Accelerometer.hpp"
|
||||
#include "Analog.hpp"
|
||||
#include "CAN.hpp"
|
||||
#include "Compressor.hpp"
|
||||
#include "Digital.hpp"
|
||||
#include "Solenoid.hpp"
|
||||
@@ -20,6 +22,7 @@
|
||||
#include "Interrupts.hpp"
|
||||
#include "Errors.hpp"
|
||||
#include "PDP.hpp"
|
||||
#include "Power.hpp"
|
||||
|
||||
#include "Utilities.hpp"
|
||||
#include "Semaphore.hpp"
|
||||
@@ -28,7 +31,6 @@
|
||||
#define HAL_IO_CONFIG_DATA_SIZE 32
|
||||
#define HAL_SYS_STATUS_DATA_SIZE 44
|
||||
#define HAL_USER_STATUS_DATA_SIZE (984 - HAL_IO_CONFIG_DATA_SIZE - HAL_SYS_STATUS_DATA_SIZE)
|
||||
#define HAL_USER_DS_LCD_DATA_SIZE 128
|
||||
|
||||
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
|
||||
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
|
||||
@@ -140,119 +142,32 @@ namespace HALUsageReporting
|
||||
};
|
||||
}
|
||||
|
||||
struct HALCommonControlData
|
||||
{
|
||||
uint16_t packetIndex;
|
||||
union
|
||||
{
|
||||
uint8_t control;
|
||||
#ifndef __vxworks
|
||||
struct
|
||||
{
|
||||
uint8_t checkVersions :1;
|
||||
uint8_t test :1;
|
||||
uint8_t resync :1;
|
||||
uint8_t fmsAttached :1;
|
||||
uint8_t autonomous :1;
|
||||
uint8_t enabled :1;
|
||||
uint8_t notEStop :1;
|
||||
uint8_t reset :1;
|
||||
};
|
||||
#else
|
||||
struct
|
||||
{
|
||||
uint8_t reset : 1;
|
||||
uint8_t notEStop : 1;
|
||||
uint8_t enabled : 1;
|
||||
uint8_t autonomous : 1;
|
||||
uint8_t fmsAttached:1;
|
||||
uint8_t resync : 1;
|
||||
uint8_t test :1;
|
||||
uint8_t checkVersions :1;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
uint8_t dsDigitalIn;
|
||||
uint16_t teamID;
|
||||
|
||||
char dsID_Alliance;
|
||||
char dsID_Position;
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick0Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick0Axis1;
|
||||
int8_t stick0Axis2;
|
||||
int8_t stick0Axis3;
|
||||
int8_t stick0Axis4;
|
||||
int8_t stick0Axis5;
|
||||
int8_t stick0Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick0Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick1Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick1Axis1;
|
||||
int8_t stick1Axis2;
|
||||
int8_t stick1Axis3;
|
||||
int8_t stick1Axis4;
|
||||
int8_t stick1Axis5;
|
||||
int8_t stick1Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick1Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick2Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick2Axis1;
|
||||
int8_t stick2Axis2;
|
||||
int8_t stick2Axis3;
|
||||
int8_t stick2Axis4;
|
||||
int8_t stick2Axis5;
|
||||
int8_t stick2Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick2Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick3Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick3Axis1;
|
||||
int8_t stick3Axis2;
|
||||
int8_t stick3Axis3;
|
||||
int8_t stick3Axis4;
|
||||
int8_t stick3Axis5;
|
||||
int8_t stick3Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick3Buttons; // Left-most 4 bits are unused
|
||||
|
||||
//Analog inputs are 10 bit right-justified
|
||||
uint16_t analog1;
|
||||
uint16_t analog2;
|
||||
uint16_t analog3;
|
||||
uint16_t analog4;
|
||||
|
||||
uint64_t cRIOChecksum;
|
||||
uint32_t FPGAChecksum0;
|
||||
uint32_t FPGAChecksum1;
|
||||
uint32_t FPGAChecksum2;
|
||||
uint32_t FPGAChecksum3;
|
||||
|
||||
char versionData[8];
|
||||
struct HALControlWord {
|
||||
uint32_t enabled : 1;
|
||||
uint32_t autonomous : 1;
|
||||
uint32_t test :1;
|
||||
uint32_t eStop : 1;
|
||||
uint32_t fmsAttached:1;
|
||||
uint32_t dsAttached:1;
|
||||
uint32_t control_reserved : 26;
|
||||
};
|
||||
|
||||
enum HALAllianceStationID {
|
||||
kHALAllianceStationID_red1,
|
||||
kHALAllianceStationID_red2,
|
||||
kHALAllianceStationID_red3,
|
||||
kHALAllianceStationID_blue1,
|
||||
kHALAllianceStationID_blue2,
|
||||
kHALAllianceStationID_blue3,
|
||||
};
|
||||
|
||||
struct HALJoystickAxes {
|
||||
uint16_t count;
|
||||
int16_t axes[6];
|
||||
};
|
||||
|
||||
typedef uint32_t HALJoystickButtons;
|
||||
|
||||
inline float intToFloat(int value)
|
||||
{
|
||||
return (float)value;
|
||||
@@ -278,18 +193,16 @@ extern "C"
|
||||
uint32_t getFPGARevision(int32_t *status);
|
||||
uint32_t getFPGATime(int32_t *status);
|
||||
|
||||
void setFPGALED(uint32_t state, int32_t *status);
|
||||
int32_t getFPGALED(int32_t *status);
|
||||
bool getFPGAButton(int32_t *status);
|
||||
|
||||
int HALSetErrorData(const char *errors, int errorsLength, int wait_ms);
|
||||
int HALSetUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
|
||||
int HALOverrideIOConfig(const char *ioConfig, int wait_ms);
|
||||
int HALGetDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
|
||||
int HALGetCommonControlData(HALCommonControlData *data, int wait_ms);
|
||||
|
||||
int HALGetControlWord(HALControlWord *data);
|
||||
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes, uint8_t maxAxes);
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
|
||||
|
||||
void HALSetNewDataSem(pthread_mutex_t *);
|
||||
int HALSetStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
|
||||
const char *userDataHigh, int userDataHighLength, const char *userDataLow,
|
||||
int userDataLowLength, int wait_ms);
|
||||
|
||||
int HALInitialize(int mode = 0);
|
||||
void HALNetworkCommunicationObserveUserProgramStarting();
|
||||
@@ -311,4 +224,3 @@ extern "C"
|
||||
void EDVR_CreateReference();
|
||||
void Occur();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include "errno.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
typedef void (*InterruptHandlerFunction)(uint32_t interruptAssertedMask, void *param);
|
||||
|
||||
15
hal/include/HAL/Power.hpp
Normal file
15
hal/include/HAL/Power.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
float getVinVoltage(int32_t *status);
|
||||
float getVinCurrent(int32_t *status);
|
||||
float getUserVoltage6V(int32_t *status);
|
||||
float getUserCurrent6V(int32_t *status);
|
||||
float getUserVoltage5V(int32_t *status);
|
||||
float getUserCurrent5V(int32_t *status);
|
||||
float getUserVoltage3V3(int32_t *status);
|
||||
float getUserCurrent3V3(int32_t *status);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void printCurrentStackTrace();
|
||||
bool getErrnoToName(int32_t errNo, char* name);
|
||||
}
|
||||
234
hal/lib/Athena/Accelerometer.cpp
Normal file
234
hal/lib/Athena/Accelerometer.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
#include "HAL/Accelerometer.hpp"
|
||||
|
||||
#include "ChipObject.h"
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
// The 7-bit I2C address with a 0 "send" bit
|
||||
static const uint8_t kSendAddress = (0x1c << 1) | 0;
|
||||
|
||||
// The 7-bit I2C address with a 1 "receive" bit
|
||||
static const uint8_t kReceiveAddress = (0x1c << 1) | 1;
|
||||
|
||||
static const uint8_t kControlTxRx = 1;
|
||||
static const uint8_t kControlStart = 2;
|
||||
static const uint8_t kControlStop = 4;
|
||||
|
||||
static tAccel *accel = 0;
|
||||
static AccelerometerRange accelerometerRange;
|
||||
|
||||
// Register addresses
|
||||
enum Register {
|
||||
kReg_Status = 0x00,
|
||||
kReg_OutXMSB = 0x01,
|
||||
kReg_OutXLSB = 0x02,
|
||||
kReg_OutYMSB = 0x03,
|
||||
kReg_OutYLSB = 0x04,
|
||||
kReg_OutZMSB = 0x05,
|
||||
kReg_OutZLSB = 0x06,
|
||||
kReg_Sysmod = 0x0B,
|
||||
kReg_IntSource = 0x0C,
|
||||
kReg_WhoAmI = 0x0D,
|
||||
kReg_XYZDataCfg = 0x0E,
|
||||
kReg_HPFilterCutoff = 0x0F,
|
||||
kReg_PLStatus = 0x10,
|
||||
kReg_PLCfg = 0x11,
|
||||
kReg_PLCount = 0x12,
|
||||
kReg_PLBfZcomp = 0x13,
|
||||
kReg_PLThsReg = 0x14,
|
||||
kReg_FFMtCfg = 0x15,
|
||||
kReg_FFMtSrc = 0x16,
|
||||
kReg_FFMtThs = 0x17,
|
||||
kReg_FFMtCount = 0x18,
|
||||
kReg_TransientCfg = 0x1D,
|
||||
kReg_TransientSrc = 0x1E,
|
||||
kReg_TransientThs = 0x1F,
|
||||
kReg_TransientCount = 0x20,
|
||||
kReg_PulseCfg = 0x21,
|
||||
kReg_PulseSrc = 0x22,
|
||||
kReg_PulseThsx = 0x23,
|
||||
kReg_PulseThsy = 0x24,
|
||||
kReg_PulseThsz = 0x25,
|
||||
kReg_PulseTmlt = 0x26,
|
||||
kReg_PulseLtcy = 0x27,
|
||||
kReg_PulseWind = 0x28,
|
||||
kReg_ASlpCount = 0x29,
|
||||
kReg_CtrlReg1 = 0x2A,
|
||||
kReg_CtrlReg2 = 0x2B,
|
||||
kReg_CtrlReg3 = 0x2C,
|
||||
kReg_CtrlReg4 = 0x2D,
|
||||
kReg_CtrlReg5 = 0x2E,
|
||||
kReg_OffX = 0x2F,
|
||||
kReg_OffY = 0x30,
|
||||
kReg_OffZ = 0x31
|
||||
};
|
||||
|
||||
extern "C" uint32_t getFPGATime(int32_t *status);
|
||||
|
||||
static void writeRegister(Register reg, uint8_t data);
|
||||
static uint8_t readRegister(Register reg);
|
||||
|
||||
/**
|
||||
* Initialize the accelerometer.
|
||||
*/
|
||||
static void initializeAccelerometer() {
|
||||
int32_t status;
|
||||
|
||||
if(!accel) {
|
||||
accel = tAccel::create(&status);
|
||||
|
||||
// Enable I2C
|
||||
accel->writeCNFG(1, &status);
|
||||
|
||||
// Set the counter to 100 kbps
|
||||
accel->writeCNTR(213, &status);
|
||||
|
||||
// The device identification number should be 0x2a
|
||||
assert(readRegister(kReg_WhoAmI) == 0x2a);
|
||||
}
|
||||
}
|
||||
|
||||
static void writeRegister(Register reg, uint8_t data) {
|
||||
int32_t status = 0;
|
||||
uint32_t initialTime;
|
||||
|
||||
accel->writeADDR(kSendAddress, &status);
|
||||
|
||||
// Send a start transmit/receive message with the register address
|
||||
accel->writeCNTL(kControlStart | kControlTxRx, &status);
|
||||
accel->writeDATO(reg, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
// Send a stop transmit/receive message with the data
|
||||
accel->writeCNTL(kControlStop | kControlTxRx, &status);
|
||||
accel->writeDATO(data, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static uint8_t readRegister(Register reg) {
|
||||
int32_t status = 0;
|
||||
uint32_t initialTime;
|
||||
|
||||
// Send a start transmit/receive message with the register address
|
||||
accel->writeADDR(kSendAddress, &status);
|
||||
accel->writeCNTL(kControlStart | kControlTxRx, &status);
|
||||
accel->writeDATO(reg, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
// Receive a message with the data and stop
|
||||
accel->writeADDR(kReceiveAddress, &status);
|
||||
accel->writeCNTL(kControlStart | kControlStop | kControlTxRx, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
return accel->readDATI(&status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 12-bit raw acceleration value into a scaled double in units of
|
||||
* 1 g-force, taking into account the accelerometer range.
|
||||
*/
|
||||
static double unpackAxis(int16_t raw) {
|
||||
// The raw value is actually 12 bits, not 16, so we need to propogate the
|
||||
// 2's complement sign bit to the unused 4 bits for this to work with
|
||||
// negative numbers.
|
||||
raw <<= 4;
|
||||
raw >>= 4;
|
||||
|
||||
switch(accelerometerRange) {
|
||||
case kRange_2G: return raw / 1024.0;
|
||||
case kRange_4G: return raw / 512.0;
|
||||
case kRange_8G: return raw / 256.0;
|
||||
default: return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the accelerometer to active or standby mode. It must be in standby
|
||||
* mode to change any configuration.
|
||||
*/
|
||||
void setAccelerometerActive(bool active) {
|
||||
initializeAccelerometer();
|
||||
|
||||
uint8_t ctrlReg1 = readRegister(kReg_CtrlReg1);
|
||||
ctrlReg1 &= ~1; // Clear the existing active bit
|
||||
writeRegister(kReg_CtrlReg1, ctrlReg1 | (active? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the range of values that can be measured (either 2, 4, or 8 g-forces).
|
||||
* The accelerometer should be in standby mode when this is called.
|
||||
*/
|
||||
void setAccelerometerRange(AccelerometerRange range) {
|
||||
initializeAccelerometer();
|
||||
|
||||
accelerometerRange = range;
|
||||
|
||||
uint8_t xyzDataCfg = readRegister(kReg_XYZDataCfg);
|
||||
xyzDataCfg &= ~3; // Clear the existing two range bits
|
||||
writeRegister(kReg_XYZDataCfg, xyzDataCfg | range);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the x-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerX() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutXMSB) << 4) | (readRegister(kReg_OutXLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the y-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerY() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutYMSB) << 4) | (readRegister(kReg_OutYLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the z-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerZ() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutZMSB) << 4) | (readRegister(kReg_OutZLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ bool checkAnalogModule(uint8_t module) {
|
||||
* @return Analog channel is valid
|
||||
*/
|
||||
bool checkAnalogInputChannel(uint32_t pin) {
|
||||
if (pin >= 0 && pin < kAnalogInputPins)
|
||||
if (pin < kAnalogInputPins)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ bool checkAnalogInputChannel(uint32_t pin) {
|
||||
* @return Analog channel is valid
|
||||
*/
|
||||
bool checkAnalogOutputChannel(uint32_t pin) {
|
||||
if (pin >= 0 && pin < kAnalogOutputPins)
|
||||
if (pin < kAnalogOutputPins)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -185,40 +185,6 @@ float getAnalogSampleRate(int32_t *status) {
|
||||
return (float)kTimebase / (float)ticksPerSample;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sample rate on the module.
|
||||
*
|
||||
* This is a global setting for the module and effects all channels.
|
||||
*
|
||||
* @param module The module to use
|
||||
* @param samplesPerSecond The number of samples per channel per second.
|
||||
*/
|
||||
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status) {
|
||||
if (checkAnalogModule(module)) {
|
||||
setAnalogSampleRate(samplesPerSecond, status);
|
||||
} else {
|
||||
// XXX: Set error status
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current sample rate on the module.
|
||||
*
|
||||
* This assumes one entry in the scan list.
|
||||
* This is a global setting for the module and effects all channels.
|
||||
*
|
||||
* @param module The module to use
|
||||
* @return Sample rate.
|
||||
*/
|
||||
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status) {
|
||||
if (checkAnalogModule(module)) {
|
||||
return getAnalogSampleRate(status);
|
||||
} else {
|
||||
return -1; // XXX: Set error status
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the number of averaging bits.
|
||||
*
|
||||
@@ -283,7 +249,7 @@ uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) {
|
||||
/**
|
||||
* Get a sample straight from the channel on this module.
|
||||
*
|
||||
* The sample is a 12-bit value representing the -10V to 10V range of the A/D converter in the module.
|
||||
* The sample is a 12-bit value representing the 0V to 5V range of the A/D converter in the module.
|
||||
* The units are in A/D converter codes. Use GetVoltage() to get the analog value in calibrated units.
|
||||
*
|
||||
* @param analog_port_pointer Pointer to the analog port to use.
|
||||
@@ -322,7 +288,7 @@ int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) {
|
||||
*/
|
||||
int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
|
||||
AnalogPort* port = (AnalogPort*) analog_port_pointer;
|
||||
int16_t value;
|
||||
int32_t value;
|
||||
checkAnalogInputChannel(port->port.pin);
|
||||
|
||||
tAI::tReadSelect readSelect;
|
||||
@@ -333,7 +299,7 @@ int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
|
||||
Synchronized sync(analogRegisterWindowSemaphore);
|
||||
analogInputSystem->writeReadSelect(readSelect, status);
|
||||
analogInputSystem->strobeLatchOutput(status);
|
||||
value = (int16_t) analogInputSystem->readOutput(status);
|
||||
value = (int32_t) analogInputSystem->readOutput(status);
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -387,12 +353,12 @@ float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) {
|
||||
* @return The raw value for the channel.
|
||||
*/
|
||||
int32_t getAnalogVoltsToValue(void* analog_port_pointer, double voltage, int32_t *status) {
|
||||
if (voltage > 10.0) {
|
||||
voltage = 10.0;
|
||||
if (voltage > 5.0) {
|
||||
voltage = 5.0;
|
||||
*status = VOLTAGE_OUT_OF_RANGE;
|
||||
}
|
||||
if (voltage < -10.0) {
|
||||
voltage = -10.0;
|
||||
if (voltage < 0.0) {
|
||||
voltage = 0.0;
|
||||
*status = VOLTAGE_OUT_OF_RANGE;
|
||||
}
|
||||
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
|
||||
@@ -736,10 +702,6 @@ int getAnalogSampleRateIntHack(int32_t *status) {
|
||||
return floatToInt(getAnalogSampleRate(status));
|
||||
}
|
||||
|
||||
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status) {
|
||||
return floatToInt(getAnalogSampleRateWithModuleIntHack(module, status));
|
||||
}
|
||||
|
||||
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status) {
|
||||
return floatToInt(getAnalogVoltage(analog_port_pointer, status));
|
||||
}
|
||||
@@ -754,10 +716,6 @@ void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status) {
|
||||
setAnalogSampleRate(intToFloat(samplesPerSecond), status);
|
||||
}
|
||||
|
||||
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond, int32_t *status) {
|
||||
setAnalogSampleRateWithModule(module, intToFloat(samplesPerSecond), status);
|
||||
}
|
||||
|
||||
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status) {
|
||||
return getAnalogVoltsToValue(analog_port_pointer, intToFloat(voltage), status);
|
||||
}
|
||||
|
||||
232
hal/lib/Athena/CAN.cpp
Normal file
232
hal/lib/Athena/CAN.cpp
Normal file
@@ -0,0 +1,232 @@
|
||||
#include "HAL/CAN.hpp"
|
||||
#include <map>
|
||||
|
||||
struct CANMessage
|
||||
{
|
||||
uint8_t data[8];
|
||||
};
|
||||
|
||||
static std::map<uint32_t, CANMessage> outgoingMessages;
|
||||
static std::map<uint32_t, CANMessage> incomingMessages;
|
||||
|
||||
static const uint32_t kFullMessageIDMask = 0x1fffffff;
|
||||
|
||||
/**
|
||||
* Gets the data from the outgoing hashmap and calls
|
||||
* CANSessionMux...sendMessage.
|
||||
*/
|
||||
void canTxSend(uint32_t arbID, uint8_t length, int32_t period)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_sendMessage(
|
||||
arbID, message.data, length, period, &status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an single byte field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt8(uint32_t arbID, uint8_t offset, uint8_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
message.data[offset] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a short integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint16_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a long integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint32_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an 8.8 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int16_t raw = value * 255.0;
|
||||
|
||||
canTxPackInt16(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a 16.16 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int32_t raw = value * 65535.0;
|
||||
|
||||
canTxPackInt32(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint8_t canTxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canTxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canTxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data from CANSessionMux (if it's available) and put it in the incoming
|
||||
* hashmap.
|
||||
*
|
||||
* @return true if there's new data. Otherwise, the last received value should
|
||||
* still be in the hashmap.
|
||||
*/
|
||||
bool canRxReceive(uint32_t arbID)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
uint8_t length;
|
||||
uint32_t timestamp;
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_receiveMessage(
|
||||
&arbID, kFullMessageIDMask, message.data, &length, ×tamp, &status);
|
||||
|
||||
return status != ERR_CANSessionMux_MessageNotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint8_t canRxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canRxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canRxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
@@ -4,33 +4,35 @@
|
||||
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#pragma once
|
||||
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
|
||||
#include "ChipObject/tDMAManager.h"
|
||||
#include "ChipObject/tInterruptManager.h"
|
||||
#include "ChipObject/tSystem.h"
|
||||
#include "ChipObject/tSystemInterface.h"
|
||||
|
||||
#include "ChipObject/nInterfaceGlobals.h"
|
||||
#include "ChipObject/tAccel.h"
|
||||
#include "ChipObject/tAccumulator.h"
|
||||
#include "ChipObject/tAI.h"
|
||||
#include "ChipObject/tAlarm.h"
|
||||
#include "ChipObject/tAnalogTrigger.h"
|
||||
#include "ChipObject/tAO.h"
|
||||
#include "ChipObject/tBIST.h"
|
||||
#include "ChipObject/tCounter.h"
|
||||
#include "ChipObject/tDIO.h"
|
||||
#include "ChipObject/tDMA.h"
|
||||
#include "ChipObject/tEncoder.h"
|
||||
#include "ChipObject/tGlobal.h"
|
||||
#include "ChipObject/tInterrupt.h"
|
||||
#include "ChipObject/tPower.h"
|
||||
#include "ChipObject/tPWM.h"
|
||||
#include "ChipObject/tRelay.h"
|
||||
#include "ChipObject/tSPI.h"
|
||||
#include "ChipObject/tSysWatchdog.h"
|
||||
#include "FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
|
||||
#include "FRC_FPGA_ChipObject/tDMAManager.h"
|
||||
#include "FRC_FPGA_ChipObject/tInterruptManager.h"
|
||||
#include "FRC_FPGA_ChipObject/tSystem.h"
|
||||
#include "FRC_FPGA_ChipObject/tSystemInterface.h"
|
||||
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h"
|
||||
|
||||
// FIXME: these should not be here!
|
||||
using namespace nFPGA;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
@@ -1,107 +0,0 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Power_h__
|
||||
#define __nFRC_2015_1_0_5_Power_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
{
|
||||
|
||||
class tPower
|
||||
{
|
||||
public:
|
||||
tPower(){}
|
||||
virtual ~tPower(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tPower* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User6V : 8;
|
||||
#else
|
||||
unsigned User6V : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User3V3 : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 24;
|
||||
};
|
||||
} tStatus;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User6V : 1;
|
||||
#else
|
||||
unsigned User6V : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User3V3 : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 3;
|
||||
};
|
||||
} tDisable;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tStatus_IfaceConstants;
|
||||
|
||||
virtual tStatus readStatus(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDisable_IfaceConstants;
|
||||
|
||||
virtual void writeDisable(tDisable value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User3V3(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User5V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User6V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tDisable readDisable(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User5V(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tIndicateOutOfRange_IfaceConstants;
|
||||
|
||||
virtual void writeIndicateOutOfRange(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readIndicateOutOfRange(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tPower(const tPower&);
|
||||
void operator=(const tPower&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Power_h__
|
||||
@@ -2,21 +2,20 @@
|
||||
#include "ctre/PCM.h"
|
||||
#include <iostream>
|
||||
|
||||
static const int NUM_PCMS = 2;
|
||||
extern PCM *modules[NUM_PCMS];
|
||||
extern void initializePCM();
|
||||
static const int NUM_MODULE_NUMBERS = 63;
|
||||
extern PCM *modules[NUM_MODULE_NUMBERS];
|
||||
extern void initializePCM(int module);
|
||||
|
||||
void *initializeCompressor(uint8_t module) {
|
||||
initializePCM();
|
||||
initializePCM(module);
|
||||
|
||||
return modules[module - 1];
|
||||
return modules[module];
|
||||
}
|
||||
|
||||
bool checkCompressorModule(uint8_t module) {
|
||||
return module > 0 and module <= NUM_PCMS;
|
||||
return module < NUM_MODULE_NUMBERS;
|
||||
}
|
||||
|
||||
|
||||
bool getCompressor(void *pcm_pointer, int32_t *status) {
|
||||
PCM *module = (PCM *)pcm_pointer;
|
||||
bool value;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user