Squashed 'third_party/allwpilib_2019/' content from commit bd05dfa1c

Change-Id: I2b1c2250cdb9b055133780c33593292098c375b7
git-subtree-dir: third_party/allwpilib_2019
git-subtree-split: bd05dfa1c7cca74c4fac451e7b9d6a37e7b53447
diff --git a/simulation/lowfi_simulation/build.gradle b/simulation/lowfi_simulation/build.gradle
new file mode 100644
index 0000000..2b97416
--- /dev/null
+++ b/simulation/lowfi_simulation/build.gradle
@@ -0,0 +1,201 @@
+apply plugin: 'cpp'
+apply plugin: 'google-test-test-suite'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: SingleNativeBuild
+apply plugin: ExtraTasks
+
+
+ext {
+    nativeName = 'lowfi_sim'
+}
+
+apply from: "${rootDir}/shared/config.gradle"
+
+if (!project.hasProperty('onlyAthena')) {
+
+    ext {
+        sharedCvConfigs = [lowfi_simTest: []]
+        staticCvConfigs = [:]
+        useJava = false
+        useCpp = true
+    }
+    apply from: "${rootDir}/shared/opencv.gradle"
+
+    ext {
+        staticGtestConfigs = [:]
+    }
+    staticGtestConfigs["${nativeName}Test"] = []
+    apply from: "${rootDir}/shared/googletest.gradle"
+
+    project(':').libraryBuild.dependsOn build
+
+    ext {
+        chipObjectComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
+                                "${nativeName}Test".toString()]
+        netCommComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
+                             "${nativeName}Test".toString()]
+        useNiJava = false
+    }
+
+    apply from: "${rootDir}/shared/nilibraries.gradle"
+
+    model {
+        exportsConfigs {
+            lowfi_sim(ExportsConfig) {
+                x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                     '_CT??_R0?AVbad_cast',
+                                     '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                     '_TI5?AVfailure']
+                x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                     '_CT??_R0?AVbad_cast',
+                                     '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                     '_TI5?AVfailure']
+            }
+        }
+        components {
+            "${nativeName}Base"(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = ['src/main/native/cpp']
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/main/native/include'
+                        }
+                    }
+                }
+                binaries.all {
+                    if (it instanceof SharedLibraryBinarySpec) {
+                        it.buildable = false
+                        return
+                    }
+                    if (it.targetPlatform.architecture.name == 'athena') {
+                        it.buildable = false
+                        return
+                    }
+                    project(':hal').addHalDependency(it, 'shared')
+                    lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+                    lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+                }
+            }
+            "${nativeName}"(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs "${rootDir}/shared/singlelib"
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/main/native/include'
+                        }
+                    }
+                }
+                binaries.all {
+                    if (it.targetPlatform.architecture.name == 'athena') {
+                        it.buildable = false
+                        return
+                    }
+                    project(':hal').addHalDependency(it, 'shared')
+                    lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+                    lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+                }
+            }
+            // By default, a development executable will be generated. This is to help the case of
+            // testing specific functionality of the library.
+            "${nativeName}Dev"(NativeExecutableSpec) {
+                targetBuildTypes 'debug'
+                sources {
+                    cpp {
+                        source {
+                            srcDirs 'src/dev/native/cpp'
+                            include '**/*.cpp'
+                            lib library: "${nativeName}"
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/dev/native/include'
+                        }
+                    }
+                }
+                binaries.all {
+                    if (it.targetPlatform.architecture.name == 'athena') {
+                        it.buildable = false
+                        return
+                    }
+                    project(':hal').addHalDependency(it, 'shared')
+                    lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+                    lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+                    lib library: nativeName, linkage: 'shared'
+                }
+            }
+        }
+        binaries {
+            withType(GoogleTestTestSuiteBinarySpec) {
+                lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
+                lib project: ':cscore', library: 'cscore', linkage: 'shared'
+                project(':hal').addHalDependency(it, 'shared')
+                lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+                lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
+                lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
+                lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+                lib library: nativeName, linkage: 'shared'
+            }
+        }
+    }
+
+    apply from: "publish.gradle"
+}
+
+model {
+
+    testSuites {
+        if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
+            "${nativeName}Test"(GoogleTestTestSuiteSpec) {
+                for(NativeComponentSpec c : $.components) {
+                    if (c.name == nativeName) {
+                        testing c
+                        break
+                    }
+                }
+                sources {
+                    cpp {
+                        source {
+                            srcDirs 'src/test/native/cpp'
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/test/native/include', 'src/main/native/cpp'
+                        }
+                    }
+                }
+            }
+        }
+    }
+    tasks {
+        def c = $.components
+        project.tasks.create('runCpp', Exec) {
+            def found = false
+            c.each {
+                if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+								commandLine it.tasks.install.runScriptFile.get().asFile.toString()
+
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+tasks.withType(RunTestExecutable) {
+    args "--gtest_output=xml:test_detail.xml"
+    outputs.dir outputDir
+}
diff --git a/simulation/lowfi_simulation/publish.gradle b/simulation/lowfi_simulation/publish.gradle
new file mode 100644
index 0000000..4143cd2
--- /dev/null
+++ b/simulation/lowfi_simulation/publish.gradle
@@ -0,0 +1,71 @@
+apply plugin: 'maven-publish'
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = nativeName
+def artifactGroupId = 'edu.wpi.first.halsim'
+def zipBaseName = "_GROUP_edu_wpi_first_halsim_ID_${nativeName}_CLS"
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = zipBaseName
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = zipBaseName
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppSourcesZip
+build.dependsOn cppHeadersZip
+
+addTaskToCopyAllOutputs(cppSourcesZip)
+addTaskToCopyAllOutputs(cppHeadersZip)
+
+
+model {
+    publishing {
+        def lowfiSimTaskList = createComponentZipTasks($.components, [nativeName], zipBaseName, Zip, project, includeStandardZipFormat)
+
+        publications {
+            cpp(MavenPublication) {
+                lowfiSimTaskList.each {
+                    artifact it
+                }
+
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
diff --git a/simulation/lowfi_simulation/src/dev/native/cpp/main.cpp b/simulation/lowfi_simulation/src/dev/native/cpp/main.cpp
new file mode 100644
index 0000000..4dc5f43
--- /dev/null
+++ b/simulation/lowfi_simulation/src/dev/native/cpp/main.cpp
@@ -0,0 +1,15 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <hal/HAL.h>
+
+int main() {
+  std::cout << "Hello World" << std::endl;
+  std::cout << HAL_GetRuntimeType() << std::endl;
+}
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/MotorEncoderConnector.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/MotorEncoderConnector.cpp
new file mode 100644
index 0000000..5e530e6
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/MotorEncoderConnector.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/MotorEncoderConnector.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+MotorEncoderConnector::MotorEncoderConnector(MotorSim& motorController,
+                                             EncoderSim& encoder)
+    : motorSimulator(motorController), encoderSimulator(encoder) {}
+
+void MotorEncoderConnector::Update() {
+  encoderSimulator.SetPosition(motorSimulator.GetPosition());
+  encoderSimulator.SetVelocity(motorSimulator.GetVelocity());
+}
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/SimulatorComponentBase.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/SimulatorComponentBase.cpp
new file mode 100644
index 0000000..a65de3b
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/SimulatorComponentBase.cpp
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/SimulatorComponentBase.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+const std::string& SimulatorComponentBase::GetDisplayName() const {
+  return m_name;
+}
+
+void SimulatorComponentBase::SetDisplayName(const std::string& displayName) {
+  m_name = displayName;
+}
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/motormodel/SimpleMotorModel.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/motormodel/SimpleMotorModel.cpp
new file mode 100644
index 0000000..226a836
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/motormodel/SimpleMotorModel.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/motormodel/SimpleMotorModel.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+SimpleMotorModel::SimpleMotorModel(double maxSpeed) : m_maxSpeed(maxSpeed) {}
+
+void SimpleMotorModel::Reset() {
+  m_position = 0;
+  m_velocity = 0;
+}
+
+void SimpleMotorModel::SetVoltage(double voltage) {
+  m_voltagePercentage = voltage / kMaxExpectedVoltage;
+}
+
+void SimpleMotorModel::Update(double elapsedTime) {
+  m_velocity = m_maxSpeed * m_voltagePercentage;
+  m_position += m_velocity * elapsedTime;
+}
+
+double SimpleMotorModel::GetPosition() const { return m_position; }
+
+double SimpleMotorModel::GetVelocity() const { return m_velocity; }
+
+double SimpleMotorModel::GetAcceleration() const { return 0; }
+
+double SimpleMotorModel::GetCurrent() const { return 0; }
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.cpp
new file mode 100644
index 0000000..915d838
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.cpp
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+ADXLThreeAxisAccelerometerSim::ADXLThreeAxisAccelerometerSim(
+    hal::ThreeAxisAccelerometerData& accelerometerWrapper)
+    : m_accelerometerWrapper(accelerometerWrapper),
+      m_xWrapper(
+          [data = &m_accelerometerWrapper] { return data->GetInitialized(); },
+          [data = &m_accelerometerWrapper](double x) { data->x = x; },
+          [data = &m_accelerometerWrapper] { return data->GetX(); }),
+
+      m_yWrapper(
+          [data = &m_accelerometerWrapper] { return data->GetInitialized(); },
+          [data = &m_accelerometerWrapper](double y) { data->y = y; },
+          [data = &m_accelerometerWrapper] { return data->GetY(); }),
+
+      m_zWrapper(
+          [data = &m_accelerometerWrapper] { return data->GetInitialized(); },
+          [data = &m_accelerometerWrapper](double z) { data->z = z; },
+          [data = &m_accelerometerWrapper] { return data->GetZ(); }) {}
+
+AccelerometerSim& ADXLThreeAxisAccelerometerSim::GetXWrapper() {
+  return m_xWrapper;
+}
+
+AccelerometerSim& ADXLThreeAxisAccelerometerSim::GetYWrapper() {
+  return m_yWrapper;
+}
+
+AccelerometerSim& ADXLThreeAxisAccelerometerSim::GetZWrapper() {
+  return m_zWrapper;
+}
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.cpp
new file mode 100644
index 0000000..b1daf17
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/wpisimulators/ADXRS450_SpiGyroSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+ADXRS450_SpiGyroSim::ADXRS450_SpiGyroSim(int spiPort)
+    : m_gyroWrapper(spiPort) {}
+
+bool ADXRS450_SpiGyroSim::IsWrapperInitialized() const {
+  return m_gyroWrapper.GetInitialized();
+}
+
+void ADXRS450_SpiGyroSim::SetAngle(double angle) {
+  m_gyroWrapper.SetAngle(angle);
+}
+
+double ADXRS450_SpiGyroSim::GetAngle() { return m_gyroWrapper.GetAngle(); }
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiAnalogGyroSim.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiAnalogGyroSim.cpp
new file mode 100644
index 0000000..63619cc
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiAnalogGyroSim.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/wpisimulators/WpiAnalogGyroSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+WpiAnalogGyroSim::WpiAnalogGyroSim(int index) : m_gyroSimulator(index) {}
+
+bool WpiAnalogGyroSim::IsWrapperInitialized() const {
+  return m_gyroSimulator.GetInitialized();
+}
+
+void WpiAnalogGyroSim::SetAngle(double angle) {
+  m_gyroSimulator.SetAngle(angle);
+}
+
+double WpiAnalogGyroSim::GetAngle() { return m_gyroSimulator.GetAngle(); }
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiEncoderSim.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiEncoderSim.cpp
new file mode 100644
index 0000000..7425efe
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiEncoderSim.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/wpisimulators/WpiEncoderSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+WpiEncoderSim::WpiEncoderSim(int index) : m_encoderSimulator(index) {}
+
+bool WpiEncoderSim::IsWrapperInitialized() const {
+  return m_encoderSimulator.GetInitialized();
+}
+
+void WpiEncoderSim::SetPosition(double position) {
+  m_encoderSimulator.SetCount(
+      static_cast<int>(position / m_encoderSimulator.GetDistancePerPulse()));
+}
+
+void WpiEncoderSim::SetVelocity(double velocity) {
+  m_encoderSimulator.SetPeriod(1.0 / velocity);
+}
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiMotorSim.cpp b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiMotorSim.cpp
new file mode 100644
index 0000000..0b08cf2
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/cpp/lowfisim/wpisimulators/WpiMotorSim.cpp
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "lowfisim/wpisimulators/WpiMotorSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+WpiMotorSim::WpiMotorSim(int index, MotorModel& motorModelSimulator)
+    : m_motorModelSimulation(motorModelSimulator), m_pwmSimulator(index) {}
+
+void WpiMotorSim::Update(double elapsedTime) {
+  m_motorModelSimulation.SetVoltage(m_pwmSimulator.GetSpeed() *
+                                    kDefaultVoltage);
+  m_motorModelSimulation.Update(elapsedTime);
+}
+
+bool WpiMotorSim::IsWrapperInitialized() const {
+  return m_pwmSimulator.GetInitialized();
+}
+
+double WpiMotorSim::GetPosition() const {
+  return m_motorModelSimulation.GetPosition();
+}
+
+double WpiMotorSim::GetVelocity() const {
+  return m_motorModelSimulation.GetVelocity();
+}
+
+double WpiMotorSim::GetAcceleration() const {
+  return m_motorModelSimulation.GetAcceleration();
+}
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/AccelerometerSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/AccelerometerSim.h
new file mode 100644
index 0000000..fc9a456
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/AccelerometerSim.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/SimulatorComponent.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class AccelerometerSim : public virtual SimulatorComponent {
+ public:
+  virtual double GetAcceleration() = 0;
+  virtual void SetAcceleration(double acceleration) = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/EncoderSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/EncoderSim.h
new file mode 100644
index 0000000..a16f94c
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/EncoderSim.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/SimulatorComponent.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class EncoderSim : public virtual SimulatorComponent {
+ public:
+  virtual void SetPosition(double position) = 0;
+  virtual void SetVelocity(double velocity) = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/GyroSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/GyroSim.h
new file mode 100644
index 0000000..dcaa28f
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/GyroSim.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/SimulatorComponent.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class GyroSim : public virtual SimulatorComponent {
+ public:
+  virtual void SetAngle(double angle) = 0;
+  virtual double GetAngle() = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorEncoderConnector.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorEncoderConnector.h
new file mode 100644
index 0000000..0cf4873
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorEncoderConnector.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "EncoderSim.h"
+#include "MotorSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class MotorEncoderConnector {
+ public:
+  MotorEncoderConnector(MotorSim& motorController, EncoderSim& encoder);
+
+  void Update();
+
+ private:
+  MotorSim& motorSimulator;
+  EncoderSim& encoderSimulator;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorSim.h
new file mode 100644
index 0000000..e880048
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/MotorSim.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/SimulatorComponent.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class MotorSim : public virtual SimulatorComponent {
+ public:
+  virtual double GetPosition() const = 0;
+  virtual double GetVelocity() const = 0;
+  virtual double GetAcceleration() const = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleAccelerometerSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleAccelerometerSim.h
new file mode 100644
index 0000000..4c10cfe
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleAccelerometerSim.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <functional>
+
+#include "lowfisim/AccelerometerSim.h"
+#include "lowfisim/SimulatorComponentBase.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class SimpleAccelerometerSim : public SimulatorComponentBase,
+                               public AccelerometerSim {
+ public:
+  using SimulatorComponentBase::GetDisplayName;
+
+  SimpleAccelerometerSim(const std::function<bool(void)>& initializedFunction,
+                         const std::function<void(double)>& setterFunction,
+                         const std::function<double(void)>& getterFunction)
+      : m_isInitializedFunction(initializedFunction),
+        m_setAccelerationFunction(setterFunction),
+        m_getAccelerationFunction(getterFunction) {}
+  double GetAcceleration() override { return m_getAccelerationFunction(); }
+
+  void SetAcceleration(double acceleration) override {
+    m_setAccelerationFunction(acceleration);
+  }
+
+  bool IsWrapperInitialized() const override {
+    return m_isInitializedFunction();
+  }
+
+ private:
+  std::function<bool(void)> m_isInitializedFunction;
+  std::function<void(double)> m_setAccelerationFunction;
+  std::function<double(void)> m_getAccelerationFunction;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleGyroSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleGyroSim.h
new file mode 100644
index 0000000..ea69247
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimpleGyroSim.h
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <functional>
+
+#include "lowfisim/GyroSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class SimpleGyroSim : public GyroSim {
+ public:
+  SimpleGyroSim(std::function<void(double)>& setterFunction,
+                std::function<double(void)>& getterFunction)
+      : m_setAngleFunction(setterFunction),
+        m_getAngleFunction(getterFunction) {}
+  double GetAngle() override { return m_getAngleFunction(); }
+
+  void SetAngle(double angle) override { m_setAngleFunction(angle); }
+
+ private:
+  std::function<void(double)> m_setAngleFunction;
+  std::function<double(void)> m_getAngleFunction;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponent.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponent.h
new file mode 100644
index 0000000..4eb5e99
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponent.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class SimulatorComponent {
+ public:
+  virtual ~SimulatorComponent() = default;
+
+  virtual bool IsWrapperInitialized() const = 0;
+
+  virtual const std::string& GetDisplayName() const = 0;
+
+  virtual void SetDisplayName(const std::string& displayName) = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponentBase.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponentBase.h
new file mode 100644
index 0000000..c29e68c
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/SimulatorComponentBase.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include "lowfisim/SimulatorComponent.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class SimulatorComponentBase : public virtual SimulatorComponent {
+ public:
+  SimulatorComponentBase() = default;
+  virtual ~SimulatorComponentBase() = default;
+
+  const std::string& GetDisplayName() const override;
+
+  void SetDisplayName(const std::string& displayName) override;
+
+ private:
+  std::string m_name;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/MotorModel.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/MotorModel.h
new file mode 100644
index 0000000..aeffcb7
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/MotorModel.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class MotorModel {
+ public:
+  virtual void Reset() = 0;
+  virtual void SetVoltage(double voltage) = 0;
+  virtual void Update(double elapsedTime) = 0;
+
+  virtual double GetPosition() const = 0;
+  virtual double GetVelocity() const = 0;
+  virtual double GetAcceleration() const = 0;
+  virtual double GetCurrent() const = 0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/SimpleMotorModel.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/SimpleMotorModel.h
new file mode 100644
index 0000000..ccfc3b9
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/motormodel/SimpleMotorModel.h
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/motormodel/MotorModel.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class SimpleMotorModel : public MotorModel {
+ public:
+  explicit SimpleMotorModel(double maxSpeed);
+
+  void Reset() override;
+  void SetVoltage(double voltage) override;
+  void Update(double elapsedTime) override;
+
+  double GetPosition() const override;
+  double GetVelocity() const override;
+  double GetAcceleration() const override;
+  double GetCurrent() const override;
+
+ protected:
+  double m_maxSpeed;
+  double m_voltagePercentage{0};
+  double m_position{0};
+  double m_velocity{0};
+
+  static constexpr double kMaxExpectedVoltage = 12;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.h
new file mode 100644
index 0000000..0b63f2e
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.h
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ThreeAxisAccelerometerData.h"
+#include "lowfisim/SimpleAccelerometerSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class ADXLThreeAxisAccelerometerSim {
+ public:
+  ADXLThreeAxisAccelerometerSim(
+      hal::ThreeAxisAccelerometerData& accelerometerWrapper);
+
+  AccelerometerSim& GetXWrapper();
+  AccelerometerSim& GetYWrapper();
+  AccelerometerSim& GetZWrapper();
+
+ protected:
+  hal::ThreeAxisAccelerometerData& m_accelerometerWrapper;
+  SimpleAccelerometerSim m_xWrapper;
+  SimpleAccelerometerSim m_yWrapper;
+  SimpleAccelerometerSim m_zWrapper;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.h
new file mode 100644
index 0000000..9b23320
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/ADXRS450_SpiGyroSim.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ADXRS450_SpiGyroWrapperData.h"
+#include "lowfisim/GyroSim.h"
+#include "lowfisim/SimulatorComponentBase.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class ADXRS450_SpiGyroSim : public SimulatorComponentBase, public GyroSim {
+ public:
+  explicit ADXRS450_SpiGyroSim(int spiPort);
+
+  bool IsWrapperInitialized() const override;
+
+  void SetAngle(double angle) override;
+  double GetAngle() override;
+
+ protected:
+  hal::ADXRS450_SpiGyroWrapper m_gyroWrapper;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiAnalogGyroSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiAnalogGyroSim.h
new file mode 100644
index 0000000..8741cb2
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiAnalogGyroSim.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/GyroSim.h"
+#include "lowfisim/SimulatorComponentBase.h"
+#include "simulation/AnalogGyroSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class WpiAnalogGyroSim : public SimulatorComponentBase, public GyroSim {
+ public:
+  explicit WpiAnalogGyroSim(int index);
+
+  bool IsWrapperInitialized() const override;
+
+  void SetAngle(double angle) override;
+  double GetAngle() override;
+
+ protected:
+  frc::sim::AnalogGyroSim m_gyroSimulator;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiEncoderSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiEncoderSim.h
new file mode 100644
index 0000000..6460d8b
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiEncoderSim.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/EncoderSim.h"
+#include "lowfisim/SimulatorComponentBase.h"
+#include "simulation/EncoderSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class WpiEncoderSim : public SimulatorComponentBase, public EncoderSim {
+ public:
+  explicit WpiEncoderSim(int index);
+  bool IsWrapperInitialized() const override;
+
+  void SetPosition(double position) override;
+  void SetVelocity(double velocity) override;
+
+ protected:
+  frc::sim::EncoderSim m_encoderSimulator;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiMotorSim.h b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiMotorSim.h
new file mode 100644
index 0000000..d24e831
--- /dev/null
+++ b/simulation/lowfi_simulation/src/main/native/include/lowfisim/wpisimulators/WpiMotorSim.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "lowfisim/MotorSim.h"
+#include "lowfisim/SimulatorComponentBase.h"
+#include "lowfisim/motormodel/MotorModel.h"
+#include "simulation/PWMSim.h"
+
+namespace frc {
+namespace sim {
+namespace lowfi {
+
+class WpiMotorSim : public SimulatorComponentBase, public MotorSim {
+ public:
+  explicit WpiMotorSim(int index, MotorModel& motorModelSimulator);
+  bool IsWrapperInitialized() const override;
+
+  void Update(double elapsedTime);
+  double GetPosition() const override;
+  double GetVelocity() const override;
+  double GetAcceleration() const override;
+
+ private:
+  MotorModel& m_motorModelSimulation;
+  frc::sim::PWMSim m_pwmSimulator;
+
+  static constexpr double kDefaultVoltage = 12.0;
+};
+
+}  // namespace lowfi
+}  // namespace sim
+}  // namespace frc
diff --git a/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/AccelerometerSimulatorTest.cpp b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/AccelerometerSimulatorTest.cpp
new file mode 100644
index 0000000..b51a63a
--- /dev/null
+++ b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/AccelerometerSimulatorTest.cpp
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL345_I2CAccelerometerData.h"
+#include "frc/ADXL345_I2C.h"
+#include "gtest/gtest.h"
+#include "lowfisim/wpisimulators/ADXLThreeAxisAccelerometerSim.h"
+
+TEST(AccelerometerTests, TestADXL345_I2CAccelerometerWrapper) {
+  const double EPSILON = 1 / 256.0;
+
+  frc::I2C::Port port = frc::I2C::kOnboard;
+
+  hal::ADXL345_I2CData rawAdxSim(port);
+  frc::sim::lowfi::ADXLThreeAxisAccelerometerSim accelerometerSim(rawAdxSim);
+  frc::sim::lowfi::AccelerometerSim& xWrapper = accelerometerSim.GetXWrapper();
+  frc::sim::lowfi::AccelerometerSim& yWrapper = accelerometerSim.GetYWrapper();
+  frc::sim::lowfi::AccelerometerSim& zWrapper = accelerometerSim.GetZWrapper();
+  EXPECT_FALSE(xWrapper.IsWrapperInitialized());
+  EXPECT_FALSE(yWrapper.IsWrapperInitialized());
+  EXPECT_FALSE(zWrapper.IsWrapperInitialized());
+
+  frc::ADXL345_I2C accel{port};
+  EXPECT_NEAR(0, accel.GetX(), EPSILON);
+  EXPECT_NEAR(0, accel.GetY(), EPSILON);
+  EXPECT_NEAR(0, accel.GetZ(), EPSILON);
+  EXPECT_TRUE(xWrapper.IsWrapperInitialized());
+  EXPECT_TRUE(yWrapper.IsWrapperInitialized());
+  EXPECT_TRUE(zWrapper.IsWrapperInitialized());
+
+  xWrapper.SetAcceleration(1.45);
+  EXPECT_NEAR(1.45, accel.GetX(), EPSILON);
+  EXPECT_NEAR(0, accel.GetY(), EPSILON);
+  EXPECT_NEAR(0, accel.GetZ(), EPSILON);
+  EXPECT_NEAR(1.45, xWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(0, yWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(0, zWrapper.GetAcceleration(), EPSILON);
+
+  yWrapper.SetAcceleration(-.67);
+  EXPECT_NEAR(1.45, accel.GetX(), EPSILON);
+  EXPECT_NEAR(-.67, accel.GetY(), EPSILON);
+  EXPECT_NEAR(0, accel.GetZ(), EPSILON);
+  EXPECT_NEAR(1.45, xWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(-.67, yWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(0, zWrapper.GetAcceleration(), EPSILON);
+
+  zWrapper.SetAcceleration(2.42);
+  EXPECT_NEAR(1.45, accel.GetX(), EPSILON);
+  EXPECT_NEAR(-.67, accel.GetY(), EPSILON);
+  EXPECT_NEAR(2.42, accel.GetZ(), EPSILON);
+  EXPECT_NEAR(1.45, xWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(-.67, yWrapper.GetAcceleration(), EPSILON);
+  EXPECT_NEAR(2.42, zWrapper.GetAcceleration(), EPSILON);
+}
diff --git a/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/GyroSimulatorTest.cpp b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/GyroSimulatorTest.cpp
new file mode 100644
index 0000000..6cd0b2b
--- /dev/null
+++ b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/GyroSimulatorTest.cpp
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXRS450_SpiGyroWrapperData.h"
+#include "frc/ADXRS450_Gyro.h"
+#include "frc/AnalogGyro.h"
+#include "gtest/gtest.h"
+#include "lowfisim/wpisimulators/ADXRS450_SpiGyroSim.h"
+#include "lowfisim/wpisimulators/WpiAnalogGyroSim.h"
+
+void TestGyro(frc::sim::lowfi::GyroSim& sim, frc::Gyro& gyro) {
+  const double EPSILON = .00001;
+
+  EXPECT_NEAR(0, gyro.GetAngle(), EPSILON);
+  EXPECT_NEAR(0, sim.GetAngle(), EPSILON);
+
+  sim.SetAngle(45.13);
+  EXPECT_NEAR(45.13, gyro.GetAngle(), EPSILON);
+  EXPECT_NEAR(45.13, sim.GetAngle(), EPSILON);
+}
+
+TEST(GyroSimulatorTests, TestAnalogGyro) {
+  int port = 1;
+  frc::sim::lowfi::WpiAnalogGyroSim sim{port};
+  EXPECT_FALSE(sim.IsWrapperInitialized());
+
+  frc::AnalogGyro gyro{port};
+  EXPECT_TRUE(sim.IsWrapperInitialized());
+
+  TestGyro(sim, gyro);
+}
+
+TEST(GyroSimulatorTests, TestSpiGyro) {
+  frc::SPI::Port port = frc::SPI::kOnboardCS0;
+
+  frc::sim::lowfi::ADXRS450_SpiGyroSim sim{port};
+  EXPECT_FALSE(sim.IsWrapperInitialized());
+
+  frc::ADXRS450_Gyro gyro{port};
+  EXPECT_TRUE(sim.IsWrapperInitialized());
+
+  TestGyro(sim, gyro);
+}
diff --git a/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/MotorEncoderSimulatorTest.cpp b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/MotorEncoderSimulatorTest.cpp
new file mode 100644
index 0000000..83e9ddc
--- /dev/null
+++ b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/MotorEncoderSimulatorTest.cpp
@@ -0,0 +1,110 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "frc/Encoder.h"
+#include "frc/Talon.h"
+#include "gtest/gtest.h"
+#include "lowfisim/MotorEncoderConnector.h"
+#include "lowfisim/motormodel/SimpleMotorModel.h"
+#include "lowfisim/wpisimulators/WpiEncoderSim.h"
+#include "lowfisim/wpisimulators/WpiMotorSim.h"
+
+TEST(MotorEncoderConnectorTest, TestWithoutDistancePerPulseFullSpeed) {
+  frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
+  frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
+  frc::sim::lowfi::WpiEncoderSim encoderSim(0);
+  frc::sim::lowfi::MotorEncoderConnector connector(motorSim, encoderSim);
+
+  EXPECT_FALSE(motorSim.IsWrapperInitialized());
+  EXPECT_FALSE(encoderSim.IsWrapperInitialized());
+  frc::Talon talon{3};
+  frc::Encoder encoder{3, 1};
+  EXPECT_TRUE(motorSim.IsWrapperInitialized());
+  EXPECT_TRUE(encoderSim.IsWrapperInitialized());
+
+  talon.Set(-1);
+  motorSim.Update(1);
+  connector.Update();
+
+  // Position
+  EXPECT_EQ(-6000, encoder.Get());
+  EXPECT_DOUBLE_EQ(-6000, encoder.GetDistance());
+
+  // Velocity
+  EXPECT_DOUBLE_EQ(-1.0 / 6000, encoder.GetPeriod());
+  EXPECT_DOUBLE_EQ(-6000, encoder.GetRate());
+}
+
+TEST(MotorEncoderConnectorTest, TestWithoutDistancePerPulseRealisitcUpdate) {
+  frc::Talon talon{3};
+  frc::Encoder encoder{3, 1};
+
+  frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
+  frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
+  frc::sim::lowfi::WpiEncoderSim encoderSim(0);
+  frc::sim::lowfi::MotorEncoderConnector connector(motorSim, encoderSim);
+
+  talon.Set(0.5);
+  motorSim.Update(.02);
+  connector.Update();
+
+  // Position
+  EXPECT_EQ(60, encoder.Get());
+  EXPECT_DOUBLE_EQ(60, encoder.GetDistance());
+
+  // Velocity
+  EXPECT_DOUBLE_EQ(1.0 / 3000, encoder.GetPeriod());
+  EXPECT_DOUBLE_EQ(3000, encoder.GetRate());
+}
+
+TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseFullSpeed) {
+  frc::Talon talon{3};
+  frc::Encoder encoder{3, 1};
+  encoder.SetDistancePerPulse(.001);
+
+  frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
+  frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
+  frc::sim::lowfi::WpiEncoderSim encoderSim(0);
+  frc::sim::lowfi::MotorEncoderConnector connector(motorSim, encoderSim);
+
+  talon.Set(-1);
+
+  motorSim.Update(1);
+  connector.Update();
+
+  // Position
+  EXPECT_EQ(-6000000, encoder.Get());
+  EXPECT_DOUBLE_EQ(-6000, encoder.GetDistance());
+
+  // Velocity
+  EXPECT_EQ(-1.0 / 6000, encoder.GetPeriod());
+  EXPECT_DOUBLE_EQ(-6, encoder.GetRate());
+}
+
+TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseRealistic) {
+  frc::Talon talon{3};
+  frc::Encoder encoder{3, 1};
+  encoder.SetDistancePerPulse(.001);
+
+  frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
+  frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
+  frc::sim::lowfi::WpiEncoderSim encoderSim(0);
+  frc::sim::lowfi::MotorEncoderConnector connector(motorSim, encoderSim);
+
+  talon.Set(0.5);
+
+  motorSim.Update(.02);
+  connector.Update();
+
+  // Position
+  EXPECT_EQ(60000, encoder.Get());
+  EXPECT_DOUBLE_EQ(60, encoder.GetDistance());
+
+  // Velocity
+  EXPECT_EQ(1.0 / 3000, encoder.GetPeriod());
+  EXPECT_DOUBLE_EQ(3, encoder.GetRate());
+}
diff --git a/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/motormodel/SimpleMotorModelSimulationTest.cpp b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/motormodel/SimpleMotorModelSimulationTest.cpp
new file mode 100644
index 0000000..e60cf1e
--- /dev/null
+++ b/simulation/lowfi_simulation/src/test/native/cpp/lowfisim/motormodel/SimpleMotorModelSimulationTest.cpp
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "gtest/gtest.h"
+#include "lowfisim/motormodel/SimpleMotorModel.h"
+
+TEST(SimpleMotorModelSimulationTest, TestSimpleModel) {
+  frc::sim::lowfi::SimpleMotorModel motorModelSim(200);
+
+  // Test forward voltage
+  motorModelSim.SetVoltage(6);
+  motorModelSim.Update(.5);
+
+  EXPECT_DOUBLE_EQ(50, motorModelSim.GetPosition());
+  EXPECT_DOUBLE_EQ(100, motorModelSim.GetVelocity());
+
+  // Test Reset
+  motorModelSim.Reset();
+  EXPECT_DOUBLE_EQ(0, motorModelSim.GetPosition());
+  EXPECT_DOUBLE_EQ(0, motorModelSim.GetVelocity());
+
+  // Test negative voltage
+  motorModelSim.Reset();
+  motorModelSim.SetVoltage(-3);
+  motorModelSim.Update(.06);
+
+  EXPECT_DOUBLE_EQ(-3, motorModelSim.GetPosition());
+  EXPECT_DOUBLE_EQ(-50, motorModelSim.GetVelocity());
+}
diff --git a/simulation/lowfi_simulation/src/test/native/cpp/main.cpp b/simulation/lowfi_simulation/src/test/native/cpp/main.cpp
new file mode 100644
index 0000000..0e00efa
--- /dev/null
+++ b/simulation/lowfi_simulation/src/test/native/cpp/main.cpp
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <hal/HAL.h>
+
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+  HAL_Initialize(500, 0);
+  ::testing::InitGoogleTest(&argc, argv);
+  int ret = RUN_ALL_TESTS();
+  return ret;
+}