merged from frcsim branch

verified to work on real robots
adds sim eclipse plugins, fixed JavaGazebo, made wpilibC++Sim build on windows
 - Java and C++ simulation robot programs run on windows
 - simulation eclipse plugin delivers models and gazebo plugins
 - Java Gazebo now respects GAZEBO_IP variables and can work across networks
 - hal and network tables win32 hacked to work on windows
 - smart dashboard broken on windows due to network tables hacks
 - wpilibC++Sim, gz_msgs, and frcsim_gazebo_plugins build with CMake
 - removed constexpr for cross platform compatibility
 - msgs generated using .protos as a part of build process
 - some spare and unused cmake/pom files deleted
 - simulation ubuntu debians removed entirely
 - refactored CMake project flags and macros
 - updated to match non-sim C++ API
 - fixed and updated documentation
 - servo added to simulation

Change-Id: Ia702ff0f1fee10d77f543810ad88f56696443b05
This commit is contained in:
peter mitrano
2015-04-26 19:19:57 -04:00
parent 4e46692191
commit 29d029fa61
211 changed files with 2143 additions and 6491 deletions

View File

@@ -1,6 +1,8 @@
package edu.wpi.first.wpilib.plugins.core.installer;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -45,7 +47,38 @@ public abstract class AbstractInstaller {
*/
protected abstract InputStream getInstallResourceStream();
public void installIfNecessary() {
/**
*
* @param sourcePath the file location of the zip file EX "/resources/simuation.zip"
* @param destinationPath the file location to unzip into EX "/home/peter/wpilib/simulation/plugins"
*/
public void installIfNecessary(String sourcePath, String destinationPath){
//we're installing from this directory
InputStream sourceStream;
try {
sourceStream = new FileInputStream(sourcePath);
File destFile = new File(destinationPath);
installIfNecessary(sourceStream, destFile);
} catch (FileNotFoundException e) {
WPILibCore.logInfo("source zip file was not found: "+sourcePath);
}
}
/**
* This function will delete an old wpilib subfolder if necessary and then copy
* the resource stream to the intended directory.
*
* @throws InstallException if bad things happen ...
*/
public void installIfNecessary(){
installIfNecessary(getInstallResourceStream(), installLocation);
}
/**
* I'm thinking maybe instead of final things,
* create a UnzipJob class to extend Job and have these as parameters to the constructor*
*/
public void installIfNecessary(final InputStream sourceStream,final File destination) {
final Job installJob = new Job("Install " + getFeatureName()) {
@Override
@@ -56,14 +89,14 @@ public abstract class AbstractInstaller {
if (!isInstalled()) {
WPILibCore.logInfo("Install necessary for " + getFeatureName());
try {
install();
install(sourceStream,destination);
} catch (InstallException e) {
WPILibCore.logError("Error installing "+getFeatureName(), e);
return new Status(IStatus.ERROR, WPILibCore.PLUGIN_ID,
getErrorMessage(e));
}
}
updateInstalledVersion(version);
WPILibCore.logInfo("Installed" + getFeatureName());
@@ -98,6 +131,7 @@ public abstract class AbstractInstaller {
}
/**
*
* This function has been updated to guarantee that the wpilib folder date
* is older than the jar file being run, which ensures up to date tools.
*
@@ -108,38 +142,41 @@ public abstract class AbstractInstaller {
}
/**
* This function will delete an old wpilib subfolder if necessary and then copy
* the resource stream to the intended directory.
*
* @throws InstallException if bad things happen ...
* @TODO this function is very long and complicated. If all it does is unzip, it shouldn't be so hard.
*
* @param sourceStream input stream of zip file
* @param destination desired location for output of unzipping
* @throws InstallException
*/
protected void install() throws InstallException {
if(installLocation.exists()) {
if(!removeFileHandler(installLocation, true)) {
protected void install(InputStream sourceStream, File destination) throws InstallException {
if(destination.exists()) {
if(!removeFileHandler(destination, true)) {
MessageDialog.openError(null, "Error",
String.format("Could not update the old wpilib folder.%n"
+ "Please close any WPILib tools and restart Eclipse."));
}
//removeFileHandler(installLocation, false);
}
installLocation.mkdirs();
destination.mkdirs();
final String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS X") || osName.startsWith("Linux")) { // Unix-like OSes must preserve the executable bit; call unzip
// Unix-like OSes must preserve the executable bit; call unzip
if (osName.startsWith("Mac OS X") || osName.startsWith("Linux")) {
final File tmpFile = File.createTempFile(getFeatureName()+"-", ".zip");
try {
// Copy to temporary file
try (final InputStream zip = getInstallResourceStream();
try (final InputStream zip = sourceStream;
final FileOutputStream fout = new FileOutputStream(tmpFile)) {
copyStreams(zip, fout);
}
// Call 'unzip'
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);
final String[] cmd = {"unzip", "-q", "-o", tmpFile.getAbsolutePath(), "-d", destination.getAbsolutePath()};
WPILibCore.logInfo("unzip "+tmpFile.getAbsolutePath()+" -d "+destination.getAbsolutePath());
final Process unzipProcess = DebugPlugin.exec(cmd, destination);
try (final InputStream is = unzipProcess.getInputStream()) {
copyStreams(is, System.out); // Copy output to console
}
@@ -153,11 +190,11 @@ public abstract class AbstractInstaller {
tmpFile.delete();
}
} else {
ZipInputStream zip = new ZipInputStream(getInstallResourceStream());
ZipInputStream zip = new ZipInputStream(sourceStream);
ZipEntry entry = zip.getNextEntry();
while (entry != null) {
WPILibCore.logInfo("\tZipEntry " + entry + ": " + entry.getSize());
File f = new File(installLocation, entry.getName());
File f = new File(destination, entry.getName());
if (entry.isDirectory()) {
f.mkdirs();
} else {
@@ -176,6 +213,7 @@ public abstract class AbstractInstaller {
}
}
private static void copyStreams(InputStream source, OutputStream destination) throws IOException {
byte[] buffer = new byte[1024];
int len;

View File

@@ -3,6 +3,7 @@ package edu.wpi.first.wpilib.plugins.core.launching;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.lang.System;
import java.net.URI;
import java.net.URISyntaxException;
@@ -15,7 +16,7 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public class SimulationNotification {
private static final String URL = "https://wpilib.screenstepslive.com/s/4485/m/23353";
private static final String SIMULATION_UNSUPPORTED_MSG =
"Simulation is unsupported on your current setup.\n" +
"Simulation may not be support on your operating system.\n" +
"For more information see: " + URL;
public static void showUnsupported() {
@@ -32,12 +33,8 @@ public class SimulationNotification {
}
public static boolean supportsSimulation() {
String[] cmd = {"frcsim", "--version"};
try {
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
return true;
} catch (CoreException e) {
return false;
}
String os = System.getProperty("os.name");
//for now this is good enough, but we still need better handling if they have this OS but have not installed FRCSim
return (os.equals("Windows 8") || os.equals("Windows 7") || os.equals("Linux") || os.equals("Windows 8.1"));
}
}

View File

@@ -25,6 +25,7 @@
</resource>
</resources>
<plugins>
<!--copy the ant resources from src/main/resrouces/cpp-zip to target/resources/cpp-zip to cpp-zip -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>

View File

@@ -3,7 +3,13 @@
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/GearsBotCPPWin"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/GearsBotCPPWin/Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="GearsBotCPPWin" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -12,7 +18,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Debug" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.379433867" name="Cross GCC" nonInternalBuilderId="cdt.managedbuild.builder.gnu.cross" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
<option id="cdt.managedbuild.option.gnu.cross.prefix.541714056" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="arm-frc-linux-gnueabi-" valueType="string"/>
@@ -58,10 +64,11 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" moduleId="org.eclipse.cdt.core.settings" name="Simulate">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" moduleId="org.eclipse.cdt.core.settings" name="Linux Simulate">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -70,27 +77,31 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" name="Simulate" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Linux Simulate" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" name="Linux Simulate" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325." name="/" resourcePath="">
<toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.base.1184188597" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1621111203" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.base.1621111203" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/${ProjName}}/Simulate" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="cdt.managedbuild.target.gnu.builder.base.840272037" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.158466008" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.2105416021" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<tool commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.cpp.compiler.base.2105416021" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option id="gnu.cpp.compiler.option.include.paths.1645322059" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="${WPILIB}/cpp/current/sim/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.2"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.2"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-5.0"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.3"/>
</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"/>
<option id="gnu.cpp.compiler.option.debugging.level.937474733" 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.preprocessor.def.1023092361" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"/>
<option id="gnu.cpp.compiler.option.dialect.std.1098415592" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.flags.389754588" superClass="gnu.cpp.compiler.option.dialect.flags" value="-std=c++11" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1758810658" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.2039239712" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.2100353684" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1900634657" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.dialect.std.1352883605" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1197133064" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
@@ -108,7 +119,7 @@
</option>
<option id="gnu.cpp.link.option.paths.1677933356" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu"/>
<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gazebo-2.2/plugins"/>
<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gazebo-5.0/plugins"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.152327207" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -124,26 +135,149 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128" moduleId="org.eclipse.cdt.core.settings" name="Windows Simulate">
<externalSettings>
<externalSetting>
<entry flags="RESOLVED" kind="includePath" name="C:\Users\peter\wpilib\cpp\current\include"/>
<entry flags="RESOLVED" kind="includePath" name="C:\Users\peter\gz-ws\gazebo_sketchy\build\install\Debug\include"/>
<entry flags="RESOLVED" kind="includePath" name="C:\Users\peter\gz-ws\sdformat\build\install\Debug\include"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/GearsBotCPPWin/src"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="exe" artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Windows Simulate" errorParsers="org.eclipse.cdt.core.VCErrorParser" id="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128" name="Windows Simulate" parent="cdt.managedbuild.config.gnu.mingw.exe.debug" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="setup environment variables" prebuildStep="">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128." name="/" resourcePath="">
<toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.cross.base.592056279" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.773876502" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1970286339" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1773189260" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/GearsBotCPPWIN}/Windows Simulate" errorParsers="" id="org.eclipse.cdt.build.core.internal.builder.132963544" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="" id="cdt.managedbuild.tool.gnu.cross.c.compiler.1872033968" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.172352140" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.273333971" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.default" valueType="enumerated"/>
<option id="gnu.c.compiler.option.misc.other.1387357347" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1953150292" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool command="&quot;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl&quot;" commandLinePattern="${COMMAND} ${FLAGS} /Fo${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} /wd4068 /EHsc" errorParsers="" id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.809153465" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.include.paths.599803694" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\wpilib\cpp\current\sim\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\allwpilib\wpilibc\wpilibC++Sim\msgs\build&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Program Files (x86)\Windows Kits\8.1\Include\um&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Program Files (x86)\Windows Kits\8.1\Include\shared&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\gazebo\build\install\Debug\include\gazebo-6.0&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\sdformat\build\install\Debug\include\sdformat-3.0&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\ign-math\build\install\Debug\include\ignition\math2&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\FreeImage-vc12-x64-release-debug\Source&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\protobuf-2.6.0-win64-vc12\src&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\dlfcn-win32-vc12-x64-release-debug\build\install\Debug\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\tbb43_20141023oss\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\sdformat\src\win\tinyxml&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\pthread-w32\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\peter\gz-ws\boost_1_56_0&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.optimization.level.1265709272" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1058836115" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.2006680120" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.warnings.allwarn.2144515316" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.other.other.1677876881" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="/c /MDd" valueType="string"/>
<option id="gnu.cpp.compiler.option.other.pic.594318292" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.1865235685" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_USE_MATH_DEFINES"/>
<listOptionValue builtIn="false" value="WIN32_LEAN_AND_MEAN"/>
<listOptionValue builtIn="false" value="NOMINMAX"/>
<listOptionValue builtIn="false" value="FRC_SIMULATOR"/>
</option>
<option id="gnu.cpp.compiler.option.debugging.other.183827657" name="Other debugging flags" superClass="gnu.cpp.compiler.option.debugging.other" useByScannerDiscovery="false" value="/Z7" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1150869869" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1090661906" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool command="&quot;C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\bin\link&quot;" commandLinePattern="${COMMAND} /ignore:4099 /LIBPATH:&quot;C:\Users\peter\gz-ws\FreeImage-vc12-x64-release-debug\x64\Debug\DLL&quot; /LIBPATH:&quot;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\boost_1_56_0\lib64-msvc-12.0&quot; /LIBPATH:&quot;${WPILIB}\cpp\current\sim\lib&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\dlfcn-win32-vc12-x64-release-debug\build\install\Debug\lib&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\pthread-w32\lib\x64&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\ign-math\build\install\Debug\lib&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\libcurl-vc12-x64-release-debug-static-ipv6-sspi-winssl\Debug\lib&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\sdformat\build\install\Debug\lib&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\protobuf-2.6.0-win64-vc12\vsprojects\Debug&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\gazebo\build\install\Debug\lib&quot; /LIBPATH:&quot;C:\Users\peter\allwpilib\wpilibc\wpilibC++Sim\build&quot; /LIBPATH:&quot;C:\Users\peter\gz-ws\tbb43_20141023oss\lib\intel64\vc12&quot; /LIBPATH:&quot;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64&quot; /LIBPATH:&quot;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64&quot; ${FLAGS} /OUT:${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} /DEBUG WPILibSim.lib gazebo.lib gazebo_transport.lib gazebo_msgs.lib gazebo_common.lib gazebo_util.lib gazebo_client.lib gazebo_math.lib libprotobuf.lib sdformat.lib dl.lib libcurl_a_debug.lib ignition-math2.lib pthreadVC2.lib gz_msgs.lib IPHlpApi.lib /NODEFAULTLIB:libboost_system-vc120-mt-gd-1_56.lib /NODEFAULTLIB:libboost_thread-vc120-mt-gd-1_56.lib FreeImaged.lib" errorParsers="" id="cdt.managedbuild.tool.gnu.cross.cpp.linker.680547965" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option id="gnu.cpp.link.option.libs.231732731" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>
<option id="gnu.cpp.link.option.paths.122555745" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>
<option id="gnu.cpp.link.option.shared.1816604740" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" value="false" valueType="boolean"/>
<option id="gnu.cpp.link.option.flags.761367792" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="" valueType="string"/>
<option id="gnu.cpp.link.option.other.715702568" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other"/>
<option id="gnu.cpp.link.option.userobjs.984105280" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1789925387" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
<outputType id="cdt.managedbuild.tool.gnu.cpp.linker.output.so.1893130812" outputPrefix="" superClass="cdt.managedbuild.tool.gnu.cpp.linker.output.so"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.976699519" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="" id="cdt.managedbuild.tool.gnu.cross.assembler.10555843" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.219135409" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="$project.cdt.managedbuild.target.gnu.cross.exe.13534228" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/>
<project id="GearsBotCPP.cdt.managedbuild.target.gnu.cross.exe.13534228" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Windows Simulate"/>
<configuration configurationName="Simulate">
<resource resourceType="PROJECT" workspacePath="/GearsBotCPP"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/GearsBotCPP"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.c.compiler.1261239456;cdt.managedbuild.tool.gnu.c.compiler.input.1793678673">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.809153465;cdt.managedbuild.tool.gnu.cpp.compiler.input.1150869869">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;org.eclipse.cdt.msvc.cl.dll.debug.544581750;org.eclipse.cdt.msvc.cl.inputType.1806965547">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.msw.build.clScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;org.eclipse.cdt.msvc.cl.c.dll.debug.748290057;org.eclipse.cdt.msvc.cl.inputType.c.690275938">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.msw.build.clScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.cross.c.compiler.1872033968;cdt.managedbuild.tool.gnu.c.compiler.input.1953150292">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;org.eclipse.cdt.msvc.cl.dll.debug.880390044;org.eclipse.cdt.msvc.cl.inputType.393977355">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.msw.build.clScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1297766759;cdt.managedbuild.tool.gnu.cpp.compiler.input.498113544">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.785693711;cdt.managedbuild.tool.gnu.c.compiler.input.778242069">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1647706237;cdt.managedbuild.tool.gnu.cpp.compiler.input.1338339147">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1505235107;cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/$project"/>
</configuration>
<configuration configurationName="Simulate">
<resource resourceType="PROJECT" workspacePath="/$project"/>
</configuration>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.c.compiler.1261239456;cdt.managedbuild.tool.gnu.c.compiler.input.1793678673">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;org.eclipse.cdt.msvc.cl.c.dll.debug.1658947706;org.eclipse.cdt.msvc.cl.inputType.c.2076377067">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.msw.build.clScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128;cdt.managedbuild.config.gnu.mingw.exe.debug.912379410.387599128.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.510224028;cdt.managedbuild.tool.gnu.c.compiler.input.323654435">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View File

@@ -5,11 +5,7 @@ build.dir=build
out.exe=Debug/${out}
# Simulation
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
simulation.world.file=$world
# Use the current C++ library by default
cpp-version=current

View File

@@ -14,3 +14,9 @@ roboRIOAllowedImages=23
wpilib.ant.dir=${wpilib}/ant
jsch.jar=${wpilib.ant.dir}/jsch-0.1.50.jar
classloadertask.jar=${wpilib.ant.dir}/ant-classloadertask.jar
#simulation stuff
sim.exe=Simulate/${out}
wpilib.sim=${wpilib}/sim
sim.tools=${wpilib.sim}/tools
sim.lib=${wpilib.sim}/lib

View File

@@ -104,17 +104,15 @@
<target name="simulate">
<parallel>
<sequential>
<echo>[simulate] Running Gazebo.</echo>
<exec executable="frcsim">
<arg value="${simulation.world.file}"/>
</exec>
<!-- windows uses a batch file to run frcsim, linux uses a shell script -->
<condition property="frcsim.executable" value="frcsim.bat" else="frcsim">
<os family="windows" />
</condition>
<!-- TODO: launch gazebo once? -->
<echo>[simulate] You may now run Gazebo</echo>
</sequential>
<sequential>
<sleep seconds="5"/>
<echo>[simulate] Running DriverStation.</echo>
<java jar="${sim.tools}/SimDS.jar" fork="true">
<jvmarg value="-Djava.library.path=${sim.lib}" />
</java>
<echo>[simulate] You can now run your DriverStation!</echo>
</sequential>
<sequential>
<sleep seconds="5"/>

View File

@@ -174,17 +174,15 @@
<target name="simulate" depends="jar-for-simulation">
<parallel>
<sequential>
<echo>[simulate] Running Gazebo.</echo>
<exec executable="frcsim">
<arg value="${simulation.world.file}"/>
</exec>
<condition property="frcsim.executable" value="frcsim.bat" else="frcsim">
<os family="windows" />
</condition>
<!-- TODO: launch gazebo once? -->
<echo>[simulate] You may now run Gazebo</echo>
</sequential>
<sequential>
<sleep seconds="5"/>
<echo>[simulate] Running DriverStation.</echo>
<java jar="${wpilib.sim.tools}/SimDS.jar" fork="true">
<jvmarg value="-Djava.library.path=${wpilib.sim.lib}" />
</java>
<echo>[debug-simulate] You may now run your DriverStation.</echo>
</sequential>
<sequential>
<sleep seconds="5"/>
@@ -206,10 +204,7 @@
</sequential>
<sequential>
<sleep seconds="5"/>
<echo>[debug-simulate] Running DriverStation.</echo>
<java jar="${wpilib.sim.tools}/SimDS.jar" fork="true">
<jvmarg value="-Djava.library.path=${wpilib.sim.lib}" />
</java>
<echo>[debug-simulate] you may now run your DriverStation.</echo>
</sequential>
<sequential>
<sleep seconds="5"/>

View File

@@ -0,0 +1 @@
bin.includes = feature.xml

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.simulation.feature"
label="Feature"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="edu.wpi.first.wpilib.plugins.simulation"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edu.wpi.first.wpilib.plugins.simulation.feature"
label="Robot Simulation Development"
version="0.1.0.qualifier"
provider-name="Worcester Polytechnic Institute">
<description>
FRC Robot Simulation Program Development Environment.
</description>
<copyright>
* Copyright (c) 2015 FIRST and WPI
* All rights reserved.
</copyright>
<license>
* Copyright (c) 2015 FIRST and WPI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. Neither the name of the FIRST nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS&apos;&apos;
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</license>
<includes
id="edu.wpi.first.wpilib.plugins.core.feature"
version="0.0.0"/>
<plugin
id="edu.wpi.first.wpilib.plugins.simulation"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.simulation.feature</artifactId>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
</project>

View File

@@ -0,0 +1,2 @@
#ignore libraries. They will be copied from frc_gazebo_plugins/build/plugins
*.so

View File

@@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WPILib_Robot_Simulation
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.simulation;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: edu.wpi.first.wpilib.plugins.simulation.WPILibSimulationPlugin
Require-Bundle: org.eclipse.core.runtime,
edu.wpi.first.wpilib.plugins.core;bundle-version="0.1.0",
org.eclipse.jface;bundle-version="3.10.2",
org.eclipse.ui;bundle-version="3.106.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Worcester Polytechnic Institute

View File

@@ -0,0 +1,10 @@
#Notes on the simulation eclipse plugin
Should download models when installed
build with the rest of the eclipse plugins using:
//if you're in the eclipse-plugins directory
mvn package
//otherwise in the base dir
./gradlew eclipsePlugins //no colons here!

View File

@@ -0,0 +1,8 @@
source.. = src/main/java/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
plugin.xml,\
resources/
src.include = src/,\
resources/

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup
class="edu.wpi.first.wpilib.plugins.simulation.WPILibSimulationPlugin">
</startup>
</extension>
</plugin>

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.wpi.first.wpilib.plugins.simulation</artifactId>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.plugins</groupId>
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
<version>0.1.0.qualifier</version>
<relativePath>..</relativePath>
</parent>
<properties>
<build-number>DEVELOPMENT</build-number>
<simulation-zip>${project.build.directory}\simulation-zip</simulation-zip>
</properties>
<repositories>
<repository>
<id>WPILib Maven Repository</id>
<url>http://first.wpi.edu/FRC/roborio/maven/</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>resources/configuration.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-plugins-to-simulation-zip</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${simulation-zip}</outputDirectory>
<resources>
<resource>
<directory>../../build/simulation/frc_gazebo_plugins/</directory><!-- TODO do this with variables -->
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<!-- Set time stamp and version properties. -->
<execution>
<id>set-version-info</id>
<goals>
<goal>run</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<target>
<tstamp>
<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
</tstamp>
<tstamp>
<format property="version-info" pattern="yyyy.MM.dd.HH.mm.ss"/>
</tstamp>
<property name="version" value="${version-info}.${build-number}"/>
</target>
<exportAntProperties>true</exportAntProperties>
</configuration>
</execution>
<!-- Generate zip file to unzip for the user. -->
<execution>
<id>generate-simulation-zip</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<zip destfile="${project.build.directory}/classes/resources/simulation.zip"
basedir="${simulation-zip}"
update="true"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>[2.8,)</versionRange>
<goals>
<goal>copy</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<!-- Add fake dependencies to inform Maven of the correct
order it should build projects in during a multi-module build.
This list should match the list in the invocation of
maven-dependency-plugin:copy above.
It may be possible to avoid this duplication by using the
maven-assembly-plugin instead.-->
<!-- Library sources for debugging WPILib on the Athena -->
<dependency>
<groupId>edu.wpi.first.wpilib</groupId>
<artifactId>sfx</artifactId>
<type>zip</type>
<version>LATEST</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,2 @@
timestamp=${timestamp}
version=${version}

View File

@@ -0,0 +1,104 @@
package edu.wpi.first.wpilib.plugins.simulation;
/**
* @author peter mitrano <pdmitrano@wpi.edu>
*/
import java.io.File;
import java.util.Properties;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.ant.AntPropertiesParser;
import edu.wpi.first.wpilib.plugins.simulation.installer.SimulationInstaller;
public class WPILibSimulationPlugin extends AbstractUIPlugin implements IStartup{
// The plug-in ID
public static final String PLUGIN_ID = "WPILib_Java_Robot_Development"; //$NON-NLS-1$
// The shared instance
private static WPILibSimulationPlugin plugin;
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
plugin = null;
super.stop(bundleContext);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static WPILibSimulationPlugin getDefault() {
return plugin;
}
public String getCurrentVersion() {
try {
Properties props = new AntPropertiesParser(
WPILibSimulationPlugin.class.getResourceAsStream("/resources/configuration.properties")).
getProperties();
if (props.getProperty("version").startsWith("$")) {
return "DEVELOPMENT";
} else {
return props.getProperty("version");
}
} catch (CoreException e) {
WPILibSimulationPlugin.logError("Error getting properties.", e);
return "DEVELOPMENT";
}
}
public String getSimulationDir() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "simulation";
}
public String getPluginsDir() {
return getSimulationDir() + File.separator + "plugins";
}
public static void logInfo(String msg) {
getDefault().getLog().log(new Status(Status.INFO, PLUGIN_ID, Status.OK, msg, null));
}
private static void logError(String msg, CoreException e) {
getDefault().getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e));
}
public String getJavaPath() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "java" + File.separator + "current";
}
@Override
public void earlyStartup() {
SimulationInstaller simulationInstaller = new SimulationInstaller(getCurrentVersion());
//downloads and copies the models from collabnet and unzips to
//wpilib/simulation/models and wpilib/simulation/worlds
simulationInstaller.installModels();
//extracts and copies the gazebo plugins from simulation.zip to wpilib/simulation/plugins
simulationInstaller.installPlugins();
}
}

View File

@@ -0,0 +1,89 @@
package edu.wpi.first.wpilib.plugins.simulation.installer;
/**
* @author peter mitrano <pdmitrano@wpi.edu>
*/
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.net.ssl.HttpsURLConnection;
import org.eclipse.jface.preference.IPreferenceStore;
import org.osgi.service.log.LogEntry;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.simulation.WPILibSimulationPlugin;
import edu.wpi.first.wpilib.plugins.simulation.preferences.PreferenceConstants;
public class SimulationInstaller extends AbstractInstaller {
public SimulationInstaller(String version) {
// copy gazebo plugins wpilib/simulation/plugins
super(version, WPILibSimulationPlugin.getDefault().getPreferenceStore()
.getString(PreferenceConstants.LIBRARY_INSTALLED),
WPILibSimulationPlugin.getDefault().getPluginsDir());
}
public void installModels() {
// download models
// temporarily hardcoding link, but should be smarter
String inputFilePath = WPILibSimulationPlugin.getDefault()
.getSimulationDir() + File.separator + "models.zip";
File inputFile = new File(inputFilePath);
try {
if (inputFile.exists()) {
WPILibSimulationPlugin.logInfo("models doesn't need to be downloaded again");
} else {
URL url = new URL("https://usfirst.collab.net/sf/frs/do/downloadFile/projects.wpilib/frs.simulation.frcsim_gazebo_models/frs1162?dl=1");
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
try (InputStream stream = con.getInputStream()) {
WPILibSimulationPlugin.logInfo("downloading models zip");
Files.copy(stream, Paths.get(inputFilePath));
}
}
// unzip
WPILibSimulationPlugin.logInfo("unzipping to "+ WPILibSimulationPlugin.getDefault().getSimulationDir());
super.installIfNecessary(inputFilePath, WPILibSimulationPlugin.getDefault().getSimulationDir());
} catch (MalformedURLException mue) {
WPILibSimulationPlugin
.logInfo("Malformed URL Exception when downloading models");
WPILibSimulationPlugin.logInfo(mue.getLocalizedMessage());
} catch (IOException ioe) {
WPILibSimulationPlugin
.logInfo("IO Exception when downloading models");
WPILibSimulationPlugin.logInfo(ioe.getLocalizedMessage());
}
}
public void installPlugins() {
super.installIfNecessary();
}
@Override
protected String getFeatureName() {
return "simulation";
}
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibSimulationPlugin.getDefault()
.getPreferenceStore();
prefs.setValue(PreferenceConstants.LIBRARY_INSTALLED, version);
}
@Override
protected InputStream getInstallResourceStream() {
return SimulationInstaller.class
.getResourceAsStream("/resources/simulation.zip");
}
}

View File

@@ -0,0 +1,10 @@
package edu.wpi.first.wpilib.plugins.simulation.preferences;
/**
* @author peter mitrano <pdmitrano@wpi.edu>
*
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
}

View File

@@ -0,0 +1,25 @@
package edu.wpi.first.wpilib.plugins.simulation.preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
/**
* @author peter mitrano <pdmitrano@wpi.edu>
*
* Class used to initialize default preference values.
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibCore.getDefault().getPreferenceStore();
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
store.setValue(PreferenceConstants.LIBRARY_INSTALLED, "none");
}
}

View File

@@ -6,6 +6,9 @@
<feature url="features/edu.wpi.first.wpilib.plugins.java.feature_0.1.0.qualifier.jar" id="edu.wpi.first.wpilib.plugins.java.feature" version="0.1.0.qualifier">
<category name="edu.wpi.first.wpilib.plugins"/>
</feature>
<feature url="features/edu.wpi.first.wpilib.plugins.simulation.feature_0.1.0.qualifier.jar" id="edu.wpi.first.wpilib.plugins.simulation.feature" version="0.1.0.qualifier">
<category name="edu.wpi.first.wpilib.plugins"/>
</feature>
<category-def name="edu.wpi.first.wpilib.plugins" label="WPILib Robot Development">
<description>
Core WPILib Robot Development Tools.

View File

@@ -11,6 +11,8 @@
<modules>
<module>edu.wpi.first.wpilib.plugins.core</module>
<module>edu.wpi.first.wpilib.plugins.core.feature</module>
<module>edu.wpi.first.wpilib.plugins.simulation</module>
<module>edu.wpi.first.wpilib.plugins.simulation.feature</module>
<module>edu.wpi.first.wpilib.plugins.cpp</module>
<module>edu.wpi.first.wpilib.plugins.cpp.feature</module>
<module>edu.wpi.first.wpilib.plugins.java</module>