fix up replay docs

old-commit-hash: 07d23a1db9
commatwo_master
Adeeb Shihadeh 4 years ago
parent b4adcd2e56
commit 9b50379537
  1. 2
      README.md
  2. 96
      tools/replay/README.md

@ -42,7 +42,7 @@ To use openpilot in a car, you need four things
* This software. It's free and available right here. * This software. It's free and available right here.
* One of [the 140+ supported cars](docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, and more. If your car is not supported, but has adaptive cruise control and lane keeping assist, it's likely able to run openpilot. * One of [the 140+ supported cars](docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, and more. If your car is not supported, but has adaptive cruise control and lane keeping assist, it's likely able to run openpilot.
* A supported device to run this software. This can be a [comma two](https://comma.ai/shop/products/two), [comma three](https://comma.ai/shop/products/three), or if you like to experiment, a [Ubuntu computer with webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam). * A supported device to run this software. This can be a [comma two](https://comma.ai/shop/products/two), [comma three](https://comma.ai/shop/products/three), or if you like to experiment, a [Ubuntu computer with webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
* A way to connect to your car. With a comma two or three, you need only a [car harness](https://comma.ai/shop/products/car-harness). With an EON or PC, you also need a [black panda](https://comma.ai/shop/products/panda). * A way to connect to your car. With a comma two or three, you need only a [car harness](https://comma.ai/shop/products/car-harness). With an EON Gold or PC, you also need a [black panda](https://comma.ai/shop/products/panda).
We have detailed instructions for [how to install the device in a car](https://comma.ai/setup). We have detailed instructions for [how to install the device in a car](https://comma.ai/setup).

@ -1,67 +1,69 @@
Replay driving data Stream CAN messages to your device
------------- -------------
**Hardware needed**: none Replay CAN messages as they were recorded using a [panda jungle](https://comma.ai/shop/products/panda-jungle). The jungle has 6x OBD-C ports for connecting all your comma devices.
`unlogger.py` replays data collected with [dashcam](https://github.com/commaai/openpilot/tree/dashcam) or [openpilot](https://github.com/commaai/openpilot). `can_replay.py` is a convenient script for when any CAN data will do.
Unlogger with remote data: In order to replay specific route:
```bash
MOCK=1 selfdrive/boardd/tests/boardd_old.py
# In another terminal:
python replay/unlogger.py <route-name> <path-to-data-directory>
``` ```
Replay driving data
-------------
`unlogger.py` replays all the messages logged while running openpilot.
Unlogger with remote data:
```bash
# Log in via browser # Log in via browser
python lib/auth.py python lib/auth.py
# Start unlogger # Start unlogger
python replay/unlogger.py <route-name> python replay/unlogger.py <route-name>
#Example: # Example:
#python replay/unlogger.py '3533c53bb29502d1|2019-12-10--01-13-27' # python replay/unlogger.py '3533c53bb29502d1|2019-12-10--01-13-27'
# In another terminal you can run a debug visualizer: # 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 python replay/ui.py # Define the environmental variable HORIZONTAL is the ui layout is too tall
```
Unlogger with local data downloaded from device or https://connect.comma.ai:
# Or run the normal openpilot UI
cd selffdrive/ui && ./ui
``` ```
python replay/unlogger.py <route-name> <path-to-data-directory>
#Example:
#python replay/unlogger.py '99c94dc769b5d96e|2018-11-14--13-31-42' /home/batman/unlogger_data
#Within /home/batman/unlogger_data:
# 99c94dc769b5d96e|2018-11-14--13-31-42--0--fcamera.hevc
# 99c94dc769b5d96e|2018-11-14--13-31-42--0--rlog.bz2
# ...
```
![Imgur](https://i.imgur.com/Yppe0h2.png) ![Imgur](https://i.imgur.com/Yppe0h2.png)
LogReader with remote data ## usage
``` bash
```python $ ./unlogger.py -h
from tools.lib.logreader import LogReader usage: unlogger.py [-h] [--no-loop] [--min | --enabled ENABLED] [--disabled DISABLED] [--tl PUBLISH_TIME_LENGTH] [--no-realtime]
from tools.lib.route import Route [--no-interactive] [--bind-early] [--no-visionipc] [--start-time START_TIME]
route = Route('3533c53bb29502d1|2019-12-10--01-13-27') [route_name] [data_dir] [address_mapping [address_mapping ...]]
log_paths = route.log_paths()
events_seg0 = list(LogReader(log_paths[0])) Mock openpilot components by publishing logged messages.
print(len(events_seg0), 'events logged in first segment')
``` positional arguments:
route_name The route whose messages will be published. (default: None)
Stream replayed CAN messages to EON data_dir Path to directory in which log and camera files are located. (default: None)
------------- address_mapping Pairs <service>=<zmq_addr> to publish <service> on <zmq_addr>. (default: None)
**Hardware needed**: 2 x [panda](panda.comma.ai), [debug board](https://comma.ai/shop/products/panda-debug-board/), [EON](https://comma.ai/shop/products/eon-gold-dashcam-devkit/). optional arguments:
-h, --help show this help message and exit
It is possible to replay CAN messages as they were recorded and forward them to a EON.  --no-loop Stop at the end of the replay. (default: False)
Connect 2 pandas to the debug board. A panda connects to the PC, the other panda connects to the EON. --min
--enabled ENABLED
Usage: --disabled DISABLED
``` --tl PUBLISH_TIME_LENGTH
# With MOCK=1 boardd will read logged can messages from a replay and send them to the panda. Length of interval in event time for which messages should be published. (default: None)
MOCK=1 selfdrive/boardd/tests/boardd_old.py --no-realtime Publish messages as quickly as possible instead of realtime. (default: True)
--no-interactive Disable interactivity. (default: True)
# In another terminal: --bind-early Bind early to avoid dropping messages. (default: False)
python replay/unlogger.py <route-name> <path-to-data-directory> --no-visionipc Do not output video over visionipc (default: False)
--start-time START_TIME
Seek to this absolute time (in seconds) upon starting playback. (default: 0.0)
``` ```
![Imgur](https://i.imgur.com/AcurZk8.jpg)

Loading…
Cancel
Save