Skip to content
Branch: master
Find file History
quillford test car models: fix random hanging (#1055)
* debug print

* unlogger doesn't need fcamera.hevc

* only need the rlog

* tiemout for log downloading

* try again after timeout
Latest commit 30dffb4 Feb 7, 2020
Type Name Latest commit message Commit time
Failed to load latest commit information.
carcontrols merge in tools Jan 17, 2020
clib merge in tools Jan 17, 2020
lib merge in tools Jan 17, 2020
livedm merge in tools Jan 17, 2020
misc merge in tools Jan 17, 2020
nui [Memory leak]uniq_ptr for tmsg (#985) Jan 23, 2020
replay test car models: fix random hanging (#1055) Feb 6, 2020
sim Cleanup simulator and add usage instructions (#1050) Feb 5, 2020
ssh merge in tools Jan 17, 2020
streamer merge in tools Jan 17, 2020
LICENSE merge in tools Jan 17, 2020 merge in tools Jan 17, 2020 merge in tools Jan 17, 2020
requirements.txt merge in tools Jan 17, 2020
steer.gif merge in tools Jan 17, 2020
stream.gif merge in tools Jan 17, 2020


Repo which contains tools to facilitate development and debugging of openpilot.


Table of Contents


openpilot-tools and the following setup steps are developed and tested on Ubuntu 16.04, MacOS 10.14.2 and Python 3.7.3.


  1. Install native dependencies (Mac and Ubuntu sections listed below)


    • core tools

      sudo apt install git curl python-pip
      sudo pip install --upgrade pip>=18.0 pipenv
    • ffmpeg (tested with 3.3.2)

      sudo apt install ffmpeg libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev
    • build tools

      sudo apt install autoconf automake clang clang-3.8 libtool pkg-config build-essential
    • libarchive-dev (tested with 3.1.2-11ubuntu0.16.04.4)

      sudo apt install libarchive-dev
    • qt python binding (tested with python-qt4, 4.11.4+dfsg-1build4)

      sudo apt install python-qt4
    • zmq 4.2.3 (required for replay)

      curl -LO
      tar xfz zeromq-4.2.3.tar.gz
      cd zeromq-4.2.3
      ./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC --disable-shared --enable-static
      sudo make install


    • brew

      /usr/bin/ruby -e "$(curl -fsSL"
    • core tools

      brew install git
      sudo pip install --upgrade pip pipenv
      xcode-select --install
    • ffmpeg (tested with 3.4.1)

      brew install ffmpeg
    • build tools

      brew install autoconf automake libtool llvm pkg-config
    • libarchive-dev (tested with 3.3.3)

      brew install libarchive
    • qt for Mac

      brew install qt
    • zmq 4.3.1 (required for replay)

      brew install zeromq
  2. Install Cap'n Proto

    curl -O
    tar xvf capnproto-c++-0.6.1.tar.gz
    cd capnproto-c++-0.6.1
    ./configure --prefix=/usr/local CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC --disable-shared --enable-static
    make -j4
    sudo make install
    cd ..
    git clone
    cd c-capnproto
    git submodule update --init --recursive
    autoreconf -f -i -s
    CFLAGS="-fPIC" ./configure --prefix=/usr/local
    make -j4
    sudo make install
  3. Clone openpilot if you haven't already

    git clone
    cd openpilot
    pipenv install # Install dependencies in a virtualenv
    pipenv shell # Activate the virtualenv

    For Mac users

    Recompile longitudinal_mpc for mac

    Navigate to:

    cd selfdrive/controls/lib/longitudinal_mpc
    make clean
  4. Clone tools within openpilot, and install dependencies

    git clone tools
    cd tools
    git checkout <tag>  # the tag must match the openpilot version you are using (see
    pip install -r requirements.txt # Install openpilot-tools dependencies in virtualenv
  5. Add openpilot to your PYTHONPATH.

    For bash users:

    echo 'export PYTHONPATH="$PYTHONPATH:<path-to-openpilot>"' >> ~/.bashrc
    source ~/.bashrc
  6. Add some folders to root

    sudo mkdir /data
    sudo mkdir /data/params
    sudo chown $USER /data/params
  7. Try out some tools!

Tool examples

Replay driving data

Hardware needed: none replays data collected with chffrplus or openpilot.

You'll need to download log and camera files into a local directory. Download these from the footer of the comma explorer or SCP from your device.


python replay/ <route-name> <path-to-data-directory>


#python replay/ '99c94dc769b5d96e|2018-11-14--13-31-42' /home/batman/unlogger_data

#Within /home/batman/unlogger_data:
#  99c94dc769b5d96e|2018-11-14--13-31-42--0--fcamera.hevc
#  99c94dc769b5d96e|2018-11-14--13-31-42--0--rlog.bz2
#  ...

# In another terminal you can run a debug visualizer:
python replay/   # Define the environmental variable HORIZONTAL is the ui layout is too tall


Debug car controls

Hardware needed: panda, giraffe, joystick

Use the panda's OBD-II port to connect with your car and a usb cable to connect the panda to your pc. Also, connect a joystick to your pc. runs a deamon that reads inputs from a joystick and publishes them over zmq. sends the CAN messages from your pc to the panda. debug_controls is a mocked version of and uses input from a joystick to send controls to your car.


python carcontrols/

# In another terminal:
selfdrive/boardd/tests/ # Make sure the safety setting is hardcoded to ALL_OUTPUT

# In another terminal:
python carcontrols/


Stream replayed CAN messages to EON

Hardware needed: 2 x panda, debug board, EON.

It is possible to replay CAN messages as they were recorded and forward them to a EON.  Connect 2 pandas to the debug board. A panda connects to the PC, the other panda connects to the EON.


# With MOCK=1 boardd will read logged can messages from a replay and send them to the panda.
MOCK=1 selfdrive/boardd/tests/

# In another terminal:
python replay/ <route-name> <path-to-data-directory>


Stream EON video data to a PC

Hardware needed: EON, comma Smays.

You can connect your EON to your pc using the Ethernet cable provided with the comma Smays and you'll be able to stream data from your EON, in real time, with low latency. A useful application is being able to stream the raw video frames at 20fps, as captured by the EON's camera.


# ssh into the eon and run loggerd with the flag "--stream". In ../selfdrive/ you can change:
# ...
# "loggerd": ("selfdrive/loggerd", ["./loggerd"]),
# ...
# with:
# ...
# "loggerd": ("selfdrive/loggerd", ["./loggerd", "--stream"]),
# ...

# On the PC:
# To receive frames from the EON and re-publish them. Set PYGAME env variable if you want to display the video stream
python streamer/


Welcomed contributions

  • Documentation: code comments, better tutorials, etc..
  • Support for other platforms other than Ubuntu 16.04.
  • Performance improvements: the tools have been developed on high-performance workstations (12+ logical cores with 32+ GB of RAM), so they are not optimized for running efficiently. For example, might not be able to run real-time on most PCs.
  • More tools: anything that you think might be helpful to others.
You can’t perform that action at this time.