WRS2020用にメカナム台車をROS化

Dependencies:   mbed PID2 JY901 QuaternionMath ros_lib_melodic i2cmaster WRS2020_mecanum_node

Dependents:   WRS2020_mecanum_node

Revision:
1:b20c9bcfb254
Parent:
0:c177452db984
Child:
3:cf06189a7511
--- a/robot_operator.h	Mon Nov 02 09:00:16 2020 +0000
+++ b/robot_operator.h	Mon Nov 02 11:25:53 2020 +0000
@@ -69,6 +69,8 @@
 int path = 0;
 int pathSize;
 
+bool bool_tmp = true;
+bool *is_stop_ptr_ = &bool_tmp;
 
 Timer timer2;
 PID pid_x(&timer2);
@@ -101,8 +103,10 @@
     }
 }
 
-void moveStart(float pose_x, float pose_y, float pose_theta)
+void moveStart(float pose_x, float pose_y, float pose_theta, bool* is_stop_pointer)
 {
+    is_stop_ptr_ = is_stop_pointer;
+    *is_stop_ptr_ = false;
     pid_x.setParameter(0.40, 0.0, 0.0);
     pid_y.setParameter(0.40, 0.0, 0.0);
     pid_theta.setParameter(0.10, 0.0, 0.0);
@@ -116,6 +120,7 @@
 void moveStop()
 {
     ticker_pose_controll.detach();
+    *is_stop_ptr_ = true;
 }
 
 void pose_controll()
@@ -155,6 +160,6 @@
         jy901.reset();
         
         // 制御を停止
-        ticker_pose_controll.detach();
+        moveStop();
     }
 }