mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
add UML diagram for system architecture and clean up MQTT client initialization
This commit is contained in:
51
docs/Infrastructure/uml.md
Normal file
51
docs/Infrastructure/uml.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
```mermaid
|
||||||
|
classDiagram
|
||||||
|
class CKobuki {
|
||||||
|
+enableCommands(bool commands)
|
||||||
|
+loop(void *user_data, TKobukiData &Kobuki_data)
|
||||||
|
+startCommunication(char *portname, bool CommandsEnabled, void *userDataL)
|
||||||
|
+measure()
|
||||||
|
+setLed(int led1, int led2)
|
||||||
|
+setTranslationSpeed(int mmpersec)
|
||||||
|
+setRotationSpeed(double radpersec)
|
||||||
|
+setArcSpeed(int mmpersec, int radius)
|
||||||
|
+setSound(int noteinHz, int duration)
|
||||||
|
+setPower(int value)
|
||||||
|
+goStraight(long double distance)
|
||||||
|
+forward(int speedvalue)
|
||||||
|
+doRotation(long double th)
|
||||||
|
}
|
||||||
|
|
||||||
|
class FlaskApp {
|
||||||
|
+on_message(client, message)
|
||||||
|
+get_db()
|
||||||
|
+close_db(error)
|
||||||
|
+index()
|
||||||
|
+control()
|
||||||
|
+move()
|
||||||
|
}
|
||||||
|
|
||||||
|
class MQTTClient {
|
||||||
|
+connect()
|
||||||
|
+subscribe(topic)
|
||||||
|
+getLastMessage()
|
||||||
|
+isConnected()
|
||||||
|
}
|
||||||
|
|
||||||
|
FlaskApp --> MQTTClient : uses
|
||||||
|
FlaskApp --> CKobuki : controls
|
||||||
|
|
||||||
|
class RPI {
|
||||||
|
+KobukiCommunication()
|
||||||
|
+ESP32Communication()
|
||||||
|
+Camera()
|
||||||
|
}
|
||||||
|
|
||||||
|
class ESP32 {
|
||||||
|
+TVOC()
|
||||||
|
+DHT11()
|
||||||
|
}
|
||||||
|
|
||||||
|
RPI --> MQTTClient : communicates
|
||||||
|
MQTTClient --> CKobuki : communicates
|
||||||
|
RPI --> ESP32 : communicates
|
@@ -16,8 +16,7 @@ std::string readMQTT();
|
|||||||
void parseMQTT(std::string message);
|
void parseMQTT(std::string message);
|
||||||
void CapnSend();
|
void CapnSend();
|
||||||
// ip, clientID, username, password
|
// ip, clientID, username, password
|
||||||
MqttClient client("ws://145.92.224.21/ws/", "KobukiRPI", "rpi",
|
MqttClient client("ws://145.92.224.21/ws/", "KobukiRPI", "rpi","rpiwachtwoordofzo"); // create a client object
|
||||||
"rpiwachtwoordofzo"); // create a client object
|
|
||||||
std::string message = "stop";
|
std::string message = "stop";
|
||||||
std::string serializeKobukiData(const TKobukiData &data);
|
std::string serializeKobukiData(const TKobukiData &data);
|
||||||
void sendKobukiData(TKobukiData &data);
|
void sendKobukiData(TKobukiData &data);
|
||||||
|
Reference in New Issue
Block a user