Browse files

imported ArduPlane from ArduPilotMega svn

  • Loading branch information...
1 parent 6f7d138 commit e0e426352525a3096198034c4f31db5bd50c6bbb @tridge tridge committed Sep 9, 2011
View
468 ArduPlane/.cproject
@@ -0,0 +1,468 @@
+<?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="0.1246468818">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1246468818" moduleId="org.eclipse.cdt.core.settings" name="Default">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.VCErrorParser" 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"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <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"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration buildProperties="" description="" id="0.1246468818" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+ <folderInfo id="0.1246468818." name="/" resourcePath="">
+ <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1286905935" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
+ <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1286905935.1477421615" name=""/>
+ <builder id="org.eclipse.cdt.build.core.settings.default.builder.2031915136" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.libs.150062293" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.990947382" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1924975572" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.299915223" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.814698218" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.2121091413" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1614998879" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="avr-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="avr-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="0.1246468818">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="avr-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="avr-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="0.877812590">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="avr-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="avr-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="0.1935535476">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="avr-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="avr-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+ <buildTargets>
+ <target name="ArduPilotMega" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget/>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>true</runAllBuilders>
+ </target>
+ </buildTargets>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="ArduPilotMega.null.28020601" name="ArduPilotMega"/>
+ </storageModule>
+</cproject>
View
80 ArduPlane/.project
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ArduPilotMega</name>
+ <comment></comment>
+ <projects>
+ <project>libraries</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </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>
+ </natures>
+</projectDescription>
View
25 ArduPlane/APM_Config.h
@@ -0,0 +1,25 @@
+
+ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+// This file is just a placeholder for your configuration file. If you wish to change any of the setup parameters from
+// their default values, place the appropriate #define statements here.
+
+// For example if you wanted the Port 3 baud rate to be 38400 you would add a statement like the one below (uncommented)
+//#define SERIAL3_BAUD 38400
+//#define GCS_PROTOCOL GCS_PROTOCOL_NONE
+
+
+// You may also put an include statement here to point at another configuration file. This is convenient if you maintain
+// different configuration files for different aircraft or HIL simulation. See the examples below
+//#include "APM_Config_mavlink_hil.h"
+//#include "Skywalker.h"
+
+// The following are the recommended settings for Xplane simulation. Remove the leading "/* and trailing "*/" to enable:
+
+/*
+#define HIL_PROTOCOL HIL_PROTOCOL_MAVLINK
+#define HIL_MODE HIL_MODE_ATTITUDE
+#define HIL_PORT 0
+#define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
+#define GCS_PORT 3
+*/
View
957 ArduPlane/APM_Config.h.reference
@@ -0,0 +1,957 @@
+//
+// Example and reference ArduPilot Mega configuration file
+// =======================================================
+//
+// This file contains documentation and examples for configuration options
+// supported by the ArduPilot Mega software.
+//
+// Most of these options are just that - optional. You should create
+// the APM_Config.h file and use this file as a reference for options
+// that you want to change. Don't copy this file directly; the options
+// described here and their default values may change over time.
+//
+// Each item is marked with a keyword describing when you should set it:
+//
+// REQUIRED
+// You must configure this in your APM_Config.h file. The
+// software will not compile if the option is not set.
+//
+// OPTIONAL
+// The option has a sensible default (which will be described
+// here), but you may wish to override it.
+//
+// EXPERIMENTAL
+// You should configure this option unless you are prepared
+// to deal with potential problems. It may relate to a feature
+// still in development, or which is not yet adequately tested.
+//
+// DEBUG
+// The option should only be set if you are debugging the
+// software, or if you are gathering information for a bug
+// report.
+//
+// NOTE:
+// Many of these settings are considered 'factory defaults', and the
+// live value is stored and managed in the ArduPilot Mega EEPROM.
+// Use the setup 'factoryreset' command after changing options in
+// your APM_Config.h file.
+//
+// Units
+// -----
+//
+// Unless indicated otherwise, numeric quantities use the following units:
+//
+// Measurement | Unit
+// ------------+-------------------------------------
+// angle | degrees
+// distance | metres
+// speed | metres per second
+// servo angle | microseconds
+// voltage | volts
+// times | seconds
+// throttle | percent
+//
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// HARDWARE CONFIGURATION AND CONNECTIONS
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// GPS_PROTOCOL REQUIRED
+//
+// GPS configuration, must be one of:
+//
+// GPS_PROTOCOL_AUTO Auto detect GPS type (must be a supported GPS)
+// GPS_PROTOCOL_NONE No GPS attached
+// GPS_PROTOCOL_IMU X-Plane interface or ArduPilot IMU.
+// GPS_PROTOCOL_MTK MediaTek-based GPS running the DIYDrones firmware 1.4
+// GPS_PROTOCOL_MTK16 MediaTek-based GPS running the DIYDrones firmware 1.6
+// GPS_PROTOCOL_UBLOX UBLOX GPS
+// GPS_PROTOCOL_SIRF SiRF-based GPS in Binary mode. NOT TESTED
+// GPS_PROTOCOL_NMEA Standard NMEA GPS. NOT SUPPORTED (yet?)
+//
+//#define GPS_PROTOCOL GPS_PROTOCOL_AUTO
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// AIRSPEED_SENSOR OPTIONAL
+// AIRSPEED_RATIO OPTIONAL
+//
+// Set AIRSPEED_SENSOR to ENABLED if you have an airspeed sensor attached.
+// Adjust AIRSPEED_RATIO in small increments to calibrate the airspeed
+// sensor relative to your GPS. The calculation and default value are optimized for speeds around 12 m/s
+//
+// The default assumes that an airspeed sensor is connected.
+//
+//#define AIRSPEED_SENSOR ENABLED
+//#define AIRSPEED_RATIO 1.9936
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// MAGNETOMETER OPTIONAL
+// MAG_ORIENTATION OPTIONAL
+//
+// Set MAGNETOMETER to ENABLED if you have a magnetometer attached.
+// Set MAG_ORIENTATION to reflect the orientation you have the magnetometer mounted with respect to ArduPilotMega
+//
+// The default assumes that a magnetometer is not connected.
+//
+//#define MAGNETOMETER DISABLED
+//#define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// HIL_PROTOCOL OPTIONAL
+// HIL_MODE OPTIONAL
+// HIL_PORT OPTIONAL
+//
+// Configuration for Hardware-in-the-loop simulation. In these modes,
+// APM is connected via one or more interfaces to simulation software
+// running on another system.
+//
+// HIL_PROTOCOL_XPLANE Configure for the X-plane HIL interface.
+// HIL_PROTOCOL_MAVLINK Configure for HIL over MAVLink.
+//
+// HIL_MODE_DISABLED Configure for standard flight.
+// HIL_MODE_ATTITUDE Simulator provides attitude and position information.
+// HIL_MODE_SENSORS Simulator provides raw sensor values.
+//
+// Note that currently HIL_PROTOCOL_XPLANE requires HIL_MODE_ATTITUDE.
+// Note that currently HIL_PROTOCOL_MAVLINK requires HIL_MODE_SENSORS.
+//
+//#define HIL_MODE HIL_MODE_DISABLED
+//#define HIL_PORT 0
+//#define HIL_PROTOCOL HIL_PROTOCOL_MAVLINK
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// GCS_PROTOCOL OPTIONAL
+// GCS_PORT OPTIONAL
+// MAV_SYSTEM_ID OPTIONAL
+//
+// The GCS_PROTOCOL option determines which (if any) ground control station
+// protocol will be used. Must be one of:
+//
+// GCS_PROTOCOL_NONE No GCS output
+// GCS_PROTOCOL_MAVLINK QGroundControl protocol
+//
+// The GCS_PORT option determines which serial port will be used by the
+// GCS protocol. The usual values are 0 for the console/USB port,
+// or 3 for the telemetry port on the oilpan. Note that some protocols
+// will ignore this value and always use the console port.
+//
+// The MAV_SYSTEM_ID is a unique identifier for this UAV. The default value is 1.
+// If you will be flying multiple UAV's each should be assigned a different ID so
+// that ground stations can tell them apart.
+//
+//#define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
+//#define GCS_PORT 3
+//#define MAV_SYSTEM_ID 1
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Serial port speeds.
+//
+// SERIAL0_BAUD OPTIONAL
+//
+// Baudrate for the console port. Default is 115200bps.
+//
+// SERIAL3_BAUD OPTIONAL
+//
+// Baudrate for the telemetry port. Default is 57600bps.
+//
+//#define SERIAL0_BAUD 115200
+//#define SERIAL3_BAUD 57600
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Battery monitoring OPTIONAL
+//
+// See the manual for details on selecting divider resistors for battery
+// monitoring via the oilpan.
+//
+// BATTERY_EVENT OPTIONAL
+//
+// Set BATTERY_EVENT to ENABLED to enable low voltage or high discharge warnings.
+// The default is DISABLED.
+//
+// LOW_VOLTAGE OPTIONAL if BATTERY_EVENT is set.
+//
+// Value in volts at which ArduPilot Mega should consider the
+// battery to be "low".
+//
+// VOLT_DIV_RATIO OPTIONAL
+//
+// See the manual for details. The default value corresponds to the resistors
+// recommended by the manual.
+//
+// CURR_AMPS_PER_VOLT OPTIONAL
+// CURR_AMPS_OFFSET OPTIONAL
+//
+// The sensitivity of the current sensor. This must be scaled if a resistor is installed on APM
+// for a voltage divider on input 2 (not recommended). The offset is used for current sensors with an offset
+//
+//
+// HIGH_DISCHARGE OPTIONAL if BATTERY_EVENT is set.
+//
+// Value in milliamp-hours at which a warning should be triggered. Recommended value = 80% of
+// battery capacity.
+//
+//#define BATTERY_EVENT DISABLED
+//#define LOW_VOLTAGE 9.6
+//#define VOLT_DIV_RATIO 3.56
+//#define CURR_AMPS_PER_VOLT 27.32
+//#define CURR_AMPS_OFFSET 0.0
+//#define HIGH_DISCHARGE 1760
+
+//////////////////////////////////////////////////////////////////////////////
+// INPUT_VOLTAGE OPTIONAL
+//
+// In order to have accurate pressure and battery voltage readings, this
+// value should be set to the voltage measured at the processor.
+//
+// See the manual for more details. The default value should be close if you are applying 5 volts to the servo rail.
+//
+//#define INPUT_VOLTAGE 4.68 // 4.68 is the average value for a sample set. This is the value at the processor with 5.02 applied at the servo rail
+//
+
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// RADIO CONFIGURATION
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// FLIGHT_MODE OPTIONAL
+// FLIGHT_MODE_CHANNEL OPTIONAL
+//
+// Flight modes assigned to the control channel, and the input channel that
+// is read for the control mode.
+//
+// Use a servo tester, or the ArduPilotMega_demo test program to check your
+// switch settings.
+//
+// ATTENTION: Some ArduPilot Mega boards have radio channels marked 0-7, and
+// others have them marked the standard 1-8. The FLIGHT_MODE_CHANNEL option
+// uses channel numbers 1-8 (and defaults to 8).
+//
+// If you only have a three-position switch or just want three modes, set your
+// switch to produce 1165, 1425, and 1815 microseconds and configure
+// FLIGHT_MODE 1 & 2, 3 & 4 and 5 & 6 to be the same. This is the default.
+//
+// If you have FLIGHT_MODE_CHANNEL set to 8 (the default) and your control
+// channel connected to input channel 8, the hardware failsafe mode will
+// activate for any control input over 1750ms.
+//
+// For more modes (up to six), set your switch(es) to produce any of 1165,
+// 1295, 1425, 1555, 1685, and 1815 microseconds.
+//
+// Flight mode | Switch Setting (ms)
+// ------------+---------------------
+// 1 | 1165
+// 2 | 1295
+// 3 | 1425
+// 4 | 1555
+// 5 | 1685
+// 6 | 1815 (FAILSAFE if using channel 8)
+//
+// The following standard flight modes are available:
+//
+// Name | Description
+// -----------------+--------------------------------------------
+// |
+// MANUAL | Full manual control via the hardware multiplexer.
+// |
+// STABILIZE | Tries to maintain level flight, but can be overridden with radio control inputs.
+// |
+// FLY_BY_WIRE_A | Autopilot style control via user input, with manual throttle.
+// |
+// FLY_BY_WIRE_B | Autopilot style control via user input, aispeed controlled with throttle.
+// |
+// RTL | Returns to the Home location and then LOITERs at a safe altitude.
+// |
+// AUTO | Autonomous flight based on programmed waypoints. Use the WaypointWriter
+// | application or your Ground Control System to edit and upload
+// | waypoints and other commands.
+// |
+//air
+//
+// The following non-standard modes are EXPERIMENTAL:
+//
+// Name | Description
+// -----------------+--------------------------------------------
+// |
+// LOITER | Flies in a circle around the current location.
+// |
+// CIRCLE | Flies in a stabilized 'dumb' circle.
+// |
+//
+//
+// If you are using channel 8 for mode switching then FLIGHT_MODE_5 and
+// FLIGHT_MODE_6 should be MANUAL.
+//
+//
+//#define FLIGHT_MODE_CHANNEL 8
+//
+//#define FLIGHT_MODE_1 RTL
+//#define FLIGHT_MODE_2 RTL
+//#define FLIGHT_MODE_3 STABILIZE
+//#define FLIGHT_MODE_4 STABILIZE
+//#define FLIGHT_MODE_5 MANUAL
+//#define FLIGHT_MODE_6 MANUAL
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// RC_5_FUNCT OPTIONAL
+// RC_6_FUNCT OPTIONAL
+// RC_7_FUNCT OPTIONAL
+// RC_8_FUNCT OPTIONAL
+//
+// The channel 5 through 8 function assignments allow configuration of those
+// channels for use with differential ailerons, flaps, flaperons, or camera
+// or intrument mounts
+//
+//#define RC_5_FUNCT RC_5_FUNCT_NONE
+//etc.
+
+//////////////////////////////////////////////////////////////////////////////
+// For automatic flap operation based on speed setpoint. If the speed setpoint is above flap_1_speed
+// then the flap position shall be 0%. If the speed setpoint is between flap_1_speed and flap_2_speed
+// then the flap position shall be flap_1_percent. If the speed setpoint is below flap_2_speed
+// then the flap position shall be flap_2_percent. Speed setpoint is the current value of
+// airspeed_cruise (if airspeed sensor enabled) or throttle_cruise (if no airspeed sensor)
+
+// FLAP_1_PERCENT OPTIONAL
+// FLAP_1_SPEED OPTIONAL
+// FLAP_2_PERCENT OPTIONAL
+// FLAP_2_SPEED OPTIONAL
+
+
+//////////////////////////////////////////////////////////////////////////////
+// THROTTLE_FAILSAFE OPTIONAL
+// THROTTLE_FS_VALUE OPTIONAL
+//
+// The throttle failsafe allows you to configure a software failsafe activated
+// by a setting on the throttle input channel (channel 3). Enabling this failsafe
+// also enables "short failsafe" conditions (see below) based on loss of
+// rc override control from the GCS
+//
+// This can be used to achieve a failsafe override on loss of radio control
+// without having to sacrifice one of your FLIGHT_MODE settings, as the
+// throttle failsafe overrides the switch-selected mode.
+//
+// Throttle failsafe is enabled by setting THROTTLE_FAILSAFE to 1. The default
+// is for it to be enabled.
+//
+// If the throttle failsafe is enabled, THROTTLE_FS_VALUE sets the channel value
+// below which the failsafe engages. The default is 975ms, which is a very low
+// throttle setting. Most transmitters will let you trim the manual throttle
+// position up so that you cannot engage the failsafe with a regular stick movement.
+//
+// Configure your receiver's failsafe setting for the throttle channel to the
+// absolute minimum, and use the ArduPilotMega_demo program to check that
+// you cannot reach that value with the throttle control. Leave a margin of
+// at least 50 microseconds between the lowest throttle setting and
+// THROTTLE_FS_VALUE.
+//
+//#define THROTTLE_FAILSAFE ENABLED
+//#define THROTTLE_FS_VALUE 950
+//
+
+//////////////////////////////////////////////////////////////////////////////
+
+// GCS_HEARTBEAT_FAILSAFE OPTIONAL
+// SHORT_FAILSAFE_ACTION OPTIONAL
+// LONG_FAILSAFE_ACTION OPTIONAL
+
+// There are two basic conditions which can trigger a failsafe. One is a loss of control signal.
+// Normally this means a loss of the radio control RC signal. However if rc override from the
+// GCS is in use then this can mean a loss of communication with the GCS. Such a failsafe will be
+// classified as either short (greater than 1.5 seconds but less than 20) or long (greater than 20).
+// Also, if GCS_HEARTBEAT_FAILSAFE is enabled and a heartbeat signal from the GCS has not been received
+// in the preceeding 20 seconds then this will also trigger a "long" failsafe.
+//
+// The SHORT_FAILSAFE_ACTION and LONG_FAILSAFE_ACTION settings determines what APM will do when
+// a failsafe mode is entered while flying in AUTO or LOITER mode. This is important in order to avoid
+// accidental failsafe behaviour when flying waypoints that take the aircraft
+// out of radio range.
+//
+// If SHORT_FAILSAFE_ACTION is 1, when failsafe is entered in AUTO or LOITER modes,
+// the aircraft will head for home in RTL mode. If the failsafe condition is
+// resolved, it will return to AUTO or LOITER mode.
+
+// If LONG_FAILSAFE_ACTION is 1, when failsafe is entered in AUTO or LOITER modes,
+// the aircraft will head for home in RTL mode. If the failsafe condition is
+// resolved the aircraft will not be returned to AUTO or LOITER mode, but will continue home
+
+// If XX_FAILSAFE_ACTION is 0 and the applicable failsafe occurs while in AUTO or LOITER
+// mode the aircraft will continue in that mode ignoring the failsafe condition.
+
+// Note that for Manual, Stabilize, and Fly-By-Wire (A and B) modes the aircraft will always
+// enter a circling mode for short failsafe conditions and will be switched to RTL for long
+// failsafe conditions. RTL mode is unaffected by failsafe conditions.
+//
+// The default is to have GCS Heartbeat failsafes DISABLED
+// The default behaviour is to ignore failsafes in AUTO and LOITER modes.
+//
+//#define GCS_HEARTBEAT_FAILSAFE DISABLED
+//#define SHORT_FAILSAFE_ACTION 0
+//#define LONG_FAILSAFE_ACTION 0
+
+
+//////////////////////////////////////////////////////////////////////////////
+// AUTO_TRIM OPTIONAL
+//
+// ArduPilot Mega can update its trim settings by looking at the
+// radio inputs when switching out of MANUAL mode. This allows you to
+// manually trim your aircraft before switching to an assisted mode, but it
+// also means that you should avoid switching out of MANUAL while you have
+// any control stick deflection.
+//
+// The default is to enable AUTO_TRIM.
+//
+//#define AUTO_TRIM ENABLED
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// THROTTLE_REVERSE OPTIONAL
+//
+// A few speed controls require the throttle servo signal be reversed. Setting
+// this to ENABLED will reverse the throttle output signal. Ensure that your
+// throttle needs to be reversed by using the hardware failsafe and the
+// ArduPilotMega_demo program before setting this option.
+//
+// The default is to not reverse the signal.
+//
+//#define THROTTLE_REVERSE DISABLED
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// ENABLE_STICK_MIXING OPTIONAL
+//
+// If this option is set to ENABLED, manual control inputs are are respected
+// while in the autopilot modes (AUTO, RTL, LOITER, CIRCLE etc.)
+//
+// The default is to enable stick mixing, allowing the pilot to take
+// emergency action without switching modes.
+//
+//#define ENABLE_STICK_MIXING ENABLED
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// THROTTLE_OUT DEBUG
+//
+// When debugging, it can be useful to disable the throttle output. Set
+// this option to DISABLED to disable throttle output signals.
+//
+// The default is to not disable throttle output.
+//
+//#define THROTTLE_OUT ENABLED
+//
+
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// STARTUP BEHAVIOUR
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// GROUND_START_DELAY OPTIONAL
+//
+// If configured, inserts a delay between power-up and the beginning of IMU
+// calibration during a ground start.
+//
+// Use this setting to give you time to position the aircraft horizontally
+// for the IMU calibration.
+//
+// The default is to begin IMU calibration immediately at startup.
+//
+//#define GROUND_START_DELAY 0
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// ENABLE_AIR_START OPTIONAL
+//
+// If air start is disabled then you will get a ground start (including IMU
+// calibration) every time the AP is powered up. This means that if you get
+// a power glitch or reboot for some reason in the air, you will probably
+// crash, but it prevents a lot of problems on the ground like unintentional
+// motor start-ups, etc.
+//
+// If air start is enabled then you will get an air start at power up and a
+// ground start will be performed if the speed is near zero when we get gps
+// lock.
+//
+// The default is to disable air start.
+//
+//#define ENABLE_AIR_START 0
+//
+
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// FLIGHT AND NAVIGATION CONTROL
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// Altitude measurement and control.
+//
+// ALT_EST_GAIN OPTIONAL
+//
+// The gain of the altitude estimation function; a lower number results
+// in slower error correction and smoother output. The default is a
+// reasonable starting point.
+//
+//#define ALT_EST_GAIN 0.01
+//
+// ALTITUDE_MIX OPTIONAL
+//
+// Configures the blend between GPS and pressure altitude.
+// 0 = GPS altitude, 1 = Press alt, 0.5 = half and half, etc.
+//
+// The default is to use only pressure altitude.
+//
+//#define ALTITUDE_MIX 1
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// AIRSPEED_CRUISE OPTIONAL
+//
+// The speed in metres per second to maintain during cruise. The default
+// is 10m/s, which is a conservative value suitable for relatively small,
+// light aircraft.
+//
+//#define AIRSPEED_CRUISE 12
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// FLY_BY_WIRE_B airspeed control (also used for throttle "nudging" in AUTO)
+//
+// AIRSPEED_FBW_MIN OPTIONAL
+// AIRSPEED_FBW_MAX OPTIONAL
+//
+// Airspeed corresponding to minimum and maximum throttle in Fly By Wire B mode.
+// The defaults are 6 and 30 metres per second.
+//
+// AIRSPEED_FBW_MAX also sets the maximum airspeed that the cruise airspeed can be "nudged" to in AUTO mode when ENABLE_STICK_MIXING is set.
+// In AUTO the cruise airspeed can be increased between AIRSPEED_CRUISE and AIRSPEED_FBW_MAX by positioning the throttle
+// stick in the top 1/2 of its range. Throttle stick in the bottom 1/2 provide regular AUTO control.
+//
+//#define AIRSPEED_FBW_MIN 6
+//#define AIRSPEED_FBW_MAX 22
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Servo mapping
+//
+// THROTTLE_MIN OPTIONAL
+//
+// The minimum throttle setting to which the autopilot will reduce the
+// throttle while descending. The default is zero, which is
+// suitable for aircraft with a steady power-off glide. Increase this
+// value if your aircraft needs throttle to maintain a stable descent in
+// level flight.
+//
+// THROTTLE_CRUISE OPTIONAL
+//
+// The approximate throttle setting to achieve AIRSPEED_CRUISE in level flight.
+// The default is 45%, which is reasonable for a modestly powered aircraft.
+//
+// THROTTLE_MAX OPTIONAL
+//
+// The maximum throttle setting the autopilot will apply. The default is 75%.
+// Reduce this value if your aicraft is overpowered, or has complex flight
+// characteristics at high throttle settings.
+//
+//#define THROTTLE_MIN 0 // percent
+//#define THROTTLE_CRUISE 45
+//#define THROTTLE_MAX 75
+
+//////////////////////////////////////////////////////////////////////////////
+// Autopilot control limits
+//
+// HEAD_MAX OPTIONAL
+//
+// The maximum commanded bank angle in either direction.
+// The default is 45 degrees. Decrease this value if your aircraft is not
+// stable or has difficulty maintaining altitude in a steep bank.
+//
+// PITCH_MAX OPTIONAL
+//
+// The maximum commanded pitch up angle.
+// The default is 15 degrees. Care should be taken not to set this value too
+// large, as the aircraft may stall.
+//
+// PITCH_MIN
+//
+// The maximum commanded pitch down angle. Note that this value must be
+// negative. The default is -25 degrees. Care should be taken not to set
+// this value too large as it may result in overspeeding the aircraft.
+//
+// PITCH_TARGET
+//
+// The target pitch for cruise flight. When the APM measures this pitch
+// value, the pitch error will be calculated to be 0 for the pitch PID
+// control loop.
+//
+//#define HEAD_MAX 45
+//#define PITCH_MAX 15
+//#define PITCH_MIN -25
+//#define PITCH_TARGET 0
+
+//////////////////////////////////////////////////////////////////////////////
+// Attitude control gains
+//
+// Tuning values for the attitude control PID loops.
+//
+// The P term is the primary tuning value. This determines how the control
+// deflection varies in proportion to the required correction.
+//
+// The I term is used to help control surfaces settle. This value should
+// normally be kept low.
+//
+// The D term is used to control overshoot. Avoid using or adjusting this
+// term if you are not familiar with tuning PID loops. It should normally
+// be zero for most aircraft.
+//
+// Note: When tuning these values, start with changes of no more than 25% at
+// a time.
+//
+// SERVO_ROLL_P OPTIONAL
+// SERVO_ROLL_I OPTIONAL
+// SERVO_ROLL_D OPTIONAL
+//
+// P, I and D terms for roll control. Defaults are 0.4, 0, 0.
+//
+// SERVO_ROLL_INT_MAX OPTIONAL
+//
+// Maximum control offset due to the integral. This prevents the control
+// output from being overdriven due to a persistent offset (e.g. crosstracking).
+// Default is 5 degrees.
+//
+// ROLL_SLEW_LIMIT EXPERIMENTAL
+//
+// Limits the slew rate of the roll control in degrees per second. If zero,
+// slew rate is not limited. Default is to not limit the roll control slew rate.
+// (This feature is currently not implemented.)
+//
+// SERVO_PITCH_P OPTIONAL
+// SERVO_PITCH_I OPTIONAL
+// SERVO_PITCH_D OPTIONAL
+//
+// P, I and D terms for the pitch control. Defaults are 0.6, 0, 0.
+//
+// SERVO_PITCH_INT_MAX OPTIONAL
+//
+// Maximum control offset due to the integral. This prevents the control
+// output from being overdriven due to a persistent offset (e.g. native flight
+// AoA).
+// Default is 5 degrees.
+//
+// PITCH_COMP OPTIONAL
+//
+// Adds pitch input to compensate for the loss of lift due to roll control.
+// Default is 0.20 (20% of roll control also applied to pitch control).
+//
+// SERVO_YAW_P OPTIONAL
+// SERVO_YAW_I OPTIONAL
+// SERVO_YAW_D OPTIONAL
+//
+// P, I and D terms for the YAW control. Defaults are 0., 0., 0.
+// Note units of this control loop are unusual. PID input is in m/s**2.
+//
+// SERVO_YAW_INT_MAX OPTIONAL
+//
+// Maximum control offset due to the integral. This prevents the control
+// output from being overdriven due to a persistent offset (e.g. crosstracking).
+// Default is 0.
+//
+// RUDDER_MIX OPTIONAL
+//
+// Roll to yaw mixing. This allows for co-ordinated turns.
+// Default is 0.50 (50% of roll control also applied to yaw control.)
+//
+//#define SERVO_ROLL_P 0.4
+//#define SERVO_ROLL_I 0.0
+//#define SERVO_ROLL_D 0.0
+//#define SERVO_ROLL_INT_MAX 5
+//#define ROLL_SLEW_LIMIT 0
+//#define SERVO_PITCH_P 0.6
+//#define SERVO_PITCH_I 0.0
+//#define SERVO_PITCH_D 0.0
+//#define SERVO_PITCH_INT_MAX 5
+//#define PITCH_COMP 0.2
+//#define SERVO_YAW_P 0.0 // Default is zero. A suggested value if you want to use this parameter is 0.5
+//#define SERVO_YAW_I 0.0
+//#define SERVO_YAW_D 0.0
+//#define SERVO_YAW_INT_MAX 5
+//#define RUDDER_MIX 0.5
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Navigation control gains
+//
+// Tuning values for the navigation control PID loops.
+//
+// The P term is the primary tuning value. This determines how the control
+// deflection varies in proportion to the required correction.
+//
+// The I term is used to control drift.
+//
+// The D term is used to control overshoot. Avoid adjusting this term if
+// you are not familiar with tuning PID loops.
+//
+// Note: When tuning these values, start with changes of no more than 25% at
+// a time.
+//
+// NAV_ROLL_P OPTIONAL
+// NAV_ROLL_I OPTIONAL
+// NAV_ROLL_D OPTIONAL
+//
+// P, I and D terms for navigation control over roll, normally used for
+// controlling the aircraft's course. The P term controls how aggressively
+// the aircraft will bank to change or hold course.
+// Defaults are 0.7, 0.0, 0.02.
+//
+// NAV_ROLL_INT_MAX OPTIONAL
+//
+// Maximum control offset due to the integral. This prevents the control
+// output from being overdriven due to a persistent offset (e.g. crosstracking).
+// Default is 5 degrees.
+//
+// NAV_PITCH_ASP_P OPTIONAL
+// NAV_PITCH_ASP_I OPTIONAL
+// NAV_PITCH_ASP_D OPTIONAL
+//
+// P, I and D terms for pitch adjustments made to maintain airspeed.
+// Defaults are 0.65, 0, 0.
+//
+// NAV_PITCH_ASP_INT_MAX OPTIONAL
+//
+// Maximum pitch offset due to the integral. This limits the control
+// output from being overdriven due to a persistent offset (eg. inability
+// to maintain the programmed airspeed).
+// Default is 5 degrees.
+//
+// NAV_PITCH_ALT_P OPTIONAL
+// NAV_PITCH_ALT_I OPTIONAL
+// NAV_PITCH_ALT_D OPTIONAL
+//
+// P, I and D terms for pitch adjustments made to maintain altitude.
+// Defaults are 0.65, 0, 0.
+//
+// NAV_PITCH_ALT_INT_MAX OPTIONAL
+//
+// Maximum pitch offset due to the integral. This limits the control
+// output from being overdriven due to a persistent offset (eg. inability
+// to maintain the programmed altitude).
+// Default is 5 meters.
+//
+//#define NAV_ROLL_P 0.7
+//#define NAV_ROLL_I 0.01
+//#define NAV_ROLL_D 0.02
+//#define NAV_ROLL_INT_MAX 5
+//#define NAV_PITCH_ASP_P 0.65
+//#define NAV_PITCH_ASP_I 0.0
+//#define NAV_PITCH_ASP_D 0.0
+//#define NAV_PITCH_ASP_INT_MAX 5
+//#define NAV_PITCH_ALT_P 0.65
+//#define NAV_PITCH_ALT_I 0.0
+//#define NAV_PITCH_ALT_D 0.0
+//#define NAV_PITCH_ALT_INT_MAX 5
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Energy/Altitude control gains
+//
+// The Energy/altitude control system uses throttle input to control aircraft
+// altitude.
+//
+// The P term is the primary tuning value. This determines how the throttle
+// setting varies in proportion to the required correction.
+//
+// The I term is used to compensate for small offsets.
+//
+// The D term is used to control overshoot. Avoid adjusting this term if
+// you are not familiar with tuning PID loops.
+//
+// Note units of this control loop are unusual. PID input is in m**2/s**2.
+//
+// THROTTLE_TE_P OPTIONAL
+// THROTTLE_TE_I OPTIONAL
+// THROTTLE_TE_D OPTIONAL
+//
+// P, I and D terms for throttle adjustments made to control altitude.
+// Defaults are 0.5, 0, 0.
+//
+// THROTTLE_TE_INT_MAX OPTIONAL
+//
+// Maximum throttle input due to the integral term. This limits the
+// throttle from being overdriven due to a persistent offset (e.g.
+// inability to maintain the programmed altitude).
+// Default is 20%.
+//
+// THROTTLE_SLEW_LIMIT OPTIONAL
+//
+// Limits the slew rate of the throttle, in percent per second. Helps
+// avoid sudden throttle changes, which can destabilise the aircraft.
+// A setting of zero disables the feature. Range 1 to 100.
+// Default is zero (disabled).
+//
+// P_TO_T OPTIONAL
+//
+// Pitch to throttle feed-forward gain. Default is 0.
+//
+// T_TO_P OPTIONAL
+//
+// Throttle to pitch feed-forward gain. Default is 0.
+//
+//#define THROTTLE_TE_P 0.50
+//#define THROTTLE_TE_I 0.0
+//#define THROTTLE_TE_D 0.0
+//#define THROTTLE_TE_INT_MAX 20
+//#define THROTTLE_SLEW_LIMIT 0
+//#define P_TO_T 0
+//#define T_TO_P 0
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Crosstrack compensation
+//
+// XTRACK_GAIN OPTIONAL
+//
+// Crosstrack compensation in degrees per metre off track.
+// Default value is 1.0 degrees per metre. Values lower than 0.001 will
+// disable crosstrack compensation.
+//
+// XTRACK_ENTRY_ANGLE OPTIONAL
+//
+// Maximum angle used to correct for track following.
+// Default value is 30 degrees.
+//
+//#define XTRACK_GAIN 1 // deg/m
+//#define XTRACK_ENTRY_ANGLE 30 // deg
+//
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// DEBUGGING
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// Dataflash logging control
+//
+// Each of these logging options may be set to ENABLED to enable, or DISABLED
+// to disable the logging of the respective data.
+//
+// LOG_ATTITUDE_FAST DEBUG
+//
+// Logs basic attitude info to the dataflash at 50Hz (uses more space).
+// Defaults to DISABLED.
+//
+// LOG_ATTITUDE_MED OPTIONAL
+//
+// Logs basic attitude info to the dataflash at 10Hz (uses less space than
+// LOG_ATTITUDE_FAST). Defaults to ENABLED.
+//
+// LOG_GPS OPTIONAL
+//
+// Logs GPS info to the dataflash at 10Hz. Defaults to ENABLED.
+//
+// LOG_PM OPTIONAL
+//
+// Logs IMU performance monitoring info every 20 seconds.
+// Defaults to DISABLED.
+//
+// LOG_CTUN OPTIONAL
+//
+// Logs control loop tuning info at 10 Hz. This information is useful for tuning
+// servo control loop gain values. Defaults to DISABLED.
+//
+// LOG_NTUN OPTIONAL
+//
+// Logs navigation tuning info at 10 Hz. This information is useful for tuning
+// navigation control loop gain values. Defaults to DISABLED.
+//
+// LOG_ MODE OPTIONAL
+//
+// Logs changes to the flight mode upon occurrence. Defaults to ENABLED.
+//
+// LOG_RAW DEBUG
+//
+// Logs raw accelerometer and gyro data at 50 Hz (uses more space).
+// Defaults to DISABLED.
+//
+// LOG_CMD OPTIONAL
+//
+// Logs new commands when they process.
+// Defaults to ENABLED.
+//
+//#define LOG_ATTITUDE_FAST DISABLED
+//#define LOG_ATTITUDE_MED ENABLED
+//#define LOG_GPS ENABLED
+//#define LOG_PM ENABLED
+//#define LOG_CTUN DISABLED
+//#define LOG_NTUN DISABLED
+//#define LOG_MODE ENABLED
+//#define LOG_RAW DISABLED
+//#define LOG_CMD ENABLED
+//#define LOG_CUR DISABLED
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Navigation defaults
+//
+// WP_RADIUS_DEFAULT OPTIONAL
+//
+// When the user performs a factory reset on the APM, set the waypoint radius
+// (the radius from a target waypoint within which the APM will consider
+// itself to have arrived at the waypoint) to this value in meters. This is
+// mainly intended to allow users to start using the APM without running the
+// WaypointWriter first.
+//
+// LOITER_RADIUS_DEFAULT OPTIONAL
+//
+// When the user performs a factory reset on the APM, set the loiter radius
+// (the distance the APM will attempt to maintain from a waypoint while
+// loitering) to this value in meters. This is mainly intended to allow
+// users to start using the APM without running the WaypointWriter first.
+//
+// USE_CURRENT_ALT OPTIONAL
+// ALT_HOLD_HOME OPTIONAL
+//
+// When the user performs a factory reset on the APM, set the flag for weather
+// the current altitude or ALT_HOLD_HOME altitude should be used for Return To Launch.
+// Also, set the value of USE_CURRENT_ALT in meters. This is mainly intended to allow
+// users to start using the APM without running the WaypointWriter first.
+//
+//#define WP_RADIUS_DEFAULT 30
+//#define LOITER_RADIUS_DEFAULT 60
+//#define USE_CURRENT_ALT FALSE
+//#define ALT_HOLD_HOME 100
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// Debugging interface
+//
+// DEBUG_PORT OPTIONAL
+//
+// The APM will periodically send messages reporting what it is doing; this
+// variable determines to which serial port they will be sent. Port 0 is the
+// USB serial port on the shield, port 3 is the telemetry port.
+//
+//#define DEBUG_PORT 0
+//
+
+
+//
+// Do not remove - this is to discourage users from copying this file
+// and using it as-is rather than editing their own.
+//
+#error You should not copy APM_Config.h.reference - make your own APM_Config.h file with just the options you need.
View
69 ArduPlane/APM_Config_mavlink_hil.h
@@ -0,0 +1,69 @@
+// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+// THIS IS A SAMPLE CONFIGURATION FILE FOR DOING HARDWARE IN THE LOOP TESTING USING THE MAVLINK HIL INTERFACE
+// IF YOU WANTED TO USE THIS YOU WOULD COPY THE CONTENTS INTO YOUR APM_Config.h FILE!
+
+
+// Enable Autopilot Flight Mode
+#define FLIGHT_MODE_CHANNEL 8
+#define FLIGHT_MODE_1 AUTO
+#define FLIGHT_MODE_2 RTL
+#define FLIGHT_MODE_3 FLY_BY_WIRE_A
+#define FLIGHT_MODE_4 FLY_BY_WIRE_B
+#define FLIGHT_MODE_5 STABILIZE
+#define FLIGHT_MODE_6 MANUAL
+
+// Hardware in the loop protocol
+#define HIL_PROTOCOL HIL_PROTOCOL_MAVLINK
+
+// HIL_MODE SELECTION
+//
+// Mavlink supports
+// 1. HIL_MODE_ATTITUDE : simulated position, airspeed, and attitude
+// 2. HIL_MODE_SENSORS: full sensor simulation
+#define HIL_MODE HIL_MODE_ATTITUDE
+
+// HIL_PORT SELCTION
+//
+// PORT 0
+// Port 0 is the port usually used for HIL. You attatch your HIL computer
+// to APM using a USB cable. You can run telemetry on Port 3
+//
+// PORT 1
+// Available for special situations. This uses the port that would have
+// been used for the gps
+// as the hardware in the loop port. You will have to solder
+// headers onto the gps port connection on the apm
+// and connect via an ftdi cable.
+// The buad rate is controlled by SERIAL1_BAUD in this mode.
+//
+// PORT 3
+// If you don't require telemetry communication with a gcs while running
+// hardware in the loop you may use the telemetry port as the hardware in
+// the loop port. Alternatively, use a telemetry/HIL shim like FGShim
+// https://ardupilot-mega.googlecode.com/svn/Tools/trunk/FlightGear
+//
+// The buad rate is controlled by SERIAL3_BAUD in this mode.
+
+#define HIL_PORT 0
+
+// You can set your gps protocol here for your actual
+// hardware and leave it without affecting the hardware
+// in the loop simulation
+#define GPS_PROTOCOL GPS_PROTOCOL_MTK
+
+// Ground control station comms
+#if HIL_PORT != 3
+# define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
+# define GCS_PORT 3
+#endif
+
+// Sensors
+// All sensors are supported in all modes.
+// The magnetometer is not used in
+// HIL_MODE_ATTITUDE but you may leave it
+// enabled if you wish.
+#define AIRSPEED_SENSOR ENABLED
+#define MAGNETOMETER ENABLED
+#define AIRSPEED_CRUISE 25
+#define THROTTLE_FAILSAFE ENABLED
View
22 ArduPlane/APM_Config_xplane.h
@@ -0,0 +1,22 @@
+// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+// THIS IS A SAMPLE CONFIGURATION FILE FOR DOING HARDWARE IN THE LOOP TESTING USING THE ORIGINAL X-PLANE INTERFACE
+// IF YOU WANTED TO USE THIS YOU WOULD COPY THE CONTENTS INTO YOUR APM_Config.h FILE!
+
+
+#define FLIGHT_MODE_CHANNEL 8
+#define FLIGHT_MODE_1 AUTO
+#define FLIGHT_MODE_2 RTL
+#define FLIGHT_MODE_3 FLY_BY_WIRE_A
+#define FLIGHT_MODE_4 FLY_BY_WIRE_A
+#define FLIGHT_MODE_5 MANUAL
+#define FLIGHT_MODE_6 MANUAL
+
+#define HIL_PROTOCOL HIL_PROTOCOL_XPLANE
+
+#define HIL_MODE HIL_MODE_ATTITUDE
+#define HIL_PORT 0
+
+#define AIRSPEED_CRUISE 25
+#define THROTTLE_FAILSAFE ENABLED
+#define AIRSPEED_SENSOR ENABLED
View
976 ArduPlane/ArduPilotMega.pde
@@ -0,0 +1,976 @@
+/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+#define THISFIRMWARE "ArduPilotMega V2.23"
+/*
+Authors: Doug Weibel, Jose Julio, Jordi Munoz, Jason Short
+Thanks to: Chris Anderson, HappyKillMore, Bill Premerlani, James Cohen, JB from rotorFX, Automatik, Fefenin, Peter Meister, Remzibi
+Please contribute your ideas!
+
+
+This firmware is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// Header includes
+////////////////////////////////////////////////////////////////////////////////
+
+// AVR runtime
+#include <avr/io.h>
+#include <avr/eeprom.h>
+#include <avr/pgmspace.h>
+#include <math.h>
+
+// Libraries
+#include <FastSerial.h>
+#include <AP_Common.h>
+#include <APM_RC.h> // ArduPilot Mega RC Library
+#include <AP_GPS.h> // ArduPilot GPS library
+#include <Wire.h> // Arduino I2C lib
+#include <SPI.h> // Arduino SPI lib
+#include <DataFlash.h> // ArduPilot Mega Flash Memory Library
+#include <AP_ADC.h> // ArduPilot Mega Analog to Digital Converter Library
+#include <APM_BMP085.h> // ArduPilot Mega BMP085 Library
+#include <AP_Compass.h> // ArduPilot Mega Magnetometer Library
+#include <AP_Math.h> // ArduPilot Mega Vector/Matrix math Library
+#include <AP_IMU.h> // ArduPilot Mega IMU Library
+#include <AP_DCM.h> // ArduPilot Mega DCM Library
+#include <PID.h> // PID library
+#include <RC_Channel.h> // RC Channel Library
+#include <AP_RangeFinder.h> // Range finder library
+#include <ModeFilter.h>
+#include <GCS_MAVLink.h> // MAVLink GCS definitions
+#include <memcheck.h>
+
+// Configuration
+#include "config.h"
+
+// Local modules
+#include "defines.h"
+#include "Parameters.h"
+#include "GCS.h"
+#include "HIL.h"
+
+////////////////////////////////////////////////////////////////////////////////
+// Serial ports
+////////////////////////////////////////////////////////////////////////////////
+//
+// Note that FastSerial port buffers are allocated at ::begin time,
+// so there is not much of a penalty to defining ports that we don't
+// use.
+//
+FastSerialPort0(Serial); // FTDI/console
+FastSerialPort1(Serial1); // GPS port
+FastSerialPort3(Serial3); // Telemetry port
+
+////////////////////////////////////////////////////////////////////////////////
+// Parameters
+////////////////////////////////////////////////////////////////////////////////
+//
+// Global parameters are all contained within the 'g' class.
+//
+static Parameters g;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// prototypes
+static void update_events(void);
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Sensors
+////////////////////////////////////////////////////////////////////////////////
+//
+// There are three basic options related to flight sensor selection.
+//
+// - Normal flight mode. Real sensors are used.
+// - HIL Attitude mode. Most sensors are disabled, as the HIL
+// protocol supplies attitude information directly.
+// - HIL Sensors mode. Synthetic sensors are configured that
+// supply data from the simulation.
+//
+
+// All GPS access should be through this pointer.
+static GPS *g_gps;
+
+// flight modes convenience array
+static AP_Int8 *flight_modes = &g.flight_mode1;
+
+#if HIL_MODE == HIL_MODE_DISABLED
+
+// real sensors
+static AP_ADC_ADS7844 adc;
+static APM_BMP085_Class barometer;
+static AP_Compass_HMC5843 compass(Parameters::k_param_compass);
+
+// real GPS selection
+#if GPS_PROTOCOL == GPS_PROTOCOL_AUTO
+AP_GPS_Auto g_gps_driver(&Serial1, &g_gps);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_NMEA
+AP_GPS_NMEA g_gps_driver(&Serial1);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_SIRF
+AP_GPS_SIRF g_gps_driver(&Serial1);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_UBLOX
+AP_GPS_UBLOX g_gps_driver(&Serial1);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_MTK
+AP_GPS_MTK g_gps_driver(&Serial1);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_MTK16
+AP_GPS_MTK16 g_gps_driver(&Serial1);
+
+#elif GPS_PROTOCOL == GPS_PROTOCOL_NONE
+AP_GPS_None g_gps_driver(NULL);
+
+#else
+ #error Unrecognised GPS_PROTOCOL setting.
+#endif // GPS PROTOCOL
+
+#elif HIL_MODE == HIL_MODE_SENSORS
+// sensor emulators
+AP_ADC_HIL adc;
+APM_BMP085_HIL_Class barometer;
+AP_Compass_HIL compass;
+AP_GPS_HIL g_gps_driver(NULL);
+
+#elif HIL_MODE == HIL_MODE_ATTITUDE
+AP_ADC_HIL adc;
+AP_DCM_HIL dcm;
+AP_GPS_HIL g_gps_driver(NULL);
+AP_Compass_HIL compass; // never used
+AP_IMU_Shim imu; // never used
+
+#else
+ #error Unrecognised HIL_MODE setting.
+#endif // HIL MODE
+
+#if HIL_MODE != HIL_MODE_DISABLED
+ #if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK
+ GCS_MAVLINK hil(Parameters::k_param_streamrates_port0);
+ #elif HIL_PROTOCOL == HIL_PROTOCOL_XPLANE
+ HIL_XPLANE hil;
+ #endif // HIL PROTOCOL
+#endif // HIL_MODE
+
+// We may have a hil object instantiated just for mission planning
+#if HIL_MODE == HIL_MODE_DISABLED && HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && HIL_PORT == 0
+ GCS_MAVLINK hil(Parameters::k_param_streamrates_port0);
+#endif
+
+#if HIL_MODE != HIL_MODE_ATTITUDE
+ #if HIL_MODE != HIL_MODE_SENSORS
+ // Normal
+ AP_IMU_Oilpan imu(&adc, Parameters::k_param_IMU_calibration);
+ #else
+ // hil imu
+ AP_IMU_Shim imu;
+ #endif
+ // normal dcm
+ AP_DCM dcm(&imu, g_gps);
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// GCS selection
+////////////////////////////////////////////////////////////////////////////////
+//
+#if GCS_PROTOCOL == GCS_PROTOCOL_MAVLINK
+ GCS_MAVLINK gcs(Parameters::k_param_streamrates_port3);
+#else
+// If we are not using a GCS, we need a stub that does nothing.
+ GCS_Class gcs;
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// SONAR selection
+////////////////////////////////////////////////////////////////////////////////
+//
+ModeFilter sonar_mode_filter;
+
+#if SONAR_TYPE == MAX_SONAR_XL
+ AP_RangeFinder_MaxsonarXL sonar(&adc, &sonar_mode_filter);//(SONAR_PORT, &adc);
+#elif SONAR_TYPE == MAX_SONAR_LV
+ // XXX honestly I think these output the same values
+ // If someone knows, can they confirm it?
+ AP_RangeFinder_MaxsonarXL sonar(&adc, &sonar_mode_filter);//(SONAR_PORT, &adc);
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Global variables
+////////////////////////////////////////////////////////////////////////////////
+
+byte control_mode = INITIALISING;
+byte oldSwitchPosition; // for remembering the control mode switch
+bool inverted_flight = false;
+
+static const char *comma = ",";
+
+static const char* flight_mode_strings[] = {
+ "Manual",
+ "Circle",
+ "Stabilize",
+ "",
+ "",
+ "FBW_A",
+ "FBW_B",
+ "",
+ "",
+ "",
+ "Auto",
+ "RTL",
+ "Loiter",
+ "Takeoff",
+ "Land"};
+
+
+/* Radio values
+ Channel assignments
+ 1 Ailerons (rudder if no ailerons)
+ 2 Elevator
+ 3 Throttle
+ 4 Rudder (if we have ailerons)
+ 5 Mode
+ 6 TBD
+ 7 TBD
+ 8 TBD
+*/
+
+// Failsafe
+// --------
+static int failsafe; // track which type of failsafe is being processed
+static bool ch3_failsafe;
+static byte crash_timer;
+
+// Radio
+// -----
+static uint16_t elevon1_trim = 1500; // TODO: handle in EEProm
+static uint16_t elevon2_trim = 1500;
+static uint16_t ch1_temp = 1500; // Used for elevon mixing
+static uint16_t ch2_temp = 1500;
+static int16_t rc_override[8] = {0,0,0,0,0,0,0,0};
+static bool rc_override_active = false;
+static uint32_t rc_override_fs_timer = 0;
+static uint32_t ch3_failsafe_timer = 0;
+
+// for elevons radio_in[CH_ROLL] and radio_in[CH_PITCH] are equivalent aileron and elevator, not left and right elevon
+
+// LED output
+// ----------
+static bool GPS_light; // status of the GPS light
+
+// GPS variables
+// -------------
+static const float t7 = 10000000.0; // used to scale GPS values for EEPROM storage
+static float scaleLongUp = 1; // used to reverse longitude scaling
+static float scaleLongDown = 1; // used to reverse longitude scaling
+static byte ground_start_count = 5; // have we achieved first lock and set Home?
+static int ground_start_avg; // 5 samples to avg speed for ground start
+static bool GPS_enabled = false; // used to quit "looking" for gps with auto-detect if none present
+
+// Location & Navigation
+// ---------------------
+const float radius_of_earth = 6378100; // meters
+const float gravity = 9.81; // meters/ sec^2
+static long nav_bearing; // deg * 100 : 0 to 360 current desired bearing to navigate
+static long target_bearing; // deg * 100 : 0 to 360 location of the plane to the target
+static long crosstrack_bearing; // deg * 100 : 0 to 360 desired angle of plane to target
+static int climb_rate; // m/s * 100 - For future implementation of controlled ascent/descent by rate
+static float nav_gain_scaler = 1; // Gain scaling for headwind/tailwind TODO: why does this variable need to be initialized to 1?
+static long hold_course = -1; // deg * 100 dir of plane
+
+static byte command_must_index; // current command memory location
+static byte command_may_index; // current command memory location
+static byte command_must_ID; // current command ID
+static byte command_may_ID; // current command ID
+
+// Airspeed
+// --------
+static int airspeed; // m/s * 100
+static int airspeed_nudge; // m/s * 100 : additional airspeed based on throttle stick position in top 1/2 of range
+static float airspeed_error; // m/s * 100
+static long energy_error; // energy state error (kinetic + potential) for altitude hold
+static long airspeed_energy_error; // kinetic portion of energy error
+
+// Location Errors
+// ---------------
+static long bearing_error; // deg * 100 : 0 to 36000
+static long altitude_error; // meters * 100 we are off in altitude
+static float crosstrack_error; // meters we are off trackline
+
+// Battery Sensors
+// ---------------
+static float battery_voltage = LOW_VOLTAGE * 1.05; // Battery Voltage of total battery, initialized above threshold for filter
+static float battery_voltage1 = LOW_VOLTAGE * 1.05; // Battery Voltage of cell 1, initialized above threshold for filter
+static float battery_voltage2 = LOW_VOLTAGE * 1.05; // Battery Voltage of cells 1 + 2, initialized above threshold for filter
+static float battery_voltage3 = LOW_VOLTAGE * 1.05; // Battery Voltage of cells 1 + 2+3, initialized above threshold for filter
+static float battery_voltage4 = LOW_VOLTAGE * 1.05; // Battery Voltage of cells 1 + 2+3 + 4, initialized above threshold for filter
+
+static float current_amps;
+static float current_total;
+
+// Airspeed Sensors
+// ----------------
+static float airspeed_raw; // Airspeed Sensor - is a float to better handle filtering
+static int airspeed_pressure; // airspeed as a pressure value
+
+// Barometer Sensor variables
+// --------------------------
+static unsigned long abs_pressure;
+
+// Altitude Sensor variables
+// ----------------------
+static int sonar_alt;
+
+// flight mode specific
+// --------------------
+static bool takeoff_complete = true; // Flag for using gps ground course instead of IMU yaw. Set false when takeoff command processes.
+static bool land_complete;
+static long takeoff_altitude;
+// static int landing_distance; // meters;
+static int landing_pitch; // pitch for landing set by commands
+static int takeoff_pitch;
+
+// Loiter management
+// -----------------
+static long old_target_bearing; // deg * 100
+static int loiter_total; // deg : how many times to loiter * 360
+static int loiter_delta; // deg : how far we just turned
+static int loiter_sum; // deg : how far we have turned around a waypoint
+static long loiter_time; // millis : when we started LOITER mode
+static int loiter_time_max; // millis : how long to stay in LOITER mode
+
+// these are the values for navigation control functions
+// ----------------------------------------------------
+static long nav_roll; // deg * 100 : target roll angle
+static long nav_pitch; // deg * 100 : target pitch angle
+static int throttle_nudge = 0; // 0-(throttle_max - throttle_cruise) : throttle nudge in Auto mode using top 1/2 of throttle stick travel
+
+// Waypoints
+// ---------
+static long wp_distance; // meters - distance between plane and next waypoint
+static long wp_totalDistance; // meters - distance between old and next waypoint
+
+// repeating event control
+// -----------------------
+static byte event_id; // what to do - see defines
+static long event_timer; // when the event was asked for in ms
+static uint16_t event_delay; // how long to delay the next firing of event in millis
+static int event_repeat = 0; // how many times to cycle : -1 (or -2) = forever, 2 = do one cycle, 4 = do two cycles
+static int event_value; // per command value, such as PWM for servos
+static int event_undo_value; // the value used to cycle events (alternate value to event_value)
+
+// delay command
+// --------------
+static long condition_value; // used in condition commands (eg delay, change alt, etc.)
+static long condition_start;
+static int condition_rate;
+
+// 3D Location vectors
+// -------------------
+static struct Location home; // home location
+static struct Location prev_WP; // last waypoint
+static struct Location current_loc; // current location
+static struct Location next_WP; // next waypoint
+static struct Location next_command; // command preloaded
+static struct Location guided_WP; // guided mode waypoint
+static long target_altitude; // used for altitude management between waypoints
+static long offset_altitude; // used for altitude management between waypoints
+static bool home_is_set; // Flag for if we have g_gps lock and have set the home location
+
+
+// IMU variables
+// -------------
+static float G_Dt = 0.02; // Integration time for the gyros (DCM algorithm)
+
+
+// Performance monitoring
+// ----------------------
+static long perf_mon_timer; // Metric based on accel gain deweighting
+static int G_Dt_max = 0; // Max main loop cycle time in milliseconds
+static int gps_fix_count = 0;
+static int pmTest1 = 0;
+
+
+// System Timers
+// --------------
+static unsigned long fast_loopTimer; // Time in miliseconds of main control loop
+static unsigned long fast_loopTimeStamp; // Time Stamp when fast loop was complete
+static uint8_t delta_ms_fast_loop; // Delta Time in miliseconds
+static int mainLoop_count;
+
+static unsigned long medium_loopTimer; // Time in miliseconds of medium loop
+static byte medium_loopCounter; // Counters for branching from main control loop to slower loops
+static uint8_t delta_ms_medium_loop;
+
+static byte slow_loopCounter;
+static byte superslow_loopCounter;
+static byte counter_one_herz;
+
+static unsigned long nav_loopTimer; // used to track the elapsed time for GPS nav
+
+static unsigned long dTnav; // Delta Time in milliseconds for navigation computations
+static float load; // % MCU cycles used
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Top-level logic
+////////////////////////////////////////////////////////////////////////////////
+
+void setup() {
+ memcheck_init();
+ init_ardupilot();
+}
+
+void loop()
+{
+ // We want this to execute at 50Hz if possible
+ // -------------------------------------------
+ if (millis()-fast_loopTimer > 19) {
+ delta_ms_fast_loop = millis() - fast_loopTimer;
+ load = (float)(fast_loopTimeStamp - fast_loopTimer)/delta_ms_fast_loop;
+ G_Dt = (float)delta_ms_fast_loop / 1000.f;
+ fast_loopTimer = millis();
+
+ mainLoop_count++;
+
+ // Execute the fast loop
+ // ---------------------
+ fast_loop();
+
+ // Execute the medium loop
+ // -----------------------
+ medium_loop();
+
+ counter_one_herz++;
+ if(counter_one_herz == 50){
+ one_second_loop();
+ counter_one_herz = 0;
+ }
+
+ if (millis() - perf_mon_timer > 20000) {
+ if (mainLoop_count != 0) {
+ gcs.send_message(MSG_PERF_REPORT);
+ if (g.log_bitmask & MASK_LOG_PM)
+ Log_Write_Performance();
+
+ resetPerfData();
+ }
+ }
+
+ fast_loopTimeStamp = millis();
+ }
+}
+
+// Main loop 50Hz
+static void fast_loop()
+{
+ // This is the fast loop - we want it to execute at 50Hz if possible
+ // -----------------------------------------------------------------
+ if (delta_ms_fast_loop > G_Dt_max)
+ G_Dt_max = delta_ms_fast_loop;
+
+ // Read radio
+ // ----------
+ read_radio();
+
+ // try to send any deferred messages if the serial port now has
+ // some space available
+ gcs.send_message(MSG_RETRY_DEFERRED);
+#if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && (HIL_MODE != HIL_MODE_DISABLED || HIL_PORT == 0)
+ hil.send_message(MSG_RETRY_DEFERRED);
+#endif
+
+ // check for loss of control signal failsafe condition
+ // ------------------------------------
+ check_short_failsafe();
+
+ // Read Airspeed
+ // -------------
+ if (g.airspeed_enabled == true && HIL_MODE != HIL_MODE_ATTITUDE) {
+ read_airspeed();
+ } else if (g.airspeed_enabled == true && HIL_MODE == HIL_MODE_ATTITUDE) {
+ calc_airspeed_errors();
+ }
+
+ #if HIL_MODE == HIL_MODE_SENSORS
+ // update hil before dcm update
+ hil.update();
+ #endif
+
+ dcm.update_DCM(G_Dt);
+
+ // uses the yaw from the DCM to give more accurate turns
+ calc_bearing_error();
+
+ # if HIL_MODE == HIL_MODE_DISABLED
+ if (g.log_bitmask & MASK_LOG_ATTITUDE_FAST)
+ Log_Write_Attitude((int)dcm.roll_sensor, (int)dcm.pitch_sensor, (uint16_t)dcm.yaw_sensor);
+
+ if (g.log_bitmask & MASK_LOG_RAW)
+ Log_Write_Raw();
+ #endif
+
+ // inertial navigation
+ // ------------------
+ #if INERTIAL_NAVIGATION == ENABLED
+ // TODO: implement inertial nav function
+ inertialNavigation();
+ #endif
+
+ // custom code/exceptions for flight modes
+ // ---------------------------------------
+ update_current_flight_mode();
+
+ // apply desired roll, pitch and yaw to the plane
+ // ----------------------------------------------
+ if (control_mode > MANUAL)
+ stabilize();
+
+ // write out the servo PWM values
+ // ------------------------------
+ set_servos();
+
+
+ // XXX is it appropriate to be doing the comms below on the fast loop?
+
+ #if HIL_MODE != HIL_MODE_DISABLED && HIL_PORT != GCS_PORT
+ // kick the HIL to process incoming sensor packets
+ hil.update();
+
+ #if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK
+ hil.data_stream_send(45,1000);
+ #else
+ hil.send_message(MSG_SERVO_OUT);
+ #endif
+ #elif HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && HIL_MODE == HIL_MODE_DISABLED && HIL_PORT == 0
+ // Case for hil object on port 0 just for mission planning
+ hil.update();
+ hil.data_stream_send(45,1000);
+ #endif
+
+ // kick the GCS to process uplink data
+ gcs.update();
+ #if GCS_PROTOCOL == GCS_PROTOCOL_MAVLINK
+ gcs.data_stream_send(45,1000);
+ #endif
+ // XXX this should be absorbed into the above,
+ // or be a "GCS fast loop" interface
+}
+
+static void medium_loop()
+{
+ // This is the start of the medium (10 Hz) loop pieces
+ // -----------------------------------------
+ switch(medium_loopCounter) {
+
+ // This case deals with the GPS
+ //-------------------------------
+ case 0:
+ medium_loopCounter++;
+ if(GPS_enabled) update_GPS();
+
+ #if HIL_MODE != HIL_MODE_ATTITUDE
+ if(g.compass_enabled){
+ compass.read(); // Read magnetometer
+ compass.calculate(dcm.get_dcm_matrix()); // Calculate heading
+ compass.null_offsets(dcm.get_dcm_matrix());
+ }
+ #endif
+/*{
+Serial.print(dcm.roll_sensor, DEC); Serial.printf_P(PSTR("\t"));
+Serial.print(dcm.pitch_sensor, DEC); Serial.printf_P(PSTR("\t"));
+Serial.print(dcm.yaw_sensor, DEC); Serial.printf_P(PSTR("\t"));
+Vector3f tempaccel = imu.get_accel();
+Serial.print(tempaccel.x, DEC); Serial.printf_P(PSTR("\t"));
+Serial.print(tempaccel.y, DEC); Serial.printf_P(PSTR("\t"));
+Serial.println(tempaccel.z, DEC);
+}*/
+
+ break;
+
+ // This case performs some navigation computations
+ //------------------------------------------------
+ case 1:
+ medium_loopCounter++;
+
+
+ if(g_gps->new_data){
+ g_gps->new_data = false;
+ dTnav = millis() - nav_loopTimer;
+ nav_loopTimer = millis();
+
+ // calculate the plane's desired bearing
+ // -------------------------------------
+ navigate();
+ }
+
+ break;
+
+ // command processing
+ //------------------------------
+ case 2:
+ medium_loopCounter++;
+
+ // Read altitude from sensors
+ // ------------------
+ update_alt();
+ if(g.sonar_enabled) sonar_alt = sonar.read();
+
+ // altitude smoothing
+ // ------------------
+ if (control_mode != FLY_BY_WIRE_B)
+ calc_altitude_error();
+
+ // perform next command
+ // --------------------
+ update_commands();
+ break;
+
+ // This case deals with sending high rate telemetry
+ //-------------------------------------------------
+ case 3:
+ medium_loopCounter++;
+
+ #if HIL_MODE != HIL_MODE_ATTITUDE
+ if ((g.log_bitmask & MASK_LOG_ATTITUDE_MED) && !(g.log_bitmask & MASK_LOG_ATTITUDE_FAST))
+ Log_Write_Attitude((int)dcm.roll_sensor, (int)dcm.pitch_sensor, (uint16_t)dcm.yaw_sensor);
+
+ if (g.log_bitmask & MASK_LOG_CTUN)
+ Log_Write_Control_Tuning();
+ #endif
+
+ if (g.log_bitmask & MASK_LOG_NTUN)
+ Log_Write_Nav_Tuning();
+
+ if (g.log_bitmask & MASK_LOG_GPS)
+ Log_Write_GPS(g_gps->time, current_loc.lat, current_loc.lng, g_gps->altitude, current_loc.alt, (long) g_gps->ground_speed, g_gps->ground_course, g_gps->fix, g_gps->num_sats);
+
+ // XXX this should be a "GCS medium loop" interface
+ #if GCS_PROTOCOL == GCS_PROTOCOL_MAVLINK
+ gcs.data_stream_send(5,45);
+ // send all requested output streams with rates requested
+ // between 5 and 45 Hz
+ #else
+ gcs.send_message(MSG_ATTITUDE); // Sends attitude data
+ #endif
+
+ #if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && (HIL_MODE != HIL_MODE_DISABLED || HIL_PORT == 0)
+ hil.data_stream_send(5,45);
+ #endif
+ break;
+
+ // This case controls the slow loop
+ //---------------------------------
+ case 4:
+ medium_loopCounter = 0;
+ delta_ms_medium_loop = millis() - medium_loopTimer;
+ medium_loopTimer = millis();
+
+ if (g.battery_monitoring != 0){
+ read_battery();
+ }
+
+ slow_loop();
+ break;
+ }
+}
+
+static void slow_loop()
+{
+ // This is the slow (3 1/3 Hz) loop pieces
+ //----------------------------------------
+ switch (slow_loopCounter){
+ case 0:
+ slow_loopCounter++;
+ check_long_failsafe();
+ superslow_loopCounter++;
+ if(superslow_loopCounter >=200) { // 200 = Execute every minute
+ #if HIL_MODE != HIL_MODE_ATTITUDE
+ if(g.compass_enabled) {
+ compass.save_offsets();
+ }
+ #endif
+
+ superslow_loopCounter = 0;
+ }
+ break;
+
+ case 1:
+ slow_loopCounter++;
+
+ // Read 3-position switch on radio
+ // -------------------------------
+ read_control_switch();
+
+ // Read Control Surfaces/Mix switches
+ // ----------------------------------
+ update_servo_switches();
+
+ break;
+
+ case 2:
+ slow_loopCounter = 0;
+ update_events();
+
+ #if GCS_PROTOCOL == GCS_PROTOCOL_MAVLINK
+ mavlink_system.sysid = g.sysid_this_mav; // This is just an ugly hack to keep mavlink_system.sysid sync'd with our parameter
+ gcs.data_stream_send(3,5);
+ // send all requested output streams with rates requested
+ // between 3 and 5 Hz
+ #else
+ gcs.send_message(MSG_LOCATION);
+ gcs.send_message(MSG_CPU_LOAD, load*100);
+ #endif
+
+ #if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && (HIL_MODE != HIL_MODE_DISABLED || HIL_PORT == 0)
+ hil.data_stream_send(3,5);
+ #endif
+
+
+ break;
+ }
+}
+
+static void one_second_loop()
+{
+ if (g.log_bitmask & MASK_LOG_CUR)
+ Log_Write_Current();
+
+ // send a heartbeat
+ gcs.send_message(MSG_HEARTBEAT);
+ #if GCS_PROTOCOL == GCS_PROTOCOL_MAVLINK
+ gcs.data_stream_send(1,3);
+ // send all requested output streams with rates requested
+ // between 1 and 3 Hz
+ #endif
+
+ #if HIL_PROTOCOL == HIL_PROTOCOL_MAVLINK && (HIL_MODE != HIL_MODE_DISABLED || HIL_PORT == 0)
+ hil.send_message(MSG_HEARTBEAT);
+ hil.data_stream_send(1,3);
+ #endif
+}
+
+static void update_GPS(void)
+{
+ g_gps->update();
+ update_GPS_light();
+
+ if (g_gps->new_data && g_gps->fix) {
+
+// XXX We should be sending GPS data off one of the regular loops so that we send
+// no-GPS-fix data too
+#if GCS_PROTOCOL != GCS_PROTOCOL_MAVLINK
+ gcs.send_message(MSG_LOCATION);
+#endif
+
+ // for performance
+ // ---------------
+ gps_fix_count++;
+
+ if(ground_start_count > 1){
+ ground_start_count--;
+ ground_start_avg += g_gps->ground_speed;
+
+ } else if (ground_start_count == 1) {
+ // We countdown N number of good GPS fixes
+ // so that the altitude is more accurate
+ // -------------------------------------