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/frc971/atom_code/atom_code.gyp b/frc971/atom_code/atom_code.gyp
new file mode 100644
index 0000000..d727036
--- /dev/null
+++ b/frc971/atom_code/atom_code.gyp
@@ -0,0 +1,28 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'All',
+ 'type': 'none',
+ 'dependencies': [
+ '<(AOS)/build/aos_all.gyp:Atom',
+ '../control_loops/control_loops.gyp:DriveTrain',
+ '../input/input.gyp:JoystickReader',
+ '../input/input.gyp:SensorReader',
+ '../input/input.gyp:GyroReader',
+ '../input/input.gyp:AutoMode',
+ '../output/output.gyp:MotorWriter',
+ '../output/output.gyp:CameraServer',
+ 'camera/camera.gyp:frc971',
+ ],
+ 'copies': [
+ {
+ 'destination': '<(rsync_dir)',
+ 'files': [
+ 'scripts/aos_module.ko',
+ 'scripts/start_list.txt',
+ ],
+ },
+ ],
+ },
+ ],
+}
diff --git a/frc971/atom_code/build.sh b/frc971/atom_code/build.sh
new file mode 100755
index 0000000..d1dff19
--- /dev/null
+++ b/frc971/atom_code/build.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+../../aos/build/build.sh atom atom_code.gyp no $1
diff --git a/frc971/atom_code/camera/camera.gyp b/frc971/atom_code/camera/camera.gyp
new file mode 100644
index 0000000..6dc9530
--- /dev/null
+++ b/frc971/atom_code/camera/camera.gyp
@@ -0,0 +1,30 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'frc971_camera',
+ 'variables': {
+ 'srcdirs': ['.'],
+ 'manifest': 'frc971_camera.mf',
+ },
+ 'dependencies': [
+ '<(AOS)/atom_code/camera/camera.gyp:aos_camera',
+ '<(DEPTH)/frc971/queues/queues.gyp:frc971_queues_so',
+ ],
+ 'export_dependent_settings': [
+ '<(AOS)/atom_code/camera/camera.gyp:aos_camera',
+ '<(DEPTH)/frc971/queues/queues.gyp:frc971_queues_so',
+ ],
+ 'includes': ['../../../aos/build/java.gypi'],
+ },
+ {
+ 'target_name': 'frc971',
+ 'variables': {
+ 'main_jar': 'frc971_camera',
+ },
+ 'dependencies': [
+ 'frc971_camera',
+ ],
+ 'includes': ['../../../aos/build/onejar.gypi'],
+ },
+ ],
+}
diff --git a/frc971/atom_code/camera/frc971_camera.mf b/frc971/atom_code/camera/frc971_camera.mf
new file mode 100644
index 0000000..e3929a2
--- /dev/null
+++ b/frc971/atom_code/camera/frc971_camera.mf
@@ -0,0 +1,2 @@
+Main-Class: org.spartanrobotics.camera.Test
+
diff --git a/frc971/atom_code/camera/org/spartanrobotics/camera/QueueReader.java b/frc971/atom_code/camera/org/spartanrobotics/camera/QueueReader.java
new file mode 100644
index 0000000..347b0c2
--- /dev/null
+++ b/frc971/atom_code/camera/org/spartanrobotics/camera/QueueReader.java
@@ -0,0 +1,16 @@
+package org.spartanrobotics.camera;
+
+import aos.NativeLoader;
+import aos.QueueLogHandler;
+import frc971.control_loops.Piston_q;
+
+public class QueueReader {
+
+ public static void main(String[] args) {
+ QueueLogHandler.UseForAll();
+ NativeLoader.load("frc971_queues_so");
+ System.out.println(Piston_q.shifters.FetchLatest());
+ System.out.println(Piston_q.shifters.getSet());
+ }
+
+}
diff --git a/frc971/atom_code/camera/org/spartanrobotics/camera/QueueTest.java b/frc971/atom_code/camera/org/spartanrobotics/camera/QueueTest.java
new file mode 100644
index 0000000..a71f447
--- /dev/null
+++ b/frc971/atom_code/camera/org/spartanrobotics/camera/QueueTest.java
@@ -0,0 +1,15 @@
+package org.spartanrobotics.camera;
+
+import aos.NativeLoader;
+import aos.QueueLogHandler;
+import frc971.control_loops.Piston_q;
+
+public class QueueTest {
+
+ public static void main(String[] args) {
+ QueueLogHandler.UseForAll();
+ NativeLoader.load("frc971_queues_so");
+ Piston_q.shifters.SafeMakeWithBuilder().set(false).Send();
+ }
+
+}
diff --git a/frc971/atom_code/camera/org/spartanrobotics/camera/Test.java b/frc971/atom_code/camera/org/spartanrobotics/camera/Test.java
new file mode 100644
index 0000000..86c06bc
--- /dev/null
+++ b/frc971/atom_code/camera/org/spartanrobotics/camera/Test.java
@@ -0,0 +1,44 @@
+package org.spartanrobotics.camera;
+
+import java.io.IOException;
+import com.googlecode.javacv.cpp.opencv_core;
+import com.googlecode.javacv.cpp.opencv_core.CvPoint;
+import com.googlecode.javacv.cpp.opencv_core.CvScalar;
+import com.googlecode.javacv.cpp.opencv_core.IplImage;
+import com.googlecode.javacv.cpp.opencv_imgproc;
+
+import aos.CameraProcessor;
+import aos.DebugServer;
+import aos.ImageGetter;
+import aos.ServableImage;
+import aos.Thresholder;
+
+public class Test extends CameraProcessor {
+ private final DebugServer server = new DebugServer(9719);
+ private final IplImage hsv = IplImage.create(ImageGetter.width, ImageGetter.height, opencv_core.IPL_DEPTH_8U, 3);
+ private final ServableImage thresholded = new ServableImage(ImageGetter.width, ImageGetter.height, opencv_core.IPL_DEPTH_8U, 1);
+
+ private Test(String[] args) throws IOException {
+ super(args);
+
+ server.addImage("/start", start);
+ server.addImage("/thresholded", thresholded, new DebugServer.Palette().add(0, 0, 0, 0).add(0, 0xFF, 0, 0xFF).add(0, 0, 0xFF, 0xFF));
+ }
+
+ @Override
+ protected void RunIteration() {
+ server.setTimestamp(getter.getTimestamp());
+
+ opencv_imgproc.cvCvtColor(start.getImage(), hsv, opencv_imgproc.CV_RGB2HSV);
+ Thresholder.threshold(hsv, thresholded.getImage(), 0, 100, 160, 0, 255, 0, 255);
+ thresholded.recordSnapshot(1);
+ if (thresholded.isDebugging()) {
+ opencv_core.cvCircle(thresholded.getImage(), new CvPoint(200, 200), 50, new CvScalar(2, 2, 2, 2), 5, 8, 0);
+ }
+ thresholded.releaseImage();
+ }
+
+ public static void main(String[] args) throws IOException {
+ new Test(args).Run();
+ }
+}
diff --git a/frc971/atom_code/scripts/aos_module.ko b/frc971/atom_code/scripts/aos_module.ko
new file mode 100644
index 0000000..cdaddb7
--- /dev/null
+++ b/frc971/atom_code/scripts/aos_module.ko
Binary files differ
diff --git a/frc971/atom_code/scripts/start_list.txt b/frc971/atom_code/scripts/start_list.txt
new file mode 100644
index 0000000..6bbcd70
--- /dev/null
+++ b/frc971/atom_code/scripts/start_list.txt
@@ -0,0 +1,15 @@
+MotorWriter
+JoystickReader
+SensorReader
+GyroReader
+DriveTrain
+WristMotor
+IntakeRollers
+HorizontalRoller
+VerticalRoller
+AutoMode
+BinaryLogReader
+CRIOLogReader
+CameraReader
+CameraServer
+CameraHTTPStreamer