Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GM: Set new longitudinal scaling #31932

Closed
wants to merge 9 commits into from

Conversation

nworb-cire
Copy link
Contributor

Description

See commaai/opendbc#951 for a description of the issue. See commaai/panda#1905, commaai/opendbc#1025 for submodule PRs.

Trivial changes: scaled all values according to the formula f(x) = x + (4096*5) - 22534 which is the new scaling defined in the DBC file.
Nontrivial change: using the above formula, f(ZERO_GAS) == -6. I figured that since this is quite close to 0, it is likely that our previous value of 2048 was a close but incorrect guess at the true zero value. I removed the reference to ZERO_GAS and used 0 instead.

Verification

Marking WIP to validate with the segments dataset as suggested by @sshane

@nworb-cire nworb-cire marked this pull request as draft March 20, 2024 04:13
Copy link
Contributor

github-actions bot commented Mar 20, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

Copy link
Contributor

This PR has had no activity for 30 days. It will be automatically closed in 7 days if there is no activity.

@github-actions github-actions bot added the stale label Apr 20, 2024
@nworb-cire nworb-cire marked this pull request as ready for review April 23, 2024 00:42
@github-actions github-actions bot removed the stale label Apr 23, 2024
@nworb-cire
Copy link
Contributor Author

I have validated these changes on the commaCarSegments dataset, see here. I was a bit unsure what exactly to be looking for, but in my tests nothing looks awry. I was unable to validate a few of the platforms since they have no segments with valid carParams.

@adeebshihadeh adeebshihadeh added tuning car vehicle-specific gm labels May 13, 2024
@sshane sshane removed the tuning label Jun 5, 2024
@sshane
Copy link
Contributor

sshane commented Jun 5, 2024

@Verylukyguy can you drive on this? I'd like to see just a few routes considering the zero gas is just very slightly different (previous value was -6 in new scale). And a camera-ACC user as well. Then we can merge

@@ -33,27 +33,26 @@ class CarControllerParams:

def __init__(self, CP):
# Gas/brake lookups
self.ZERO_GAS = 2048 # Coasting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for future reference, this is the conversion:

((2048 << 3) | (1 << 15) | (1 << 17)) * 0.125 - 22534

@morrislee
Copy link
Contributor

dc7716b32bf25574/00000000--b86195eae6/0
dc7716b32bf25574/00000001--a72cadb253/0
dc7716b32bf25574/00000002--df117bd704/0

@morrislee
Copy link
Contributor

route with this branch and stock ACC
dc7716b32bf25574/00000004--b140f4714a/0

@Verylukyguy
Copy link
Contributor

@Verylukyguy can you drive on this? I'd like to see just a few routes considering the zero gas is just very slightly different (previous value was -6 in new scale). And a camera-ACC user as well. Then we can merge

I am loading it now and I will test after work!

@Verylukyguy
Copy link
Contributor

Verylukyguy commented Jun 6, 2024

2018 GMC Acadia:
df51b2195de66a9b/00000001--797163b3ba/0
df51b2195de66a9b/00000002--af4d93bcfb/0
df51b2195de66a9b/00000004--64c04ece5b/0

@morrislee
Copy link
Contributor

what else do we need to have this merged? POC version currently in FrogPilot with the corrected limit (which need this PR first) makes OP Long very usable

@sshane sshane added the tuning label Aug 20, 2024
@sshane
Copy link
Contributor

sshane commented Aug 20, 2024

We've moved the car interfacing code to our opendbc repository, which is now the new home for car ports and fingerprints. Please re-open your pull request against opendbc at your convenience by using this command below. This will transform all changes under selfdrive/car/ to opendbc_repo/opendbc/car/. Make sure you have initialized submodules beforehand and have checked out the latest opendbc commit.

PR_NUMBER=33045
curl -L https://github.com/commaai/openpilot/pull/$PR_NUMBER.patch | sed -e 's/selfdrive\/car/opendbc_repo\/opendbc\/car/g' | git apply -v --reject

Simply replace the PR number with your own. Once done, add the files, fix any conflicts, and open a new PR. Alternatively, you may start a new PR from scratch if that is easier for you.

@sshane sshane closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car vehicle-specific gm tuning
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants