main

Dependents:   00_yotsuba 200_yotsuba_21 200_yotuba_21_uiChange

Revision:
0:3f87ec23c3cf
Child:
1:6a5065829cfc
diff -r 000000000000 -r 3f87ec23c3cf robot.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/robot.cpp	Thu Jan 30 10:24:20 2020 +0000
@@ -0,0 +1,51 @@
+#include "robot.h"
+
+robot::robot()
+    : spin(P, I, D, interval)
+{
+    omni.wheel[0].setRadian(PI/4 * 1);
+    omni.wheel[1].setRadian(PI/4 * 3);
+    omni.wheel[2].setRadian(PI/4 * 5);
+    omni.wheel[3].setRadian(PI/4 * 7);
+    motor[0] = new kohiMD(PA_6);
+    motor[1] = new kohiMD(PA_7);
+    motor[2] = new kohiMD(PA_9);
+    motor[3] = new kohiMD(PB_10);
+    pid1.setInputLimits(-180,180);
+    pid1.setOutputLimits(-0.3,0.3);
+    pid1.setBias(0);
+    pid1.setMode(1);
+    pid1.setSetPoint(0);
+}
+
+void robot::chaseBall(float ball_theta, float r)
+{
+    omni.compute();
+}
+
+void robot::searchBall()
+{
+    
+}
+
+void robot::moveGoal(float r, float goal_size, float goal_)
+{
+    
+}
+
+void robot::detour()
+{
+    
+}
+
+void robot::outLine(float r, line)
+{
+    
+}
+
+
+
+void robot::shotBall()
+{
+    
+}
\ No newline at end of file