Skip to content

Commit

Permalink
Removing the training status from the application architecture and co…
Browse files Browse the repository at this point in the history
…rrecting the spelling
  • Loading branch information
Akram authored and Akram committed Jul 29, 2024
1 parent 81a0bcf commit f589e5c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ package "Application" as appLayer {
class MotorSpeedCalibrationState <<control>>
class LineSensorsCalibrationState <<control>>
class ErrorState <<control>>
class DringState <<control>>
class DrivingState <<control>>
class ReadyState <<control>>
class TrainingState <<control>>

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
Expand All @@ -68,18 +67,14 @@ 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

note bottom of ReadyState
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
Expand All @@ -88,16 +83,14 @@ note top of appLayer
end note

App *--> StateMachine

StateMachine o--> "0..1" IState

IState <|.. StartupState: <<realize>>
IState <|.... MotorSpeedCalibrationState: <<realize>>
IState <|.. LineSensorsCalibrationState: <<realize>>
IState <|.... ErrorState: <<realize>>
IState <|.. ReadyState: <<realize>>
IState <|.... TrainingState: <<realize>>
IState <|.... DringState: <<realize>>
IState <|.... DrivingState: <<realize>>


@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title Driving State

package "Application" as appLayer {

class RacingState <<control>> {
class DrivingState <<control>> {
+ {static} getInstance() : DrivingState
+ entry() : void
+ process(sm : StateMachine&) : void
Expand All @@ -13,8 +13,7 @@ package "Application" as appLayer {

class ReadyState <<control>>

RacingState .r.> ReadyState: <<use>>

DrivingState .r.> ReadyState: <<use>>
}

package "Service" as serviceLayer {
Expand Down Expand Up @@ -94,12 +93,12 @@ package "HAL" as hal {
}
}

RacingState *-> SimpleTimer
RacingState ..> DifferentialDrive: <<use>>
RacingState ...> IDisplay: <<use>>
RacingState ...> ILineSensors: <<use>>
RacingState ...> ILed: <<use>>
RacingState ...> Board: <<use>>
RacingState ...>WebotsSerialDrv: <<use>>
RacingState ...>IButton: <<use>>
DrivingState *-> SimpleTimer
DrivingState ..> DifferentialDrive: <<use>>
DrivingState ...> IDisplay: <<use>>
DrivingState ...> ILineSensors: <<use>>
DrivingState ...> ILed: <<use>>
DrivingState ...> Board: <<use>>
DrivingState ...>WebotsSerialDrv: <<use>>
DrivingState ...>IButton: <<use>>
@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ package "Application" as appLayer {
+ setLapTIme(lapTime : uint32_t) void
}

class TrainingState <<control>>
class RacingState <<control>>
ReadyState .r.> RacingState: <<use>>
ReadyState .l.> TrainingState: <<use>>
class DrivingState <<control>>
ReadyState .r.> DrivingState: <<use>>
}

package "HAL" as hal {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

0 comments on commit f589e5c

Please sign in to comment.