From f589e5c3a66f6de1c7082ffb93dd10f06e50679c Mon Sep 17 00:00:00 2001 From: Akram Date: Tue, 30 Jul 2024 01:24:00 +0200 Subject: [PATCH] Removing the training status from the application architecture and correcting the spelling --- .../Application.plantuml | 17 +-- .../DrivingState.plantuml | 21 ++-- .../ReinforcementLearning/ReadyState.plantuml | 6 +- .../TrainigState.plantuml | 104 ------------------ .../SystemStates.plantuml | 12 +- 5 files changed, 19 insertions(+), 141 deletions(-) delete mode 100644 doc/architecture/uml/LogicalView/ReinforcementLearning/TrainigState.plantuml diff --git a/doc/architecture/uml/LogicalView/ReinforcementLearning/Application.plantuml b/doc/architecture/uml/LogicalView/ReinforcementLearning/Application.plantuml index 9472ec70..fa30b1de 100644 --- a/doc/architecture/uml/LogicalView/ReinforcementLearning/Application.plantuml +++ b/doc/architecture/uml/LogicalView/ReinforcementLearning/Application.plantuml @@ -41,18 +41,17 @@ package "Application" as appLayer { class MotorSpeedCalibrationState <> class LineSensorsCalibrationState <> class ErrorState <> - class DringState <> + class DrivingState <> class ReadyState <> - class TrainingState <> note bottom of StartupState The system starts up and shows - the Applikation name on the display. + the Application name on the display. end note note bottom of MotorSpeedCalibrationState The robot drives with full speed forward - and with full speed backwar to determine + and with full speed backwards to determine the max speed in steps/s. The slowest motor is considered! end note @@ -68,7 +67,7 @@ package "Application" as appLayer { Confirmation from operator is requested. end note - note bottom of DringState + note bottom of DrivingState The robot follows the line. end note @@ -76,10 +75,6 @@ package "Application" as appLayer { The robot is stopped and waits for operator input. end note - - note bottom of TrainingState - the robot trains to follow the line. - end note } note top of appLayer @@ -88,7 +83,6 @@ note top of appLayer end note App *--> StateMachine - StateMachine o--> "0..1" IState IState <|.. StartupState: <> @@ -96,8 +90,7 @@ IState <|.... MotorSpeedCalibrationState: <> IState <|.. LineSensorsCalibrationState: <> IState <|.... ErrorState: <> IState <|.. ReadyState: <> -IState <|.... TrainingState: <> -IState <|.... DringState: <> +IState <|.... DrivingState: <> @enduml \ No newline at end of file diff --git a/doc/architecture/uml/LogicalView/ReinforcementLearning/DrivingState.plantuml b/doc/architecture/uml/LogicalView/ReinforcementLearning/DrivingState.plantuml index abf49700..d082dc0f 100644 --- a/doc/architecture/uml/LogicalView/ReinforcementLearning/DrivingState.plantuml +++ b/doc/architecture/uml/LogicalView/ReinforcementLearning/DrivingState.plantuml @@ -4,7 +4,7 @@ title Driving State package "Application" as appLayer { - class RacingState <> { + class DrivingState <> { + {static} getInstance() : DrivingState + entry() : void + process(sm : StateMachine&) : void @@ -13,8 +13,7 @@ package "Application" as appLayer { class ReadyState <> - RacingState .r.> ReadyState: <> - + DrivingState .r.> ReadyState: <> } package "Service" as serviceLayer { @@ -94,12 +93,12 @@ package "HAL" as hal { } } -RacingState *-> SimpleTimer -RacingState ..> DifferentialDrive: <> -RacingState ...> IDisplay: <> -RacingState ...> ILineSensors: <> -RacingState ...> ILed: <> -RacingState ...> Board: <> -RacingState ...>WebotsSerialDrv: <> -RacingState ...>IButton: <> +DrivingState *-> SimpleTimer +DrivingState ..> DifferentialDrive: <> +DrivingState ...> IDisplay: <> +DrivingState ...> ILineSensors: <> +DrivingState ...> ILed: <> +DrivingState ...> Board: <> +DrivingState ...>WebotsSerialDrv: <> +DrivingState ...>IButton: <> @enduml \ No newline at end of file diff --git a/doc/architecture/uml/LogicalView/ReinforcementLearning/ReadyState.plantuml b/doc/architecture/uml/LogicalView/ReinforcementLearning/ReadyState.plantuml index 54776b5e..8bb248fa 100644 --- a/doc/architecture/uml/LogicalView/ReinforcementLearning/ReadyState.plantuml +++ b/doc/architecture/uml/LogicalView/ReinforcementLearning/ReadyState.plantuml @@ -12,10 +12,8 @@ package "Application" as appLayer { + setLapTIme(lapTime : uint32_t) void } - class TrainingState <> - class RacingState <> - ReadyState .r.> RacingState: <> - ReadyState .l.> TrainingState: <> + class DrivingState <> + ReadyState .r.> DrivingState: <> } package "HAL" as hal { diff --git a/doc/architecture/uml/LogicalView/ReinforcementLearning/TrainigState.plantuml b/doc/architecture/uml/LogicalView/ReinforcementLearning/TrainigState.plantuml deleted file mode 100644 index 06cef505..00000000 --- a/doc/architecture/uml/LogicalView/ReinforcementLearning/TrainigState.plantuml +++ /dev/null @@ -1,104 +0,0 @@ -@startuml - -title Training State - -package "Application" as appLayer { - - class TrainingState <> { - + {static} getInstance() : TrainingState - + entry() : void - + process(sm : StateMachine&) : void - + exit() : void - } - - class TrainingState <> - - TrainingState .r.> ReadyState: <> - -} - -package "Service" as serviceLayer { - - class SimpleTimer <> { - + start(duration : uint32_t) : void - + restart() : void - + stop() : void - + isTimeout() : bool - } - class DifferentialDrive <> -} - -package "HAL" as hal { - - package "Interfaces" as halInterfaces { - interface IDisplay { - + {abstract} clear() : void - + {abstract} gotoXY(xCoord : uint8_t, yCoord : uint8_t) : void - + {abstract} print(str : const String&) : size_t - + {abstract} print(str : const char[]) : size_t - + {abstract} print(value : uint8_t) : size_t - + {abstract} print(value : uint16_t) : size_t - + {abstract} print(value : uint32_t) : size_t - + {abstract} print(value : int8_t) : size_t - + {abstract} print(value : int16_t) : size_t - + {abstract} print(value : int32_t) : size_t - } - - interface ILineSensors { - + {abstract} init() : void - + {abstract} calibrate() : void - + {abstract} readLine() : int16_t - + {abstract} getSensorValues() : const uint16_t* - + {abstract} isCalibrationSuccessful() : bool - + {abstract} getCalibErrorInfo() const : uint8_t - + {abstract} getNumLineSensors() const : uint8_t - + {abstract} getSensorValueMax() const : uint16_t - } - interface IButton { - + {abstract} isPressed() : bool - + {abstract} waitForRelease() : void - } - - interface ILed { - + {abstract} enable(enableIt : bool) : void - } - - } - - class Board << namespace >> { - + getDisplay() : IDisplay& - + getLineSensors() : ILineSensors& - + getLedYellow() : ILed& - + getButtonA() : IButton& - } - class WebotsSerialDrv { - + setRxChannel(channelId: int32_t) : void - + setTxChannel(channelId: int32_t ) : void - + print(str: const char[]) : void - + print(value: uint8_t ) : void - + print(value: uint16_t ) : void - + print(value: uint32_t ) : void - + print(value: int8_t ) : void - + print(value: int16_t ) : void - + print(value: int32_t ) : void - + println(str: const char[]) : void - + println(value: uint8_t ) : void - + println(value: uint16_t ) : void - + println(value: uint32_t ) : void - + println(value: int8_t ) : void - + println(value: int16_t ) : void - + println(value: int32_t ) : void - + write( buffer: const uint8_t*, length: size_t ) : size_t - + readBytes( buffer: uint8_t*, length: size_t ) : size_t - } -} - -TrainingState *-> SimpleTimer -TrainingState ..> DifferentialDrive: <> -TrainingState ...> IDisplay: <> -TrainingState ...> ILineSensors: <> -TrainingState ...> ILed: <> -TrainingState ...> Board: <> -TrainingState ...>WebotsSerialDrv: <> -TrainingState ...>IButton: <> -@enduml \ No newline at end of file diff --git a/doc/architecture/uml/ProcessView/ReinforcementLearning/SystemStates.plantuml b/doc/architecture/uml/ProcessView/ReinforcementLearning/SystemStates.plantuml index 39b8f1a3..6844791c 100644 --- a/doc/architecture/uml/ProcessView/ReinforcementLearning/SystemStates.plantuml +++ b/doc/architecture/uml/ProcessView/ReinforcementLearning/SystemStates.plantuml @@ -18,12 +18,6 @@ state ErrorState: /do Wait for pushbutton A is triggered. state ReadyState: /entry Show operator info on LCD. state ReadyState: /do Wait for button A or B to be triggered. -state TrainingState: /entry Show operator info on LCD. -state TrainingState: /entry Start observation timer. -state TrainingState: /do Perform training. -state DrivingState: /exit Stop observation timer. - -state DrivingState: /entry Show operator info on LCD. state DrivingState: /entry Start observation timer. state DrivingState: /do Perform driving. state DrivingState: /exit Stop observation timer. @@ -34,10 +28,8 @@ StartupState --> LineSensorsCalibrationState: [Pushbutton B triggered] and\n[Max MotorSpeedCalibrationState --> LineSensorsCalibrationState: [Calibration finished] LineSensorsCalibrationState --> ReadyState: [Calibration finished] LineSensorsCalibrationState --> ErrorState: [Calibration failed] -ReadyState ---> DrivingState: [Pushbutton A triggered] -ReadyState --> TrainingState: [Pushbutton B triggered] -TrainingState --> ReadyState: [Pushbutton A triggered] or\n [End line detected] or\n[Observation timer timeout] -DrivingState ---> ReadyState: [End line detected] or\n[Pushbutton A triggered] or\n[Observation timer timeout] +ReadyState ---> DrivingState: [Pushbutton A triggered] or\n [Pushbutton B triggered] or \n [mode timer timeout] +DrivingState ---> ReadyState: [End line detected] or\n [Observation timer timeout] or\n [No Line Deteceted] ErrorState --> StartupState: [Pushbutton A triggered] @enduml \ No newline at end of file