From 4956dfb3efbd85d4c36cec61c642f7ccdfa4852a Mon Sep 17 00:00:00 2001 From: Arnaud Cadot Date: Thu, 17 Mar 2016 19:08:30 +0100 Subject: [PATCH] Added FishingNet class for KJ (WIP) --- .../paprikaSimulateur/paprikaSimulateur.pro | 6 ++- stm32/include/actionneurs/fishingNet.h | 45 +++++++++++++++++++ stm32/paprika_krabi_h107.cbp | 5 +++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 stm32/include/actionneurs/fishingNet.h diff --git a/simulation/qtcreator-files/paprikaSimulateur/paprikaSimulateur.pro b/simulation/qtcreator-files/paprikaSimulateur/paprikaSimulateur.pro index f275f31a..0fe5aa40 100644 --- a/simulation/qtcreator-files/paprikaSimulateur/paprikaSimulateur.pro +++ b/simulation/qtcreator-files/paprikaSimulateur/paprikaSimulateur.pro @@ -104,7 +104,8 @@ HEADERS += \ ../../include/initialisation.h \ ../../include/vector.h \ ../../include/strategie/krabijunior2016.h \ - ../../include/strategie/krabi2016.h + ../../include/strategie/krabi2016.h \ + ../../stm32/include/actionneurs/fishingNet.h SOURCES += \ @@ -183,7 +184,8 @@ SOURCES += \ ../../src/strategie/krabijunior2016.cpp \ ../../src/strategie/krabi2016.cpp \ ../../src/strategie/cabine.cpp \ - ../../src/strategie/zoneConstruction.cpp + ../../src/strategie/zoneConstruction.cpp \ + ../../src/actionneurs/fishingNet.cpp FORMS += \ ../../include/simul/remotedebug.ui \ diff --git a/stm32/include/actionneurs/fishingNet.h b/stm32/include/actionneurs/fishingNet.h new file mode 100644 index 00000000..62cf10cb --- /dev/null +++ b/stm32/include/actionneurs/fishingNet.h @@ -0,0 +1,45 @@ +#ifndef FICHINGNET_H +#define FICHINGNET_H + +class FishingNet +{ + static const int SERVO_INT_ID = 0; // To update + static const int SERVO_EXT_ID = 1; + + static const int SERVO_EXT_CLOSED_POS = 0x00; + static const int SERVO_EXT_DEPLOYED_POS = 0x00; + static const int SERVO_EXT_RAISED_POS = 0x00; + + static const int SERVO_INT_RAISED_POS = 0x00; + static const int SERVO_INT_LOWERED_POS = 0x00; + + public: + FishingNet(); + + enum NET_STATE + { + CLOSED, + OPENED, + RAISED, + NET_LOWERED + }; + + static FishingNet* getSingleton(); + + void close(); + void deploy(); + + void lowerNet(); + void raiseNet(); + + void raiseArm(); + + private: + + void moveArm(int destAngle); + void rotateArm(int destAngle); + + NET_STATE m_currentState; +}; + +#endif diff --git a/stm32/paprika_krabi_h107.cbp b/stm32/paprika_krabi_h107.cbp index cdddd498..2ef58317 100644 --- a/stm32/paprika_krabi_h107.cbp +++ b/stm32/paprika_krabi_h107.cbp @@ -75,6 +75,8 @@ + + @@ -134,6 +136,7 @@ + @@ -144,6 +147,7 @@ + @@ -209,6 +213,7 @@ + -- GitLab