diff --git a/ADIS_ESP32_Eclipse/main/CMakeLists.txt b/ADIS_ESP32_Eclipse/main/CMakeLists.txt index 8c9f0dc..c24aa9a 100644 --- a/ADIS_ESP32_Eclipse/main/CMakeLists.txt +++ b/ADIS_ESP32_Eclipse/main/CMakeLists.txt @@ -21,6 +21,7 @@ idf_component_register( "splitflap_wrapper.c" "challenge_com.c" "challenge_nvs.c" + "robo_wrapper.c" INCLUDE_DIRS "." diff --git a/ADIS_ESP32_Eclipse/main/challenge_com.c b/ADIS_ESP32_Eclipse/main/challenge_com.c index 6b06fc1..89003fc 100644 --- a/ADIS_ESP32_Eclipse/main/challenge_com.c +++ b/ADIS_ESP32_Eclipse/main/challenge_com.c @@ -23,6 +23,9 @@ const char MQTT_TOPIC_SF_DISPLAY[] = "/splitFlap/cmd/display/"; const char MQTT_TOPIC_SF_INITALL[] = "/splitFlap/cmd/init/"; const char MQTT_TOPIC_SF_CONFIG_SETUP[] = "/splitFlap/config/setup/"; +const char MQTT_TOPIC_ROBO_MODE[] = "/mobile/cmd/mode/"; +const char MQTT_TOPIC_ROBO_NAV_TURN[] = "/mobile/cmd/nav/turn"; +const char MQTT_TOPIC_ROBO_NAV_STOP[] = "/mobile/cmd/nav/stop"; void Challenge_Com_ParseMqtt(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data){ /* INFO @@ -99,7 +102,18 @@ void Challenge_Com_ParseMqtt(void *handler_args, esp_event_base_t base, int32_t } /* mobile robot allowed commands */ else{ + // CMD: ROBO MOBILE MODE + if(McuUtility_strcmp(topic, MQTT_TOPIC_ROBO_MODE)==0){ + } + // CMD: ROBO MOBILE NAV TURN + else if(McuUtility_strcmp(topic, MQTT_TOPIC_ROBO_NAV_TURN)==0){ + + } + // CMD: ROBO MOBILE NAV STOP + else if(McuUtility_strcmp(topic, MQTT_TOPIC_ROBO_NAV_STOP)==0){ + + } } /* both robot modes allowed commands */ diff --git a/ADIS_ESP32_Eclipse/main/robo_wrapper.c b/ADIS_ESP32_Eclipse/main/robo_wrapper.c new file mode 100644 index 0000000..819af40 --- /dev/null +++ b/ADIS_ESP32_Eclipse/main/robo_wrapper.c @@ -0,0 +1,28 @@ +/* + * robo_wrapper.c + * + * Created on: 09.12.2022 + * Author: jonas + */ + +/* Sets the robot to automatic / manual mode */ +bool Robo_Wrapper_SetMode(bool automatic){ + +} + +/* Lets the robot turn to a specific angle and then proceed straight with its previous movement */ +bool Robo_Wrapper_Nav_Turn(int16_t angle){ + +} + + + +/* Sets the movementspeed of the robot */ +bool Robo_Wrapper_Nav_Move(int16_t speed){ + +} + +/* Stops the movement of the robot */ +bool Robo_Wrapper_Nav_Stop(void){ + +} diff --git a/ADIS_ESP32_Eclipse/main/robo_wrapper.h b/ADIS_ESP32_Eclipse/main/robo_wrapper.h new file mode 100644 index 0000000..a61c8c5 --- /dev/null +++ b/ADIS_ESP32_Eclipse/main/robo_wrapper.h @@ -0,0 +1,26 @@ +/* + * robo_wrapper.h + * + * Created on: 09.12.2022 + * Author: jonas + */ + +#ifndef MAIN_ROBO_WRAPPER_H_ +#define MAIN_ROBO_WRAPPER_H_ + +#include +#include + +/* Sets the robot to automatic / manual mode */ +bool Robo_Wrapper_SetMode(bool automatic); + +/* Lets the robot turn to a specific angle and then proceed straight with its previous movement */ +bool Robo_Wrapper_Nav_Turn(int16_t angle); + +/* Sets the movementspeed of the robot */ +bool Robo_Wrapper_Nav_Move(int16_t speed); + +/* Stops the movement of the robot */ +bool Robo_Wrapper_Nav_Stop(void); + +#endif /* MAIN_ROBO_WRAPPER_H_ */