{"owner":"commaai","repo":"openpilot","hasSkills":true,"totalSkillsCount":12,"totalTokensCount":9466,"categories":["plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":["openpilot/tools/cabana/README.md","openpilot/tools/camerastream/README.md","openpilot/tools/joystick/README.md","openpilot/tools/lateral_maneuvers/README.md","openpilot/tools/lib/README.md","openpilot/tools/longitudinal_maneuvers/README.md","openpilot/tools/plotjuggler/README.md","openpilot/tools/replay/README.md","openpilot/tools/sim/README.md","tools/README.md","tools/car_porting/README.md","tools/release/README.md"],"skills":{"openpilot/tools/cabana/README.md":"# Cabana\n\nCabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/opendbc](https://github.com/commaai/opendbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai).\n\n## Usage Instructions\n\n```bash\n$ ./cabana -h\nUsage: ./cabana [options] [route]\n\n  route                     the drive to replay. find your drives at connect.comma.ai\n\nOptions:\n  --help                    show this help\n  --demo                    use a demo route instead of providing your own\n  --auto                    Auto load the route from the best available source (no video):\n                            internal, openpilotci, comma_api, car_segments, testing_closet\n  --qcam                    load qcamera\n  --wide-road               load wide road camera (alias: --ecam)\n  --cabin                   load cabin camera (alias: --dcam)\n  --msgq                    read can messages from the msgq\n  --panda                   read can messages from panda\n  --panda-serial <serial>   read can messages from panda with given serial\n  --socketcan <device>      read can messages from given SocketCAN device\n  --zmq <ip-address>        read can messages from zmq at the specified ip-address\n  --data_dir <dir>          local directory with routes\n  --no-vipc                 do not output video\n  --no-cache                turn off the local route file cache\n  --dbc <file>              dbc file to open\n```\n\n## Examples\n\n### Running Cabana in Demo Mode\nTo run Cabana using a built-in demo route, use the following command:\n\n```shell\ncabana --demo\n```\n\n### Loading a Specific Route\n\nTo load a specific route for replay, provide the route as an argument:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\"\n```\n\nReplace \"5beb9b58bd12b691/0000010a--a51155e496\" with your desired route identifier.\n\n\n### Running Cabana with multiple cameras\nTo run Cabana with multiple cameras, use the following command:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\" --cabin --wide-road\n```\n\n### Streaming CAN Messages from a comma Device\n\n[SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and start the bridge with the following command:\n\n```shell\ncd /data/openpilot\n./openpilot/cereal/messaging/bridge &\n```\n\nThen Run Cabana with the device's IP address:\n\n```shell\ncabana --zmq <ipaddress>\n```\n\nReplace &lt;ipaddress&gt; with your comma device's IP address.\n\nWhile streaming from the device, Cabana will log the CAN messages to a local directory. By default, this directory is ~/cabana_live_stream/. You can change the log directory in Cabana by navigating to menu -> tools -> settings.\n\nAfter disconnecting from the device, you can replay the logged CAN messages from the stream selector dialog -> browse local route.\n\n### Streaming CAN Messages from Panda\n\nTo read CAN messages from a connected Panda, use the following command:\n\n```shell\ncabana --panda\n```\n\n### Using the Stream Selector Dialog\n\nIf you run Cabana without any arguments, a stream selector dialog will pop up, allowing you to choose the stream.\n\n```shell\ncabana\n```\n\n## Additional Information\n\nFor more information, see the [openpilot wiki](https://github.com/commaai/openpilot/wiki/Cabana)\n","openpilot/tools/camerastream/README.md":"# Camera stream\n\n`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC.\n\n## Usage\n\n### On the device\nSSH into the device and run following in separate terminals:\n\n`cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n\n`cd /data/openpilot/system/loggerd && ./encoderd`\n\n`cd /data/openpilot/system/camerad && ./camerad`\n\nNote that both the device and your PC must be on the same openpilot commit.\n\nAlternatively paste this as a single command:\n```\n(\n  cd /data/openpilot\n  ./openpilot/cereal/messaging/bridge &\n\n  cd /data/openpilot/system/camerad/\n  ./camerad &\n\n  cd /data/openpilot/system/loggerd/\n  ./encoderd &\n\n  wait\n) ; trap 'kill $(jobs -p)' SIGINT\n```\nCtrl+C will stop all three processes.\n\n### On the PC\nDecode the stream with `compressed_vipc.py`:\n\n```cd ~/openpilot/tools/camerastream && ./compressed_vipc.py <ip>```\n\nTo actually display the stream, run `watch3` in separate terminal:\n\n```cd ~/openpilot/selfdrive/ui/ && ./watch3.py```\n\n## compressed_vipc.py usage\n```\n$ python3 compressed_vipc.py -h\nusage: compressed_vipc.py [-h] [--cams CAMS] [--server SERVER] [--silent] addr\n\nDecode video streams and broadcast on VisionIPC\n\npositional arguments:\n  addr             Address of comma three\n\noptions:\n  -h, --help       show this help message and exit\n  --cams CAMS      Cameras to decode\n  --server SERVER  choose vipc server name\n  --silent         Suppress debug output\n```\n\n\n## Example:\n```\ncd ~/openpilot/tools/camerastream && ./compressed_vipc.py comma-ffffffff --cams 0\ncd ~/openpilot/selfdrive/ui/ && ./watch3.py\n```\n","openpilot/tools/joystick/README.md":"# Joystick\n\n**Hardware needed**: device running openpilot, laptop, joystick (optional)\n\nWith joystick_control, you can connect your laptop to your comma device over the network and debug controls using a joystick or keyboard.\njoystick_control uses [inputs](https://pypi.org/project/inputs) which supports many common gamepads and joysticks.\n\n## Usage\n\nThe car must be off, and openpilot must be offroad before starting `joystick_control`.\n\n### Using a keyboard\n\nSSH into your comma device and start joystick_control with the following command:\n\n```shell\nopenpilot/tools/joystick/joystick_control.py --keyboard\n```\n\nThe available buttons and axes will print showing their key mappings. In general, the WASD keys control gas and brakes and steering torque in 5% increments.\n\n### Joystick on your comma three\n\nPlug the joystick into your comma three aux USB-C port. Then, SSH into the device and start `joystick_control.py`.\n\n### Joystick on your laptop\n\nIn order to use a joystick over the network, we need to run joystick_control locally from your laptop and have it send `testJoystick` packets over the network to the comma device.\n\n1. Connect a joystick to your PC.\n2. Connect your laptop to your comma device's hotspot and open a new SSH shell. Since joystick_control is being run on your laptop, we need to write a parameter to let controlsd know to start in joystick debug mode:\n   ```shell\n   # on your comma device\n   echo -n \"1\" > /data/params/d/JoystickDebugMode\n   ```\n3. Run bridge with your laptop's IP address. This republishes the `testJoystick` packets sent from your laptop so that openpilot can receive them:\n   ```shell\n   # on your comma device\n   openpilot/cereal/messaging/bridge {LAPTOP_IP} testJoystick\n   ```\n4. Start joystick_control on your laptop in ZMQ mode.\n   ```shell\n   # on your laptop\n   export ZMQ=1\n   openpilot/tools/joystick/joystick_control.py\n   ```\n\n---\nNow start your car and openpilot should go into joystick mode with an alert on startup! The status of the axes will display on the alert, while button statuses print in the shell.\n\nMake sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.\n\n![](https://github.com/commaai/openpilot/assets/8762862/e640cbca-cb7a-4dcb-abce-b23b036ad8e7)\n","openpilot/tools/lateral_maneuvers/README.md":"# Lateral Maneuvers Testing Tool\n\n> [!WARNING]\n> Use caution when using this tool.\n\nTest your vehicle's lateral control tuning with this tool. The tool will test the vehicle's ability to follow a few lateral maneuvers and includes a tool to generate a report from the route.\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. The full maneuver suite runs at 20 and 30 mph.\n3. Enable \"Lateral Maneuver Mode\" in Settings > Developer on the device while offroad. Alternatively, set the parameter manually:\n\n   ```sh\n   echo -n 1 > /data/params/d/LateralManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see \"Lateral Maneuver Mode\".\n\n5. Ensure the area ahead is clear, as openpilot will command lateral acceleration steps in this mode. Once you are ready, set ACC manually to the target speed shown on screen and let openpilot stabilize lateral. After 1 seconds of steady straight driving, the maneuver will begin automatically. openpilot lateral control stays engaged between maneuvers normally while waiting for the next maneuver's readiness conditions. The maneuver will be aborted and repeated if speed is out of range, steering is touched or openpilot disengages.\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/lateral_maneuvers/generate_report.py 98395b7c5b27882e/000001cc--5a73bde686\n\n    processing report for KIA_EV6\n    plotting maneuver: step right 20mph, runs: 3\n    plotting maneuver: step left 20mph, runs: 3\n    plotting maneuver: sine 0.5Hz 20mph, runs: 3\n    plotting maneuver: step right 30mph, runs: 3\n\n    Opening report: /home/batman/openpilot/tools/lateral_maneuvers/lateral_reports/KIA_EV6_98395b7c5b27882e_000001cc--5a73bde686.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","openpilot/tools/lib/README.md":"## LogReader\n\nRoute is a class for conveniently accessing all the [logs](/openpilot/system/loggerd/) from your routes. The LogReader class reads the non-video logs, i.e. rlog.bz2 and qlog.bz2. There's also a matching FrameReader class for reading the videos.\n\n```python\nfrom openpilot.tools.lib.route import Route\nfrom openpilot.tools.lib.logreader import LogReader\n\nr = Route(\"a2a0ccea32023010|2023-07-27--13-01-19\")\n\n# get a list of paths for the route's rlog files\nprint(r.log_paths())\n\n# and road camera (fcamera.hevc) files\nprint(r.camera_paths())\n\n# setup a LogReader to read the route's first rlog\nlr = LogReader(r.log_paths()[0])\n\n# print out all the messages in the log\nimport codecs\ncodecs.register_error(\"strict\", codecs.backslashreplace_errors)\nfor msg in lr:\n  print(msg)\n\n# setup a LogReader for the route's second qlog\nlr = LogReader(r.log_paths()[1])\n\n# print all the steering angles values from the log\nfor msg in lr:\n  if msg.which() == \"carState\":\n    print(msg.carState.steeringAngleDeg)\n```\n\n### Segment Ranges\n\nWe also support a new format called a \"segment range\":\n\n```\n344c5c15b34f2d8a   /   2024-01-03--09-37-12   /     2:6    /       q\n[   dongle id     ] [       timestamp        ] [ selector ]  [ query type]\n```\n\nyou can specify which segments from a route to load\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4\")   # 4th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4:6\") # 4th and 5th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/-1\")  # last segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/:5\")  # first 5 segments\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/1:\")  # all except first segment\n```\n\nand can select which type of logs to grab\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/q\") # get qlogs\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/r\") # get rlogs (default)\n```\n","openpilot/tools/longitudinal_maneuvers/README.md":"# Longitudinal Maneuvers Testing Tool\n\nTest your vehicle's longitudinal control tuning with this tool. The tool will test the vehicle's ability to follow a few longitudinal maneuvers and includes a tool to generate a report from the route.\n\n<details><summary>Sample snapshot of a report.</summary><img width=\"600px\" src=\"https://github.com/user-attachments/assets/d18d0c7d-2bde-44c1-8e86-1741ed442ad8\"></details>\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. Locate either a large empty parking lot or road devoid of any car or foot traffic. Flat, straight road is preferred. The full maneuver suite can take 1 mile or more if left running, however it is recommended to disengage openpilot between maneuvers and turn around if there is not enough space.\n3. Turn off the vehicle and set this parameter which will signal to openpilot to start the longitudinal maneuver daemon:\n\n   ```sh\n   echo -n 1 > /data/params/d/LongitudinalManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see the \"Longitudinal Maneuver Mode\" alert:\n\n   ![videoframe_6652](https://github.com/user-attachments/assets/e9d4c95a-cd76-4ab7-933e-19937792fa0f)\n\n5. Ensure the road ahead is clear, as openpilot will not brake for any obstructions in this mode. Once you are ready, press \"Set\" on your steering wheel to start the tests. The tests will run for about 4 minutes. If you need to pause the tests, press \"Cancel\" on your steering wheel. You can resume the tests by pressing \"Resume\" on your steering wheel. \n\n   **Note:** For GM cars, it is recommended to hold down the resume button for all low-speed tests (starting, stopping and creep) to avoid the car entering standstill.\n\n   ![cog-clip-00 01 11 250-00 01 22 250](https://github.com/user-attachments/assets/c312c1cc-76e8-46e1-a05e-bb9dfb58994f)\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n   ![fin2](https://github.com/user-attachments/assets/c06960ae-7cfb-44af-beaa-4dc28848e49d)\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/longitudinal_maneuvers/generate_report.py 57048cfce01d9625/0000010e--5b26bc3be7 'pcm accel compensation'\n\n    processing report for LEXUS_ES_TSS2\n    plotting maneuver: start from stop, runs: 4\n    plotting maneuver: creep: alternate between +1m/s^2 and -1m/s^2, runs: 2\n    plotting maneuver: gas step response: +1m/s^2 from 20mph, runs: 2\n\n    Report written to /home/batman/openpilot/tools/longitudinal_maneuvers/longitudinal_reports/LEXUS_ES_TSS2_57048cfce01d9625_0000010e--5b26bc3be7.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","openpilot/tools/plotjuggler/README.md":"# PlotJuggler\n\n[PlotJuggler](https://github.com/facontidavide/PlotJuggler) is a tool to quickly visualize time series data, and we've written plugins to parse openpilot logs. Check out our plugins: https://github.com/commaai/PlotJuggler.\n\n## Installation\n\nOnce you've [set up the openpilot environment](/tools/README.md), this command will download PlotJuggler and install our plugins:\n\n`cd openpilot/tools/plotjuggler && ./juggle.py --install`\n\n## Usage\n\n```\n$ ./juggle.py -h\nusage: juggle.py [-h] [--demo] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]\n                 [route_or_segment_name]\n\nA helper to run PlotJuggler on openpilot routes\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to plot (cabana share URL accepted) (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --demo                Use the demo route instead of providing one (default: False)\n  --can                 Parse CAN data (default: False)\n  --stream              Start PlotJuggler in streaming mode (default: False)\n  --layout [LAYOUT]     Run PlotJuggler with a pre-defined layout (default: None)\n  --install             Install or update PlotJuggler + plugins (default: False)\n  --dbc DBC             Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically\n                        inferred from the logs. (default: None)\n\n```\n\nExample using route name:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496\"`\n\nExamples using segment:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1\"`\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1/q\" # use qlogs`\n\nExample using segment range:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/0:1\"`\n\n## Streaming\n\nExplore live data from your car! Follow these steps to stream from your comma device to your laptop:\n- Enable wifi tethering on your comma device\n- [SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and run `cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n- On your laptop, connect to the device's wifi hotspot\n- Start PlotJuggler with `ZMQ=1 ./juggle.py --stream`, find the `Cereal Subscriber` plugin in the dropdown under Streaming, and click `Start`.\n\nIf streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.\n\n## Demo\n\nFor a quick demo, go through the installation step and run this command:\n\n`./juggle.py --demo --layout=layouts/tuning.xml`\n\n## Layouts\n\nIf you create a layout that's useful for others, consider upstreaming it.\n\n### Tuning\n\nUse this layout to improve your car's tuning and generate plots for tuning PRs. Also see the [tuning wiki](https://github.com/commaai/openpilot/wiki/Tuning) and tuning PR template.\n\n`--layout layouts/tuning.xml`\n\n\n![screenshot](https://i.imgur.com/cizHCH3.png)\n","openpilot/tools/replay/README.md":"# Replay\n\n`replay` allows you to simulate a driving session by replaying all messages logged during the use of openpilot. This provides a way to analyze and visualize system behavior as if it were live.\n\n## Setup\n\nBefore starting a replay, you need to authenticate with your comma account using `auth.py`. This will allow you to access your routes from the server.\n\n```bash\n# Authenticate to access routes from your comma account:\npython3 openpilot/tools/lib/auth.py\n```\n\n## Replay a Remote Route\nYou can replay a route from your comma account by specifying the route name.\n\n```bash\n# Start a replay with a specific route:\nopenpilot/tools/replay/replay <route-name>\n\n# Example:\nopenpilot/tools/replay/replay '5beb9b58bd12b691/0000010a--a51155e496'\n\n# Replay the default demo route:\nopenpilot/tools/replay/replay --demo\n```\n\n## Replay a Local Route\nTo replay a route stored locally on your machine, specify the route name and provide the path to the directory where the route files are stored.\n\n```bash\n# Replay a local route\nopenpilot/tools/replay/replay <route-name> --data_dir=\"/path_to/route\"\n\n# Example:\n# If you have a local route stored at /path_to_routes with segments like:\n# 5beb9b58bd12b691/0000010a--a51155e496--0\n# 5beb9b58bd12b691/0000010a--a51155e496--1\n# You can replay it like this:\nopenpilot/tools/replay/replay \"5beb9b58bd12b691/0000010a--a51155e496\" --data_dir=\"/path_to_routes\"\n```\n\n## Send Messages via ZMQ\nBy default, replay sends messages via MSGQ. To switch to ZMQ, set the ZMQ environment variable.\n\n```bash\n# Start replay and send messages via ZMQ:\nZMQ=1 openpilot/tools/replay/replay <route-name>\n```\n\n## Usage\nFor more information on available options and arguments, use the help command:\n\n``` bash\n$ openpilot/tools/replay/replay -h\nUsage: openpilot/tools/replay/replay [options] route\nMock openpilot components by publishing logged messages.\n\nOptions:\n  -h, --help             Displays this help.\n  -a, --allow <allow>    whitelist of services to send (comma-separated)\n  -b, --block <block>    blacklist of services to send (comma-separated)\n  -c, --cache <n>        cache <n> segments in memory. default is 5\n  -s, --start <seconds>  start from <seconds>\n  -x <speed>             playback <speed>. between 0.2 - 3\n  --demo                 use a demo route instead of providing your own\n  --auto                 Auto load the route from the best available source (no video):\n                         internal, openpilotci, comma_api, car_segments, testing_closet\n  --data_dir <data_dir>  local directory with routes\n  --prefix <prefix>      set OPENPILOT_PREFIX\n  --cabin                  load cabin camera\n  --wide-road                 load wide road camera\n  --no-loop              stop at the end of the route\n  --no-cache             turn off local cache\n  --qcam                 load qcamera\n  --no-hw-decoder        disable HW video decoding\n  --no-vipc              do not output video\n  --all                  do output all messages including uiDebug, userBookmark.\n                         this may causes issues when used along with UI\n\nArguments:\n  route                  the drive to replay. find your drives at\n                         connect.comma.ai\n```\n\n## Visualize the Replay in the openpilot UI\nTo visualize the replay within the openpilot UI, run the following commands:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\ncd openpilot/selfdrive/ui && ./ui.py\n```\n\n## Work with plotjuggler\nIf you want to use replay with plotjuggler, you can stream messages by running:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\nopenpilot/tools/plotjuggler/juggle.py --stream\n```\n\n## watch3\n\nwatch all three cameras simultaneously from your comma three routes with watch3\n\nsimply replay a route using the `--cabin` and `--wide-road` flags:\n\n```bash\n# start a replay\ncd openpilot/tools/replay && ./replay --demo --cabin --wide-road\n\n# then start watch3\ncd openpilot/selfdrive/ui && ./watch3.py\n```\n\n![](https://i.imgur.com/IeaOdAb.png)\n\n## Stream CAN messages to your device\n\nReplay 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. Check out the [jungle repo](https://github.com/commaai/panda_jungle) for more info.\n\nIn order to run your device as if it was in a car:\n* connect a panda jungle to your PC\n* connect a comma device or panda to the jungle via OBD-C\n* run `can_replay.py`\n\n``` bash\nbatman:replay$ ./can_replay.py -h\nusage: can_replay.py [-h] [route_or_segment_name]\n\nReplay CAN messages from a route to all connected pandas and jungles\nin a loop.\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to replay. If not\n                        specified, a default public route will be\n                        used. (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n","openpilot/tools/sim/README.md":"openpilot in simulator\n=====================\n\nopenpilot implements a [bridge](run_bridge.py) that allows it to run in the [MetaDrive simulator](https://github.com/metadriverse/metadrive).\n\n## Launching openpilot\nFirst, start openpilot.\n``` bash\n# Run locally\n./openpilot/tools/sim/launch_openpilot.sh\n```\n\n## Bridge usage\n```\n$ ./run_bridge.py -h\nusage: run_bridge.py [-h] [--joystick] [--high_quality] [--dual_camera]\nBridge between the simulator and openpilot.\n\noptions:\n  -h, --help            show this help message and exit\n  --joystick\n  --high_quality\n  --dual_camera\n```\n\n#### Bridge Controls:\n- To engage openpilot press 2, then press 1 to increase the speed and 2 to decrease.\n- To disengage, press \"S\" (simulates a user brake)\n\n#### All inputs:\n\n```\n| key  |   functionality       |\n|------|-----------------------|\n|  1   | Cruise Resume / Accel |\n|  2   | Cruise Set    / Decel |\n|  3   | Cruise Cancel         |\n|  r   | Reset Simulation      |\n|  i   | Toggle Ignition       |\n|  q   | Exit all              |\n| wasd | Control manually      |\n```\n\n## MetaDrive\n\n### Launching Metadrive\nStart bridge processes located in openpilot/tools/sim:\n``` bash\n./run_bridge.py\n```","tools/README.md":"# openpilot tools\n\n## System Requirements\n\nopenpilot supports Linux alongside the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).\n\nMost of openpilot should work natively on macOS. On Windows, you can use WSL for a nearly native Linux experience.\n\n## Native setup on Linux and macOS\n\nFollow these instructions for a fully managed setup experience. If you'd like to manage the dependencies yourself, just read the setup scripts in this directory.\n\n**1. Clone openpilot**\n``` bash\ngit clone https://github.com/commaai/openpilot.git\n```\n\n**2. Run the setup script**\n``` bash\ncd openpilot\ntools/op.sh setup\n```\n\n**3. Activate a Python shell**\nActivate a shell with the Python dependencies installed:\n``` bash\nsource .venv/bin/activate\n```\n\n**4. Build openpilot**\n``` bash\nscons -u\n```\n\n## WSL on Windows\n\n[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Linux. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.\n\nFollow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to set up WSL. We recommend installing the `Ubuntu-24.04` distribution. Once your WSL environment is set up, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.\n\n**NOTE**: If you are running WSL 2 and experiencing performance issues with the UI or simulator, you may need to explicitly enable hardware acceleration by setting `GALLIUM_DRIVER=d3d12` before commands. Add `export GALLIUM_DRIVER=d3d12` to your `~/.bashrc` file to make it automatic for future sessions.\n\n## CTF\nLearn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md).\n\n## Directory Structure\n\n```\n├── car_porting/        # Tools for porting new cars\n├── release/            # Scripts for building openpilot releases\n└── scripts/            # Miscellaneous scripts\n```\n\nDevelopment tools such as cabana, plotjuggler, and replay live in [openpilot/tools/](/openpilot/tools/):\n\n```\n├── cabana/             # View and plot CAN messages from drives or in realtime\n├── camerastream/       # Cameras stream over the network\n├── joystick/           # Control your car with a joystick\n├── lib/                # Libraries to support the tools and reading openpilot logs\n├── plotjuggler/        # A tool to plot openpilot logs\n├── replay/             # Replay drives and mock openpilot services\n└── sim/                # Run openpilot in a simulator\n```\n","tools/car_porting/README.md":"# tools/car_porting\n\nCheck out [this blog post](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) for a high-level overview of porting a car.\n\n## Useful car porting utilities\n\nTesting car ports in your car is very time-consuming. Check out these utilities to do basic checks on your work before running it in your car.\n\n### [Cabana](/openpilot/tools/cabana/README.md)\n\nView your car's CAN signals through DBC files, which openpilot uses to parse and create messages that talk to the car.\n\nExample:\n```bash\n> openpilot/tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43'\n```\n\n### [tools/car_porting/auto_fingerprint.py](/tools/car_porting/auto_fingerprint.py)\n\nGiven a route and platform, automatically inserts FW fingerprints from the platform into the correct place in fingerprints.py\n\nExample:\n```bash\n> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK'\nAttempting to add fw version for:  OUTBACK\n```\n\n### [openpilot/selfdrive/car/tests/test_car_interfaces.py](/openpilot/selfdrive/car/tests/test_car_interfaces.py)\n\nFinds common bugs for car interfaces, without even requiring a route.\n\n\n#### Example: Typo in signal name\n```bash\n> tools/test_runner.py openpilot/selfdrive/car/tests/test_car_interfaces.py -k subaru  # replace with the brand you are working on\n\n=====================================================================\nFAILED openpilot/selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces::test_car_interfaces_165_SUBARU_LEGACY_7TH_GEN - KeyError: 'CruiseControlOOPS'\n\n```\n\n### [tools/car_porting/test_car_model.py](/tools/car_porting/test_car_model.py)\n\nGiven a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches.\n\n#### Example: panda safety mismatch for gasPressed\n```bash\n> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21'\n\n=====================================================================\nFAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate)\nAssert that panda safety matches openpilot's carState\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/home/batman/openpilot/opendbc_repo/opendbc/car/tests/test_models.py\", line 440, in test_panda_safety_carstate\n    self.assertFalse(failed_checks, f\"panda safety doesn't agree with CarState: {failed_checks}\")\nAssertionError: {'gasPressed': 116} is not false : panda safety doesn't agree with CarState: {'gasPressed': 116}\n```\n\n## Jupyter notebooks\n\nTo use these notebooks, install Jupyter within your [openpilot virtual environment](/tools/README.md).\n\n```bash\nuv pip install jupyter ipykernel\n```\n\nLaunching:\n\n```bash\njupyter notebook\n```\n\n### [examples/subaru_steer_temp_fault.ipynb](/tools/car_porting/examples/subaru_steer_temp_fault.ipynb)\n\nAn example of searching through a database of segments for a specific condition, and plotting the results.\n\n![steer warning example](https://github.com/commaai/openpilot/assets/9648890/d60ad120-4b44-4974-ac79-adc660fb8fe2)\n\n*a plot of the steer_warning vs steering angle, where we can see it is clearly caused by a large steering angle change*\n\n### [examples/subaru_long_accel.ipynb](/tools/car_porting/examples/subaru_long_accel.ipynb)\n\nAn example of plotting the response of an actuator when it is active.\n\n![brake pressure example](https://github.com/commaai/openpilot/assets/9648890/8f32cf1d-8fc0-4407-b540-70625ebbf082)\n\n*a plot of the brake_pressure vs acceleration, where we can see it is a fairly linear response.*\n\n### [examples/ford_vin_fingerprint.ipynb](/tools/car_porting/examples/ford_vin_fingerprint.ipynb)\n\nIn this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\n\n```\nvin: 1FM5K8GC7LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 00000000000XXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 3FTTW8F98NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 1FTVW1EL4NWXXXXXX real platform: FORD F-150 LIGHTNING 1ST GEN       determined platform: FORD F-150 LIGHTNING 1ST GEN      correct: True\nvin: 1FM5K7LC0MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: WF0NXXGCHNJXXXXXX real platform: FORD FOCUS 4TH GEN                 determined platform: mock                              correct: False\nvin: 1FMCU9J94MUXXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 5LM5J7XC9LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FMCR9B69NRXXXXXX real platform: FORD BRONCO SPORT 1ST GEN          determined platform: mock                              correct: False\nvin: 3FMTK3SU0MMXXXXXX real platform: FORD MUSTANG MACH-E 1ST GEN        determined platform: FORD MUSTANG MACH-E 1ST GEN       correct: True\nvin: 1FM5K8HC7MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 1FM5K8GC7NGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 5LM5J7XC8MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\n```\n\n### [examples/find_segments_with_message.ipynb](/tools/car_porting/examples/find_segments_with_message.ipynb)\n\nSearches for segments where a set of given CAN message IDs are present. In the example, we search for all messages\nused for CAN-based ignition detection.\n\n```\nMatch found: 46b21f1c5f7aa885/2024-01-23--15-19-34/20/s    JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: a63a23c3e628f288/2023-11-05--18-36-20/8/s     JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: ce31b7a998781ba8/2024-01-19--07-05-29/23/s    JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2023-12-25--19-31-00/4/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2024-01-10--14-33-57/2/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: ae679616266f4096/2023-12-05--15-43-46/4/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2023-11-18--17-49-42/3/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2024-01-03--21-57-09/25/s    RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-10--11-53-15/17/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-03--17-31-17/29/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-11-27--23-29-07/1/s     FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\n```\n","tools/release/README.md":"# openpilot releases\n\n```\n## release checklist\n\n### Go to staging\n- [ ] make a GitHub issue to track release with this checklist\n- [ ] create release master branch\n  - [ ] create a branch from upstream master named `zerotentwo` for release `v0.10.2`\n  - [ ] revert risky commits (double check with autonomy team)\n  - [ ] push the new branch\n- [ ] push to staging:\n  - [ ] make sure you are on the newly created release master branch (`zerotentwo`)\n  - [ ] run `BRANCH=devel-staging tools/release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch\n- [ ] bump version on master: `openpilot/common/version.h` and `RELEASES.md`\n- [ ] post on Discord, tag `@release crew`\n\n### Go to release\n- [ ] before going to release, test the following:\n  - [ ] update from previous release -> new release\n  - [ ] update from new release -> previous release\n  - [ ] fresh install with `openpilot-test.comma.ai`\n  - [ ] drive on fresh install\n  - [ ] no submodules; only the Chestnut big driving model uses LFS\n  - [ ] check MTBF, etc.\n  - [ ] stress test passes in production\n- [ ] publish the blog post\n- [ ] `git reset --hard origin/release-mici-staging`\n- [ ] tag the release: `git tag v0.X.X <commit-hash> && git push origin v0.X.X`\n- [ ] create GitHub release\n- [ ] final test install on `openpilot.comma.ai`\n- [ ] update factory provisioning\n- [ ] close out milestone and issue\n- [ ] post on Discord, X, etc.\n```\n"},"files":{"openpilot/tools/cabana/README.md":"# Cabana\n\nCabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/opendbc](https://github.com/commaai/opendbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai).\n\n## Usage Instructions\n\n```bash\n$ ./cabana -h\nUsage: ./cabana [options] [route]\n\n  route                     the drive to replay. find your drives at connect.comma.ai\n\nOptions:\n  --help                    show this help\n  --demo                    use a demo route instead of providing your own\n  --auto                    Auto load the route from the best available source (no video):\n                            internal, openpilotci, comma_api, car_segments, testing_closet\n  --qcam                    load qcamera\n  --wide-road               load wide road camera (alias: --ecam)\n  --cabin                   load cabin camera (alias: --dcam)\n  --msgq                    read can messages from the msgq\n  --panda                   read can messages from panda\n  --panda-serial <serial>   read can messages from panda with given serial\n  --socketcan <device>      read can messages from given SocketCAN device\n  --zmq <ip-address>        read can messages from zmq at the specified ip-address\n  --data_dir <dir>          local directory with routes\n  --no-vipc                 do not output video\n  --no-cache                turn off the local route file cache\n  --dbc <file>              dbc file to open\n```\n\n## Examples\n\n### Running Cabana in Demo Mode\nTo run Cabana using a built-in demo route, use the following command:\n\n```shell\ncabana --demo\n```\n\n### Loading a Specific Route\n\nTo load a specific route for replay, provide the route as an argument:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\"\n```\n\nReplace \"5beb9b58bd12b691/0000010a--a51155e496\" with your desired route identifier.\n\n\n### Running Cabana with multiple cameras\nTo run Cabana with multiple cameras, use the following command:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\" --cabin --wide-road\n```\n\n### Streaming CAN Messages from a comma Device\n\n[SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and start the bridge with the following command:\n\n```shell\ncd /data/openpilot\n./openpilot/cereal/messaging/bridge &\n```\n\nThen Run Cabana with the device's IP address:\n\n```shell\ncabana --zmq <ipaddress>\n```\n\nReplace &lt;ipaddress&gt; with your comma device's IP address.\n\nWhile streaming from the device, Cabana will log the CAN messages to a local directory. By default, this directory is ~/cabana_live_stream/. You can change the log directory in Cabana by navigating to menu -> tools -> settings.\n\nAfter disconnecting from the device, you can replay the logged CAN messages from the stream selector dialog -> browse local route.\n\n### Streaming CAN Messages from Panda\n\nTo read CAN messages from a connected Panda, use the following command:\n\n```shell\ncabana --panda\n```\n\n### Using the Stream Selector Dialog\n\nIf you run Cabana without any arguments, a stream selector dialog will pop up, allowing you to choose the stream.\n\n```shell\ncabana\n```\n\n## Additional Information\n\nFor more information, see the [openpilot wiki](https://github.com/commaai/openpilot/wiki/Cabana)\n","openpilot/tools/camerastream/README.md":"# Camera stream\n\n`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC.\n\n## Usage\n\n### On the device\nSSH into the device and run following in separate terminals:\n\n`cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n\n`cd /data/openpilot/system/loggerd && ./encoderd`\n\n`cd /data/openpilot/system/camerad && ./camerad`\n\nNote that both the device and your PC must be on the same openpilot commit.\n\nAlternatively paste this as a single command:\n```\n(\n  cd /data/openpilot\n  ./openpilot/cereal/messaging/bridge &\n\n  cd /data/openpilot/system/camerad/\n  ./camerad &\n\n  cd /data/openpilot/system/loggerd/\n  ./encoderd &\n\n  wait\n) ; trap 'kill $(jobs -p)' SIGINT\n```\nCtrl+C will stop all three processes.\n\n### On the PC\nDecode the stream with `compressed_vipc.py`:\n\n```cd ~/openpilot/tools/camerastream && ./compressed_vipc.py <ip>```\n\nTo actually display the stream, run `watch3` in separate terminal:\n\n```cd ~/openpilot/selfdrive/ui/ && ./watch3.py```\n\n## compressed_vipc.py usage\n```\n$ python3 compressed_vipc.py -h\nusage: compressed_vipc.py [-h] [--cams CAMS] [--server SERVER] [--silent] addr\n\nDecode video streams and broadcast on VisionIPC\n\npositional arguments:\n  addr             Address of comma three\n\noptions:\n  -h, --help       show this help message and exit\n  --cams CAMS      Cameras to decode\n  --server SERVER  choose vipc server name\n  --silent         Suppress debug output\n```\n\n\n## Example:\n```\ncd ~/openpilot/tools/camerastream && ./compressed_vipc.py comma-ffffffff --cams 0\ncd ~/openpilot/selfdrive/ui/ && ./watch3.py\n```\n","openpilot/tools/joystick/README.md":"# Joystick\n\n**Hardware needed**: device running openpilot, laptop, joystick (optional)\n\nWith joystick_control, you can connect your laptop to your comma device over the network and debug controls using a joystick or keyboard.\njoystick_control uses [inputs](https://pypi.org/project/inputs) which supports many common gamepads and joysticks.\n\n## Usage\n\nThe car must be off, and openpilot must be offroad before starting `joystick_control`.\n\n### Using a keyboard\n\nSSH into your comma device and start joystick_control with the following command:\n\n```shell\nopenpilot/tools/joystick/joystick_control.py --keyboard\n```\n\nThe available buttons and axes will print showing their key mappings. In general, the WASD keys control gas and brakes and steering torque in 5% increments.\n\n### Joystick on your comma three\n\nPlug the joystick into your comma three aux USB-C port. Then, SSH into the device and start `joystick_control.py`.\n\n### Joystick on your laptop\n\nIn order to use a joystick over the network, we need to run joystick_control locally from your laptop and have it send `testJoystick` packets over the network to the comma device.\n\n1. Connect a joystick to your PC.\n2. Connect your laptop to your comma device's hotspot and open a new SSH shell. Since joystick_control is being run on your laptop, we need to write a parameter to let controlsd know to start in joystick debug mode:\n   ```shell\n   # on your comma device\n   echo -n \"1\" > /data/params/d/JoystickDebugMode\n   ```\n3. Run bridge with your laptop's IP address. This republishes the `testJoystick` packets sent from your laptop so that openpilot can receive them:\n   ```shell\n   # on your comma device\n   openpilot/cereal/messaging/bridge {LAPTOP_IP} testJoystick\n   ```\n4. Start joystick_control on your laptop in ZMQ mode.\n   ```shell\n   # on your laptop\n   export ZMQ=1\n   openpilot/tools/joystick/joystick_control.py\n   ```\n\n---\nNow start your car and openpilot should go into joystick mode with an alert on startup! The status of the axes will display on the alert, while button statuses print in the shell.\n\nMake sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.\n\n![](https://github.com/commaai/openpilot/assets/8762862/e640cbca-cb7a-4dcb-abce-b23b036ad8e7)\n","openpilot/tools/lateral_maneuvers/README.md":"# Lateral Maneuvers Testing Tool\n\n> [!WARNING]\n> Use caution when using this tool.\n\nTest your vehicle's lateral control tuning with this tool. The tool will test the vehicle's ability to follow a few lateral maneuvers and includes a tool to generate a report from the route.\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. The full maneuver suite runs at 20 and 30 mph.\n3. Enable \"Lateral Maneuver Mode\" in Settings > Developer on the device while offroad. Alternatively, set the parameter manually:\n\n   ```sh\n   echo -n 1 > /data/params/d/LateralManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see \"Lateral Maneuver Mode\".\n\n5. Ensure the area ahead is clear, as openpilot will command lateral acceleration steps in this mode. Once you are ready, set ACC manually to the target speed shown on screen and let openpilot stabilize lateral. After 1 seconds of steady straight driving, the maneuver will begin automatically. openpilot lateral control stays engaged between maneuvers normally while waiting for the next maneuver's readiness conditions. The maneuver will be aborted and repeated if speed is out of range, steering is touched or openpilot disengages.\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/lateral_maneuvers/generate_report.py 98395b7c5b27882e/000001cc--5a73bde686\n\n    processing report for KIA_EV6\n    plotting maneuver: step right 20mph, runs: 3\n    plotting maneuver: step left 20mph, runs: 3\n    plotting maneuver: sine 0.5Hz 20mph, runs: 3\n    plotting maneuver: step right 30mph, runs: 3\n\n    Opening report: /home/batman/openpilot/tools/lateral_maneuvers/lateral_reports/KIA_EV6_98395b7c5b27882e_000001cc--5a73bde686.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","openpilot/tools/lib/README.md":"## LogReader\n\nRoute is a class for conveniently accessing all the [logs](/openpilot/system/loggerd/) from your routes. The LogReader class reads the non-video logs, i.e. rlog.bz2 and qlog.bz2. There's also a matching FrameReader class for reading the videos.\n\n```python\nfrom openpilot.tools.lib.route import Route\nfrom openpilot.tools.lib.logreader import LogReader\n\nr = Route(\"a2a0ccea32023010|2023-07-27--13-01-19\")\n\n# get a list of paths for the route's rlog files\nprint(r.log_paths())\n\n# and road camera (fcamera.hevc) files\nprint(r.camera_paths())\n\n# setup a LogReader to read the route's first rlog\nlr = LogReader(r.log_paths()[0])\n\n# print out all the messages in the log\nimport codecs\ncodecs.register_error(\"strict\", codecs.backslashreplace_errors)\nfor msg in lr:\n  print(msg)\n\n# setup a LogReader for the route's second qlog\nlr = LogReader(r.log_paths()[1])\n\n# print all the steering angles values from the log\nfor msg in lr:\n  if msg.which() == \"carState\":\n    print(msg.carState.steeringAngleDeg)\n```\n\n### Segment Ranges\n\nWe also support a new format called a \"segment range\":\n\n```\n344c5c15b34f2d8a   /   2024-01-03--09-37-12   /     2:6    /       q\n[   dongle id     ] [       timestamp        ] [ selector ]  [ query type]\n```\n\nyou can specify which segments from a route to load\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4\")   # 4th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4:6\") # 4th and 5th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/-1\")  # last segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/:5\")  # first 5 segments\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/1:\")  # all except first segment\n```\n\nand can select which type of logs to grab\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/q\") # get qlogs\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/r\") # get rlogs (default)\n```\n","openpilot/tools/longitudinal_maneuvers/README.md":"# Longitudinal Maneuvers Testing Tool\n\nTest your vehicle's longitudinal control tuning with this tool. The tool will test the vehicle's ability to follow a few longitudinal maneuvers and includes a tool to generate a report from the route.\n\n<details><summary>Sample snapshot of a report.</summary><img width=\"600px\" src=\"https://github.com/user-attachments/assets/d18d0c7d-2bde-44c1-8e86-1741ed442ad8\"></details>\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. Locate either a large empty parking lot or road devoid of any car or foot traffic. Flat, straight road is preferred. The full maneuver suite can take 1 mile or more if left running, however it is recommended to disengage openpilot between maneuvers and turn around if there is not enough space.\n3. Turn off the vehicle and set this parameter which will signal to openpilot to start the longitudinal maneuver daemon:\n\n   ```sh\n   echo -n 1 > /data/params/d/LongitudinalManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see the \"Longitudinal Maneuver Mode\" alert:\n\n   ![videoframe_6652](https://github.com/user-attachments/assets/e9d4c95a-cd76-4ab7-933e-19937792fa0f)\n\n5. Ensure the road ahead is clear, as openpilot will not brake for any obstructions in this mode. Once you are ready, press \"Set\" on your steering wheel to start the tests. The tests will run for about 4 minutes. If you need to pause the tests, press \"Cancel\" on your steering wheel. You can resume the tests by pressing \"Resume\" on your steering wheel. \n\n   **Note:** For GM cars, it is recommended to hold down the resume button for all low-speed tests (starting, stopping and creep) to avoid the car entering standstill.\n\n   ![cog-clip-00 01 11 250-00 01 22 250](https://github.com/user-attachments/assets/c312c1cc-76e8-46e1-a05e-bb9dfb58994f)\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n   ![fin2](https://github.com/user-attachments/assets/c06960ae-7cfb-44af-beaa-4dc28848e49d)\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/longitudinal_maneuvers/generate_report.py 57048cfce01d9625/0000010e--5b26bc3be7 'pcm accel compensation'\n\n    processing report for LEXUS_ES_TSS2\n    plotting maneuver: start from stop, runs: 4\n    plotting maneuver: creep: alternate between +1m/s^2 and -1m/s^2, runs: 2\n    plotting maneuver: gas step response: +1m/s^2 from 20mph, runs: 2\n\n    Report written to /home/batman/openpilot/tools/longitudinal_maneuvers/longitudinal_reports/LEXUS_ES_TSS2_57048cfce01d9625_0000010e--5b26bc3be7.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","openpilot/tools/plotjuggler/README.md":"# PlotJuggler\n\n[PlotJuggler](https://github.com/facontidavide/PlotJuggler) is a tool to quickly visualize time series data, and we've written plugins to parse openpilot logs. Check out our plugins: https://github.com/commaai/PlotJuggler.\n\n## Installation\n\nOnce you've [set up the openpilot environment](/tools/README.md), this command will download PlotJuggler and install our plugins:\n\n`cd openpilot/tools/plotjuggler && ./juggle.py --install`\n\n## Usage\n\n```\n$ ./juggle.py -h\nusage: juggle.py [-h] [--demo] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]\n                 [route_or_segment_name]\n\nA helper to run PlotJuggler on openpilot routes\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to plot (cabana share URL accepted) (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --demo                Use the demo route instead of providing one (default: False)\n  --can                 Parse CAN data (default: False)\n  --stream              Start PlotJuggler in streaming mode (default: False)\n  --layout [LAYOUT]     Run PlotJuggler with a pre-defined layout (default: None)\n  --install             Install or update PlotJuggler + plugins (default: False)\n  --dbc DBC             Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically\n                        inferred from the logs. (default: None)\n\n```\n\nExample using route name:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496\"`\n\nExamples using segment:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1\"`\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1/q\" # use qlogs`\n\nExample using segment range:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/0:1\"`\n\n## Streaming\n\nExplore live data from your car! Follow these steps to stream from your comma device to your laptop:\n- Enable wifi tethering on your comma device\n- [SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and run `cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n- On your laptop, connect to the device's wifi hotspot\n- Start PlotJuggler with `ZMQ=1 ./juggle.py --stream`, find the `Cereal Subscriber` plugin in the dropdown under Streaming, and click `Start`.\n\nIf streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.\n\n## Demo\n\nFor a quick demo, go through the installation step and run this command:\n\n`./juggle.py --demo --layout=layouts/tuning.xml`\n\n## Layouts\n\nIf you create a layout that's useful for others, consider upstreaming it.\n\n### Tuning\n\nUse this layout to improve your car's tuning and generate plots for tuning PRs. Also see the [tuning wiki](https://github.com/commaai/openpilot/wiki/Tuning) and tuning PR template.\n\n`--layout layouts/tuning.xml`\n\n\n![screenshot](https://i.imgur.com/cizHCH3.png)\n","openpilot/tools/replay/README.md":"# Replay\n\n`replay` allows you to simulate a driving session by replaying all messages logged during the use of openpilot. This provides a way to analyze and visualize system behavior as if it were live.\n\n## Setup\n\nBefore starting a replay, you need to authenticate with your comma account using `auth.py`. This will allow you to access your routes from the server.\n\n```bash\n# Authenticate to access routes from your comma account:\npython3 openpilot/tools/lib/auth.py\n```\n\n## Replay a Remote Route\nYou can replay a route from your comma account by specifying the route name.\n\n```bash\n# Start a replay with a specific route:\nopenpilot/tools/replay/replay <route-name>\n\n# Example:\nopenpilot/tools/replay/replay '5beb9b58bd12b691/0000010a--a51155e496'\n\n# Replay the default demo route:\nopenpilot/tools/replay/replay --demo\n```\n\n## Replay a Local Route\nTo replay a route stored locally on your machine, specify the route name and provide the path to the directory where the route files are stored.\n\n```bash\n# Replay a local route\nopenpilot/tools/replay/replay <route-name> --data_dir=\"/path_to/route\"\n\n# Example:\n# If you have a local route stored at /path_to_routes with segments like:\n# 5beb9b58bd12b691/0000010a--a51155e496--0\n# 5beb9b58bd12b691/0000010a--a51155e496--1\n# You can replay it like this:\nopenpilot/tools/replay/replay \"5beb9b58bd12b691/0000010a--a51155e496\" --data_dir=\"/path_to_routes\"\n```\n\n## Send Messages via ZMQ\nBy default, replay sends messages via MSGQ. To switch to ZMQ, set the ZMQ environment variable.\n\n```bash\n# Start replay and send messages via ZMQ:\nZMQ=1 openpilot/tools/replay/replay <route-name>\n```\n\n## Usage\nFor more information on available options and arguments, use the help command:\n\n``` bash\n$ openpilot/tools/replay/replay -h\nUsage: openpilot/tools/replay/replay [options] route\nMock openpilot components by publishing logged messages.\n\nOptions:\n  -h, --help             Displays this help.\n  -a, --allow <allow>    whitelist of services to send (comma-separated)\n  -b, --block <block>    blacklist of services to send (comma-separated)\n  -c, --cache <n>        cache <n> segments in memory. default is 5\n  -s, --start <seconds>  start from <seconds>\n  -x <speed>             playback <speed>. between 0.2 - 3\n  --demo                 use a demo route instead of providing your own\n  --auto                 Auto load the route from the best available source (no video):\n                         internal, openpilotci, comma_api, car_segments, testing_closet\n  --data_dir <data_dir>  local directory with routes\n  --prefix <prefix>      set OPENPILOT_PREFIX\n  --cabin                  load cabin camera\n  --wide-road                 load wide road camera\n  --no-loop              stop at the end of the route\n  --no-cache             turn off local cache\n  --qcam                 load qcamera\n  --no-hw-decoder        disable HW video decoding\n  --no-vipc              do not output video\n  --all                  do output all messages including uiDebug, userBookmark.\n                         this may causes issues when used along with UI\n\nArguments:\n  route                  the drive to replay. find your drives at\n                         connect.comma.ai\n```\n\n## Visualize the Replay in the openpilot UI\nTo visualize the replay within the openpilot UI, run the following commands:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\ncd openpilot/selfdrive/ui && ./ui.py\n```\n\n## Work with plotjuggler\nIf you want to use replay with plotjuggler, you can stream messages by running:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\nopenpilot/tools/plotjuggler/juggle.py --stream\n```\n\n## watch3\n\nwatch all three cameras simultaneously from your comma three routes with watch3\n\nsimply replay a route using the `--cabin` and `--wide-road` flags:\n\n```bash\n# start a replay\ncd openpilot/tools/replay && ./replay --demo --cabin --wide-road\n\n# then start watch3\ncd openpilot/selfdrive/ui && ./watch3.py\n```\n\n![](https://i.imgur.com/IeaOdAb.png)\n\n## Stream CAN messages to your device\n\nReplay 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. Check out the [jungle repo](https://github.com/commaai/panda_jungle) for more info.\n\nIn order to run your device as if it was in a car:\n* connect a panda jungle to your PC\n* connect a comma device or panda to the jungle via OBD-C\n* run `can_replay.py`\n\n``` bash\nbatman:replay$ ./can_replay.py -h\nusage: can_replay.py [-h] [route_or_segment_name]\n\nReplay CAN messages from a route to all connected pandas and jungles\nin a loop.\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to replay. If not\n                        specified, a default public route will be\n                        used. (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n","openpilot/tools/sim/README.md":"openpilot in simulator\n=====================\n\nopenpilot implements a [bridge](run_bridge.py) that allows it to run in the [MetaDrive simulator](https://github.com/metadriverse/metadrive).\n\n## Launching openpilot\nFirst, start openpilot.\n``` bash\n# Run locally\n./openpilot/tools/sim/launch_openpilot.sh\n```\n\n## Bridge usage\n```\n$ ./run_bridge.py -h\nusage: run_bridge.py [-h] [--joystick] [--high_quality] [--dual_camera]\nBridge between the simulator and openpilot.\n\noptions:\n  -h, --help            show this help message and exit\n  --joystick\n  --high_quality\n  --dual_camera\n```\n\n#### Bridge Controls:\n- To engage openpilot press 2, then press 1 to increase the speed and 2 to decrease.\n- To disengage, press \"S\" (simulates a user brake)\n\n#### All inputs:\n\n```\n| key  |   functionality       |\n|------|-----------------------|\n|  1   | Cruise Resume / Accel |\n|  2   | Cruise Set    / Decel |\n|  3   | Cruise Cancel         |\n|  r   | Reset Simulation      |\n|  i   | Toggle Ignition       |\n|  q   | Exit all              |\n| wasd | Control manually      |\n```\n\n## MetaDrive\n\n### Launching Metadrive\nStart bridge processes located in openpilot/tools/sim:\n``` bash\n./run_bridge.py\n```","tools/README.md":"# openpilot tools\n\n## System Requirements\n\nopenpilot supports Linux alongside the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).\n\nMost of openpilot should work natively on macOS. On Windows, you can use WSL for a nearly native Linux experience.\n\n## Native setup on Linux and macOS\n\nFollow these instructions for a fully managed setup experience. If you'd like to manage the dependencies yourself, just read the setup scripts in this directory.\n\n**1. Clone openpilot**\n``` bash\ngit clone https://github.com/commaai/openpilot.git\n```\n\n**2. Run the setup script**\n``` bash\ncd openpilot\ntools/op.sh setup\n```\n\n**3. Activate a Python shell**\nActivate a shell with the Python dependencies installed:\n``` bash\nsource .venv/bin/activate\n```\n\n**4. Build openpilot**\n``` bash\nscons -u\n```\n\n## WSL on Windows\n\n[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Linux. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.\n\nFollow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to set up WSL. We recommend installing the `Ubuntu-24.04` distribution. Once your WSL environment is set up, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.\n\n**NOTE**: If you are running WSL 2 and experiencing performance issues with the UI or simulator, you may need to explicitly enable hardware acceleration by setting `GALLIUM_DRIVER=d3d12` before commands. Add `export GALLIUM_DRIVER=d3d12` to your `~/.bashrc` file to make it automatic for future sessions.\n\n## CTF\nLearn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md).\n\n## Directory Structure\n\n```\n├── car_porting/        # Tools for porting new cars\n├── release/            # Scripts for building openpilot releases\n└── scripts/            # Miscellaneous scripts\n```\n\nDevelopment tools such as cabana, plotjuggler, and replay live in [openpilot/tools/](/openpilot/tools/):\n\n```\n├── cabana/             # View and plot CAN messages from drives or in realtime\n├── camerastream/       # Cameras stream over the network\n├── joystick/           # Control your car with a joystick\n├── lib/                # Libraries to support the tools and reading openpilot logs\n├── plotjuggler/        # A tool to plot openpilot logs\n├── replay/             # Replay drives and mock openpilot services\n└── sim/                # Run openpilot in a simulator\n```\n","tools/car_porting/README.md":"# tools/car_porting\n\nCheck out [this blog post](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) for a high-level overview of porting a car.\n\n## Useful car porting utilities\n\nTesting car ports in your car is very time-consuming. Check out these utilities to do basic checks on your work before running it in your car.\n\n### [Cabana](/openpilot/tools/cabana/README.md)\n\nView your car's CAN signals through DBC files, which openpilot uses to parse and create messages that talk to the car.\n\nExample:\n```bash\n> openpilot/tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43'\n```\n\n### [tools/car_porting/auto_fingerprint.py](/tools/car_porting/auto_fingerprint.py)\n\nGiven a route and platform, automatically inserts FW fingerprints from the platform into the correct place in fingerprints.py\n\nExample:\n```bash\n> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK'\nAttempting to add fw version for:  OUTBACK\n```\n\n### [openpilot/selfdrive/car/tests/test_car_interfaces.py](/openpilot/selfdrive/car/tests/test_car_interfaces.py)\n\nFinds common bugs for car interfaces, without even requiring a route.\n\n\n#### Example: Typo in signal name\n```bash\n> tools/test_runner.py openpilot/selfdrive/car/tests/test_car_interfaces.py -k subaru  # replace with the brand you are working on\n\n=====================================================================\nFAILED openpilot/selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces::test_car_interfaces_165_SUBARU_LEGACY_7TH_GEN - KeyError: 'CruiseControlOOPS'\n\n```\n\n### [tools/car_porting/test_car_model.py](/tools/car_porting/test_car_model.py)\n\nGiven a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches.\n\n#### Example: panda safety mismatch for gasPressed\n```bash\n> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21'\n\n=====================================================================\nFAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate)\nAssert that panda safety matches openpilot's carState\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/home/batman/openpilot/opendbc_repo/opendbc/car/tests/test_models.py\", line 440, in test_panda_safety_carstate\n    self.assertFalse(failed_checks, f\"panda safety doesn't agree with CarState: {failed_checks}\")\nAssertionError: {'gasPressed': 116} is not false : panda safety doesn't agree with CarState: {'gasPressed': 116}\n```\n\n## Jupyter notebooks\n\nTo use these notebooks, install Jupyter within your [openpilot virtual environment](/tools/README.md).\n\n```bash\nuv pip install jupyter ipykernel\n```\n\nLaunching:\n\n```bash\njupyter notebook\n```\n\n### [examples/subaru_steer_temp_fault.ipynb](/tools/car_porting/examples/subaru_steer_temp_fault.ipynb)\n\nAn example of searching through a database of segments for a specific condition, and plotting the results.\n\n![steer warning example](https://github.com/commaai/openpilot/assets/9648890/d60ad120-4b44-4974-ac79-adc660fb8fe2)\n\n*a plot of the steer_warning vs steering angle, where we can see it is clearly caused by a large steering angle change*\n\n### [examples/subaru_long_accel.ipynb](/tools/car_porting/examples/subaru_long_accel.ipynb)\n\nAn example of plotting the response of an actuator when it is active.\n\n![brake pressure example](https://github.com/commaai/openpilot/assets/9648890/8f32cf1d-8fc0-4407-b540-70625ebbf082)\n\n*a plot of the brake_pressure vs acceleration, where we can see it is a fairly linear response.*\n\n### [examples/ford_vin_fingerprint.ipynb](/tools/car_porting/examples/ford_vin_fingerprint.ipynb)\n\nIn this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\n\n```\nvin: 1FM5K8GC7LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 00000000000XXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 3FTTW8F98NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 1FTVW1EL4NWXXXXXX real platform: FORD F-150 LIGHTNING 1ST GEN       determined platform: FORD F-150 LIGHTNING 1ST GEN      correct: True\nvin: 1FM5K7LC0MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: WF0NXXGCHNJXXXXXX real platform: FORD FOCUS 4TH GEN                 determined platform: mock                              correct: False\nvin: 1FMCU9J94MUXXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 5LM5J7XC9LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FMCR9B69NRXXXXXX real platform: FORD BRONCO SPORT 1ST GEN          determined platform: mock                              correct: False\nvin: 3FMTK3SU0MMXXXXXX real platform: FORD MUSTANG MACH-E 1ST GEN        determined platform: FORD MUSTANG MACH-E 1ST GEN       correct: True\nvin: 1FM5K8HC7MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 1FM5K8GC7NGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 5LM5J7XC8MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\n```\n\n### [examples/find_segments_with_message.ipynb](/tools/car_porting/examples/find_segments_with_message.ipynb)\n\nSearches for segments where a set of given CAN message IDs are present. In the example, we search for all messages\nused for CAN-based ignition detection.\n\n```\nMatch found: 46b21f1c5f7aa885/2024-01-23--15-19-34/20/s    JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: a63a23c3e628f288/2023-11-05--18-36-20/8/s     JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: ce31b7a998781ba8/2024-01-19--07-05-29/23/s    JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2023-12-25--19-31-00/4/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2024-01-10--14-33-57/2/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: ae679616266f4096/2023-12-05--15-43-46/4/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2023-11-18--17-49-42/3/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2024-01-03--21-57-09/25/s    RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-10--11-53-15/17/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-03--17-31-17/29/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-11-27--23-29-07/1/s     FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\n```\n","tools/release/README.md":"# openpilot releases\n\n```\n## release checklist\n\n### Go to staging\n- [ ] make a GitHub issue to track release with this checklist\n- [ ] create release master branch\n  - [ ] create a branch from upstream master named `zerotentwo` for release `v0.10.2`\n  - [ ] revert risky commits (double check with autonomy team)\n  - [ ] push the new branch\n- [ ] push to staging:\n  - [ ] make sure you are on the newly created release master branch (`zerotentwo`)\n  - [ ] run `BRANCH=devel-staging tools/release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch\n- [ ] bump version on master: `openpilot/common/version.h` and `RELEASES.md`\n- [ ] post on Discord, tag `@release crew`\n\n### Go to release\n- [ ] before going to release, test the following:\n  - [ ] update from previous release -> new release\n  - [ ] update from new release -> previous release\n  - [ ] fresh install with `openpilot-test.comma.ai`\n  - [ ] drive on fresh install\n  - [ ] no submodules; only the Chestnut big driving model uses LFS\n  - [ ] check MTBF, etc.\n  - [ ] stress test passes in production\n- [ ] publish the blog post\n- [ ] `git reset --hard origin/release-mici-staging`\n- [ ] tag the release: `git tag v0.X.X <commit-hash> && git push origin v0.X.X`\n- [ ] create GitHub release\n- [ ] final test install on `openpilot.comma.ai`\n- [ ] update factory provisioning\n- [ ] close out milestone and issue\n- [ ] post on Discord, X, etc.\n```\n"},"items":[{"name":"README.md","path":"openpilot/tools/cabana/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/cabana/README.md","title":"cabana Documentation","category":"plugin-manifest","format":"markdown","content":"# Cabana\n\nCabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/opendbc](https://github.com/commaai/opendbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai).\n\n## Usage Instructions\n\n```bash\n$ ./cabana -h\nUsage: ./cabana [options] [route]\n\n  route                     the drive to replay. find your drives at connect.comma.ai\n\nOptions:\n  --help                    show this help\n  --demo                    use a demo route instead of providing your own\n  --auto                    Auto load the route from the best available source (no video):\n                            internal, openpilotci, comma_api, car_segments, testing_closet\n  --qcam                    load qcamera\n  --wide-road               load wide road camera (alias: --ecam)\n  --cabin                   load cabin camera (alias: --dcam)\n  --msgq                    read can messages from the msgq\n  --panda                   read can messages from panda\n  --panda-serial <serial>   read can messages from panda with given serial\n  --socketcan <device>      read can messages from given SocketCAN device\n  --zmq <ip-address>        read can messages from zmq at the specified ip-address\n  --data_dir <dir>          local directory with routes\n  --no-vipc                 do not output video\n  --no-cache                turn off the local route file cache\n  --dbc <file>              dbc file to open\n```\n\n## Examples\n\n### Running Cabana in Demo Mode\nTo run Cabana using a built-in demo route, use the following command:\n\n```shell\ncabana --demo\n```\n\n### Loading a Specific Route\n\nTo load a specific route for replay, provide the route as an argument:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\"\n```\n\nReplace \"5beb9b58bd12b691/0000010a--a51155e496\" with your desired route identifier.\n\n\n### Running Cabana with multiple cameras\nTo run Cabana with multiple cameras, use the following command:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\" --cabin --wide-road\n```\n\n### Streaming CAN Messages from a comma Device\n\n[SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and start the bridge with the following command:\n\n```shell\ncd /data/openpilot\n./openpilot/cereal/messaging/bridge &\n```\n\nThen Run Cabana with the device's IP address:\n\n```shell\ncabana --zmq <ipaddress>\n```\n\nReplace &lt;ipaddress&gt; with your comma device's IP address.\n\nWhile streaming from the device, Cabana will log the CAN messages to a local directory. By default, this directory is ~/cabana_live_stream/. You can change the log directory in Cabana by navigating to menu -> tools -> settings.\n\nAfter disconnecting from the device, you can replay the logged CAN messages from the stream selector dialog -> browse local route.\n\n### Streaming CAN Messages from Panda\n\nTo read CAN messages from a connected Panda, use the following command:\n\n```shell\ncabana --panda\n```\n\n### Using the Stream Selector Dialog\n\nIf you run Cabana without any arguments, a stream selector dialog will pop up, allowing you to choose the stream.\n\n```shell\ncabana\n```\n\n## Additional Information\n\nFor more information, see the [openpilot wiki](https://github.com/commaai/openpilot/wiki/Cabana)\n","isInternal":false,"tokens":839,"sizeBytes":3452},{"name":"README.md","path":"openpilot/tools/camerastream/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/camerastream/README.md","title":"camerastream Documentation","category":"plugin-manifest","format":"markdown","content":"# Camera stream\n\n`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC.\n\n## Usage\n\n### On the device\nSSH into the device and run following in separate terminals:\n\n`cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n\n`cd /data/openpilot/system/loggerd && ./encoderd`\n\n`cd /data/openpilot/system/camerad && ./camerad`\n\nNote that both the device and your PC must be on the same openpilot commit.\n\nAlternatively paste this as a single command:\n```\n(\n  cd /data/openpilot\n  ./openpilot/cereal/messaging/bridge &\n\n  cd /data/openpilot/system/camerad/\n  ./camerad &\n\n  cd /data/openpilot/system/loggerd/\n  ./encoderd &\n\n  wait\n) ; trap 'kill $(jobs -p)' SIGINT\n```\nCtrl+C will stop all three processes.\n\n### On the PC\nDecode the stream with `compressed_vipc.py`:\n\n```cd ~/openpilot/tools/camerastream && ./compressed_vipc.py <ip>```\n\nTo actually display the stream, run `watch3` in separate terminal:\n\n```cd ~/openpilot/selfdrive/ui/ && ./watch3.py```\n\n## compressed_vipc.py usage\n```\n$ python3 compressed_vipc.py -h\nusage: compressed_vipc.py [-h] [--cams CAMS] [--server SERVER] [--silent] addr\n\nDecode video streams and broadcast on VisionIPC\n\npositional arguments:\n  addr             Address of comma three\n\noptions:\n  -h, --help       show this help message and exit\n  --cams CAMS      Cameras to decode\n  --server SERVER  choose vipc server name\n  --silent         Suppress debug output\n```\n\n\n## Example:\n```\ncd ~/openpilot/tools/camerastream && ./compressed_vipc.py comma-ffffffff --cams 0\ncd ~/openpilot/selfdrive/ui/ && ./watch3.py\n```\n","isInternal":false,"tokens":443,"sizeBytes":1622},{"name":"README.md","path":"openpilot/tools/joystick/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/joystick/README.md","title":"joystick Documentation","category":"plugin-manifest","format":"markdown","content":"# Joystick\n\n**Hardware needed**: device running openpilot, laptop, joystick (optional)\n\nWith joystick_control, you can connect your laptop to your comma device over the network and debug controls using a joystick or keyboard.\njoystick_control uses [inputs](https://pypi.org/project/inputs) which supports many common gamepads and joysticks.\n\n## Usage\n\nThe car must be off, and openpilot must be offroad before starting `joystick_control`.\n\n### Using a keyboard\n\nSSH into your comma device and start joystick_control with the following command:\n\n```shell\nopenpilot/tools/joystick/joystick_control.py --keyboard\n```\n\nThe available buttons and axes will print showing their key mappings. In general, the WASD keys control gas and brakes and steering torque in 5% increments.\n\n### Joystick on your comma three\n\nPlug the joystick into your comma three aux USB-C port. Then, SSH into the device and start `joystick_control.py`.\n\n### Joystick on your laptop\n\nIn order to use a joystick over the network, we need to run joystick_control locally from your laptop and have it send `testJoystick` packets over the network to the comma device.\n\n1. Connect a joystick to your PC.\n2. Connect your laptop to your comma device's hotspot and open a new SSH shell. Since joystick_control is being run on your laptop, we need to write a parameter to let controlsd know to start in joystick debug mode:\n   ```shell\n   # on your comma device\n   echo -n \"1\" > /data/params/d/JoystickDebugMode\n   ```\n3. Run bridge with your laptop's IP address. This republishes the `testJoystick` packets sent from your laptop so that openpilot can receive them:\n   ```shell\n   # on your comma device\n   openpilot/cereal/messaging/bridge {LAPTOP_IP} testJoystick\n   ```\n4. Start joystick_control on your laptop in ZMQ mode.\n   ```shell\n   # on your laptop\n   export ZMQ=1\n   openpilot/tools/joystick/joystick_control.py\n   ```\n\n---\nNow start your car and openpilot should go into joystick mode with an alert on startup! The status of the axes will display on the alert, while button statuses print in the shell.\n\nMake sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.\n\n![](https://github.com/commaai/openpilot/assets/8762862/e640cbca-cb7a-4dcb-abce-b23b036ad8e7)\n","isInternal":false,"tokens":559,"sizeBytes":2342},{"name":"README.md","path":"openpilot/tools/lateral_maneuvers/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/lateral_maneuvers/README.md","title":"lateral_maneuvers Documentation","category":"plugin-manifest","format":"markdown","content":"# Lateral Maneuvers Testing Tool\n\n> [!WARNING]\n> Use caution when using this tool.\n\nTest your vehicle's lateral control tuning with this tool. The tool will test the vehicle's ability to follow a few lateral maneuvers and includes a tool to generate a report from the route.\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. The full maneuver suite runs at 20 and 30 mph.\n3. Enable \"Lateral Maneuver Mode\" in Settings > Developer on the device while offroad. Alternatively, set the parameter manually:\n\n   ```sh\n   echo -n 1 > /data/params/d/LateralManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see \"Lateral Maneuver Mode\".\n\n5. Ensure the area ahead is clear, as openpilot will command lateral acceleration steps in this mode. Once you are ready, set ACC manually to the target speed shown on screen and let openpilot stabilize lateral. After 1 seconds of steady straight driving, the maneuver will begin automatically. openpilot lateral control stays engaged between maneuvers normally while waiting for the next maneuver's readiness conditions. The maneuver will be aborted and repeated if speed is out of range, steering is touched or openpilot disengages.\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/lateral_maneuvers/generate_report.py 98395b7c5b27882e/000001cc--5a73bde686\n\n    processing report for KIA_EV6\n    plotting maneuver: step right 20mph, runs: 3\n    plotting maneuver: step left 20mph, runs: 3\n    plotting maneuver: sine 0.5Hz 20mph, runs: 3\n    plotting maneuver: step right 30mph, runs: 3\n\n    Opening report: /home/batman/openpilot/tools/lateral_maneuvers/lateral_reports/KIA_EV6_98395b7c5b27882e_000001cc--5a73bde686.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","isInternal":false,"tokens":603,"sizeBytes":2354},{"name":"README.md","path":"openpilot/tools/lib/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/lib/README.md","title":"lib Documentation","category":"plugin-manifest","format":"markdown","content":"## LogReader\n\nRoute is a class for conveniently accessing all the [logs](/openpilot/system/loggerd/) from your routes. The LogReader class reads the non-video logs, i.e. rlog.bz2 and qlog.bz2. There's also a matching FrameReader class for reading the videos.\n\n```python\nfrom openpilot.tools.lib.route import Route\nfrom openpilot.tools.lib.logreader import LogReader\n\nr = Route(\"a2a0ccea32023010|2023-07-27--13-01-19\")\n\n# get a list of paths for the route's rlog files\nprint(r.log_paths())\n\n# and road camera (fcamera.hevc) files\nprint(r.camera_paths())\n\n# setup a LogReader to read the route's first rlog\nlr = LogReader(r.log_paths()[0])\n\n# print out all the messages in the log\nimport codecs\ncodecs.register_error(\"strict\", codecs.backslashreplace_errors)\nfor msg in lr:\n  print(msg)\n\n# setup a LogReader for the route's second qlog\nlr = LogReader(r.log_paths()[1])\n\n# print all the steering angles values from the log\nfor msg in lr:\n  if msg.which() == \"carState\":\n    print(msg.carState.steeringAngleDeg)\n```\n\n### Segment Ranges\n\nWe also support a new format called a \"segment range\":\n\n```\n344c5c15b34f2d8a   /   2024-01-03--09-37-12   /     2:6    /       q\n[   dongle id     ] [       timestamp        ] [ selector ]  [ query type]\n```\n\nyou can specify which segments from a route to load\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4\")   # 4th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4:6\") # 4th and 5th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/-1\")  # last segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/:5\")  # first 5 segments\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/1:\")  # all except first segment\n```\n\nand can select which type of logs to grab\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/q\") # get qlogs\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/r\") # get rlogs (default)\n```\n","isInternal":false,"tokens":647,"sizeBytes":1918},{"name":"README.md","path":"openpilot/tools/longitudinal_maneuvers/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/longitudinal_maneuvers/README.md","title":"longitudinal_maneuvers Documentation","category":"plugin-manifest","format":"markdown","content":"# Longitudinal Maneuvers Testing Tool\n\nTest your vehicle's longitudinal control tuning with this tool. The tool will test the vehicle's ability to follow a few longitudinal maneuvers and includes a tool to generate a report from the route.\n\n<details><summary>Sample snapshot of a report.</summary><img width=\"600px\" src=\"https://github.com/user-attachments/assets/d18d0c7d-2bde-44c1-8e86-1741ed442ad8\"></details>\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. Locate either a large empty parking lot or road devoid of any car or foot traffic. Flat, straight road is preferred. The full maneuver suite can take 1 mile or more if left running, however it is recommended to disengage openpilot between maneuvers and turn around if there is not enough space.\n3. Turn off the vehicle and set this parameter which will signal to openpilot to start the longitudinal maneuver daemon:\n\n   ```sh\n   echo -n 1 > /data/params/d/LongitudinalManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see the \"Longitudinal Maneuver Mode\" alert:\n\n   ![videoframe_6652](https://github.com/user-attachments/assets/e9d4c95a-cd76-4ab7-933e-19937792fa0f)\n\n5. Ensure the road ahead is clear, as openpilot will not brake for any obstructions in this mode. Once you are ready, press \"Set\" on your steering wheel to start the tests. The tests will run for about 4 minutes. If you need to pause the tests, press \"Cancel\" on your steering wheel. You can resume the tests by pressing \"Resume\" on your steering wheel. \n\n   **Note:** For GM cars, it is recommended to hold down the resume button for all low-speed tests (starting, stopping and creep) to avoid the car entering standstill.\n\n   ![cog-clip-00 01 11 250-00 01 22 250](https://github.com/user-attachments/assets/c312c1cc-76e8-46e1-a05e-bb9dfb58994f)\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n   ![fin2](https://github.com/user-attachments/assets/c06960ae-7cfb-44af-beaa-4dc28848e49d)\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/longitudinal_maneuvers/generate_report.py 57048cfce01d9625/0000010e--5b26bc3be7 'pcm accel compensation'\n\n    processing report for LEXUS_ES_TSS2\n    plotting maneuver: start from stop, runs: 4\n    plotting maneuver: creep: alternate between +1m/s^2 and -1m/s^2, runs: 2\n    plotting maneuver: gas step response: +1m/s^2 from 20mph, runs: 2\n\n    Report written to /home/batman/openpilot/tools/longitudinal_maneuvers/longitudinal_reports/LEXUS_ES_TSS2_57048cfce01d9625_0000010e--5b26bc3be7.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n","isInternal":false,"tokens":864,"sizeBytes":3114},{"name":"README.md","path":"openpilot/tools/plotjuggler/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/plotjuggler/README.md","title":"plotjuggler Documentation","category":"plugin-manifest","format":"markdown","content":"# PlotJuggler\n\n[PlotJuggler](https://github.com/facontidavide/PlotJuggler) is a tool to quickly visualize time series data, and we've written plugins to parse openpilot logs. Check out our plugins: https://github.com/commaai/PlotJuggler.\n\n## Installation\n\nOnce you've [set up the openpilot environment](/tools/README.md), this command will download PlotJuggler and install our plugins:\n\n`cd openpilot/tools/plotjuggler && ./juggle.py --install`\n\n## Usage\n\n```\n$ ./juggle.py -h\nusage: juggle.py [-h] [--demo] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]\n                 [route_or_segment_name]\n\nA helper to run PlotJuggler on openpilot routes\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to plot (cabana share URL accepted) (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --demo                Use the demo route instead of providing one (default: False)\n  --can                 Parse CAN data (default: False)\n  --stream              Start PlotJuggler in streaming mode (default: False)\n  --layout [LAYOUT]     Run PlotJuggler with a pre-defined layout (default: None)\n  --install             Install or update PlotJuggler + plugins (default: False)\n  --dbc DBC             Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically\n                        inferred from the logs. (default: None)\n\n```\n\nExample using route name:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496\"`\n\nExamples using segment:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1\"`\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1/q\" # use qlogs`\n\nExample using segment range:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/0:1\"`\n\n## Streaming\n\nExplore live data from your car! Follow these steps to stream from your comma device to your laptop:\n- Enable wifi tethering on your comma device\n- [SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and run `cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n- On your laptop, connect to the device's wifi hotspot\n- Start PlotJuggler with `ZMQ=1 ./juggle.py --stream`, find the `Cereal Subscriber` plugin in the dropdown under Streaming, and click `Start`.\n\nIf streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.\n\n## Demo\n\nFor a quick demo, go through the installation step and run this command:\n\n`./juggle.py --demo --layout=layouts/tuning.xml`\n\n## Layouts\n\nIf you create a layout that's useful for others, consider upstreaming it.\n\n### Tuning\n\nUse this layout to improve your car's tuning and generate plots for tuning PRs. Also see the [tuning wiki](https://github.com/commaai/openpilot/wiki/Tuning) and tuning PR template.\n\n`--layout layouts/tuning.xml`\n\n\n![screenshot](https://i.imgur.com/cizHCH3.png)\n","isInternal":false,"tokens":780,"sizeBytes":2890},{"name":"README.md","path":"openpilot/tools/replay/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/replay/README.md","title":"replay Documentation","category":"plugin-manifest","format":"markdown","content":"# Replay\n\n`replay` allows you to simulate a driving session by replaying all messages logged during the use of openpilot. This provides a way to analyze and visualize system behavior as if it were live.\n\n## Setup\n\nBefore starting a replay, you need to authenticate with your comma account using `auth.py`. This will allow you to access your routes from the server.\n\n```bash\n# Authenticate to access routes from your comma account:\npython3 openpilot/tools/lib/auth.py\n```\n\n## Replay a Remote Route\nYou can replay a route from your comma account by specifying the route name.\n\n```bash\n# Start a replay with a specific route:\nopenpilot/tools/replay/replay <route-name>\n\n# Example:\nopenpilot/tools/replay/replay '5beb9b58bd12b691/0000010a--a51155e496'\n\n# Replay the default demo route:\nopenpilot/tools/replay/replay --demo\n```\n\n## Replay a Local Route\nTo replay a route stored locally on your machine, specify the route name and provide the path to the directory where the route files are stored.\n\n```bash\n# Replay a local route\nopenpilot/tools/replay/replay <route-name> --data_dir=\"/path_to/route\"\n\n# Example:\n# If you have a local route stored at /path_to_routes with segments like:\n# 5beb9b58bd12b691/0000010a--a51155e496--0\n# 5beb9b58bd12b691/0000010a--a51155e496--1\n# You can replay it like this:\nopenpilot/tools/replay/replay \"5beb9b58bd12b691/0000010a--a51155e496\" --data_dir=\"/path_to_routes\"\n```\n\n## Send Messages via ZMQ\nBy default, replay sends messages via MSGQ. To switch to ZMQ, set the ZMQ environment variable.\n\n```bash\n# Start replay and send messages via ZMQ:\nZMQ=1 openpilot/tools/replay/replay <route-name>\n```\n\n## Usage\nFor more information on available options and arguments, use the help command:\n\n``` bash\n$ openpilot/tools/replay/replay -h\nUsage: openpilot/tools/replay/replay [options] route\nMock openpilot components by publishing logged messages.\n\nOptions:\n  -h, --help             Displays this help.\n  -a, --allow <allow>    whitelist of services to send (comma-separated)\n  -b, --block <block>    blacklist of services to send (comma-separated)\n  -c, --cache <n>        cache <n> segments in memory. default is 5\n  -s, --start <seconds>  start from <seconds>\n  -x <speed>             playback <speed>. between 0.2 - 3\n  --demo                 use a demo route instead of providing your own\n  --auto                 Auto load the route from the best available source (no video):\n                         internal, openpilotci, comma_api, car_segments, testing_closet\n  --data_dir <data_dir>  local directory with routes\n  --prefix <prefix>      set OPENPILOT_PREFIX\n  --cabin                  load cabin camera\n  --wide-road                 load wide road camera\n  --no-loop              stop at the end of the route\n  --no-cache             turn off local cache\n  --qcam                 load qcamera\n  --no-hw-decoder        disable HW video decoding\n  --no-vipc              do not output video\n  --all                  do output all messages including uiDebug, userBookmark.\n                         this may causes issues when used along with UI\n\nArguments:\n  route                  the drive to replay. find your drives at\n                         connect.comma.ai\n```\n\n## Visualize the Replay in the openpilot UI\nTo visualize the replay within the openpilot UI, run the following commands:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\ncd openpilot/selfdrive/ui && ./ui.py\n```\n\n## Work with plotjuggler\nIf you want to use replay with plotjuggler, you can stream messages by running:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\nopenpilot/tools/plotjuggler/juggle.py --stream\n```\n\n## watch3\n\nwatch all three cameras simultaneously from your comma three routes with watch3\n\nsimply replay a route using the `--cabin` and `--wide-road` flags:\n\n```bash\n# start a replay\ncd openpilot/tools/replay && ./replay --demo --cabin --wide-road\n\n# then start watch3\ncd openpilot/selfdrive/ui && ./watch3.py\n```\n\n![](https://i.imgur.com/IeaOdAb.png)\n\n## Stream CAN messages to your device\n\nReplay 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. Check out the [jungle repo](https://github.com/commaai/panda_jungle) for more info.\n\nIn order to run your device as if it was in a car:\n* connect a panda jungle to your PC\n* connect a comma device or panda to the jungle via OBD-C\n* run `can_replay.py`\n\n``` bash\nbatman:replay$ ./can_replay.py -h\nusage: can_replay.py [-h] [route_or_segment_name]\n\nReplay CAN messages from a route to all connected pandas and jungles\nin a loop.\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to replay. If not\n                        specified, a default public route will be\n                        used. (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n","isInternal":false,"tokens":1257,"sizeBytes":4935},{"name":"README.md","path":"openpilot/tools/sim/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/openpilot/tools/sim/README.md","title":"sim Documentation","category":"plugin-manifest","format":"markdown","content":"openpilot in simulator\n=====================\n\nopenpilot implements a [bridge](run_bridge.py) that allows it to run in the [MetaDrive simulator](https://github.com/metadriverse/metadrive).\n\n## Launching openpilot\nFirst, start openpilot.\n``` bash\n# Run locally\n./openpilot/tools/sim/launch_openpilot.sh\n```\n\n## Bridge usage\n```\n$ ./run_bridge.py -h\nusage: run_bridge.py [-h] [--joystick] [--high_quality] [--dual_camera]\nBridge between the simulator and openpilot.\n\noptions:\n  -h, --help            show this help message and exit\n  --joystick\n  --high_quality\n  --dual_camera\n```\n\n#### Bridge Controls:\n- To engage openpilot press 2, then press 1 to increase the speed and 2 to decrease.\n- To disengage, press \"S\" (simulates a user brake)\n\n#### All inputs:\n\n```\n| key  |   functionality       |\n|------|-----------------------|\n|  1   | Cruise Resume / Accel |\n|  2   | Cruise Set    / Decel |\n|  3   | Cruise Cancel         |\n|  r   | Reset Simulation      |\n|  i   | Toggle Ignition       |\n|  q   | Exit all              |\n| wasd | Control manually      |\n```\n\n## MetaDrive\n\n### Launching Metadrive\nStart bridge processes located in openpilot/tools/sim:\n``` bash\n./run_bridge.py\n```","isInternal":false,"tokens":329,"sizeBytes":1184},{"name":"README.md","path":"tools/car_porting/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/tools/car_porting/README.md","title":"car_porting Documentation","category":"plugin-manifest","format":"markdown","content":"# tools/car_porting\n\nCheck out [this blog post](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) for a high-level overview of porting a car.\n\n## Useful car porting utilities\n\nTesting car ports in your car is very time-consuming. Check out these utilities to do basic checks on your work before running it in your car.\n\n### [Cabana](/openpilot/tools/cabana/README.md)\n\nView your car's CAN signals through DBC files, which openpilot uses to parse and create messages that talk to the car.\n\nExample:\n```bash\n> openpilot/tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43'\n```\n\n### [tools/car_porting/auto_fingerprint.py](/tools/car_porting/auto_fingerprint.py)\n\nGiven a route and platform, automatically inserts FW fingerprints from the platform into the correct place in fingerprints.py\n\nExample:\n```bash\n> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK'\nAttempting to add fw version for:  OUTBACK\n```\n\n### [openpilot/selfdrive/car/tests/test_car_interfaces.py](/openpilot/selfdrive/car/tests/test_car_interfaces.py)\n\nFinds common bugs for car interfaces, without even requiring a route.\n\n\n#### Example: Typo in signal name\n```bash\n> tools/test_runner.py openpilot/selfdrive/car/tests/test_car_interfaces.py -k subaru  # replace with the brand you are working on\n\n=====================================================================\nFAILED openpilot/selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces::test_car_interfaces_165_SUBARU_LEGACY_7TH_GEN - KeyError: 'CruiseControlOOPS'\n\n```\n\n### [tools/car_porting/test_car_model.py](/tools/car_porting/test_car_model.py)\n\nGiven a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches.\n\n#### Example: panda safety mismatch for gasPressed\n```bash\n> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21'\n\n=====================================================================\nFAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate)\nAssert that panda safety matches openpilot's carState\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/home/batman/openpilot/opendbc_repo/opendbc/car/tests/test_models.py\", line 440, in test_panda_safety_carstate\n    self.assertFalse(failed_checks, f\"panda safety doesn't agree with CarState: {failed_checks}\")\nAssertionError: {'gasPressed': 116} is not false : panda safety doesn't agree with CarState: {'gasPressed': 116}\n```\n\n## Jupyter notebooks\n\nTo use these notebooks, install Jupyter within your [openpilot virtual environment](/tools/README.md).\n\n```bash\nuv pip install jupyter ipykernel\n```\n\nLaunching:\n\n```bash\njupyter notebook\n```\n\n### [examples/subaru_steer_temp_fault.ipynb](/tools/car_porting/examples/subaru_steer_temp_fault.ipynb)\n\nAn example of searching through a database of segments for a specific condition, and plotting the results.\n\n![steer warning example](https://github.com/commaai/openpilot/assets/9648890/d60ad120-4b44-4974-ac79-adc660fb8fe2)\n\n*a plot of the steer_warning vs steering angle, where we can see it is clearly caused by a large steering angle change*\n\n### [examples/subaru_long_accel.ipynb](/tools/car_porting/examples/subaru_long_accel.ipynb)\n\nAn example of plotting the response of an actuator when it is active.\n\n![brake pressure example](https://github.com/commaai/openpilot/assets/9648890/8f32cf1d-8fc0-4407-b540-70625ebbf082)\n\n*a plot of the brake_pressure vs acceleration, where we can see it is a fairly linear response.*\n\n### [examples/ford_vin_fingerprint.ipynb](/tools/car_porting/examples/ford_vin_fingerprint.ipynb)\n\nIn this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\n\n```\nvin: 1FM5K8GC7LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 00000000000XXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 3FTTW8F98NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 1FTVW1EL4NWXXXXXX real platform: FORD F-150 LIGHTNING 1ST GEN       determined platform: FORD F-150 LIGHTNING 1ST GEN      correct: True\nvin: 1FM5K7LC0MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: WF0NXXGCHNJXXXXXX real platform: FORD FOCUS 4TH GEN                 determined platform: mock                              correct: False\nvin: 1FMCU9J94MUXXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 5LM5J7XC9LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FMCR9B69NRXXXXXX real platform: FORD BRONCO SPORT 1ST GEN          determined platform: mock                              correct: False\nvin: 3FMTK3SU0MMXXXXXX real platform: FORD MUSTANG MACH-E 1ST GEN        determined platform: FORD MUSTANG MACH-E 1ST GEN       correct: True\nvin: 1FM5K8HC7MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 1FM5K8GC7NGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 5LM5J7XC8MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\n```\n\n### [examples/find_segments_with_message.ipynb](/tools/car_porting/examples/find_segments_with_message.ipynb)\n\nSearches for segments where a set of given CAN message IDs are present. In the example, we search for all messages\nused for CAN-based ignition detection.\n\n```\nMatch found: 46b21f1c5f7aa885/2024-01-23--15-19-34/20/s    JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: a63a23c3e628f288/2023-11-05--18-36-20/8/s     JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: ce31b7a998781ba8/2024-01-19--07-05-29/23/s    JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2023-12-25--19-31-00/4/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2024-01-10--14-33-57/2/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: ae679616266f4096/2023-12-05--15-43-46/4/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2023-11-18--17-49-42/3/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2024-01-03--21-57-09/25/s    RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-10--11-53-15/17/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-03--17-31-17/29/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-11-27--23-29-07/1/s     FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\n```\n","isInternal":false,"tokens":2084,"sizeBytes":7549},{"name":"README.md","path":"tools/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/tools/README.md","title":"tools Documentation","category":"plugin-manifest","format":"markdown","content":"# openpilot tools\n\n## System Requirements\n\nopenpilot supports Linux alongside the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).\n\nMost of openpilot should work natively on macOS. On Windows, you can use WSL for a nearly native Linux experience.\n\n## Native setup on Linux and macOS\n\nFollow these instructions for a fully managed setup experience. If you'd like to manage the dependencies yourself, just read the setup scripts in this directory.\n\n**1. Clone openpilot**\n``` bash\ngit clone https://github.com/commaai/openpilot.git\n```\n\n**2. Run the setup script**\n``` bash\ncd openpilot\ntools/op.sh setup\n```\n\n**3. Activate a Python shell**\nActivate a shell with the Python dependencies installed:\n``` bash\nsource .venv/bin/activate\n```\n\n**4. Build openpilot**\n``` bash\nscons -u\n```\n\n## WSL on Windows\n\n[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Linux. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.\n\nFollow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to set up WSL. We recommend installing the `Ubuntu-24.04` distribution. Once your WSL environment is set up, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.\n\n**NOTE**: If you are running WSL 2 and experiencing performance issues with the UI or simulator, you may need to explicitly enable hardware acceleration by setting `GALLIUM_DRIVER=d3d12` before commands. Add `export GALLIUM_DRIVER=d3d12` to your `~/.bashrc` file to make it automatic for future sessions.\n\n## CTF\nLearn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md).\n\n## Directory Structure\n\n```\n├── car_porting/        # Tools for porting new cars\n├── release/            # Scripts for building openpilot releases\n└── scripts/            # Miscellaneous scripts\n```\n\nDevelopment tools such as cabana, plotjuggler, and replay live in [openpilot/tools/](/openpilot/tools/):\n\n```\n├── cabana/             # View and plot CAN messages from drives or in realtime\n├── camerastream/       # Cameras stream over the network\n├── joystick/           # Control your car with a joystick\n├── lib/                # Libraries to support the tools and reading openpilot logs\n├── plotjuggler/        # A tool to plot openpilot logs\n├── replay/             # Replay drives and mock openpilot services\n└── sim/                # Run openpilot in a simulator\n```\n","isInternal":false,"tokens":663,"sizeBytes":2761},{"name":"README.md","path":"tools/release/README.md","rawUrl":"https://raw.githubusercontent.com/commaai/openpilot/HEAD/tools/release/README.md","title":"release Documentation","category":"plugin-manifest","format":"markdown","content":"# openpilot releases\n\n```\n## release checklist\n\n### Go to staging\n- [ ] make a GitHub issue to track release with this checklist\n- [ ] create release master branch\n  - [ ] create a branch from upstream master named `zerotentwo` for release `v0.10.2`\n  - [ ] revert risky commits (double check with autonomy team)\n  - [ ] push the new branch\n- [ ] push to staging:\n  - [ ] make sure you are on the newly created release master branch (`zerotentwo`)\n  - [ ] run `BRANCH=devel-staging tools/release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch\n- [ ] bump version on master: `openpilot/common/version.h` and `RELEASES.md`\n- [ ] post on Discord, tag `@release crew`\n\n### Go to release\n- [ ] before going to release, test the following:\n  - [ ] update from previous release -> new release\n  - [ ] update from new release -> previous release\n  - [ ] fresh install with `openpilot-test.comma.ai`\n  - [ ] drive on fresh install\n  - [ ] no submodules; only the Chestnut big driving model uses LFS\n  - [ ] check MTBF, etc.\n  - [ ] stress test passes in production\n- [ ] publish the blog post\n- [ ] `git reset --hard origin/release-mici-staging`\n- [ ] tag the release: `git tag v0.X.X <commit-hash> && git push origin v0.X.X`\n- [ ] create GitHub release\n- [ ] final test install on `openpilot.comma.ai`\n- [ ] update factory provisioning\n- [ ] close out milestone and issue\n- [ ] post on Discord, X, etc.\n```\n","isInternal":false,"tokens":398,"sizeBytes":1476}],"systemPromptSnippet":"<yakaai_skills repo=\"commaai/openpilot\">\n<!-- File: openpilot/tools/cabana/README.md (Tokens: ~839 | Category: plugin-manifest) -->\n# Cabana\n\nCabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/opendbc](https://github.com/commaai/opendbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai).\n\n## Usage Instructions\n\n```bash\n$ ./cabana -h\nUsage: ./cabana [options] [route]\n\n  route                     the drive to replay. find your drives at connect.comma.ai\n\nOptions:\n  --help                    show this help\n  --demo                    use a demo route instead of providing your own\n  --auto                    Auto load the route from the best available source (no video):\n                            internal, openpilotci, comma_api, car_segments, testing_closet\n  --qcam                    load qcamera\n  --wide-road               load wide road camera (alias: --ecam)\n  --cabin                   load cabin camera (alias: --dcam)\n  --msgq                    read can messages from the msgq\n  --panda                   read can messages from panda\n  --panda-serial <serial>   read can messages from panda with given serial\n  --socketcan <device>      read can messages from given SocketCAN device\n  --zmq <ip-address>        read can messages from zmq at the specified ip-address\n  --data_dir <dir>          local directory with routes\n  --no-vipc                 do not output video\n  --no-cache                turn off the local route file cache\n  --dbc <file>              dbc file to open\n```\n\n## Examples\n\n### Running Cabana in Demo Mode\nTo run Cabana using a built-in demo route, use the following command:\n\n```shell\ncabana --demo\n```\n\n### Loading a Specific Route\n\nTo load a specific route for replay, provide the route as an argument:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\"\n```\n\nReplace \"5beb9b58bd12b691/0000010a--a51155e496\" with your desired route identifier.\n\n\n### Running Cabana with multiple cameras\nTo run Cabana with multiple cameras, use the following command:\n\n```shell\ncabana \"5beb9b58bd12b691/0000010a--a51155e496\" --cabin --wide-road\n```\n\n### Streaming CAN Messages from a comma Device\n\n[SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and start the bridge with the following command:\n\n```shell\ncd /data/openpilot\n./openpilot/cereal/messaging/bridge &\n```\n\nThen Run Cabana with the device's IP address:\n\n```shell\ncabana --zmq <ipaddress>\n```\n\nReplace &lt;ipaddress&gt; with your comma device's IP address.\n\nWhile streaming from the device, Cabana will log the CAN messages to a local directory. By default, this directory is ~/cabana_live_stream/. You can change the log directory in Cabana by navigating to menu -> tools -> settings.\n\nAfter disconnecting from the device, you can replay the logged CAN messages from the stream selector dialog -> browse local route.\n\n### Streaming CAN Messages from Panda\n\nTo read CAN messages from a connected Panda, use the following command:\n\n```shell\ncabana --panda\n```\n\n### Using the Stream Selector Dialog\n\nIf you run Cabana without any arguments, a stream selector dialog will pop up, allowing you to choose the stream.\n\n```shell\ncabana\n```\n\n## Additional Information\n\nFor more information, see the [openpilot wiki](https://github.com/commaai/openpilot/wiki/Cabana)\n\n<!-- File: openpilot/tools/camerastream/README.md (Tokens: ~443 | Category: plugin-manifest) -->\n# Camera stream\n\n`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC.\n\n## Usage\n\n### On the device\nSSH into the device and run following in separate terminals:\n\n`cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n\n`cd /data/openpilot/system/loggerd && ./encoderd`\n\n`cd /data/openpilot/system/camerad && ./camerad`\n\nNote that both the device and your PC must be on the same openpilot commit.\n\nAlternatively paste this as a single command:\n```\n(\n  cd /data/openpilot\n  ./openpilot/cereal/messaging/bridge &\n\n  cd /data/openpilot/system/camerad/\n  ./camerad &\n\n  cd /data/openpilot/system/loggerd/\n  ./encoderd &\n\n  wait\n) ; trap 'kill $(jobs -p)' SIGINT\n```\nCtrl+C will stop all three processes.\n\n### On the PC\nDecode the stream with `compressed_vipc.py`:\n\n```cd ~/openpilot/tools/camerastream && ./compressed_vipc.py <ip>```\n\nTo actually display the stream, run `watch3` in separate terminal:\n\n```cd ~/openpilot/selfdrive/ui/ && ./watch3.py```\n\n## compressed_vipc.py usage\n```\n$ python3 compressed_vipc.py -h\nusage: compressed_vipc.py [-h] [--cams CAMS] [--server SERVER] [--silent] addr\n\nDecode video streams and broadcast on VisionIPC\n\npositional arguments:\n  addr             Address of comma three\n\noptions:\n  -h, --help       show this help message and exit\n  --cams CAMS      Cameras to decode\n  --server SERVER  choose vipc server name\n  --silent         Suppress debug output\n```\n\n\n## Example:\n```\ncd ~/openpilot/tools/camerastream && ./compressed_vipc.py comma-ffffffff --cams 0\ncd ~/openpilot/selfdrive/ui/ && ./watch3.py\n```\n\n<!-- File: openpilot/tools/joystick/README.md (Tokens: ~559 | Category: plugin-manifest) -->\n# Joystick\n\n**Hardware needed**: device running openpilot, laptop, joystick (optional)\n\nWith joystick_control, you can connect your laptop to your comma device over the network and debug controls using a joystick or keyboard.\njoystick_control uses [inputs](https://pypi.org/project/inputs) which supports many common gamepads and joysticks.\n\n## Usage\n\nThe car must be off, and openpilot must be offroad before starting `joystick_control`.\n\n### Using a keyboard\n\nSSH into your comma device and start joystick_control with the following command:\n\n```shell\nopenpilot/tools/joystick/joystick_control.py --keyboard\n```\n\nThe available buttons and axes will print showing their key mappings. In general, the WASD keys control gas and brakes and steering torque in 5% increments.\n\n### Joystick on your comma three\n\nPlug the joystick into your comma three aux USB-C port. Then, SSH into the device and start `joystick_control.py`.\n\n### Joystick on your laptop\n\nIn order to use a joystick over the network, we need to run joystick_control locally from your laptop and have it send `testJoystick` packets over the network to the comma device.\n\n1. Connect a joystick to your PC.\n2. Connect your laptop to your comma device's hotspot and open a new SSH shell. Since joystick_control is being run on your laptop, we need to write a parameter to let controlsd know to start in joystick debug mode:\n   ```shell\n   # on your comma device\n   echo -n \"1\" > /data/params/d/JoystickDebugMode\n   ```\n3. Run bridge with your laptop's IP address. This republishes the `testJoystick` packets sent from your laptop so that openpilot can receive them:\n   ```shell\n   # on your comma device\n   openpilot/cereal/messaging/bridge {LAPTOP_IP} testJoystick\n   ```\n4. Start joystick_control on your laptop in ZMQ mode.\n   ```shell\n   # on your laptop\n   export ZMQ=1\n   openpilot/tools/joystick/joystick_control.py\n   ```\n\n---\nNow start your car and openpilot should go into joystick mode with an alert on startup! The status of the axes will display on the alert, while button statuses print in the shell.\n\nMake sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.\n\n![](https://github.com/commaai/openpilot/assets/8762862/e640cbca-cb7a-4dcb-abce-b23b036ad8e7)\n\n<!-- File: openpilot/tools/lateral_maneuvers/README.md (Tokens: ~603 | Category: plugin-manifest) -->\n# Lateral Maneuvers Testing Tool\n\n> [!WARNING]\n> Use caution when using this tool.\n\nTest your vehicle's lateral control tuning with this tool. The tool will test the vehicle's ability to follow a few lateral maneuvers and includes a tool to generate a report from the route.\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. The full maneuver suite runs at 20 and 30 mph.\n3. Enable \"Lateral Maneuver Mode\" in Settings > Developer on the device while offroad. Alternatively, set the parameter manually:\n\n   ```sh\n   echo -n 1 > /data/params/d/LateralManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see \"Lateral Maneuver Mode\".\n\n5. Ensure the area ahead is clear, as openpilot will command lateral acceleration steps in this mode. Once you are ready, set ACC manually to the target speed shown on screen and let openpilot stabilize lateral. After 1 seconds of steady straight driving, the maneuver will begin automatically. openpilot lateral control stays engaged between maneuvers normally while waiting for the next maneuver's readiness conditions. The maneuver will be aborted and repeated if speed is out of range, steering is touched or openpilot disengages.\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/lateral_maneuvers/generate_report.py 98395b7c5b27882e/000001cc--5a73bde686\n\n    processing report for KIA_EV6\n    plotting maneuver: step right 20mph, runs: 3\n    plotting maneuver: step left 20mph, runs: 3\n    plotting maneuver: sine 0.5Hz 20mph, runs: 3\n    plotting maneuver: step right 30mph, runs: 3\n\n    Opening report: /home/batman/openpilot/tools/lateral_maneuvers/lateral_reports/KIA_EV6_98395b7c5b27882e_000001cc--5a73bde686.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n\n<!-- File: openpilot/tools/lib/README.md (Tokens: ~647 | Category: plugin-manifest) -->\n## LogReader\n\nRoute is a class for conveniently accessing all the [logs](/openpilot/system/loggerd/) from your routes. The LogReader class reads the non-video logs, i.e. rlog.bz2 and qlog.bz2. There's also a matching FrameReader class for reading the videos.\n\n```python\nfrom openpilot.tools.lib.route import Route\nfrom openpilot.tools.lib.logreader import LogReader\n\nr = Route(\"a2a0ccea32023010|2023-07-27--13-01-19\")\n\n# get a list of paths for the route's rlog files\nprint(r.log_paths())\n\n# and road camera (fcamera.hevc) files\nprint(r.camera_paths())\n\n# setup a LogReader to read the route's first rlog\nlr = LogReader(r.log_paths()[0])\n\n# print out all the messages in the log\nimport codecs\ncodecs.register_error(\"strict\", codecs.backslashreplace_errors)\nfor msg in lr:\n  print(msg)\n\n# setup a LogReader for the route's second qlog\nlr = LogReader(r.log_paths()[1])\n\n# print all the steering angles values from the log\nfor msg in lr:\n  if msg.which() == \"carState\":\n    print(msg.carState.steeringAngleDeg)\n```\n\n### Segment Ranges\n\nWe also support a new format called a \"segment range\":\n\n```\n344c5c15b34f2d8a   /   2024-01-03--09-37-12   /     2:6    /       q\n[   dongle id     ] [       timestamp        ] [ selector ]  [ query type]\n```\n\nyou can specify which segments from a route to load\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4\")   # 4th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4:6\") # 4th and 5th segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/-1\")  # last segment\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/:5\")  # first 5 segments\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/1:\")  # all except first segment\n```\n\nand can select which type of logs to grab\n\n```python\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/q\") # get qlogs\nlr = LogReader(\"a2a0ccea32023010|2023-07-27--13-01-19/4/r\") # get rlogs (default)\n```\n\n<!-- File: openpilot/tools/longitudinal_maneuvers/README.md (Tokens: ~864 | Category: plugin-manifest) -->\n# Longitudinal Maneuvers Testing Tool\n\nTest your vehicle's longitudinal control tuning with this tool. The tool will test the vehicle's ability to follow a few longitudinal maneuvers and includes a tool to generate a report from the route.\n\n<details><summary>Sample snapshot of a report.</summary><img width=\"600px\" src=\"https://github.com/user-attachments/assets/d18d0c7d-2bde-44c1-8e86-1741ed442ad8\"></details>\n\n## Instructions\n\n1. Check out a development branch such as `master` on your comma device.\n2. Locate either a large empty parking lot or road devoid of any car or foot traffic. Flat, straight road is preferred. The full maneuver suite can take 1 mile or more if left running, however it is recommended to disengage openpilot between maneuvers and turn around if there is not enough space.\n3. Turn off the vehicle and set this parameter which will signal to openpilot to start the longitudinal maneuver daemon:\n\n   ```sh\n   echo -n 1 > /data/params/d/LongitudinalManeuverMode\n   ```\n\n4. Turn your vehicle back on. You will see the \"Longitudinal Maneuver Mode\" alert:\n\n   ![videoframe_6652](https://github.com/user-attachments/assets/e9d4c95a-cd76-4ab7-933e-19937792fa0f)\n\n5. Ensure the road ahead is clear, as openpilot will not brake for any obstructions in this mode. Once you are ready, press \"Set\" on your steering wheel to start the tests. The tests will run for about 4 minutes. If you need to pause the tests, press \"Cancel\" on your steering wheel. You can resume the tests by pressing \"Resume\" on your steering wheel. \n\n   **Note:** For GM cars, it is recommended to hold down the resume button for all low-speed tests (starting, stopping and creep) to avoid the car entering standstill.\n\n   ![cog-clip-00 01 11 250-00 01 22 250](https://github.com/user-attachments/assets/c312c1cc-76e8-46e1-a05e-bb9dfb58994f)\n\n6. When the testing is complete, you'll see an alert that says \"Maneuvers Finished.\" Complete the route by pulling over and turning off the vehicle.\n\n   ![fin2](https://github.com/user-attachments/assets/c06960ae-7cfb-44af-beaa-4dc28848e49d)\n\n7. Visit https://connect.comma.ai and locate the route(s). They will stand out with lots of orange intervals in their timeline. Ensure \"All logs\" show as \"uploaded.\"\n\n   ![image](https://github.com/user-attachments/assets/cfe4c6d9-752f-4b24-b421-4b90a01933dc)\n\n8. Gather the route ID and then run the report generator. The file will be exported to the same directory:\n\n    ```sh\n    $ python openpilot/tools/longitudinal_maneuvers/generate_report.py 57048cfce01d9625/0000010e--5b26bc3be7 'pcm accel compensation'\n\n    processing report for LEXUS_ES_TSS2\n    plotting maneuver: start from stop, runs: 4\n    plotting maneuver: creep: alternate between +1m/s^2 and -1m/s^2, runs: 2\n    plotting maneuver: gas step response: +1m/s^2 from 20mph, runs: 2\n\n    Report written to /home/batman/openpilot/tools/longitudinal_maneuvers/longitudinal_reports/LEXUS_ES_TSS2_57048cfce01d9625_0000010e--5b26bc3be7.html\n    ```\n\nYou can reach out on [Discord](https://discord.comma.ai) if you have any questions about these instructions or the tool itself.\n\n<!-- File: openpilot/tools/plotjuggler/README.md (Tokens: ~780 | Category: plugin-manifest) -->\n# PlotJuggler\n\n[PlotJuggler](https://github.com/facontidavide/PlotJuggler) is a tool to quickly visualize time series data, and we've written plugins to parse openpilot logs. Check out our plugins: https://github.com/commaai/PlotJuggler.\n\n## Installation\n\nOnce you've [set up the openpilot environment](/tools/README.md), this command will download PlotJuggler and install our plugins:\n\n`cd openpilot/tools/plotjuggler && ./juggle.py --install`\n\n## Usage\n\n```\n$ ./juggle.py -h\nusage: juggle.py [-h] [--demo] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]\n                 [route_or_segment_name]\n\nA helper to run PlotJuggler on openpilot routes\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to plot (cabana share URL accepted) (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --demo                Use the demo route instead of providing one (default: False)\n  --can                 Parse CAN data (default: False)\n  --stream              Start PlotJuggler in streaming mode (default: False)\n  --layout [LAYOUT]     Run PlotJuggler with a pre-defined layout (default: None)\n  --install             Install or update PlotJuggler + plugins (default: False)\n  --dbc DBC             Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically\n                        inferred from the logs. (default: None)\n\n```\n\nExample using route name:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496\"`\n\nExamples using segment:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1\"`\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/1/q\" # use qlogs`\n\nExample using segment range:\n\n`./juggle.py \"5beb9b58bd12b691/0000010a--a51155e496/0:1\"`\n\n## Streaming\n\nExplore live data from your car! Follow these steps to stream from your comma device to your laptop:\n- Enable wifi tethering on your comma device\n- [SSH into your device](https://github.com/commaai/openpilot/wiki/SSH) and run `cd /data/openpilot && ./openpilot/cereal/messaging/bridge`\n- On your laptop, connect to the device's wifi hotspot\n- Start PlotJuggler with `ZMQ=1 ./juggle.py --stream`, find the `Cereal Subscriber` plugin in the dropdown under Streaming, and click `Start`.\n\nIf streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.\n\n## Demo\n\nFor a quick demo, go through the installation step and run this command:\n\n`./juggle.py --demo --layout=layouts/tuning.xml`\n\n## Layouts\n\nIf you create a layout that's useful for others, consider upstreaming it.\n\n### Tuning\n\nUse this layout to improve your car's tuning and generate plots for tuning PRs. Also see the [tuning wiki](https://github.com/commaai/openpilot/wiki/Tuning) and tuning PR template.\n\n`--layout layouts/tuning.xml`\n\n\n![screenshot](https://i.imgur.com/cizHCH3.png)\n\n<!-- File: openpilot/tools/replay/README.md (Tokens: ~1257 | Category: plugin-manifest) -->\n# Replay\n\n`replay` allows you to simulate a driving session by replaying all messages logged during the use of openpilot. This provides a way to analyze and visualize system behavior as if it were live.\n\n## Setup\n\nBefore starting a replay, you need to authenticate with your comma account using `auth.py`. This will allow you to access your routes from the server.\n\n```bash\n# Authenticate to access routes from your comma account:\npython3 openpilot/tools/lib/auth.py\n```\n\n## Replay a Remote Route\nYou can replay a route from your comma account by specifying the route name.\n\n```bash\n# Start a replay with a specific route:\nopenpilot/tools/replay/replay <route-name>\n\n# Example:\nopenpilot/tools/replay/replay '5beb9b58bd12b691/0000010a--a51155e496'\n\n# Replay the default demo route:\nopenpilot/tools/replay/replay --demo\n```\n\n## Replay a Local Route\nTo replay a route stored locally on your machine, specify the route name and provide the path to the directory where the route files are stored.\n\n```bash\n# Replay a local route\nopenpilot/tools/replay/replay <route-name> --data_dir=\"/path_to/route\"\n\n# Example:\n# If you have a local route stored at /path_to_routes with segments like:\n# 5beb9b58bd12b691/0000010a--a51155e496--0\n# 5beb9b58bd12b691/0000010a--a51155e496--1\n# You can replay it like this:\nopenpilot/tools/replay/replay \"5beb9b58bd12b691/0000010a--a51155e496\" --data_dir=\"/path_to_routes\"\n```\n\n## Send Messages via ZMQ\nBy default, replay sends messages via MSGQ. To switch to ZMQ, set the ZMQ environment variable.\n\n```bash\n# Start replay and send messages via ZMQ:\nZMQ=1 openpilot/tools/replay/replay <route-name>\n```\n\n## Usage\nFor more information on available options and arguments, use the help command:\n\n``` bash\n$ openpilot/tools/replay/replay -h\nUsage: openpilot/tools/replay/replay [options] route\nMock openpilot components by publishing logged messages.\n\nOptions:\n  -h, --help             Displays this help.\n  -a, --allow <allow>    whitelist of services to send (comma-separated)\n  -b, --block <block>    blacklist of services to send (comma-separated)\n  -c, --cache <n>        cache <n> segments in memory. default is 5\n  -s, --start <seconds>  start from <seconds>\n  -x <speed>             playback <speed>. between 0.2 - 3\n  --demo                 use a demo route instead of providing your own\n  --auto                 Auto load the route from the best available source (no video):\n                         internal, openpilotci, comma_api, car_segments, testing_closet\n  --data_dir <data_dir>  local directory with routes\n  --prefix <prefix>      set OPENPILOT_PREFIX\n  --cabin                  load cabin camera\n  --wide-road                 load wide road camera\n  --no-loop              stop at the end of the route\n  --no-cache             turn off local cache\n  --qcam                 load qcamera\n  --no-hw-decoder        disable HW video decoding\n  --no-vipc              do not output video\n  --all                  do output all messages including uiDebug, userBookmark.\n                         this may causes issues when used along with UI\n\nArguments:\n  route                  the drive to replay. find your drives at\n                         connect.comma.ai\n```\n\n## Visualize the Replay in the openpilot UI\nTo visualize the replay within the openpilot UI, run the following commands:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\ncd openpilot/selfdrive/ui && ./ui.py\n```\n\n## Work with plotjuggler\nIf you want to use replay with plotjuggler, you can stream messages by running:\n\n```bash\nopenpilot/tools/replay/replay <route-name>\nopenpilot/tools/plotjuggler/juggle.py --stream\n```\n\n## watch3\n\nwatch all three cameras simultaneously from your comma three routes with watch3\n\nsimply replay a route using the `--cabin` and `--wide-road` flags:\n\n```bash\n# start a replay\ncd openpilot/tools/replay && ./replay --demo --cabin --wide-road\n\n# then start watch3\ncd openpilot/selfdrive/ui && ./watch3.py\n```\n\n![](https://i.imgur.com/IeaOdAb.png)\n\n## Stream CAN messages to your device\n\nReplay 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. Check out the [jungle repo](https://github.com/commaai/panda_jungle) for more info.\n\nIn order to run your device as if it was in a car:\n* connect a panda jungle to your PC\n* connect a comma device or panda to the jungle via OBD-C\n* run `can_replay.py`\n\n``` bash\nbatman:replay$ ./can_replay.py -h\nusage: can_replay.py [-h] [route_or_segment_name]\n\nReplay CAN messages from a route to all connected pandas and jungles\nin a loop.\n\npositional arguments:\n  route_or_segment_name\n                        The route or segment name to replay. If not\n                        specified, a default public route will be\n                        used. (default: None)\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n\n<!-- File: openpilot/tools/sim/README.md (Tokens: ~329 | Category: plugin-manifest) -->\nopenpilot in simulator\n=====================\n\nopenpilot implements a [bridge](run_bridge.py) that allows it to run in the [MetaDrive simulator](https://github.com/metadriverse/metadrive).\n\n## Launching openpilot\nFirst, start openpilot.\n``` bash\n# Run locally\n./openpilot/tools/sim/launch_openpilot.sh\n```\n\n## Bridge usage\n```\n$ ./run_bridge.py -h\nusage: run_bridge.py [-h] [--joystick] [--high_quality] [--dual_camera]\nBridge between the simulator and openpilot.\n\noptions:\n  -h, --help            show this help message and exit\n  --joystick\n  --high_quality\n  --dual_camera\n```\n\n#### Bridge Controls:\n- To engage openpilot press 2, then press 1 to increase the speed and 2 to decrease.\n- To disengage, press \"S\" (simulates a user brake)\n\n#### All inputs:\n\n```\n| key  |   functionality       |\n|------|-----------------------|\n|  1   | Cruise Resume / Accel |\n|  2   | Cruise Set    / Decel |\n|  3   | Cruise Cancel         |\n|  r   | Reset Simulation      |\n|  i   | Toggle Ignition       |\n|  q   | Exit all              |\n| wasd | Control manually      |\n```\n\n## MetaDrive\n\n### Launching Metadrive\nStart bridge processes located in openpilot/tools/sim:\n``` bash\n./run_bridge.py\n```\n\n<!-- File: tools/car_porting/README.md (Tokens: ~2084 | Category: plugin-manifest) -->\n# tools/car_porting\n\nCheck out [this blog post](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) for a high-level overview of porting a car.\n\n## Useful car porting utilities\n\nTesting car ports in your car is very time-consuming. Check out these utilities to do basic checks on your work before running it in your car.\n\n### [Cabana](/openpilot/tools/cabana/README.md)\n\nView your car's CAN signals through DBC files, which openpilot uses to parse and create messages that talk to the car.\n\nExample:\n```bash\n> openpilot/tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43'\n```\n\n### [tools/car_porting/auto_fingerprint.py](/tools/car_porting/auto_fingerprint.py)\n\nGiven a route and platform, automatically inserts FW fingerprints from the platform into the correct place in fingerprints.py\n\nExample:\n```bash\n> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK'\nAttempting to add fw version for:  OUTBACK\n```\n\n### [openpilot/selfdrive/car/tests/test_car_interfaces.py](/openpilot/selfdrive/car/tests/test_car_interfaces.py)\n\nFinds common bugs for car interfaces, without even requiring a route.\n\n\n#### Example: Typo in signal name\n```bash\n> tools/test_runner.py openpilot/selfdrive/car/tests/test_car_interfaces.py -k subaru  # replace with the brand you are working on\n\n=====================================================================\nFAILED openpilot/selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces::test_car_interfaces_165_SUBARU_LEGACY_7TH_GEN - KeyError: 'CruiseControlOOPS'\n\n```\n\n### [tools/car_porting/test_car_model.py](/tools/car_porting/test_car_model.py)\n\nGiven a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches.\n\n#### Example: panda safety mismatch for gasPressed\n```bash\n> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21'\n\n=====================================================================\nFAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate)\nAssert that panda safety matches openpilot's carState\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/home/batman/openpilot/opendbc_repo/opendbc/car/tests/test_models.py\", line 440, in test_panda_safety_carstate\n    self.assertFalse(failed_checks, f\"panda safety doesn't agree with CarState: {failed_checks}\")\nAssertionError: {'gasPressed': 116} is not false : panda safety doesn't agree with CarState: {'gasPressed': 116}\n```\n\n## Jupyter notebooks\n\nTo use these notebooks, install Jupyter within your [openpilot virtual environment](/tools/README.md).\n\n```bash\nuv pip install jupyter ipykernel\n```\n\nLaunching:\n\n```bash\njupyter notebook\n```\n\n### [examples/subaru_steer_temp_fault.ipynb](/tools/car_porting/examples/subaru_steer_temp_fault.ipynb)\n\nAn example of searching through a database of segments for a specific condition, and plotting the results.\n\n![steer warning example](https://github.com/commaai/openpilot/assets/9648890/d60ad120-4b44-4974-ac79-adc660fb8fe2)\n\n*a plot of the steer_warning vs steering angle, where we can see it is clearly caused by a large steering angle change*\n\n### [examples/subaru_long_accel.ipynb](/tools/car_porting/examples/subaru_long_accel.ipynb)\n\nAn example of plotting the response of an actuator when it is active.\n\n![brake pressure example](https://github.com/commaai/openpilot/assets/9648890/8f32cf1d-8fc0-4407-b540-70625ebbf082)\n\n*a plot of the brake_pressure vs acceleration, where we can see it is a fairly linear response.*\n\n### [examples/ford_vin_fingerprint.ipynb](/tools/car_porting/examples/ford_vin_fingerprint.ipynb)\n\nIn this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford.\n\n```\nvin: 1FM5K8GC7LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 00000000000XXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 3FTTW8F98NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 1FTVW1EL4NWXXXXXX real platform: FORD F-150 LIGHTNING 1ST GEN       determined platform: FORD F-150 LIGHTNING 1ST GEN      correct: True\nvin: 1FM5K7LC0MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: WF0NXXGCHNJXXXXXX real platform: FORD FOCUS 4TH GEN                 determined platform: mock                              correct: False\nvin: 1FMCU9J94MUXXXXXX real platform: FORD ESCAPE 4TH GEN                determined platform: mock                              correct: False\nvin: 5LM5J7XC9LGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FMCR9B69NRXXXXXX real platform: FORD BRONCO SPORT 1ST GEN          determined platform: mock                              correct: False\nvin: 3FMTK3SU0MMXXXXXX real platform: FORD MUSTANG MACH-E 1ST GEN        determined platform: FORD MUSTANG MACH-E 1ST GEN       correct: True\nvin: 1FM5K8HC7MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 1FM5K8GC7NGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 5LM5J7XC8MGXXXXXX real platform: FORD EXPLORER 6TH GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\nvin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN              determined platform: mock                              correct: False\n```\n\n### [examples/find_segments_with_message.ipynb](/tools/car_porting/examples/find_segments_with_message.ipynb)\n\nSearches for segments where a set of given CAN message IDs are present. In the example, we search for all messages\nused for CAN-based ignition detection.\n\n```\nMatch found: 46b21f1c5f7aa885/2024-01-23--15-19-34/20/s    JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: a63a23c3e628f288/2023-11-05--18-36-20/8/s     JEEP GRAND CHEROKEE V6 2018            ['VW CAN Ign']\nMatch found: ce31b7a998781ba8/2024-01-19--07-05-29/23/s    JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2023-12-25--19-31-00/4/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: e1dfba62a4e33f7b/2024-01-10--14-33-57/2/s     JEEP GRAND CHEROKEE 2019               ['VW CAN Ign']\nMatch found: ae679616266f4096/2023-12-05--15-43-46/4/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2023-11-18--17-49-42/3/s     RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: ae679616266f4096/2024-01-03--21-57-09/25/s    RAM HD 5TH GEN                         ['Tesla 3/Y CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-10--11-53-15/17/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-12-03--17-31-17/29/s    FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\nMatch found: 6dae2984cc53cd7f/2023-11-27--23-29-07/1/s     FORD BRONCO SPORT 1ST GEN              ['Rivian CAN Ign']\n```\n\n<!-- File: tools/README.md (Tokens: ~663 | Category: plugin-manifest) -->\n# openpilot tools\n\n## System Requirements\n\nopenpilot supports Linux alongside the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).\n\nMost of openpilot should work natively on macOS. On Windows, you can use WSL for a nearly native Linux experience.\n\n## Native setup on Linux and macOS\n\nFollow these instructions for a fully managed setup experience. If you'd like to manage the dependencies yourself, just read the setup scripts in this directory.\n\n**1. Clone openpilot**\n``` bash\ngit clone https://github.com/commaai/openpilot.git\n```\n\n**2. Run the setup script**\n``` bash\ncd openpilot\ntools/op.sh setup\n```\n\n**3. Activate a Python shell**\nActivate a shell with the Python dependencies installed:\n``` bash\nsource .venv/bin/activate\n```\n\n**4. Build openpilot**\n``` bash\nscons -u\n```\n\n## WSL on Windows\n\n[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Linux. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.\n\nFollow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to set up WSL. We recommend installing the `Ubuntu-24.04` distribution. Once your WSL environment is set up, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.\n\n**NOTE**: If you are running WSL 2 and experiencing performance issues with the UI or simulator, you may need to explicitly enable hardware acceleration by setting `GALLIUM_DRIVER=d3d12` before commands. Add `export GALLIUM_DRIVER=d3d12` to your `~/.bashrc` file to make it automatic for future sessions.\n\n## CTF\nLearn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md).\n\n## Directory Structure\n\n```\n├── car_porting/        # Tools for porting new cars\n├── release/            # Scripts for building openpilot releases\n└── scripts/            # Miscellaneous scripts\n```\n\nDevelopment tools such as cabana, plotjuggler, and replay live in [openpilot/tools/](/openpilot/tools/):\n\n```\n├── cabana/             # View and plot CAN messages from drives or in realtime\n├── camerastream/       # Cameras stream over the network\n├── joystick/           # Control your car with a joystick\n├── lib/                # Libraries to support the tools and reading openpilot logs\n├── plotjuggler/        # A tool to plot openpilot logs\n├── replay/             # Replay drives and mock openpilot services\n└── sim/                # Run openpilot in a simulator\n```\n\n<!-- File: tools/release/README.md (Tokens: ~398 | Category: plugin-manifest) -->\n# openpilot releases\n\n```\n## release checklist\n\n### Go to staging\n- [ ] make a GitHub issue to track release with this checklist\n- [ ] create release master branch\n  - [ ] create a branch from upstream master named `zerotentwo` for release `v0.10.2`\n  - [ ] revert risky commits (double check with autonomy team)\n  - [ ] push the new branch\n- [ ] push to staging:\n  - [ ] make sure you are on the newly created release master branch (`zerotentwo`)\n  - [ ] run `BRANCH=devel-staging tools/release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch\n- [ ] bump version on master: `openpilot/common/version.h` and `RELEASES.md`\n- [ ] post on Discord, tag `@release crew`\n\n### Go to release\n- [ ] before going to release, test the following:\n  - [ ] update from previous release -> new release\n  - [ ] update from new release -> previous release\n  - [ ] fresh install with `openpilot-test.comma.ai`\n  - [ ] drive on fresh install\n  - [ ] no submodules; only the Chestnut big driving model uses LFS\n  - [ ] check MTBF, etc.\n  - [ ] stress test passes in production\n- [ ] publish the blog post\n- [ ] `git reset --hard origin/release-mici-staging`\n- [ ] tag the release: `git tag v0.X.X <commit-hash> && git push origin v0.X.X`\n- [ ] create GitHub release\n- [ ] final test install on `openpilot.comma.ai`\n- [ ] update factory provisioning\n- [ ] close out milestone and issue\n- [ ] post on Discord, X, etc.\n```\n</yakaai_skills>"}