Skip to content

Commit c46578e

Browse files
committed
Add a section on simulated robot logs
1 parent 66ce29d commit c46578e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

simulator/using_the_simulator.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,22 @@ Rather than having a single `robot.py`, code can be placed in a number of `zone-
9999
```
100100

101101
This will run two robots in the arena, each with different `robot.py` files. You can run as many or as few zones as you like, in any combination.
102+
103+
## Robot logs
104+
105+
When your program runs in the simulator, the output of `print(...)` statements and any errors which occur are written to a log file next to your code as `log-zone-<zone>-<date-time>.txt`.
106+
107+
These logs are also available to view live via the console at bottom of the simulator.
108+
109+
In the simulator, all logs are prefixed with the zone that the robot code is running in. For example, a robot running in zone 2 might have logs like:
110+
111+
~~~~~ not-code
112+
2| Using /home/srobo/my-robot/robot.py for Zone 2
113+
2| Robot Initialized. Zone: 2, Mode: RobotMode.DEV.
114+
2| Waiting for start signal.
115+
2| Starting
116+
2| I saw a marker!
117+
2| I turned left!
118+
~~~~~
119+
120+
This makes it possible to distinguish which logs are from which robot when they are viewed in Webots console panel.

0 commit comments

Comments
 (0)