Squashed 'third_party/allwpilib_2016/' changes from 7f61816..3ce6feb
3ce6feb Updated release number for the new release
e054bbc This adds StopMotor() to the SpeedController interface for C++ and Java. For Java, this is as simple as just adding it, as all motors already have an implementation from MotorSafety that is correctly resolved. For C++, I had to override StopMotor in the classes that descend from SafePWM and explicitly call the SafePWM version. RobotDrive now calls StopMotor on each of its SpeedControllers, instead of calling Disable or setting the motor to 0.0 as it was doing previously.
a15b9dc Merge "More updates to the Gyro test fixing potential null pointer exception"
21b7213 Added Config routine to allow enabling/disabling of limit switch and soft limits. This improves upon the ConfigLimitMode routine, which does not allow certain combinations of enable/disabled limit features. Also keeps parity with LV and Java.
1b45237 Merge "Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically."
1096b15 Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically.
7da21fa More updates to the Gyro test fixing potential null pointer exception
ede5862 Rate-limit duplicate error messages to avoid flooding console.
c22284d Merge "artf4818: Fix CAN Talon JNI references with underscores."
cac3741 Merge "Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now."
097aa8c Fixed the gyro deviation over time test
1d647b3 artf4818: Fix CAN Talon JNI references with underscores.
368cfc7 Merge "Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs."
833e459 Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now.
6c096a3 Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs.
dd7eb0f Fixed robot drive for C++ Simulation
258a622 Merge "Update version number for Release 3 Print distinctive message on robot program startup Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405"
b1386c6 Update version number for Release 3 Print distinctive message on robot program startup Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405
a58de40 Merge "Removed publishing of java sim jar"
792d0d3 PDP Classes should support any PDP address
35df955 Merge "Remove maven local as a possible search location"
a0ce9ee Another improvement to HAL-joy getting to ensure it works in future RIO image updates.
0f02c31 Removed publishing of java sim jar
8435ac7 DriverStation::GetJoystickName(): Make work for stick>0.
b4cf4f4 Remove maven local as a possible search location
c3000c3 Merge "Fix HALGetJoystickDescriptor()."
4dec0b4 Merge "Fixed Simulation C++ API"
abc9c27 Fixed Simulation C++ API
b8ae9ec Fix HALGetJoystickDescriptor().
a60f874 Artf4800: Fixes HALGetJoystick*** Segfault
010b584 Merge "fix sim_ds launch script"
4429e16 Merge "Added build dir specification for sim javadoc to not overwrite athena javadoc"
ec9349b Initialized the m_sensors variable to fix artf4798.
9745af8 Added build dir specification for sim javadoc to not overwrite athena javadoc
4da8702 fix sim_ds launch script
05acf79 Fix C++ PIDController SetToleranceBuffer and OnTarget locking.
94a6b05 Merge "Fix onTarget() so that it returns false until there are any values retrieved"
d06053d Fix onTarget() so that it returns false until there are any values retrieved
74927cc Correctly set smart dashboard type for AnalogGyro and ADXRS450_Gyro.
070752f Merge "Fixed sim_ds script library path"
21a8bab Merge "PIDController feed forward term can now be calculated by the end user"
56bd6da Fixed sim_ds script library path
07710f1 Merge "Fixing install script... again"
e1cb61f Use absolute path for NT persistent storage.
09c7482 Fixing install script... again
a3b8bec PIDController feed forward term can now be calculated by the end user
790adb0 artf2612: Update license in source files.
042671c Merge "Removed gz_msgs from wpilibcSim"
c111690 Ultrasonic: replace linked list with std::set.
d71a8ed Removed gz_msgs from wpilibcSim
37259f7 Merge "Replaced linked list in Notifier with std::list"
cd17e7a Merge "Renamed Gyro to AnalogGyro to match athena API"
c5c8a87 Replaced linked list in Notifier with std::list
89405d8 Renamed Gyro to AnalogGyro to match athena API
4a19490 Merge "Adds CANTalon to LiveWindow"
c4a3567 Merge "Fixing the frcsim installer script"
295648f Adds CANTalon to LiveWindow
1b964a2 Merge "Fixes CAN devices in C++ library not showing in the livewindow"
7ba5cee Merge "HAL: Use extern "C" in implementation files."
d17d242 Fixes CAN devices in C++ library not showing in the livewindow
25a771a Added linear digital filters
7349c2c Fixing the frcsim installer script
c82122c Merge "Default bufLength for PIDController in Java should be 1"
58f3f97 Merge "Adds WaitResult to Java waitForInterrupt"
bc8ed12 HAL: Use extern "C" in implementation files.
4cac89e Default bufLength for PIDController in Java should be 1
64fcdcc Keep track of FPGA time rollovers with 64-bit time.
d30b283 Merge "Change C++ Notifier to allow std::function callback."
6ee3052 Merge "Rewrite C++ Notifier to use HAL multi-notifier support."
f5d09e2 Merge "Rewrite Java Notifier and update Interrupt JNI."
d0274aa Merge "Readded styleguide accidentally removed in the reorg"
68311ad Merge "Artf4179: Allow alternate I2C addresses for ADXL345_I2C"
dee12d4 Readded styleguide accidentally removed in the reorg
fa100df Fixed some typos in the comments of MotorEncoderFixture.java, a method name in CANMotorEncoderFixture.java, and the README files
3397b5c Adds WaitResult to Java waitForInterrupt
5f0dffd Artf4177: Use read byte count for ReadString
8564f33 Artf4179: Allow alternate I2C addresses for ADXL345_I2C
e52b52d Change C++ Notifier to allow std::function callback.
40b29e7 Rewrite C++ Notifier to use HAL multi-notifier support.
d126f45 Rewrite Java Notifier and update Interrupt JNI.
557805a Merge "finishing up FRCSim installer"
911b64b finishing up FRCSim installer
e24fe6f Merge "Artf4776 Fixes First DIO PWM usage errors"
f8f9284 Merge "Artf4774 Fixes HAL getHALErrorMessage missing error"
84428d5 Merge "Prevent double free in DigitalGlitchFilter"
a00a5ff Merge "Set correct error message"
9aeee98 Prevent double free in DigitalGlitchFilter
5d2186c working on install process for FRCSim 2016
7fdb616 Merge "This commit adds documentation generation, including grabbing ntcore sources, for both Java and C++. This will need changes made in the wpilib promotion tasks to copy the generatd documentation to the correct places."
f67ebca Improved READMEs
8a7c019 Artf4776 Fixes First DIO PWM usage errors
1cd2f9a Added libnipalu to make vision programs link properly
375b92a This commit adds documentation generation, including grabbing ntcore sources, for both Java and C++. This will need changes made in the wpilib promotion tasks to copy the generatd documentation to the correct places.
8d0a990 Set correct error message
b65401f Artf4774 Fixes HAL getHALErrorMessage missing error
5f918be Condition java sim build on -PmakeSim flag
53bd180 Merge "Add SPARK and SD540 motor controllers"
66cbe69 Fixed double free of DriverStation.
431f345 Repaired simulation build on linux
611593c Add Cmake wrappers and unzip desktop ntcore builds
51a18cd Add SPARK and SD540 motor controllers
c05e883 Merge changes I55ce71c6,I803680c1
2b80029 Rewrite CANTalon JNI layer.
ef4c45b Last feature addition for CANTalon java/C++ user-facing API.
Change-Id: Ia3a124978a426991890b6f8abbe07d34d75ba38d
git-subtree-dir: third_party/allwpilib_2016
git-subtree-split: 3ce6feb8acdeca46e93a55280fb6ace3a4d5bcd6
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Connection.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Connection.java
index 994c78f..8ab6fff 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Connection.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Connection.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import gazebo.msgs.GzPacket.Packet;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Msgs.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Msgs.java
index 5062408..cd20d40 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Msgs.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Msgs.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import gazebo.msgs.GzBool.Bool;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Node.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Node.java
index 455d452..0aaeeb5 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Node.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Node.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import gazebo.msgs.GzPacket.Packet;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Publisher.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Publisher.java
index ebf9749..fccc65d 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Publisher.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Publisher.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import java.io.IOException;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/PublisherRecord.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/PublisherRecord.java
index 90ab604..a49193f 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/PublisherRecord.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/PublisherRecord.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
public interface PublisherRecord {
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/RemotePublisherRecord.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/RemotePublisherRecord.java
index 83d290e..86adf16 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/RemotePublisherRecord.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/RemotePublisherRecord.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import gazebo.msgs.GzPublish.Publish;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/ServerCallback.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/ServerCallback.java
index b9a6576..c0a67a5 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/ServerCallback.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/ServerCallback.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import java.io.IOException;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Subscriber.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Subscriber.java
index 12770ee..a385e27 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Subscriber.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/Subscriber.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
import gazebo.msgs.GzSubscribe.Subscribe;
diff --git a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/SubscriberCallback.java b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/SubscriberCallback.java
index 5ed5269..4dc63ba 100644
--- a/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/SubscriberCallback.java
+++ b/simulation/JavaGazebo/src/main/java/org/gazebosim/transport/SubscriberCallback.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package org.gazebosim.transport;
public interface SubscriberCallback<T> {
diff --git a/simulation/README.md b/simulation/README.md
index eb58dd5..d171be7 100644
--- a/simulation/README.md
+++ b/simulation/README.md
@@ -1,29 +1,32 @@
-## Simulation Directory
+## Components and Location
-Observe the following directory structure
-
-.
-|-- frc_gazebo_plugins (contains Gazebo Plugins)
-| |-- clock
-| |-- dc_motor
-| |-- encoder
-| |-- gyro
-| |-- plugins
-| |-- pneumatic_piston
-| |-- potentiometer
-| |-- rangefinder
-| |-- servo
-|
-|-- frcsim.bat (launches gazebo with model/plugin paths on windows)
-|-- frcsim.sh (launches gazebo with model/plugin paths on linux/mac)
-|-- install.sh (convenient linux script to install Eclipse, Eclipse Plugins, and Gazebo)
-|-- JavaGazebo (java library used by java simulation. Equivelant of the C++ gazebo_transport)
-|-- SimDS (linux driverstation)
+Simluation is a mix of wpilib and other components.
+The wpilib components are in their respective locations in the /wpilibc and /wpilibj directories.
The gazbeo plugins are currently built with CMake.
Eventually they will be built with gradle.
-All of this is delivered to students via the eclipse plugins
+## Simulation delivery and installation
+
+For 2016 FRCSim is only officially supported on Ubuntu 14.04 or greater.
+However it is possible on any platform that runs Gazebo.
+FRCSim is currently delivered via a zip file published by this project,
+and is available at first.wpi.edu/FRC/roborio/maven/PROMOTION_STATUS/edu/wpi/first/wpilib/simulation/simulation/1.0.0/simulation-1.0.0.zip
+where PROMOTION_STATUS is one of:
+- development (the latest commit merged into wpilib)
+- beta (used periodically before release)
+- release (used just before kick-off and possibly a few other times)
+- stable (used for old releases we want to keep around)
+
+The zip contains most of the contents of ~/wpilib/simulation, such as C++ libraries, jars, and scripts
+
+The exmple robot model files are seperate, and can be found under "file releases" on collabnet.
+
+All together you need eclipse, gazebo, those two zips, g++ 4.9, java8, and a few other small packages.
+See the frcsim-installer script or the screensteps on manual install for all the nitty-gritty details
+
+The frcsim-installer script is meant for quick and painless setup on Ubuntu 14.04, 15.04, or 15.10
+A manual install is a more tedious process, so this is an easy option for students.
## Building
-see the top level building.md
+See the top level README.md.
diff --git a/simulation/SimDS/build.gradle b/simulation/SimDS/build.gradle
index 0acaaee..58270b7 100644
--- a/simulation/SimDS/build.gradle
+++ b/simulation/SimDS/build.gradle
@@ -51,4 +51,14 @@
group = 'WPILib'
classifier = 'javadoc'
from javadoc.destinationDir
-}
\ No newline at end of file
+}
+
+//we need to move the simulation jars to the install directory
+task copyJars(type: Copy) {
+ description = 'copy SimDS-all.jar to make simulation zip'
+ group = 'WPILib Simulation'
+ from shadowJar.archivePath
+ into "$simulationInstallDir/jar"
+}
+
+build.dependsOn shadowJar
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/DS.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/DS.java
index bd12c41..d62958a 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/DS.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/DS.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.Dimension;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/EnableAction.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/EnableAction.java
index f847568..9751e74 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/EnableAction.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/EnableAction.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/FakeJoystick.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/FakeJoystick.java
index 4831a27..b548930 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/FakeJoystick.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/FakeJoystick.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import org.gazebosim.transport.Node;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ISimJoystick.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ISimJoystick.java
index 9263a1b..b9fb0ab 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ISimJoystick.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ISimJoystick.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import org.gazebosim.transport.Node;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickList.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickList.java
index f598a3d..f1bd684 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickList.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickList.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.datatransfer.DataFlavor;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickProvider.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickProvider.java
index 4c22320..80119d0 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickProvider.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/JoystickProvider.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.util.ArrayList;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/Main.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/Main.java
index 2f5188a..b93bdd0 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/Main.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/Main.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import gazebo.msgs.GzFloat64.Float64;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ModeAction.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ModeAction.java
index 532ef67..362e8c6 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ModeAction.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/ModeAction.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/RefreshAction.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/RefreshAction.java
index 5f264e0..6320aac 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/RefreshAction.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/RefreshAction.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
diff --git a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/SimJoystick.java b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/SimJoystick.java
index 23794ca..7239cac 100644
--- a/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/SimJoystick.java
+++ b/simulation/SimDS/src/main/java/edu/wpi/first/wpilibj/simulation/ds/SimJoystick.java
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
package edu.wpi.first.wpilibj.simulation.ds;
import gazebo.msgs.GzJoystick.Joystick;
diff --git a/simulation/build.gradle b/simulation/build.gradle
new file mode 100644
index 0000000..c0d1ff0
--- /dev/null
+++ b/simulation/build.gradle
@@ -0,0 +1,35 @@
+apply plugin: 'java'
+apply plugin: 'maven-publish'
+
+publishing {
+ publications {
+ simulation(MavenPublication) {
+ artifact zip
+ groupId 'edu.wpi.first.wpilib.simulation'
+ artifactId 'simulation'
+ version '1.0.0'
+ }
+ }
+
+ setupWpilibRepo(it)
+}
+
+task copy_resources(type: Copy) {
+ description = 'copy gz_msgs and install_resources to make simulation zip'
+ group = 'WPILib Simulation'
+ into ('gz_msgs') {
+ from 'gz_msgs'
+ }
+ into "$simulationInstallDir"
+ from 'install_resources'
+}
+
+task zip(type: Zip, dependsOn: [copy_resources,
+ ':wpilibc:wpilibcSimCopy',
+ ':simulation:SimDS:copyJars',
+ ':wpilibj:copyJars']) {
+ description = 'zip of all the resources for simulation'
+ group = 'WPILib Simulation'
+ baseName = 'simulation-trusty'
+ from "$simulationInstallDir"
+}
diff --git a/simulation/frc_gazebo_plugins/CMakeLists.txt b/simulation/frc_gazebo_plugins/CMakeLists.txt
index 1d45789..e3574dd 100644
--- a/simulation/frc_gazebo_plugins/CMakeLists.txt
+++ b/simulation/frc_gazebo_plugins/CMakeLists.txt
@@ -12,8 +12,6 @@
rangefinder
servo)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/plugins)
-
link_directories(${GAZEBO_LIBRARY_DIRS})
foreach(PLUGIN ${PLUGINS})
@@ -29,7 +27,11 @@
endif()
target_link_libraries(${PLUGIN} gz_msgs ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES})
-
- install(TARGETS ${PLUGIN} DESTINATION $ENV{HOME}/wpilib/simulation/plugins)
+ set_target_properties(${PLUGIN}
+ PROPERTIES
+ LIBRARY_OUTPUT_DIRECTORY ${SIMULATION_INSTALL_DIR}/plugins)
endforeach()
+
+# create a dummy target the depends on all the plugins
+add_custom_target(${PROJECT_NAME} DEPENDS ${PLUGINS})
diff --git a/simulation/frc_gazebo_plugins/clock/src/clock.cpp b/simulation/frc_gazebo_plugins/clock/src/clock.cpp
index 32cd3b7..0297943 100644
--- a/simulation/frc_gazebo_plugins/clock/src/clock.cpp
+++ b/simulation/frc_gazebo_plugins/clock/src/clock.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "clock.h"
GZ_REGISTER_MODEL_PLUGIN(Clock)
diff --git a/simulation/frc_gazebo_plugins/clock/src/clock.h b/simulation/frc_gazebo_plugins/clock/src/clock.h
index 4590471..403fcb1 100644
--- a/simulation/frc_gazebo_plugins/clock/src/clock.h
+++ b/simulation/frc_gazebo_plugins/clock/src/clock.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
diff --git a/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.cpp b/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.cpp
index 0b4bbab..1074d70 100644
--- a/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.cpp
+++ b/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "dc_motor.h"
GZ_REGISTER_MODEL_PLUGIN(DCMotor)
diff --git a/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.h b/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.h
index 22d70be..d162ff8 100644
--- a/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.h
+++ b/simulation/frc_gazebo_plugins/dc_motor/src/dc_motor.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frc_gazebo_plugins/encoder/src/encoder.cpp b/simulation/frc_gazebo_plugins/encoder/src/encoder.cpp
index aea246f..0742edd 100644
--- a/simulation/frc_gazebo_plugins/encoder/src/encoder.cpp
+++ b/simulation/frc_gazebo_plugins/encoder/src/encoder.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "encoder.h"
GZ_REGISTER_MODEL_PLUGIN(Encoder)
diff --git a/simulation/frc_gazebo_plugins/encoder/src/encoder.h b/simulation/frc_gazebo_plugins/encoder/src/encoder.h
index 728341d..f3d3ea1 100644
--- a/simulation/frc_gazebo_plugins/encoder/src/encoder.h
+++ b/simulation/frc_gazebo_plugins/encoder/src/encoder.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frc_gazebo_plugins/gyro/src/gyro.cpp b/simulation/frc_gazebo_plugins/gyro/src/gyro.cpp
index e918bbb..0895c6a 100644
--- a/simulation/frc_gazebo_plugins/gyro/src/gyro.cpp
+++ b/simulation/frc_gazebo_plugins/gyro/src/gyro.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "gyro.h"
diff --git a/simulation/frc_gazebo_plugins/gyro/src/gyro.h b/simulation/frc_gazebo_plugins/gyro/src/gyro.h
index fee48b3..29f62a9 100644
--- a/simulation/frc_gazebo_plugins/gyro/src/gyro.h
+++ b/simulation/frc_gazebo_plugins/gyro/src/gyro.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.cpp b/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.cpp
index 67c2c7a..c871212 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.cpp
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "external_limit_switch.h"
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.h b/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.h
index 573e93b..08e9198 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.h
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/external_limit_switch.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "switch.h"
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.cpp b/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.cpp
index 3b6d7de..b410ca5 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.cpp
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "internal_limit_switch.h"
InternalLimitSwitch::InternalLimitSwitch(physics::ModelPtr model, sdf::ElementPtr sdf) {
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.h b/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.h
index bf08cbb..b7b007a 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.h
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/internal_limit_switch.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "switch.h"
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.cpp b/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.cpp
index f32e65c..88f8846 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.cpp
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#include "limit_switch.h"
GZ_REGISTER_MODEL_PLUGIN(LimitSwitch)
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.h b/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.h
index 4d590d5..17ae8cf 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.h
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/limit_switch.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frc_gazebo_plugins/limit_switch/src/switch.h b/simulation/frc_gazebo_plugins/limit_switch/src/switch.h
index d7d5aac..8c204a3 100644
--- a/simulation/frc_gazebo_plugins/limit_switch/src/switch.h
+++ b/simulation/frc_gazebo_plugins/limit_switch/src/switch.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
class Switch {
diff --git a/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.cpp b/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.cpp
index 11cf432..4dbe57d 100644
--- a/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.cpp
+++ b/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h, which can get
// pulled in by anybody (e.g., Boost).
diff --git a/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.h b/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.h
index 8bfb7b1..488d9f3 100644
--- a/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.h
+++ b/simulation/frc_gazebo_plugins/pneumatic_piston/src/pneumatic_piston.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.cpp b/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.cpp
index f7f4251..0b0ad54 100644
--- a/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.cpp
+++ b/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h, which can get
// pulled in by anybody (e.g., Boost).
diff --git a/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.h b/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.h
index 422ff20..5cb96cd 100644
--- a/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.h
+++ b/simulation/frc_gazebo_plugins/potentiometer/src/potentiometer.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include <simulation/gz_msgs/msgs.h>
diff --git a/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.cpp b/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.cpp
index c91cfb2..dd76107 100644
--- a/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.cpp
+++ b/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h, which can get
// pulled in by anybody (e.g., Boost).
diff --git a/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.h b/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.h
index f9a7ef4..a205368 100644
--- a/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.h
+++ b/simulation/frc_gazebo_plugins/rangefinder/src/rangefinder.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include <simulation/gz_msgs/msgs.h>
diff --git a/simulation/frc_gazebo_plugins/servo/src/servo.cpp b/simulation/frc_gazebo_plugins/servo/src/servo.cpp
index 8298280..e1b61f3 100644
--- a/simulation/frc_gazebo_plugins/servo/src/servo.cpp
+++ b/simulation/frc_gazebo_plugins/servo/src/servo.cpp
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h, which can get
// pulled in by anybody (e.g., Boost).
diff --git a/simulation/frc_gazebo_plugins/servo/src/servo.h b/simulation/frc_gazebo_plugins/servo/src/servo.h
index a998761..dd6d18b 100644
--- a/simulation/frc_gazebo_plugins/servo/src/servo.h
+++ b/simulation/frc_gazebo_plugins/servo/src/servo.h
@@ -1,3 +1,10 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
#pragma once
#include "simulation/gz_msgs/msgs.h"
diff --git a/simulation/frcsim-installer.sh b/simulation/frcsim-installer.sh
new file mode 100755
index 0000000..c82bc2a
--- /dev/null
+++ b/simulation/frcsim-installer.sh
@@ -0,0 +1,308 @@
+#!/bin/bash
+
+function check-environment {
+ # Ensure root access
+ if [ "$(id -u)" != "0" ]; then
+ echo "*** This script must be run as root!" 1>&2
+ echo "*** Make sure that you followed the instructions properly." 1>&2
+ install-fail
+ fi
+
+ # Make sure that we're on Ubuntu.
+ if [ "$(lsb_release -is)" != "Ubuntu" ]; then
+ if [ "$(lsb_release -is)" = "" ]; then
+ echo "*** Distributions other than Ubuntu (such as yours, probably) are not supported." 1>&2
+ else
+ echo "*** Distributions other than Ubuntu (such as $(lsb_release -is)) are not supported." 1>&2
+ fi
+ echo "*** This means that the install will likely fail." 1>&2
+ echo "*** Continue anyway? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ fi
+
+ # Make sure that we have /etc/apt/sources.list.d available.
+ if [ ! -e /etc/apt/sources.list.d ]; then
+ echo "*** Cannot find /etc/apt/sources.list.d - is apt installed?"
+ install-fail
+ fi
+
+ # Make sure that apt-key is installed.
+ if ! which apt-key >/dev/null; then
+ echo "*** You don't appear to have apt-key installed." 1>&2
+ echo "*** Please install apt and run the script again." 1>&2
+ install-fail
+ fi
+
+ # Make sure that apt-get is installed.
+ if ! which apt-get >/dev/null; then
+ echo "*** You don't appear to have apt-get installed." 1>&2
+ echo "*** Please install apt and run the script again." 1>&2
+ install-fail
+ fi
+
+ # Make sure that we have internet access.
+ if ! ping 8.8.8.8 -c 1 >/dev/null; then
+ echo "*** You don't appear to be able to access the internet! (Can't ping 8.8.8.8)" 1>&2
+ install-fail
+ fi
+
+ # Make sure that wget is installed.
+ if ! which wget >/dev/null; then
+ echo "*** You don't appear to have wget installed." 1>&2
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ apt-get install wget -y
+ fi
+
+ # Make sure that python is installed
+ if ! which python >/dev/null; then
+ echo "*** You don't appear to have python installed." 1>&2
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ apt-get install python -y
+ fi
+
+ # Make sure that unzip is installed
+ if ! which unzip >/dev/null; then
+ echo "*** You don't appear to have unzip installed." 1>&2
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ apt-get install unzip -y
+ fi
+
+ # Make sure that app-apt-repository is installed
+ if ! which add-apt-repository >/dev/null; then
+ echo "*** You don't appear to have all apt commands installed." 1>&2
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ apt-get install software-properties-common -y
+ fi
+}
+
+function remove-frcsim {
+ echo "*** Remove Gazebo package entry too? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" == "y" -o "$CONT" == "Y" ]; then
+ rm -f /etc/apt/sources.list.d/gazebo-latest.list
+ fi
+
+ apt-get remove --auto-remove libgazebo6-dev gazebo6 g++-4.9 openjdk-8-jdk
+ rm -rf /opt/eclipse
+ rm -f /usr/share/applications/frcsim.desktop /usr/share/applications/eclipse.desktop /usr/share/applications/sim_ds.desktop
+ rm -f /usr/bin/frcism /usr/bin/sim_ds /usr/bin/eclipse
+ rm -rf ~/wpilib/simulation
+
+ add-apt-repository --remove ppa:openjdk-r/ppa -y
+ add-apt-repository --remove ppa:ubuntu-toolchain-r/test -y
+}
+
+function install-eclipse-plugins {
+ #valid URLs can have promotion status of any of the following
+ # - development (used for most recent merge into wpilib)
+ # - beta
+ # - release
+ # - stable
+
+ #this file is published to maven repo by simulation/build.gradle
+ if ! (wget -O /tmp/simulation.zip http://first.wpi.edu/FRC/roborio/maven/$PROMOTION_STATUS/edu/wpi/first/wpilib/simulation/simulation/1.0.0/simulation-1.0.0.zip)
+ then
+ echo "***could not download wpilib simulation plugins, wrong URL probably***"
+ echo "promotion status = $PROMOTION_STATUS"
+ echo "url = http://first.wpi.edu/FRC/roborio/maven/$PROMOTION_STATUS/edu/wpi/first/wpilib/simulation/simulation/1.0.0/simulation-1.0.0.zip"
+ install-fail
+ fi
+
+ mkdir -p ~/wpilib/simulation
+ unzip /tmp/simulation.zip -d ~/wpilib/simulation
+ rm -f /usr/bin/frcsim /usr/bin/sim_ds
+ ln -s ~/wpilib/simulation/frcsim /usr/bin/frcsim
+ ln -s ~/wpilib/simulation/sim_ds /usr/bin/sim_ds
+}
+
+function install-eclipse {
+ if ! (wget -O /tmp/eclipse.tar.gz http://eclipse.mirror.rafal.ca/technology/epp/downloads/release/mars/1/eclipse-cpp-mars-1-linux-gtk-x86_64.tar.gz)
+ then
+ echo "***could not download eclipse, wrong URL probably***"
+ install-fail
+ fi
+
+ tar -xf /tmp/eclipse.tar.gz -C /opt
+ rm -f /usr/bin/eclipse
+ ln -s /opt/eclipse/eclipse /usr/bin/eclipse
+}
+
+function install-desktops {
+ # desktop files allow ubuntu (unity) users to "search" for their programs in the sidebar
+ mv ~/wpilib/simulation/eclipse.desktop /usr/share/applications/eclipse.desktop
+ mv ~/wpilib/simulation/frcsim.desktop /usr/share/applications/frcsim.desktop
+ mv ~/wpilib/simulation/sim_ds.desktop /usr/share/applications/sim_ds.desktop
+ mkdir -p /usr/share/icons/sim_ds
+ mv ~/wpilib/simulation/sim_ds_logo.png /usr/share/icons/sim_ds/sim_ds_logo.png
+}
+
+function install-gz_msgs {
+ # gz_msgs is built on the end-user system
+ # that way the versions of protobuf will match whatever the default for that platform is
+ cd ~/wpilib/simulation/gz_msgs
+ mkdir build
+ cd build
+ cmake ..
+ make
+ make install
+ chmod u+x ~/wpilib/simulation/lib/libgz_msgs.so
+}
+
+function install-toolchain {
+ # older version of ubuntu like 14.04 don't have the versions of g++ and java we need
+ # we can add some very reliable PPAs to get them however
+ if [[ "`lsb_release -rs`" == "14.04" ]]
+ then
+ echo "*** You're using `lsb_release -r`, you will need additional repositories***"
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ add-apt-repository ppa:openjdk-r/ppa -y
+ add-apt-repository ppa:ubuntu-toolchain-r/test -y
+ fi
+ if [[ "`lsb_release -rs`" == "15.04" ]]
+ then
+ echo "*** You're using `lsb_release -r`, you will need additional repositories***"
+ echo "*** Install? (y/n)" 1>&2
+ read CONT
+ if [ "$CONT" != "y" -a "$CONT" != "Y" ]; then
+ install-fail
+ fi
+ add-apt-repository ppa:openjdk-r/ppa -y
+ fi
+
+ # Update and install dependencies
+ if ! apt-get update
+ then
+ echo "*** Could not resynchronize package index files." 1>&2
+ echo "*** Are you running another update or install?" 1>&2
+ install-fail
+ fi
+
+ apt-get install cmake libprotoc-dev libprotobuf-dev protobuf-compiler g++-4.9 openjdk-8-jdk -y
+ rm -f /usr/bin/g++
+ ln -s /usr/bin/g++-4.9 /usr/bin/g++
+}
+
+function install-models {
+ # this zip file is made by hand. A better option to add models is to use the gazebo repository
+ if ! (wget -O /tmp/models.zip https://usfirst.collab.net/sf/frs/do/downloadFile/projects.wpilib/frs.simulation.frcsim_gazebo_models/frs1160?)
+ then
+ echo "*** failed to download models. Check your internet connection! ***"
+ install-fail
+ fi
+
+ unzip /tmp/models.zip -d /tmp
+ mv /tmp/frcsim-gazebo-models/models ~/wpilib/simulation/models
+ mv /tmp/frcsim-gazebo-models/worlds ~/wpilib/simulation/worlds
+}
+
+function install-frcsim {
+ check-environment
+
+ # Add Gazebo Repository and Key
+ if ! echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list
+ then
+ echo "*** Cannot add Gazebo repository!" 1>&2
+ install-fail
+ fi
+ if ! (wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -)
+ then
+ echo "*** Cannot add Gazebo repository key!" 1>&2
+ if ! ping packages.osrfoundation.org -c 1 >/dev/null; then
+ echo "*** The package host for Gazebo appears to be down. Try again later." 1>&2
+ fi
+ install-fail
+ fi
+
+ install-toolchain
+
+ if ! apt-get install -y libgazebo6-dev gazebo6
+ then
+ echo "*** Could not install frcsim packages. See above output for details." 1>&2
+ echo "*** Are you running another update or install?" 1>&2
+ install-fail
+ fi
+
+ install-eclipse-plugins
+ install-gz_msgs
+ install-eclipse
+ install-desktops
+ install-models
+
+ change-ownership
+
+ # Done
+ echo "Installation Finished!!"
+}
+
+function install-fail {
+ echo "***INSTALLATION UNSUCCESSFUL***"
+ echo "***Check the output about for anything that looks like errors***"
+ echo "Please comment on the following to tutorial if you're unable to resolve your problem:"
+ echo "https://wpilib.screenstepslive.com/s/4485/m/23353/l/478421-installing-frcsim-with-a-script-ubuntu"
+ exit 1
+}
+
+function change-ownership {
+ chown -R $NON_SUDO_USER:$NON_SUDO_USER ~/wpilib
+}
+
+if [ "$1" == "INSTALL-ROOT" ]
+then
+
+ if [ -z "$2" ]
+ then
+ echo "*** Could not set user ~/wpilib ownership to empty user***"
+ install-fail
+ else
+ NON_SUDO_USER="$2"
+ fi
+
+ if [ -z "$3" ]
+ then
+ PROMOTION_STATUS="release"
+ else
+ PROMOTION_STATUS="$3"
+ fi
+
+ install-frcsim
+
+elif [ "$1" == "INSTALL" ]
+then
+ NON_SUDO_USER="$USER"
+ PROMOTION_STATUS="$2"
+ SUDO_ASKPASS=/usr/bin/ssh-askpass sudo bash -c "$0 INSTALL-ROOT $NON_SUDO_USER $PROMOTION_STATUS"
+elif [ "$1" == "REMOVE-ROOT" ]
+then
+ remove-frcsim
+elif [ "$1" == "REMOVE" ]
+then
+ NON_SUDO_USER="$USER"
+ SUDO_ASKPASS=/usr/bin/ssh-askpass sudo bash -c "$0 REMOVE-ROOT $NON_SUDO_USER $PROMOTION_STATUS"
+else
+ echo "***This script requires an argument!***"
+ echo "***Run ./frcsim_installer.sh INSTALL to install***"
+ echo "***The other option is REMOVE"
+fi
diff --git a/simulation/frcsim.sh b/simulation/frcsim.sh
deleted file mode 100755
index a923f53..0000000
--- a/simulation/frcsim.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-export GAZEBO_PLUGIN_PATH="${GAZEBO_PLUGIN_PATH}:${HOME}/wpilib/simulation/plugins"
-export GAZEBO_MODEL_PATH="${GAZEBO_MODEL_PATH}:${HOME}/wpilib/simulation/models"
-export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${HOME}/wpilib/simulation/plugins"
-gazebo $@
diff --git a/simulation/gz_msgs/CMakeLists.txt b/simulation/gz_msgs/CMakeLists.txt
index 17ecf5c..5e79a8b 100644
--- a/simulation/gz_msgs/CMakeLists.txt
+++ b/simulation/gz_msgs/CMakeLists.txt
@@ -1,6 +1,25 @@
-cmake_minimum_required(VERSION 2.8)
+Cmake_minimum_required(VERSION 2.8)
project(gz_msgs)
+#copied from GazeboUtils.cmake
+macro (APPEND_TO_CACHED_STRING _string _cacheDesc)
+ FOREACH (newItem ${ARGN})
+ SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE)
+ ENDFOREACH (newItem ${ARGN})
+endmacro (APPEND_TO_CACHED_STRING)
+
+find_package(Protobuf REQUIRED)
+
+if (NOT PROTOBUF_FOUND)
+ MESSAGE ("Missing: Google Protobuf (libprotobuf-dev)")
+endif()
+if (NOT PROTOBUF_PROTOC_EXECUTABLE)
+ MESSAGE ( "Missing: Google Protobuf Compiler (protobuf-compiler)")
+endif()
+if (NOT PROTOBUF_PROTOC_LIBRARY)
+ MESSAGE ("Missing: Google Protobuf Compiler Library (libprotoc-dev)")
+endif()
+
#list all proto files used
get_filename_component(PROTO_DIR src/main/proto ABSOLUTE)
set(msgs
@@ -62,3 +81,9 @@
endif()
target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES})
+set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ENV{HOME}/wpilib/simulation/lib")
+
+install(TARGETS ${PROJECT_NAME}
+ DESTINATION "$ENV{HOME}/wpilib/simulation/lib")
+install(DIRECTORY "${GZ_MSGS_INCLUDE_DIR}/simulation"
+ DESTINATION "$ENV{HOME}/wpilib/simulation/include")
diff --git a/simulation/gz_msgs/README.md b/simulation/gz_msgs/README.md
index 203457d..74266c3 100644
--- a/simulation/gz_msgs/README.md
+++ b/simulation/gz_msgs/README.md
@@ -1,6 +1,19 @@
Building gz_msgs
================
-Currently uses cmake.
-This is build as a part of the whole cmake project.
-see top level building.md for detail
+gz_msgs currently uses cmake, is built on the end-users computer.
+This allows us to support various versions of protobuf (2.5 on Ubuntu 14.04, 2.6 on Ubuntu 15.10)
+
+To build, run the following commands in the ~/wpilib/simulation/gz_msgs directory.
+If that directory doesn't exist, it means you haven't installed correctly.
+
+If you're a developer for wpilib, you will need to unzip the simulation.zip file you published into ~/releases.
+If you are a student using FRCSim, you should have downloaded that zip when you installed frcsim.
+
+ mkdir build
+ cd build
+ cmake ..
+ make
+ make install
+
+If you are installing FRCSim with the script, then this *should* have be done for you.
diff --git a/simulation/install_resources/eclipse.desktop b/simulation/install_resources/eclipse.desktop
new file mode 100644
index 0000000..c6d8a86
--- /dev/null
+++ b/simulation/install_resources/eclipse.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=Eclipse
+Exec=/usr/bin/eclipse
+Icon=/opt/eclipse/icon.xpm
+Type=Application
+Categories=Development;Education;Science;
+StartupNotify=true
diff --git a/simulation/install_resources/frcsim b/simulation/install_resources/frcsim
new file mode 100755
index 0000000..f8d6560
--- /dev/null
+++ b/simulation/install_resources/frcsim
@@ -0,0 +1,5 @@
+#!/bin/bash
+export GAZEBO_PLUGIN_PATH="${HOME}/wpilib/simulation/plugins:${GAZEBO_PLUGIN_PATH}"
+export GAZEBO_MODEL_PATH="${HOME}/wpilib/simulation/models:${GAZEBO_MODEL_PATH}"
+export LD_LIBRARY_PATH="${HOME}/wpilib/simulation/plugins:${HOME}/wpilib/simulation/lib:${LD_LIBRARY_PATH}"
+gazebo --verbose $@
diff --git a/simulation/install_resources/frcsim.desktop b/simulation/install_resources/frcsim.desktop
new file mode 100644
index 0000000..6434d9c
--- /dev/null
+++ b/simulation/install_resources/frcsim.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=FRCSim
+Keywords=frcsim,gazebo
+Exec=/usr/bin/frcsim
+Icon=gazebo
+Type=Application
+StartupNotify=true
+Terminal=false
+Categories=Development;IDE;Java;Education;Science
diff --git a/simulation/install_resources/jar/jinput-2.0.5.jar b/simulation/install_resources/jar/jinput-2.0.5.jar
new file mode 100644
index 0000000..2081334
--- /dev/null
+++ b/simulation/install_resources/jar/jinput-2.0.5.jar
Binary files differ
diff --git a/simulation/install_resources/jar/jinput-platform-2.0.5-natives-linux.jar b/simulation/install_resources/jar/jinput-platform-2.0.5-natives-linux.jar
new file mode 100644
index 0000000..6423d54
--- /dev/null
+++ b/simulation/install_resources/jar/jinput-platform-2.0.5-natives-linux.jar
Binary files differ
diff --git a/simulation/install_resources/lib/libjinput-linux.so b/simulation/install_resources/lib/libjinput-linux.so
new file mode 100755
index 0000000..dba9e59
--- /dev/null
+++ b/simulation/install_resources/lib/libjinput-linux.so
Binary files differ
diff --git a/simulation/install_resources/lib/libjinput-linux64.so b/simulation/install_resources/lib/libjinput-linux64.so
new file mode 100755
index 0000000..8b5f9d8
--- /dev/null
+++ b/simulation/install_resources/lib/libjinput-linux64.so
Binary files differ
diff --git a/simulation/install_resources/sim_ds b/simulation/install_resources/sim_ds
new file mode 100755
index 0000000..4ea26de
--- /dev/null
+++ b/simulation/install_resources/sim_ds
@@ -0,0 +1 @@
+java -Djava.library.path=${HOME}/wpilib/simulation/lib -jar ~/wpilib/simulation/jar/SimDS-all.jar
diff --git a/simulation/install_resources/sim_ds.desktop b/simulation/install_resources/sim_ds.desktop
new file mode 100644
index 0000000..bf1a9c7
--- /dev/null
+++ b/simulation/install_resources/sim_ds.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Sim DS
+Keywords=frcsim,driverstation
+Exec=/usr/bin/sim_ds
+Icon=/usr/share/icons/sim_ds/sim_ds_logo.png
+Type=Application
+StartupNotify=true
+Terminal=false
+Categories=Development;IDE;Java;Education;Science
diff --git a/simulation/install_resources/sim_ds_logo.png b/simulation/install_resources/sim_ds_logo.png
new file mode 100644
index 0000000..39df91c
--- /dev/null
+++ b/simulation/install_resources/sim_ds_logo.png
Binary files differ