From e7dbaac272293c6c9e78cd219dc6681e5fcb3a1f Mon Sep 17 00:00:00 2001 From: andyh2 Date: Fri, 28 Feb 2020 23:01:55 -0500 Subject: [PATCH] tools: Update replay examples old-commit-hash: 8c5f843fa32434e7f614b3604c5e2b295b48482c --- tools/README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/README.md b/tools/README.md index e83ccb758..601d2fabe 100644 --- a/tools/README.md +++ b/tools/README.md @@ -191,7 +191,8 @@ Replay driving data `unlogger.py` replays data collected with [chffrplus](https://github.com/commaai/chffrplus) or [openpilot](https://github.com/commaai/openpilot). -Usage (Remote data): +Unlogger with remote data: + ``` # Log in via browser python lib/auth.py @@ -199,13 +200,13 @@ python lib/auth.py # Start unlogger python replay/unlogger.py #Example: -#python replay/unlogger.py '99c94dc769b5d96e|2018-11-14--13-31-42' +#python replay/unlogger.py '3533c53bb29502d1|2019-12-10--01-13-27' # In another terminal you can run a debug visualizer: python replay/ui.py # Define the environmental variable HORIZONTAL is the ui layout is too tall ``` -Usage (Local data downloaded from device or https://my.comma.ai): +Unlogger with local data downloaded from device or https://my.comma.ai: ``` python replay/unlogger.py @@ -221,6 +222,16 @@ python replay/unlogger.py ``` ![Imgur](https://i.imgur.com/Yppe0h2.png) +LogReader with remote data + +```python +from tools.lib.logreader import LogReader +from tools.lib.route import Route +route = Route('3533c53bb29502d1|2019-12-10--01-13-27') +log_paths = route.log_paths() +events_seg0 = list(LogReader(log_paths[0])) +print(len(events_seg0), 'events logged in first segment') +``` Debug car controls -------------