gestion de servomoteur individuelement, et du message ROS associe

Dependents:   stm32_actuator_gobeur

Files at this revision

API Documentation at this revision

Comitter:
kyxstark
Date:
Thu Jul 08 22:46:14 2021 +0000
Parent:
4:de7ca80dbe4b
Commit message:
peut de modif

Changed in this revision

Manche_a_air.cpp Show annotated file Show diff for this revision Revisions of this file
Manche_a_air.h Show annotated file Show diff for this revision Revisions of this file
--- a/Manche_a_air.cpp	Thu Jul 08 16:43:25 2021 +0000
+++ b/Manche_a_air.cpp	Thu Jul 08 22:46:14 2021 +0000
@@ -36,11 +36,12 @@
     switch(_state)
     {
         case closed:
-            if( (_order == open && 0) ||  (  (elapsed>_timeout_auto_open) && _flag_auto_open  )  )
+            if( (_order == open && 1) ||  (  (elapsed>_timeout_auto_open) && _flag_auto_open  )  )
             {
                  _state = opening;
                  *_servo = _servo_open;
                  _time = clock_s();
+                 _order = open;
             }
             break;
         case opening:
@@ -51,11 +52,12 @@
             }
             break;
         case opened:
-            if(  (_order == close && 0) || (  (elapsed>_timeout_auto_close) && _flag_auto_close  ) )
+            if(  (_order == close && 1) || (  (elapsed>_timeout_auto_close) && _flag_auto_close  ) )
             {
                  _state = closing;
                  *_servo = _servo_close;
                  _time = clock_s();
+                 _order = close;
             }
             break;
         case closing:
--- a/Manche_a_air.h	Thu Jul 08 16:43:25 2021 +0000
+++ b/Manche_a_air.h	Thu Jul 08 22:46:14 2021 +0000
@@ -15,7 +15,7 @@
 
 
 
-namespace manche_a_air_node
+namespace stm32_actuators_node
 {
 
   class Manche_a_air_msg : public ros::Msg
@@ -52,7 +52,7 @@
             return offset;
         }
     
-        const char * getType(){ return "manche_a_air_node/Manche_a_air_msg"; };
+        const char * getType(){ return "stm32_actuators/Manche_a_air_msg"; };
         const char * getMD5(){ return "33a9b4e076016e58fe35593be08a2827"; };
 
   };
@@ -60,7 +60,7 @@
 }
 
 
-void maa_trait_msg(const manche_a_air_node::Manche_a_air_msg& manche_a_air_msg);
+void maa_trait_msg(const stm32_actuators_node::Manche_a_air_msg& manche_a_air_msg);