Compare commits
4 Commits
cleanup-un
...
master
Author | SHA1 | Date | |
---|---|---|---|
165507277e | |||
|
b88e1c48db | ||
|
5e7a390bd4 | ||
|
99175b1bfb |
283
.cproject
Normal file
283
.cproject
Normal file
@ -0,0 +1,283 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
<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>
|
||||||
|
<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"/>
|
||||||
|
<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"/>
|
||||||
|
</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="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"/>
|
||||||
|
<option id="cdt.managedbuild.option.gnu.cross.path.1246856819" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path" value="/usr/local/bin" valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.864368257" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
||||||
|
<builder autoBuildTarget="all" buildPath="${workspace_loc:/Robot2016}/Debug" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.1308552451" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1261239456" 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.680635682" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||||
|
<option id="gnu.c.compiler.option.debugging.level.143320011" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||||
|
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1793678673" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1505235107" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
||||||
|
<option id="gnu.cpp.compiler.option.optimization.level.1204256582" 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.969129918" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||||
|
<option id="gnu.cpp.compiler.option.include.paths.394786621" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value=""${WPILIB}/cpp/current/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||||
|
</option>
|
||||||
|
<option id="gnu.cpp.compiler.option.dialect.flags.1518551306" superClass="gnu.cpp.compiler.option.dialect.flags" value="-std=c++1y" valueType="string"/>
|
||||||
|
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.362679811" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1895838080" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
||||||
|
<option id="gnu.cpp.link.option.libs.1363675797" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value="wpi"/>
|
||||||
|
</option>
|
||||||
|
<option id="gnu.cpp.link.option.paths.1566479969" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
|
||||||
|
<listOptionValue builtIn="false" value=""${WPILIB}/cpp/current/lib""/>
|
||||||
|
</option>
|
||||||
|
<option id="gnu.cpp.link.option.flags.675338432" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a,-rpath,/usr/local/frc/rpath-lib" valueType="string"/>
|
||||||
|
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.132949138" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.412234585" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1047448065" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
||||||
|
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1542016468" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<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="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"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</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="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;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 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=""${workspace_loc:/${ProjName}}/src""/>
|
||||||
|
<listOptionValue builtIn="false" value="${WPILIB}/simulation/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="/usr/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="/usr/include/gazebo-6.5"/>
|
||||||
|
<listOptionValue builtIn="false" value="/usr/include/ignition/math2"/>
|
||||||
|
<listOptionValue builtIn="false" value="/usr/include/sdformat-3.7"/>
|
||||||
|
</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"/>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.2094820582" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
|
||||||
|
<option id="gnu.cpp.link.option.libs.1563598353" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value="wpilibcSim"/>
|
||||||
|
<listOptionValue builtIn="false" value="gz_msgs"/>
|
||||||
|
<listOptionValue builtIn="false" value="ntcore"/>
|
||||||
|
<listOptionValue builtIn="false" value="gazebo_client"/>
|
||||||
|
<listOptionValue builtIn="false" value="boost_system"/>
|
||||||
|
</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="${WPILIB}/simulation/lib"/>
|
||||||
|
</option>
|
||||||
|
<option id="gnu.cpp.link.option.other.1549699992" superClass="gnu.cpp.link.option.other" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="-rpath ${WPILIB}/simulation/lib"/>
|
||||||
|
</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)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="cdt.managedbuild.tool.gnu.assembler.base.2105089872" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
|
||||||
|
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.254601899" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
</configuration>
|
||||||
|
</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="${WPILIB}\cpp\current\include"/>
|
||||||
|
<entry flags="RESOLVED" kind="includePath" name="C:\Program Files\Gazebo\gazebo\build\install\Debug\include"/>
|
||||||
|
<entry flags="RESOLVED" kind="includePath" name="C:\Program Files\Gazebo\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=""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl"" 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=""${workspace_loc:/${ProjName}/src}""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${WPILIB}\simulation\include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files (x86)\Windows Kits\8.1\Include\um""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files (x86)\Windows Kits\8.1\Include\winrt""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files (x86)\Windows Kits\8.1\Include\shared""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\gazebo\build\install\Debug\include\gazebo-6.0""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\sdformat\build\install\Debug\include\sdformat-3.0""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\ign-math\build\install\Debug\include\ignition\math2""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\FreeImage-vc12-x64-release-debug\Source""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\protobuf-2.6.0-win64-vc12\src""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\dlfcn-win32-vc12-x64-release-debug\build\install\Debug\include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\tbb43_20141023oss\include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\sdformat\src\win\tinyxml""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\pthread-w32\include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""C:\Program Files\Gazebo\boost_1_56_0""/>
|
||||||
|
</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=""C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\bin\link"" commandLinePattern="${COMMAND} /ignore:4099 /LIBPATH:"C:\Program Files\Gazebo\FreeImage-vc12-x64-release-debug\x64\Debug\DLL" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64" /LIBPATH:"C:\Program Files\Gazebo\boost_1_56_0\lib64-msvc-12.0" /LIBPATH:"${WPILIB}\simulation\lib" /LIBPATH:"C:\Program Files\Gazebo\dlfcn-win32-vc12-x64-release-debug\build\install\Debug\lib" /LIBPATH:"C:\Program Files\Gazebo\pthread-w32\lib\x64" /LIBPATH:"C:\Program Files\Gazebo\ign-math\build\install\Debug\lib" /LIBPATH:"C:\Program Files\Gazebo\libcurl-vc12-x64-release-debug-static-ipv6-sspi-winssl\Debug\lib" /LIBPATH:"C:\Program Files\Gazebo\sdformat\build\install\Debug\lib" /LIBPATH:"C:\Program Files\Gazebo\protobuf-2.6.0-win64-vc12\vsprojects\Debug" /LIBPATH:"C:\Program Files\Gazebo\gazebo\build\install\Debug\lib" /LIBPATH:"C:\Program Files\Gazebo\tbb43_20141023oss\lib\intel64\vc12" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64" ${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="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.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>
|
||||||
|
<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>
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/Debug/
|
28
.project
Normal file
28
.project
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Robot2016</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
<nature>edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
35
Makefile
Normal file
35
Makefile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
LIBS=wpi
|
||||||
|
CXX=arm-frc-linux-gnueabi-g++
|
||||||
|
override CPPFLAGS +=-std=c++14
|
||||||
|
LDFLAGS=-l$(LIBS)
|
||||||
|
TEAM=1786
|
||||||
|
SSH_OPTIONS=-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
|
||||||
|
SSH_SSHPASS=$(shell command -v sshpass >/dev/null 2>&1 && echo -n "sshpass -p ''")
|
||||||
|
SSH_HOST=roborio-1786-frc.local
|
||||||
|
|
||||||
|
all: deploy
|
||||||
|
|
||||||
|
build: FRCUserProgram
|
||||||
|
|
||||||
|
FRCUserProgram: src/Robot.cpp
|
||||||
|
@echo "Building FRCUserProgram"
|
||||||
|
$(CXX) $(CPPFLAGS) $< -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm FRCUserProgram
|
||||||
|
|
||||||
|
deploy: build
|
||||||
|
@echo "Copying FRCUserProgram"
|
||||||
|
ssh $(SSH_OPTIONS) lvuser@$(SSH_HOST) 'rm -f /home/lvuser/FRCUserProgram'
|
||||||
|
scp $(SSH_OPTIONS) -o "LogLevel QUIET" FRCUserProgram lvuser@$(SSH_HOST):/home/lvuser/FRCUserProgram
|
||||||
|
@echo "Restarting FRCUserProgram"
|
||||||
|
$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r'
|
||||||
|
|
||||||
|
restart: FRCUserProgram
|
||||||
|
echo "Restarting FRCUserProgram"
|
||||||
|
$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r'
|
||||||
|
|
||||||
|
stop:
|
||||||
|
@echo "Restarting FRCUserProgram"
|
||||||
|
$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t'y
|
||||||
|
|
11
build.properties
Normal file
11
build.properties
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Build information
|
||||||
|
out=FRCUserProgram
|
||||||
|
src.dir=src
|
||||||
|
build.dir=build
|
||||||
|
out.exe=Debug/${out}
|
||||||
|
|
||||||
|
# Simulation
|
||||||
|
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
|
||||||
|
|
||||||
|
# Use the current C++ library by default
|
||||||
|
cpp-version=current
|
28
build.xml
Normal file
28
build.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project name="FRC Deployment" default="deploy">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The following properties can be defined to override system level
|
||||||
|
settings. These should not be touched unless you know what you're
|
||||||
|
doing. The primary use is to override the wpilib version when
|
||||||
|
working with older robots that can't compile with the latest
|
||||||
|
libraries.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- By default the system version of WPI is used -->
|
||||||
|
<!-- <property name="version" value=""/> -->
|
||||||
|
|
||||||
|
<!-- By default the system team number is used -->
|
||||||
|
<!-- <property name="team-number" value=""/> -->
|
||||||
|
|
||||||
|
<!-- By default the target is set to 10.TE.AM.2 -->
|
||||||
|
<!-- <property name="target" value=""/> -->
|
||||||
|
|
||||||
|
<property file="${user.home}/wpilib/wpilib.properties"/>
|
||||||
|
<property file="build.properties"/>
|
||||||
|
<property file="${user.home}/wpilib/cpp/${version}/ant/build.properties"/>
|
||||||
|
|
||||||
|
<import file="${wpilib.ant.dir}/build.xml"/>
|
||||||
|
|
||||||
|
</project>
|
597
src/Robot.cpp
Normal file
597
src/Robot.cpp
Normal file
@ -0,0 +1,597 @@
|
|||||||
|
#include "WPILib.h"
|
||||||
|
#include "Shooter.h"
|
||||||
|
#include <ctime>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <cmath>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifndef BUTTON_LAYOUT
|
||||||
|
#define BUTTON_LAYOUT
|
||||||
|
|
||||||
|
#define TRIGGER 1 // Trigger button number
|
||||||
|
#define THUMB 2 // Thumb button number
|
||||||
|
#define RAMP_RAISE 5 // Button 3 for Raising Ramp
|
||||||
|
#define RAMP_LOWER 3 // Button 4 to lower ramp.
|
||||||
|
#define UNJAM 11
|
||||||
|
#define GIM_UP 7
|
||||||
|
#define GIM_DOWN 9
|
||||||
|
#define GIM_ZERO 10
|
||||||
|
#define GIM_SHOOT 8
|
||||||
|
|
||||||
|
#define GIMB_DEFAULT 768 //Default position of the gimble (*1000)
|
||||||
|
#define GIMB_DELTA 2 //Amount to increment by
|
||||||
|
|
||||||
|
#define ARMS_SCALE 0.75
|
||||||
|
|
||||||
|
#define DEADZONE_RADIUS 0.05 // Deadzone Radius prevents tiny twitches in the joystick's value from
|
||||||
|
// affecting the robot. Use this for cleaning up drive train and shooter.
|
||||||
|
// Also used for detecting changes in an axis' value.
|
||||||
|
|
||||||
|
#define TURN_FACTOR 1.5 // Left(x,y) = y*(1 + TF*x) : x < 0
|
||||||
|
// = y : x >= 0
|
||||||
|
// Right(x,y) = y : x < 0
|
||||||
|
// = y*(1 - TF*x) : x >= 0
|
||||||
|
|
||||||
|
#endif // BUTTON_LAYOUT
|
||||||
|
|
||||||
|
#ifndef LOG
|
||||||
|
#define LOG(X) logA << X; logB << X; logC << X //for writing data to the csv file
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class Robot: public IterativeRobot
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
TalonSRX left_drive, right_drive;
|
||||||
|
CANTalon shooter1, shooter2,
|
||||||
|
ramp,
|
||||||
|
arms;
|
||||||
|
RobotDrive drive;
|
||||||
|
Shooter shooter;
|
||||||
|
Joystick driver_stick, operator_stick;
|
||||||
|
Timer auto_clock;
|
||||||
|
Servo gimbs;
|
||||||
|
int gimba; // angle of the gimble as a value of from 0 to 1000
|
||||||
|
|
||||||
|
// instance variables
|
||||||
|
bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released.
|
||||||
|
bool inverting;
|
||||||
|
bool ramping;
|
||||||
|
bool shooting;
|
||||||
|
bool unjamming;
|
||||||
|
bool arming;
|
||||||
|
bool arcade;
|
||||||
|
float shooter_power;
|
||||||
|
|
||||||
|
enum auto_states
|
||||||
|
{
|
||||||
|
START,
|
||||||
|
DRIVING_FORWARD,
|
||||||
|
STOP
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_states auto_status;
|
||||||
|
|
||||||
|
LiveWindow *lw = LiveWindow::GetInstance();
|
||||||
|
SendableChooser *chooser;
|
||||||
|
const std::string autoNameDefault = "1.7 Seconds (Slightly Longer)";
|
||||||
|
const std::string autoNameShort = "1.5 Seconds (Short, good on the moat)";
|
||||||
|
const std::string autoNameOne = "1 Seconds";
|
||||||
|
const std::string autoNameDisable = "Disable Autonomous (set time to 0)";
|
||||||
|
std::string autoSelected;
|
||||||
|
|
||||||
|
void LogCSVData()
|
||||||
|
{
|
||||||
|
static PowerDistributionPanel pdp; // preparing to read from the pdp
|
||||||
|
static std::vector<CANTalon*> motors;
|
||||||
|
|
||||||
|
static std::ofstream logA, logB, logC;
|
||||||
|
timeval tm;
|
||||||
|
|
||||||
|
SmartDashboard::PutBoolean("log A", logA.is_open());
|
||||||
|
SmartDashboard::PutBoolean("log B", logB.is_open());
|
||||||
|
SmartDashboard::PutBoolean("log C", logC.is_open());
|
||||||
|
|
||||||
|
SmartDashboard::PutBoolean("Ramp Limit F", !ramp.IsFwdLimitSwitchClosed());
|
||||||
|
SmartDashboard::PutBoolean("Ramp Limit R", !ramp.IsRevLimitSwitchClosed());
|
||||||
|
SmartDashboard::PutBoolean("Arms Limit F", !arms.IsFwdLimitSwitchClosed());
|
||||||
|
SmartDashboard::PutBoolean("Arms Limit R", !arms.IsRevLimitSwitchClosed());
|
||||||
|
|
||||||
|
SmartDashboard::PutNumber("angle of camera", gimba);
|
||||||
|
|
||||||
|
if (!logA.is_open() && !logB.is_open() && !logC.is_open())
|
||||||
|
{
|
||||||
|
std::fstream logNumFile;
|
||||||
|
int logNum;
|
||||||
|
logNumFile.open("/home/lvuser/logNum");
|
||||||
|
logNumFile >> logNum;
|
||||||
|
logNum++;
|
||||||
|
logNumFile.seekp(0);
|
||||||
|
logNumFile << logNum;
|
||||||
|
// writing to /home/lvuser/logs/[unixtime].log
|
||||||
|
logA.open("/media/sda1/logs/log" + std::to_string(logNum) + ".csv");
|
||||||
|
std::cerr << (logA.is_open() ? "Opened" : "Failed to open") << "log A." << std::endl;
|
||||||
|
logB.open("/media/sdb1/logs/log" + std::to_string(logNum) + ".csv");
|
||||||
|
std::cerr << (logB.is_open() ? "Opened" : "Failed to open") << "log B." << std::endl;
|
||||||
|
logC.open("/home/lvuser/logs/log" + std::to_string(logNum) + ".csv");
|
||||||
|
std::cerr << (logC.is_open() ? "Opened" : "Failed to open") << "log C." << std::endl;
|
||||||
|
|
||||||
|
LOG("Time\tpdpInput voltage\tpdpTemperature\tpdpTotal Current\t");
|
||||||
|
for (int ii = 0; ii < 16; ii++)
|
||||||
|
{
|
||||||
|
LOG("pdpChannel " << ii << " current\t");
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG("tlaunch_spinny Bus Voltage\ttlaunch_spinny Output Current\ttlaunch_spinny Output Voltage\ttlaunch_spinny Temperature");
|
||||||
|
motors.push_back(&ramp);
|
||||||
|
LOG("\tShooter1 Bus Voltage\tShooter1 Output Current\tShooter1 Output Voltage\tShooter1 Temperature");
|
||||||
|
motors.push_back(&shooter1);
|
||||||
|
LOG("\tShooter2 Bus Voltage\tShooter2 Output Current\tShooter2 Output Voltage\tShooter2 Temperature");
|
||||||
|
motors.push_back(&shooter2);
|
||||||
|
|
||||||
|
LOG("\tJoystick X\tJoystick Y\tJoystick Twist");
|
||||||
|
LOG("\tAlliance\tLocation\tMatch Time\tFMS Attached\tBrowned Out");
|
||||||
|
LOG("\tTestStage");
|
||||||
|
LOG(std::endl);
|
||||||
|
}
|
||||||
|
gettimeofday(&tm, NULL);
|
||||||
|
LOG(time(0) << '.' << std::setfill('0') << std::setw(3) << tm.tv_usec/1000);
|
||||||
|
// Some general information
|
||||||
|
LOG("\t" << pdp.GetVoltage());
|
||||||
|
LOG("\t" << pdp.GetTemperature());
|
||||||
|
LOG("\t" << pdp.GetTotalCurrent());
|
||||||
|
// current on each channel
|
||||||
|
for (int ii = 0; ii < 16; ii++)
|
||||||
|
{
|
||||||
|
LOG("\t" << pdp.GetCurrent(ii));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Talon Data
|
||||||
|
for(int ii = 0; ii < motors.size(); ii++)
|
||||||
|
{
|
||||||
|
LOG("\t" << motors[ii]->GetBusVoltage());
|
||||||
|
LOG("\t" << motors[ii]->GetOutputVoltage());
|
||||||
|
LOG("\t" << motors[ii]->GetOutputCurrent());
|
||||||
|
LOG("\t" << motors[ii]->GetTemperature());
|
||||||
|
}
|
||||||
|
//control data
|
||||||
|
LOG("\t" << driver_stick.GetX());
|
||||||
|
LOG("\t" << driver_stick.GetY());
|
||||||
|
LOG("\t" << driver_stick.GetTwist());
|
||||||
|
|
||||||
|
//DriverStation Data
|
||||||
|
LOG("\t" << DriverStation::GetInstance().GetAlliance());
|
||||||
|
LOG("\t" << DriverStation::GetInstance().GetLocation());
|
||||||
|
LOG("\t" << DriverStation::GetInstance().GetMatchTime());
|
||||||
|
LOG("\t" << DriverStation::GetInstance().IsFMSAttached());
|
||||||
|
LOG("\t" << DriverStation::GetInstance().IsSysBrownedOut());
|
||||||
|
LOG(std::endl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes the gross raw throttle input from joystick and returns a
|
||||||
|
* value between 0.0-1.0 (no negative values)
|
||||||
|
*/
|
||||||
|
float SaneThrottle(float rawThrottle)
|
||||||
|
{
|
||||||
|
return ((1.0 - rawThrottle) / 2.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateDrive()
|
||||||
|
{
|
||||||
|
float x = -driver_stick.GetX();
|
||||||
|
float y = -driver_stick.GetY();
|
||||||
|
if (x > 0)
|
||||||
|
{
|
||||||
|
float right = y * SaneThrottle(driver_stick.GetThrottle());
|
||||||
|
float left = (1-x)*y * SaneThrottle(driver_stick.GetThrottle());
|
||||||
|
drive.TankDrive(left, right);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float left = y * SaneThrottle(driver_stick.GetThrottle());
|
||||||
|
float right = (1+x)*y * SaneThrottle(driver_stick.GetThrottle());
|
||||||
|
drive.TankDrive(left, right);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
Robot():
|
||||||
|
left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter
|
||||||
|
right_drive(1), // Right DriveTrain Talons plug // left wheel 2
|
||||||
|
shooter1(11), // shooter drive 1
|
||||||
|
shooter2(10), // shooter drive 2
|
||||||
|
ramp(12),
|
||||||
|
arms(13),
|
||||||
|
drive(&left_drive, &right_drive),
|
||||||
|
shooter( // initialize Shooter object.
|
||||||
|
&shooter1, &shooter2, &ramp),
|
||||||
|
driver_stick(0), // right stick (operator)
|
||||||
|
operator_stick(1), // left stick (driver)
|
||||||
|
gimbs(3),
|
||||||
|
gimba(GIMB_DEFAULT)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RobotInit()
|
||||||
|
{
|
||||||
|
chooser = new SendableChooser();
|
||||||
|
|
||||||
|
chooser->AddDefault(autoNameDefault, (void*)&autoNameDefault);
|
||||||
|
chooser->AddObject(autoNameShort, (void*)&autoNameShort);
|
||||||
|
chooser->AddObject(autoNameOne, (void*)&autoNameOne);
|
||||||
|
chooser->AddObject(autoNameDisable, (void*)&autoNameDisable);
|
||||||
|
SmartDashboard::PutData("Auto Modes", chooser);
|
||||||
|
shooter1.Enable();
|
||||||
|
shooter2.Enable();
|
||||||
|
left_drive.SetInverted(true);
|
||||||
|
right_drive.SetInverted(true);
|
||||||
|
//ramp.SetInverted(true);
|
||||||
|
inverting = false;
|
||||||
|
pickupRunning = false;
|
||||||
|
ramping = false;
|
||||||
|
shooting = false;
|
||||||
|
unjamming = false;
|
||||||
|
arming = false;
|
||||||
|
shooter_power = 0;
|
||||||
|
arcade = false;
|
||||||
|
|
||||||
|
// Initialize the number so we can get it later
|
||||||
|
SmartDashboard::PutNumber("shooting angle", GIMB_DEFAULT);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutonomousInit()
|
||||||
|
{
|
||||||
|
autoSelected = *((std::string*)chooser->GetSelected());
|
||||||
|
//std::string autoSelected = SmartDashboard::GetString("Auto Selector", autoNameDefault);
|
||||||
|
std::cout << "Auto selected: " << autoSelected << std::endl;
|
||||||
|
|
||||||
|
auto_status = START;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutonomousPeriodic()
|
||||||
|
{
|
||||||
|
const float drivePower = 1;
|
||||||
|
float driveTime = 1.7;
|
||||||
|
LogCSVData();
|
||||||
|
if (autoSelected == autoNameDisable) driveTime = 0;
|
||||||
|
else if (autoSelected == autoNameShort) driveTime = 1.5;
|
||||||
|
else if (autoSelected == autoNameOne) driveTime = 1;
|
||||||
|
else driveTime = 1.7;
|
||||||
|
|
||||||
|
//Default Auto goes here
|
||||||
|
switch (auto_status)
|
||||||
|
{
|
||||||
|
case START:
|
||||||
|
{
|
||||||
|
auto_clock.Start();
|
||||||
|
auto_status = DRIVING_FORWARD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DRIVING_FORWARD:
|
||||||
|
{
|
||||||
|
if (auto_clock.Get() > driveTime)
|
||||||
|
{
|
||||||
|
drive.TankDrive(0.0, 0.0);
|
||||||
|
auto_status = STOP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drive.TankDrive(drivePower, drivePower);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case STOP:
|
||||||
|
{
|
||||||
|
std::cout << "All done!\n" ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gimbs.Set(gimba/1000.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TeleopInit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TeleopPeriodic()
|
||||||
|
{
|
||||||
|
LogCSVData();
|
||||||
|
std::cout << "arm encoder position: " << arms.GetEncPosition() << std::endl;
|
||||||
|
std::cout << "arm encoder velocity: " << arms.GetEncVel() << std::endl;
|
||||||
|
|
||||||
|
if(driver_stick.GetRawButton(7))
|
||||||
|
{
|
||||||
|
arcade = true;
|
||||||
|
}
|
||||||
|
if(driver_stick.GetRawButton(8))
|
||||||
|
{
|
||||||
|
arcade = false;
|
||||||
|
}
|
||||||
|
if (arcade)
|
||||||
|
{
|
||||||
|
drive.ArcadeDrive(driver_stick);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (driver_stick.GetRawButton(THUMB))
|
||||||
|
{
|
||||||
|
float left = driver_stick.GetTwist();
|
||||||
|
float right = -driver_stick.GetTwist();
|
||||||
|
drive.TankDrive(left, right);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateDrive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//bool rampDoing = false;
|
||||||
|
// This is shit code for testing. Replace it with real code.
|
||||||
|
if(!ramping && operator_stick.GetRawButton(RAMP_RAISE))
|
||||||
|
{
|
||||||
|
std::cout << "Raising Ramp.";
|
||||||
|
//ramp.Set(1);
|
||||||
|
shooter.RaiseRamp();
|
||||||
|
ramping =true;
|
||||||
|
}
|
||||||
|
else if(!ramping && operator_stick.GetRawButton(RAMP_LOWER))
|
||||||
|
{
|
||||||
|
std::cout << "Lowering Ramp.";
|
||||||
|
//ramp.Set(-1);
|
||||||
|
shooter.LowerRamp();
|
||||||
|
ramping = true;
|
||||||
|
}
|
||||||
|
/*else if(!ramping && operator_stick.GetRawButton(TRIGGER))
|
||||||
|
{
|
||||||
|
shooter.BoostRamp();
|
||||||
|
ramping = true;
|
||||||
|
}*/
|
||||||
|
else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE)
|
||||||
|
&& !operator_stick.GetRawButton(RAMP_LOWER))
|
||||||
|
{
|
||||||
|
shooter.StopRamp();
|
||||||
|
ramping = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!unjamming && operator_stick.GetRawButton(UNJAM))
|
||||||
|
{
|
||||||
|
unjamming = true;
|
||||||
|
shooter.Unjam();
|
||||||
|
}
|
||||||
|
else if(!unjamming && operator_stick.GetRawButton(TRIGGER))
|
||||||
|
{
|
||||||
|
shooter.ShootLow();
|
||||||
|
unjamming = true;
|
||||||
|
}
|
||||||
|
else if(unjamming && !operator_stick.GetRawButton(UNJAM) && !operator_stick.GetRawButton(TRIGGER))
|
||||||
|
{
|
||||||
|
shooter.PickUp(false);
|
||||||
|
unjamming = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is for controlling the gimbal.
|
||||||
|
*/
|
||||||
|
if(operator_stick.GetRawButton(GIM_UP))
|
||||||
|
{
|
||||||
|
gimba += GIMB_DELTA;
|
||||||
|
}
|
||||||
|
else if(operator_stick.GetRawButton(GIM_DOWN)){
|
||||||
|
gimba -= GIMB_DELTA;
|
||||||
|
}
|
||||||
|
else if(operator_stick.GetRawButton(GIM_SHOOT))
|
||||||
|
{
|
||||||
|
gimba = SmartDashboard::GetNumber("shooting angle", GIMB_DEFAULT);
|
||||||
|
}
|
||||||
|
gimbs.Set(gimba/1000.0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run the Shooter only while the THUMB button is held down on the operator stick.
|
||||||
|
* the 'pickupRunning' boolean is there to prevent the shooter from calling PickUp
|
||||||
|
* every iteration of the TeleopPeriodic method (once every 10ms!)
|
||||||
|
* The pickup is disabled when the thumb button is released, but the code still
|
||||||
|
* has 'pickupRunning' as true.
|
||||||
|
*/
|
||||||
|
if(operator_stick.GetRawButton(THUMB) && !pickupRunning)
|
||||||
|
{
|
||||||
|
shooter.PickUp();
|
||||||
|
pickupRunning = true;
|
||||||
|
}
|
||||||
|
else if(!operator_stick.GetRawButton(THUMB) && pickupRunning)
|
||||||
|
{
|
||||||
|
shooter.PickUp(false);
|
||||||
|
pickupRunning = false;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* The 'inverting' variable is used to make sure that the drive train isn't getting
|
||||||
|
* inverted every iteration of the TeleopPeriodic method while the button is held down.
|
||||||
|
* This is important because the TeleopPeriodic method executes something like once every 10ms.
|
||||||
|
* Thus, this if-else if pair make the button a toggle.
|
||||||
|
*/
|
||||||
|
if(driver_stick.GetRawButton(TRIGGER) && !inverting)
|
||||||
|
{
|
||||||
|
std::cout << "Inverting Drive Train.";
|
||||||
|
left_drive.SetInverted(!left_drive.GetInverted());
|
||||||
|
right_drive.SetInverted(!right_drive.GetInverted());
|
||||||
|
inverting = true;
|
||||||
|
}
|
||||||
|
else if(!driver_stick.GetRawButton(TRIGGER))
|
||||||
|
{
|
||||||
|
inverting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(operator_stick.GetRawButton(4))
|
||||||
|
{
|
||||||
|
arms.Set(-operator_stick.GetY() * ARMS_SCALE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arms.Set(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This code will become obsolete after the Shooter logic is complete.
|
||||||
|
float opThrottle = SaneThrottle(operator_stick.GetThrottle());
|
||||||
|
|
||||||
|
if(!pickupRunning && ( opThrottle > shooter_power + DEADZONE_RADIUS
|
||||||
|
|| opThrottle < shooter_power - DEADZONE_RADIUS))
|
||||||
|
{
|
||||||
|
shooter.SetPower(opThrottle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestPeriodic()
|
||||||
|
{
|
||||||
|
const int driveTime = 5; //Drive for 5 seconds
|
||||||
|
const float drivePower = 0.5, armPower=.35, rampPower=.4; //Arbitrary powers to test at
|
||||||
|
static Timer t;
|
||||||
|
enum test_stages {
|
||||||
|
INIT,
|
||||||
|
ARMS_UP,
|
||||||
|
ARMS_DOWN,
|
||||||
|
RAMP_UP,
|
||||||
|
RAMP_DOWN,
|
||||||
|
DRIVE_FORWARD,
|
||||||
|
DRIVE_BACKWARD,
|
||||||
|
TURN_CW,
|
||||||
|
TURN_CCW,
|
||||||
|
END};
|
||||||
|
|
||||||
|
static enum test_stages test_stage, old_test_stage;
|
||||||
|
|
||||||
|
if (old_test_stage != test_stage)
|
||||||
|
{
|
||||||
|
//Reset timer between stages
|
||||||
|
t.Stop();
|
||||||
|
t.Reset();
|
||||||
|
|
||||||
|
//Wait for a button press between stages
|
||||||
|
if (operator_stick.GetRawButton(TRIGGER))
|
||||||
|
old_test_stage = test_stage;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!t.Get()) t.Start();
|
||||||
|
|
||||||
|
switch (test_stage)
|
||||||
|
{
|
||||||
|
case INIT:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ARMS_UP:
|
||||||
|
{
|
||||||
|
if (arms.GetForwardLimitOK())
|
||||||
|
arms.Set(1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arms.Set(0);
|
||||||
|
test_stage = ARMS_DOWN;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ARMS_DOWN:
|
||||||
|
{
|
||||||
|
if (arms.GetReverseLimitOK())
|
||||||
|
arms.Set(-1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arms.Set(0);
|
||||||
|
test_stage = RAMP_UP;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case RAMP_UP:
|
||||||
|
{
|
||||||
|
if (arms.GetForwardLimitOK())
|
||||||
|
ramp.Set(1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ramp.Set(0);
|
||||||
|
test_stage = RAMP_DOWN;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case RAMP_DOWN:
|
||||||
|
{
|
||||||
|
if (arms.GetReverseLimitOK())
|
||||||
|
ramp.Set(-1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ramp.Set(0);
|
||||||
|
test_stage = DRIVE_FORWARD;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case DRIVE_FORWARD:
|
||||||
|
{
|
||||||
|
if (t.Get() < driveTime)
|
||||||
|
drive.TankDrive(drivePower, drivePower);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drive.TankDrive(0.0, 0.0);
|
||||||
|
test_stage = DRIVE_BACKWARD;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case DRIVE_BACKWARD:
|
||||||
|
{
|
||||||
|
if (t.Get() < driveTime)
|
||||||
|
drive.TankDrive(-drivePower, -drivePower);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drive.TankDrive(0.0, 0.0);
|
||||||
|
test_stage = TURN_CW;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case TURN_CW:
|
||||||
|
{
|
||||||
|
if (t.Get() < driveTime)
|
||||||
|
drive.TankDrive(drivePower, -drivePower);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drive.TankDrive(0.0, 0.0);
|
||||||
|
test_stage = TURN_CCW;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case TURN_CCW:
|
||||||
|
{
|
||||||
|
if (t.Get() < driveTime)
|
||||||
|
drive.TankDrive(-drivePower, drivePower);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drive.TankDrive(0.0, 0.0);
|
||||||
|
test_stage = END;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case END:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LogCSVData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
START_ROBOT_CLASS(Robot)
|
197
src/Shooter.h
Normal file
197
src/Shooter.h
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
/*
|
||||||
|
* Shooter.h
|
||||||
|
*
|
||||||
|
* Created on: Feb 2, 2016
|
||||||
|
* Author: Jason
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRC_SHOOTER_H_
|
||||||
|
#define SRC_SHOOTER_H_
|
||||||
|
|
||||||
|
#define PICKUP_POWER 0.75
|
||||||
|
#define LAUNCH_POWER 1
|
||||||
|
#define SPINUP_TIME 1.5 // seconds.
|
||||||
|
#define LAUNCH_TIME 0.5
|
||||||
|
#define RAMP_POWER 0.3
|
||||||
|
|
||||||
|
class Shooter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shooter talons and launch-spinny talon.
|
||||||
|
* s2 is also for the pickup-mechanism and can be controlled independently.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
enum ShooterState
|
||||||
|
{
|
||||||
|
READY,
|
||||||
|
ON_FIRE,
|
||||||
|
SPINNINGUP,
|
||||||
|
LAUNCH,
|
||||||
|
LAUNCHING,
|
||||||
|
RESETTING
|
||||||
|
};
|
||||||
|
|
||||||
|
Shooter(CANTalon *s1, CANTalon *s2, CANTalon *r)
|
||||||
|
{
|
||||||
|
// shooterDrive = new RobotDrive(s1, s2);
|
||||||
|
launcher = s1;
|
||||||
|
pickup = s2;
|
||||||
|
ramp = r;
|
||||||
|
ready = true;
|
||||||
|
state = READY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call this method on TeleopInit so that the ramp is properly
|
||||||
|
* set at the beginning of the match.
|
||||||
|
*/
|
||||||
|
|
||||||
|
virtual ~Shooter()
|
||||||
|
{
|
||||||
|
delete launcher;
|
||||||
|
delete pickup;
|
||||||
|
delete ramp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StopShooter()
|
||||||
|
{
|
||||||
|
ready = true;
|
||||||
|
ramp->Set(0);
|
||||||
|
launcher->Set(0);
|
||||||
|
pickup->Set(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LowerRamp()
|
||||||
|
{
|
||||||
|
ramp->Set(-RAMP_POWER);
|
||||||
|
if(ramp->Limits::kReverseLimit){
|
||||||
|
SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be
|
||||||
|
} else {
|
||||||
|
SmartDashboard::PutNumber("ramp", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RaiseRamp()
|
||||||
|
{
|
||||||
|
ramp->Set(RAMP_POWER);
|
||||||
|
if(ramp->Limits::kForwardLimit){
|
||||||
|
SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be
|
||||||
|
} else {
|
||||||
|
SmartDashboard::PutNumber("ramp", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void StopRamp()
|
||||||
|
{
|
||||||
|
ramp->Set(0);
|
||||||
|
}
|
||||||
|
void Shoot()
|
||||||
|
{
|
||||||
|
if (shotClock.Get() > (SPINUP_TIME + 0.1))
|
||||||
|
{
|
||||||
|
state = RESETTING;
|
||||||
|
}
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case READY:
|
||||||
|
{
|
||||||
|
state = SPINNINGUP;
|
||||||
|
ramp->Set(-1);
|
||||||
|
launcher->Set(LAUNCH_POWER);
|
||||||
|
pickup->Set(LAUNCH_POWER);
|
||||||
|
shotClock.Reset();
|
||||||
|
shotClock.Start();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SPINNINGUP:
|
||||||
|
{
|
||||||
|
if (shotClock.Get() > SPINUP_TIME)
|
||||||
|
{
|
||||||
|
state = LAUNCH;
|
||||||
|
shotClock.Reset();
|
||||||
|
shotClock.Start();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//std::cout << "*Goku noises*\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LAUNCH:
|
||||||
|
{
|
||||||
|
ramp->Set(LAUNCH_POWER);
|
||||||
|
state = LAUNCHING;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LAUNCHING:
|
||||||
|
{
|
||||||
|
if (shotClock.Get() > LAUNCH_TIME)
|
||||||
|
{
|
||||||
|
|
||||||
|
state = RESETTING;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RESETTING:
|
||||||
|
{
|
||||||
|
ramp->Set(0);
|
||||||
|
launcher->Set(0);
|
||||||
|
pickup->Set(0);
|
||||||
|
state = READY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ON_FIRE:
|
||||||
|
{
|
||||||
|
std::cout << "Something is wrong with the launch sequence.\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void PickUp(bool state = true)
|
||||||
|
{
|
||||||
|
pickup->Set((float) (state * PICKUP_POWER));
|
||||||
|
launcher->Set((float) (state * PICKUP_POWER * -1));
|
||||||
|
//std::cout << "picking up!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call this to run the pickup backwards if the ball gets jammed somehow...
|
||||||
|
*/
|
||||||
|
void Unjam()
|
||||||
|
{
|
||||||
|
pickup->Set(-1 * PICKUP_POWER);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShootLow()
|
||||||
|
{
|
||||||
|
pickup->Set(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetPower(float power)
|
||||||
|
{
|
||||||
|
pickup->Set(power);
|
||||||
|
launcher->Set(power);
|
||||||
|
//std::cout << "setting shooter power" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetState()
|
||||||
|
{
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
|
||||||
|
//RobotDrive *shooterDrive;
|
||||||
|
CANTalon *launcher;
|
||||||
|
CANTalon *pickup;
|
||||||
|
CANTalon *ramp;
|
||||||
|
ShooterState state;
|
||||||
|
|
||||||
|
Timer shotClock;
|
||||||
|
bool ready;
|
||||||
|
int fake_position;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* SRC_SHOOTER_H_ */
|
Reference in New Issue
Block a user