Skip to content

Helpful Commits

sshane edited this page Nov 14, 2021 · 25 revisions

Allow Gas Press

With this commit, you can enable gas press without disengaging. The unsafe_mode setting has changed in 0.7.9/0.7.10 so here's what works now.

This method of setting unsafe_mode is completely endorsed by comma and doesn't require changing any panda firmware code which is strongly discouraged.

Adjustable Following Distance (from 0.8.10+)

In this version, the MPC library moved from ACADO to ACADOS, which is a much simpler library for writing MPCs, with everything defined in Python and compiled on-device. However this meant the previous method of changing the following distance was no longer valid, and the relatively safe costs found for each following distance no longer applicable.

The new costs tuned for this new MPC library are arbitrary at best, however it can pass all test_longitudinal.py tests down to 1.2 seconds, so that is what the desired TR is clipped to by default. This pick offers no warranty that your car will always brake in time, so as always, always pay attention!

Just cherry-pick this commit on branches with ACADOS.

Outdated

These picks may still work, but you will need to do extra work resolving conflicts on newer versions. They should still work on the versions posted however.

Support Grey (and White) Panda on 0.8.2+

Simply cherry-pick this commit to revert all changes that make the grey and white pandas unsupported. This commit was done on the devel branch of openpilot, so any non-master branch should cherry-pick in a breeze (master should too, but tests may no longer work).

Adjustable Following Distance (up to 0.8.9)

Here is how you can add adjustable TR support to your fork: https://github.com/sshane/openpilot-archive/commit/814176baecb35200cc82693ad84af082d119199c

Just git cherry-pick it! Of course you need to modify the line in long_mpc.py to include a TR and optionally (but recommended) adjust the distance cost.

The line to adjust, simply add a float following distance as an extra argument.


How To Cherry Pick These Commits

  1. Assuming you're on another/your own fork, you'll need to fetch my repository in order for git to cherry pick my commits. For me, this operation uses ~200MB on top of commaai/openpilot.
    git remote add sshane https://github.com/sshane/openpilot
    git fetch sshane
  2. Now that you fetched my repository locally, you can use the git cherry-pick command on any commit here! If you're lucky and there are no merge conflicts, simply push; a merge commit has already been made. Else, resolve the conflicts and commit and push!