Skip to content

Commit 7a74c61

Browse files
committed
add state machine test/doc
1 parent 4ef9d7b commit 7a74c61

File tree

8 files changed

+259
-210
lines changed

8 files changed

+259
-210
lines changed

MissionPlanning/StateMachine/robot_behavior_case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __init__(self):
77
self.task_progress = 0
88

99
# Initialize state machine
10-
self.machine = StateMachine(self, "robot_sm")
10+
self.machine = StateMachine("robot_sm", self)
1111

1212
# Add state transition rules
1313
self.machine.add_transition(
@@ -93,6 +93,7 @@ def on_enter_charging(self):
9393
# Keep the test section structure the same, only modify the trigger method
9494
if __name__ == "__main__":
9595
robot = Robot()
96+
print(robot.machine.generate_plantuml())
9697

9798
print(f"Initial state: {robot.machine.get_current_state().name}")
9899
print("------------")

MissionPlanning/StateMachine/robot_top_case.py

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)