copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/common/commonmath.h b/aos/common/commonmath.h
new file mode 100644
index 0000000..a77210f
--- /dev/null
+++ b/aos/common/commonmath.h
@@ -0,0 +1,18 @@
+#ifndef AOS_COMMON_MATH_H_
+#define AOS_COMMON_MATH_H_
+
+namespace aos {
+
+// Clips a value so that it is in [min, max]
+inline double Clip(double value, double min, double max) {
+ if (value > max) {
+ value = max;
+ } else if (value < min) {
+ value = min;
+ }
+ return value;
+}
+
+} // namespace aos
+
+#endif // AOS_COMMON_MATH_H_