From 54e84e4b5d049a943d91f9eed6d4aa307d5e3948 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 7 Dec 2021 23:35:15 +0100 Subject: [PATCH] some stuff --- .gitignore | 2 + debugMqtt/rhede/main.py | 3 +- debugMqtt/rhede/main_debug.py | 3 +- doc/statesAutopilot.uxf | 401 +++++++++++++++++++++++++++++++++- src/config.h | 2 +- src/main.cpp | 6 +- 6 files changed, 399 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 89cc49c..f6d85db 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch + +workspace.code-workspace \ No newline at end of file diff --git a/debugMqtt/rhede/main.py b/debugMqtt/rhede/main.py index 912df6a..af65384 100644 --- a/debugMqtt/rhede/main.py +++ b/debugMqtt/rhede/main.py @@ -21,6 +21,7 @@ if __name__ == '__main__': client.on_connect = on_connect client.on_message = on_message - client.connect("192.168.1.2", 1883, 60) + client.username_pw_set("kleiax", password="p?{$_~5%hBM7wrcFkr55KWr#") + client.connect("192.168.1.7", 1883, 60) client.loop_forever() diff --git a/debugMqtt/rhede/main_debug.py b/debugMqtt/rhede/main_debug.py index 98f4087..27599f1 100644 --- a/debugMqtt/rhede/main_debug.py +++ b/debugMqtt/rhede/main_debug.py @@ -18,6 +18,7 @@ if __name__ == '__main__': client.on_connect = on_connect client.on_message = on_message - client.connect("192.168.1.2", 1883, 60) + client.username_pw_set("kleiax", password="p?{$_~5%hBM7wrcFkr55KWr#") + client.connect("192.168.1.7", 1883, 60) client.loop_forever() diff --git a/doc/statesAutopilot.uxf b/doc/statesAutopilot.uxf index 32eec97..21f880d 100644 --- a/doc/statesAutopilot.uxf +++ b/doc/statesAutopilot.uxf @@ -1,13 +1,390 @@ -10UMLSpecialState40202020type=initialRelation402013030lt=<-110;10;10;10UMLState1501010040search next point -bg=greenUMLSpecialState180904040bg=green -type=decisionRelation190403070lt=<-10;50;10;10UMLState15018010040detect alignment -bg=greenRelation19012012080lt=<- -[distance <= 5m]10;60;10;10UMLObject200840590Autopilot + + + 10 + + UMLSpecialState + + 40 + 20 + 20 + 20 + + type=initial + + + + Relation + + 40 + 20 + 130 + 30 + + lt=<- + 110.0;10.0;10.0;10.0 + + + UMLState + + 150 + 10 + 100 + 40 + + search next point +bg=green + + + + UMLSpecialState + + 180 + 90 + 40 + 40 + + bg=green +type=decision + + + + Relation + + 190 + 40 + 30 + 70 + + lt=<- + 10.0;50.0;10.0;10.0 + + + UMLState + + 150 + 180 + 100 + 40 + + detect alignment +bg=green + + + + Relation + + 190 + 120 + 130 + 80 + + lt=<- +[distance <= 5m] + 10.0;60.0;10.0;10.0 + + + UMLObject + + 20 + 0 + 840 + 590 + + Autopilot -valign=topRelation2109014040lt=<- -[distance > 5m]120;20;10;20UMLState3309010040Error -bg=redUMLState15027010040correct alignment -bg=greenUMLState15036010040drive to point -bg=greenRelation1902103080lt=<-10;60;10;10Relation1903003080lt=<-10;60;10;10Relation9028080120lt=<-60;10;10;10;10;100;60;100UMLState44010410300detect alignment -valign=topUMLSpecialState460602020type=finalRelation470609030lt=->10;10;70;10UMLState5405011040drive 1m forwardUMLState54014011040drive 2m backwardUMLState54023011040drive 1m forwardUMLState70023012040calculate straight lineRelation580803080lt=<-10;60;10;10Relation5801703080lt=<-10;60;10;10Relation6205808030lt=<-60;10;10;10UMLSpecialState7501502020type=terminationRelation7501603090lt=<-10;10;10;70UMLState440320410260correct alignment -valign=topUMLState54037019040calculate relativ target positionRelation4703809030lt=->10;10;70;10UMLSpecialState4603802020type=finalUMLState58046012040rotate x degreeRelation6304003080lt=<-10;60;10;10Relation6304903080lt=<-10;60;10;10UMLSpecialState6305502020type=termination \ No newline at end of file +valign=top + + + + Relation + + 210 + 90 + 140 + 40 + + lt=<- +[distance > 5m] + 120.0;20.0;10.0;20.0 + + + UMLState + + 330 + 90 + 100 + 40 + + Error +bg=red + + + + UMLState + + 150 + 270 + 100 + 40 + + correct alignment +bg=green + + + + UMLState + + 150 + 360 + 100 + 40 + + drive to point +bg=green + + + + Relation + + 190 + 210 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + Relation + + 190 + 300 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + Relation + + 90 + 280 + 80 + 120 + + lt=<- + 60.0;10.0;10.0;10.0;10.0;100.0;60.0;100.0 + + + UMLState + + 440 + 10 + 410 + 300 + + detect alignment +valign=top + + + + UMLSpecialState + + 460 + 60 + 20 + 20 + + type=final + + + + Relation + + 470 + 60 + 90 + 30 + + lt=-> + 10.0;10.0;70.0;10.0 + + + UMLState + + 540 + 50 + 110 + 40 + + drive 1m forward + + + + UMLState + + 540 + 140 + 110 + 40 + + drive 2m backward + + + + UMLState + + 540 + 230 + 110 + 40 + + drive 1m forward + + + + UMLState + + 700 + 230 + 120 + 40 + + calculate straight line + + + + Relation + + 580 + 80 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + Relation + + 580 + 170 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + UMLSpecialState + + 750 + 150 + 20 + 20 + + type=termination + + + + Relation + + 750 + 160 + 30 + 90 + + lt=<- + 10.0;10.0;10.0;70.0 + + + UMLState + + 440 + 320 + 410 + 260 + + correct alignment +valign=top + + + + UMLState + + 540 + 370 + 190 + 40 + + calculate relativ target position + + + + Relation + + 470 + 380 + 90 + 30 + + lt=-> + 10.0;10.0;70.0;10.0 + + + UMLSpecialState + + 460 + 380 + 20 + 20 + + type=final + + + + UMLState + + 580 + 460 + 120 + 40 + + rotate x degree + + + + Relation + + 630 + 400 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + Relation + + 630 + 490 + 30 + 80 + + lt=<- + 10.0;60.0;10.0;10.0 + + + UMLSpecialState + + 630 + 550 + 20 + 20 + + type=termination + + + diff --git a/src/config.h b/src/config.h index dc75ef9..1bfd71e 100644 --- a/src/config.h +++ b/src/config.h @@ -71,7 +71,7 @@ // PS3 Controller // ESP32 MAC BL 24:62:AB:F2:4B:3A -#define HW1 +#define RHEDE //Network config RHEDE #ifdef RHEDE diff --git a/src/main.cpp b/src/main.cpp index 7d06c72..c7792a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ ConsolControl consolControl; IPAddress local_IP(WLAN_IP); IPAddress gateway(WLAN_GATEWAY); IPAddress subnet(WLAN_SUBNETMASK); -// IPAddress mqtt_server(MQTT_SERVER); +IPAddress mqtt_server(MQTT_SERVER); WiFiClient wifi_client; PubSubClient mqtt_client(wifi_client); @@ -73,8 +73,8 @@ void setup() { Serial.println("IP address: "); Serial.println(WiFi.localIP()); - // mqtt_client.setServer(mqtt_server, MQTT_PORT); - mqtt_client.setServer(MQTT_SERVER, MQTT_PORT); + mqtt_client.setServer(mqtt_server, MQTT_PORT); + // mqtt_client.setServer(MQTT_SERVER, MQTT_PORT); mqtt_client.setSocketTimeout(1); reconnectMqtt();