Skip to content

Commit

Permalink
Add Gernby's Feed Forward Resonant Steering
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 8d37193
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Mar 1 11:55:57 2019 -0600

    fixed realtime sync

commit 542e301
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Mar 1 08:01:03 2019 -0600

    realtime tweak

commit d881aa7
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Thu Feb 28 18:04:34 2019 -0600

    hopefully workinghopefully working

commit 6512927
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 19:05:20 2019 -0600

    merge fix

commit d516067
Merge: a05a310 b91298a
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 16:50:52 2019 -0600

    iirge branch 'resonant-mpc-interp-059' of https://github.com/Gernby/openpilot into resonant-mpc-interp-059

commit a05a310
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 16:32:21 2019 -0600

    more merge updates

commit b91298a
Merge: 06963f0 b3398b2
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 13:54:53 2019 -0600

    Merge branch 'resonant-mpc-interp-PR' of https://github.com/Gernby/openpilot into resonant-mpc-interp-059

commit 06963f0
Merge: cd70b10 f020361
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 13:27:08 2019 -0600

    Merge branch 'devel' of https://github.com/commaai/openpilot into resonant-mpc-interp-059

commit cd70b10
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 13:26:39 2019 -0600

    about to merge

commit 445dd71
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Feb 27 12:13:48 2019 -0600

    Fixed boardd to run at exactly 200HzFixed boardd to run at exactly 200Hz

commit b3398b2
Author: Gernby <gernby2002@yahoo.com>
Date:   Wed Feb 27 08:53:07 2019 -0600

    Updated Civic values from stage 4

commit f020361
Author: Nigel Armstrong <legonigel@users.noreply.github.com>
Date:   Mon Feb 25 10:43:56 2019 -0800

    .gitignore visiond (commaai#539)

commit 8b7dfb6
Author: Drew Hintz <pushespretn@gmail.com>
Date:   Fri Feb 22 12:48:33 2019 -0800

    remove Pacifica 2019 from supported car list (commaai#538)

    Although there's a fingerprint and LKAS constant for the 2019 Pacifica, it doesn't work well enough that I'd consider it supported.

    P.S. I have an idea for how to support all Chrysler with one code base, even those I've never looked at. Forward can0 to the stock LKAS (can2) so that the stock LKAS is active. Then read the stock LKAS messages on can2 to both get the vehicle's LKAS constant, any status messages, and perhaps a more reliable counter. I'll try to code it up this weekend.

commit 64cd45f
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 13:31:04 2019 -0600

    gitignore

commit 031996f
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:59:29 2019 -0600

    git cleanup

commit e7c52d5
Merge: 2629080 eef45dc
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:54:53 2019 -0600

    Merge branch 'devel' of https://github.com/gernby/openpilot into devel

commit 2629080
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:54:12 2019 -0600

    git config

commit eef45dc
Merge: 9e28ef9 2ea0602
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:43:20 2019 -0600

    Merge branch 'devel' of https://github.com/Gernby/openpilot into devel

commit 2ea0602
Merge: a1819ea 4101ddc
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:40:19 2019 -0600

    Merge branch 'devel' of https://github.com/gernby/openpilot into devel

commit a1819ea
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:34:35 2019 -0600

    git config

commit 4101ddc
Author: Gernby <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:30:44 2019 -0600

    Update README.md

commit 9e28ef9
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:29:18 2019 -0600

    git config

commit 5a0aae3
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 11:03:04 2019 -0600

    git config

commit 4712458
Merge: e57a9ac 73c8877
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 10:55:26 2019 -0600

    Merge branch 'devel' of https://github.com/Gernby/openpilot into deve

commit e57a9ac
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Fri Feb 22 10:54:33 2019 -0600

    configuring git

commit 73c8877
Merge: 3a49dac 5c8aa72
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Thu Feb 21 23:05:47 2019 -0600

    Merge branch 'devel' of https://github.com/commaai/openpilot into devel

commit 3a49dac
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Thu Feb 21 23:05:18 2019 -0600

    added sftp

commit 4f8dd77
Author: Gernby <gernby2002@yahoo.com>
Date:   Sat Feb 16 13:21:35 2019 -0600

    Update README.md

commit 17a5c7b
Author: Gernby <gernby2002@yahoo.com>
Date:   Sat Feb 16 12:56:00 2019 -0600

    Update README.md

commit b836d60
Author: Gernby <gernby2002@yahoo.com>
Date:   Sat Feb 16 09:44:02 2019 -0600

    Updated based on rolling-tune stage 1

commit 576348e
Author: Gernby <gernby2002@yahoo.com>
Date:   Thu Feb 14 22:47:47 2019 -0600

    Updated KpV and KiV for some cars.

commit 90f6e58
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Thu Feb 14 19:11:20 2019 -0600

    Squashed commit of the following:

    commit 3624f8cc01172996e2176493899efcb0c458a53e
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Feb 14 19:08:27 2019 -0600

        cleanup for PR

    commit 4678492
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Feb 4 21:08:01 2019 -0600

        updated vision

    commit 3f8cc11
    Merge: ff3cd65 4ed0725
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Feb 4 19:49:59 2019 -0600

        Merge branch 'devel' of https://github.com/Gernby/openpilot into resonant-mpc-interp-

    commit ff3cd65
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Tue Jan 22 13:58:31 2019 -0600

        Updated Accord resonant parameters

    commit a9c808b
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 21 16:34:23 2019 -0600

        improved some resonant parameters

    commit 2e59311
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 21 10:10:38 2019 -0600

        Updates for pr

    commit 3f7abe3
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Jan 12 09:33:39 2019 -0600

        added default parameters

    commit b816310
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Jan 11 17:31:48 2019 -0600

        added resonant parameters

    commit 8328254
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Jan 10 15:04:54 2019 -0600

        need to test, but I think it's ready

    commit 93efe26
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Jan 10 13:23:33 2019 -0600

        added vibration

    commit 69ec2dd
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Jan 10 11:43:01 2019 -0600

        not quite ready

    commit c734116
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 16:52:36 2019 -0600

        more cleanup

    commit c3ebdf2
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 16:44:53 2019 -0600

        added comments in carstate

    commit d9c8c0d
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 16:38:53 2019 -0600

        Fixed a cleanup issue

    commit bf9a4ce
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 15:58:15 2019 -0600

        untested: cleaning up for PR

    commit 7652a56
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 14:29:53 2019 -0600

        removed extra variable

    commit 40713b5
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Jan 7 13:56:12 2019 -0600

        enabled auto-selection of steer_rate

    commit 62a941a
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Jan 6 20:11:24 2019 -0600

        reverted toyota carstate change

    commit 784c4d4
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Jan 6 20:05:38 2019 -0600

        add dual-mode steer-rate alternating

    commit a163a3b
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Jan 6 13:44:32 2019 -0600

        updated toyota carstate

    commit fc4629c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Jan 6 13:40:35 2019 -0600

        added calculated steer rate

    commit 2789c2a
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Jan 2 20:20:41 2019 -0600

        not working ... lane filtering

    commit 1a36d19
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Jan 1 12:58:12 2019 -0600

        last commit didn't have saved values

    commit bf6c44d
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Jan 1 12:56:20 2019 -0600

        Added simplified tuning parameters

    commit b307f70
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Dec 31 14:18:07 2018 -0600

        fixed projected_angle_steers for future statefixed projected_angle_steers for future state

    commit b92a2f4
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Mon Dec 31 11:11:37 2018 -0600

        Reverted projection_factor

    commit 99460c1
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Mon Dec 31 11:10:35 2018 -0600

        Increased error correction

    commit e42d081
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Dec 30 16:41:53 2018 -0600

        reverted visiond

    commit 989e888
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Dec 30 16:29:48 2018 -0600

        reverted accelerated_angle_rate for pid updates

    commit f6c2d0e
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Dec 29 09:12:11 2018 -0600

        Works great... time to clean it up

    commit e2ece4b
    Merge: 0dd9339 4d2ff10
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Fri Dec 28 13:47:10 2018 -0600

        Merge 0.5.7 into testing-mpc-interp

    commit 0dd9339
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Dec 28 13:35:19 2018 -0600

        changed Kp for some

    commit 218d69c
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Dec 28 13:19:18 2018 -0600

        Enabled error correction

    commit 45ef704
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Dec 28 13:15:50 2018 -0600

        Reverted a couple resonant parameters

        Reduced projection_factor and increased accel_limit

    commit d5c2202
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Dec 28 10:21:08 2018 -0600

        Tweaked steer_offset list

    commit ebad223
    Author: Gernby <gernby2002@yahoo.com>
    Date:   Fri Dec 28 10:19:11 2018 -0600

        removed steer_offset from pilot

    commit 776d853
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 27 19:16:17 2018 -0600

        Fixed honda interface values

    commit 9dd050f
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 27 16:16:46 2018 -0600

        tiny meaningless changes

    commit 8982228
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 27 13:28:18 2018 -0600

        much better interpolation plus Civic tweaks

    commit a0266f6
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 27 09:52:40 2018 -0600

        increased Kf for Pilot

    commit 057289b
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 27 09:50:31 2018 -0600

        very smooth interpolation between delayed MPC updates

    commit 68836c1
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Dec 26 19:46:28 2018 -0600

        added update to cur_state.delta

    commit b204acd
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Dec 26 17:22:00 2018 -0600

        trying different interpolation logic

    commit 19db4fe
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Dec 26 09:53:22 2018 -0600

        added smoothing of mpc delta values

    commit 96dbc51
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Dec 24 23:57:58 2018 -0600

        enhanced torque logic to use accelerated rate

    commit 0b24b41
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Dec 24 14:22:34 2018 -0600

        increased projection factor and decreased accel_limit

    commit 343d946
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Dec 22 19:12:25 2018 -0600

        Wiggle vision + resonant FF and error cancellation

    commit 0579016
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Dec 16 17:14:05 2018 -0600

        Fixed steer_actuator_delay for pathplanner

    commit 5b9708c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Dec 15 20:52:21 2018 -0600

        removed hard-coded actuator delay

    commit f2b706c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 13 13:03:17 2018 -0600

        working again, hopefully resolved git issue

    commit 05eae19
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Dec 13 11:32:12 2018 -0600

        hopefully fixed white space corruption

    commit 53bdee4
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Thu Dec 13 09:26:55 2018 -0600

        Hopefully not corrupted by git

    commit 982c7e0
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Wed Dec 12 16:01:31 2018 -0600

        Finally got it fixed, works awesome!

    commit 37c7196
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Wed Dec 12 14:38:54 2018 -0600

        still trying to un-git myself

    commit 89418e4
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Wed Dec 12 11:37:20 2018 -0600

        Trying to figure out what git did...

    commit 7cb32e9
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 11 21:32:08 2018 -0600

        git is sucking giant monkey balls

    commit be6bc31
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 11 21:28:55 2018 -0600

        battling shitty git

    commit 044bd29
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 11 20:48:45 2018 -0600

        untested merge

    commit e222d48
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Wed Dec 5 19:01:14 2018 -0600

        completely UNtested

    commit a559a7d
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 4 20:35:08 2018 -0600

        added comments

    commit dbdc422
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 4 13:22:41 2018 -0600

        untested ...

    commit 46bf0aa
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Tue Dec 4 12:23:55 2018 -0600

        fixed projected angle error for PIF

    commit 2d988b9
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Mon Dec 3 14:37:37 2018 -0600

        added actual acceleration to future projected state

    commit 68c9a0a
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Sun Dec 2 17:39:35 2018 -0600

        added steer rate to future state calculation

    commit 8837355
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Sat Dec 1 22:22:25 2018 -0600

        fixed an oops for non-bosch hondas

    commit 559593b
    Author: gernby2002@yahoo.com <gernby2002@yahoo.com>
    Date:   Sat Dec 1 20:36:32 2018 -0600

        hopefully proper merge of merged fixes of merge

    commit 1aa2b75
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 22:23:07 2018 -0600

        I wish git was batter for cleanup

    commit d820de2
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 22:12:46 2018 -0600

        cleanup

    commit 5ed48fd
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 22:02:57 2018 -0600

        works amazingly well ... big O face

    commit c186f5c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 21:08:31 2018 -0600

        cleanup of the cleanup?  Need to test

    commit dbe6835
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 21:01:27 2018 -0600

        more cleanup

    commit d4acc24
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 20:47:26 2018 -0600

        awesome, but untested after some cleanup

    commit b658484
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 29 16:33:27 2018 -0600

        ugly code with amazing results

    commit 9f89e4d
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Nov 28 15:26:37 2018 -0600

        oops

    commit 4ead166
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Nov 28 15:25:23 2018 -0600

        switching directions again

    commit 1a839ba
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Wed Nov 28 09:17:36 2018 -0600

        non-specific save

    commit fcc3c3e
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 27 19:49:21 2018 -0600

        added super awesome angular accel limit

    commit 72ed9ef
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 27 15:50:29 2018 -0600

        added angular accelleration limit

    commit aa2bc77
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 27 10:59:01 2018 -0600

        simulteneous dual mode feedforward working very well

    commit c70e60e
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Nov 26 19:54:51 2018 -0600

        many tweaks, self-tuning is a bitch

    commit 527788b
    Author: George Hotz <george@comma.ai>
    Date:   Sun Nov 25 13:35:56 2018 -0600

        decreased time lapse for angle-based FF adjust

    commit 60f9e85
    Author: George Hotz <george@comma.ai>
    Date:   Sun Nov 25 12:24:13 2018 -0600

        working amazingly well

    commit 3f9b21e
    Author: George Hotz <george@comma.ai>
    Date:   Sun Nov 25 11:27:48 2018 -0600

        fixed trim logic, and persisted to flash

    commit 33e44f6
    Author: George Hotz <george@comma.ai>
    Date:   Sat Nov 24 18:36:45 2018 -0600

        added self-tuning parms for rate and angle FF

    commit cec70b7
    Author: George Hotz <george@comma.ai>
    Date:   Sat Nov 24 12:15:56 2018 -0600

        trying rate-based feed-forward

    commit d04f868
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Nov 17 14:29:29 2018 -0600

        Testing approach when desired angle close to actual

    commit 07bbadc
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Nov 17 13:23:44 2018 -0600

        Fixed merge

    commit 3134bce
    Merge: 52094ba b94d598
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Nov 17 12:45:12 2018 -0600

        Merge remote-tracking branch 'origin' into Feed-Forward_Steer_Offset

    commit 52094ba
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 13 17:06:02 2018 -0600

        cleaned up for PR

    commit 34e239f
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 13 16:55:00 2018 -0600

        Added steering rate consideration to latcontrol

    commit 900b9cd
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 13 10:22:31 2018 -0600

        Reverted changes to manager.py

    commit a0c9b2d
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Nov 12 20:15:50 2018 -0600

        reverted change to Ki

    commit 856f2b1
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Nov 12 20:09:52 2018 -0600

        some cleanup

    commit f26785e
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Nov 12 20:04:15 2018 -0600

        Fixed defect in desired angle interpolation

    commit 66ec2bc
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Mon Nov 12 16:40:05 2018 -0600

        untested: minor adjustment to further reduce noise

    commit 1251809
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Nov 11 18:46:51 2018 -0600

        more cleanup for general use

    commit b12aaf3
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Nov 11 18:41:30 2018 -0600

        cleaned up personalized "stuff"

    commit 4b4767c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Nov 11 17:28:45 2018 -0600

        Best yet

    commit 347d1d1
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sun Nov 11 11:46:02 2018 -0600

        going the other way with some things...

    commit a8fabe2
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Nov 10 21:03:05 2018 -0600

        many untested changes

    commit 855684c
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Sat Nov 10 09:37:38 2018 -0600

        minor tweaks

    commit 78095f4
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Fri Nov 9 19:53:18 2018 -0600

        untested tweaks

    commit 8087e81
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 18:10:04 2018 -0600

        Cleanup

    commit d9c8dff
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 18:02:50 2018 -0600

        performance tweaks

    commit 8f0effd
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 17:17:35 2018 -0600

        Adjusted parameter timing

    commit b6a5180
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 14:23:56 2018 -0600

        Added more metrics

    commit f475160
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 12:21:25 2018 -0600

        First working

    commit f543fe9
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 11:49:01 2018 -0600

        added outbound interface for feed-forward table

    commit ebbfd0b
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 10:04:17 2018 -0600

        First version that runs

    commit f720034
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 09:28:41 2018 -0600

        Moved angle stat collection to latcontrol.py

    commit f6e5830
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Thu Nov 8 08:00:49 2018 -0600

        Testing strategies for zero-crossing

    commit 0bbc4fc
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 6 18:29:42 2018 -0600

        fixed a small oops on types

    commit ea86f34
    Author: Greg Esmond <gernby2002@yahoo.com>
    Date:   Tue Nov 6 17:56:07 2018 -0600

        Fixed feed-forward to consider steer_offset

commit 4ed0725
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Feb 4 19:48:49 2019 -0600

    another merge fix

commit 167ef82
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Feb 4 19:46:04 2019 -0600

    Merge fix

commit 6d737ca
Merge: baa7b73e 2c9d5af
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Feb 4 19:32:53 2019 -0600

    Merge branch 'devel' of https://github.com/commaa/openpilot into

commit baa7b73
Merge: 845508b 504f750
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Jan 16 09:32:20 2019 -0600

    Merge branch 'devel' of https://github.com/Gernby/openpilot into devel

commit 504f750
Author: Gernby <gernby2002@yahoo.com>
Date:   Thu Jan 10 17:11:57 2019 -0600

    0.5.6 visiond

commit 5443792
Author: Gernby <gernby2002@yahoo.com>
Date:   Thu Jan 10 17:11:15 2019 -0600

    Delete visiond

commit 845508b
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Wed Jan 9 20:43:57 2019 -0600

    fixed max torque, for more actual torque
  • Loading branch information
kegman committed Mar 3, 2019
1 parent 38de7e6 commit 6813263
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 52 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Expand Up @@ -3,6 +3,7 @@
.ipynb_checkpoints
.idea
.sconsign.dblite
.vscode
model2.png
a.out

Expand All @@ -22,14 +23,18 @@ a.out
*.vcd
config.json
clcache

launch_chffrplus.sh
.vscode/*.json
selfdrive/visiond/visiond
.vscode/
board/obj/
selfdrive/boardd/boardd
selfdrive/visiond/visiond
selfdrive/logcatd/logcatd
selfdrive/proclogd/proclogd
selfdrive/ui/ui
selfdrive/test/tests/plant/out
openpilot_tools/
/src/

one
6 changes: 5 additions & 1 deletion cereal/car.capnp
Expand Up @@ -329,6 +329,7 @@ struct CarParams {
centerToFront @9 :Float32; # [m] GC distance to front axle
steerRatio @10 :Float32; # [] ratio between front wheels and steering wheel angles
steerRatioRear @11 :Float32; # [] rear steering ratio wrt front steering (usually 0)
eonToFront @54 :Float32; # [m] distance from EON to front wheels

# things we can derive
rotationalInertia @12 :Float32; # [kg*m2] body rotational inertia
Expand All @@ -343,7 +344,10 @@ struct CarParams {
steerKpDEPRECATED @15 :Float32;
steerKiDEPRECATED @16 :Float32;
steerKf @25 :Float32;

steerReactance @51 :Float32;
steerInductance @52 :Float32;
steerResistance @53 :Float32;

# Kp and Ki for the longitudinal control
longitudinalKpBP @36 :List(Float32);
longitudinalKpV @37 :List(Float32);
Expand Down
2 changes: 2 additions & 0 deletions cereal/log.capnp
Expand Up @@ -607,6 +607,8 @@ struct PathPlan {
lProb @5 :Float32;
rPoly @6 :List(Float32);
rProb @7 :Float32;
mpcAngles @10 :List(Float64);
mpcTimes @11 :List(Float64);

angleSteers @8 :Float32;
valid @9 :Bool;
Expand Down
6 changes: 4 additions & 2 deletions common/realtime.py
Expand Up @@ -73,7 +73,10 @@ class Ratekeeper(object):
def __init__(self, rate, print_delay_threshold=0.):
"""Rate in Hz for ratekeeping. print_delay_threshold must be nonnegative."""
self._interval = 1. / rate
self._next_frame_time = sec_since_boot() + self._interval
cur_time = sec_since_boot()
sync_time = (7500 - (1000000 * cur_time) % 5000) / 1000000
self._next_frame_time = cur_time + self._interval + sync_time
print(self._next_frame_time, cur_time)
self._print_delay_threshold = print_delay_threshold
self._frame = 0
self._remaining = 0
Expand Down Expand Up @@ -105,4 +108,3 @@ def monitor_time(self):
self._frame += 1
self._remaining = remaining
return lagged

20 changes: 14 additions & 6 deletions panda/examples/can_logger.py
Expand Up @@ -2,6 +2,7 @@
from __future__ import print_function
import binascii
import csv
import time
import sys
from panda import Panda

Expand All @@ -24,18 +25,25 @@ def can_logger():
outputfile = open('output.csv', 'wb')
csvwriter = csv.writer(outputfile)
#Write Header
csvwriter.writerow(['Bus', 'MessageID', 'Message', 'MessageLength'])
csvwriter.writerow(['Time', 'MessageID', 'Bus', 'Message'])
#csvwriter.writerow(['Bus', 'MessageID', 'Message', 'MessageLength'])
print("Writing csv file output.csv. Press Ctrl-C to exit...\n")

bus0_msg_cnt = 0
bus1_msg_cnt = 0
bus2_msg_cnt = 0

startTime = 0.0
cycle_count = 0
p.can_clear(0)
p.can_clear(1)
p.can_clear(2)
while True:
can_recv = p.can_recv()

can_recv = p.can_recv()
cycle_count += 1
for address, _, dat, src in can_recv:
csvwriter.writerow([str(src), str(hex(address)), "0x" + binascii.hexlify(dat), len(dat)])
if startTime == 0.0:
startTime = time.time()
csvwriter.writerow([str(time.time()-startTime), str(address), str(src), binascii.hexlify(dat)])

if src == 0:
bus0_msg_cnt += 1
Expand All @@ -44,7 +52,7 @@ def can_logger():
elif src == 2:
bus2_msg_cnt += 1

print("Message Counts... Bus 0: " + str(bus0_msg_cnt) + " Bus 1: " + str(bus1_msg_cnt) + " Bus 2: " + str(bus2_msg_cnt), end='\r')
if (bus0_msg_cnt + bus1_msg_cnt + bus2_msg_cnt) % 1000 == 0: print("Message Counts... Bus 0: " + str(bus0_msg_cnt) + " Bus 1: " + str(bus1_msg_cnt) + " Bus 2: " + str(bus2_msg_cnt), end='\r')

except KeyboardInterrupt:
print("\nNow exiting. Final message Counts... Bus 0: " + str(bus0_msg_cnt) + " Bus 1: " + str(bus1_msg_cnt) + " Bus 2: " + str(bus2_msg_cnt))
Expand Down
6 changes: 5 additions & 1 deletion selfdrive/boardd/boardd.cc
Expand Up @@ -446,12 +446,16 @@ void *can_recv_thread(void *crap) {
void *context = zmq_ctx_new();
void *publisher = zmq_socket(context, ZMQ_PUB);
zmq_bind(publisher, "tcp://*:8006");
int sleepTime;

// run at ~200hz
while (!do_exit) {
can_recv(publisher);
// 5ms
usleep(5*1000);
sleepTime = 5000 - ((nanos_since_boot() / 1000) % 5000);
usleep(sleepTime);
//usleep(5000);
//LOGW(" sleeptime = %d ", sleepTime);
}
return NULL;
}
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/car/ford/interface.py
Expand Up @@ -77,6 +77,10 @@ def get_params(candidate, fingerprint):
ret.steerKf = 1. / MAX_ANGLE # MAX Steer angle to normalize FF
ret.steerActuatorDelay = 0.1 # Default delay, not measured yet
ret.steerRateCost = 1.0
ret.steerReactance = 0.7
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

f = 1.2
tireStiffnessFront_civic *= f
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/gm/interface.py
Expand Up @@ -64,6 +64,11 @@ def get_params(candidate, fingerprint):
ret.enableCamera = not any(x for x in STOCK_CONTROL_MSGS[candidate] if x in fingerprint)
ret.openpilotLongitudinalControl = ret.enableCamera

ret.steerReactance = 0.7
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

std_cargo = 136

if candidate == CAR.VOLT:
Expand Down
28 changes: 24 additions & 4 deletions selfdrive/car/honda/interface.py
Expand Up @@ -186,6 +186,10 @@ def get_params(candidate, fingerprint):
ret.steerKiBP, ret.steerKpBP = [[0.], [0.]]

ret.steerKf = 0.00006 # conservative feed-forward
ret.steerReactance = 1.0
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

if candidate in [CAR.CIVIC, CAR.CIVIC_BOSCH]:
stop_and_go = True
Expand All @@ -196,7 +200,11 @@ def get_params(candidate, fingerprint):
tire_stiffness_factor = 1.
# Civic at comma has modified steering FW, so different tuning for the Neo in that car
is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e']
ret.steerKpV, ret.steerKiV = [[0.4], [0.12]] if is_fw_modified else [[0.8], [0.24]]
ret.steerKpV, ret.steerKiV = [[0.4], [0.12]] if is_fw_modified else [[0.6], [0.18]]
ret.steerReactance = 0.3
ret.steerInductance = 0.9
ret.steerResistance = 1.0
ret.eonToFront = 0.0
if is_fw_modified:
tire_stiffness_factor = 0.9
ret.steerKf = 0.00004
Expand Down Expand Up @@ -227,6 +235,10 @@ def get_params(candidate, fingerprint):
ret.centerToFront = ret.wheelbase * 0.39
ret.steerRatio = 15.96 # 11.82 is spec end-to-end
tire_stiffness_factor = 0.8467
ret.steerReactance = 1.75
ret.steerInductance = 2.25
ret.steerResistance = 0.5
ret.eonToFront = 1.0
ret.steerKpV, ret.steerKiV = [[0.6], [0.18]]
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
Expand All @@ -240,7 +252,11 @@ def get_params(candidate, fingerprint):
ret.centerToFront = ret.wheelbase * 0.37
ret.steerRatio = 18.61 # 15.3 is spec end-to-end
tire_stiffness_factor = 0.72
ret.steerKpV, ret.steerKiV = [[0.8], [0.24]]
ret.steerKpV, ret.steerKiV = [[0.6], [0.18]]
ret.steerReactance = 0.3
ret.steerInductance = 0.9
ret.steerResistance = 1.0
ret.eonToFront = 0.0
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
Expand All @@ -253,7 +269,11 @@ def get_params(candidate, fingerprint):
ret.centerToFront = ret.wheelbase * 0.41
ret.steerRatio = 15.3 # as spec
tire_stiffness_factor = 0.444 # not optimized yet
ret.steerKpV, ret.steerKiV = [[0.8], [0.24]]
ret.steerKpV, ret.steerKiV = [[0.6], [0.18]]
ret.steerReactance = 0.6
ret.steerInductance = 1.0
ret.steerResistance = 0.5
ret.eonToFront = 0.0
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
Expand All @@ -280,7 +300,7 @@ def get_params(candidate, fingerprint):
ret.centerToFront = ret.wheelbase * 0.38
ret.steerRatio = 15.0 # as spec
tire_stiffness_factor = 0.444 # not optimized yet
ret.steerKpV, ret.steerKiV = [[0.8], [0.24]]
ret.steerKpV, ret.steerKiV = [[0.6], [0.18]]
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
Expand Down
4 changes: 3 additions & 1 deletion selfdrive/car/hyundai/carstate.py
Expand Up @@ -185,7 +185,9 @@ def update(self, cp, cp_cam):
self.standstill = not self.v_wheel > 0.1

self.angle_steers = cp.vl["SAS11"]['SAS_Angle']
self.angle_steers_rate = cp.vl["SAS11"]['SAS_Speed']

# The defined value in the DBC is always positive, so the calculated value needs to be used
self.angle_steers_rate = 0.0 #cp.vl["SAS11"]['SAS_Speed']
self.yaw_rate = cp.vl["ESP12"]['YAW_RATE']
self.main_on = True
self.left_blinker_on = cp.vl["CGW1"]['CF_Gway_TSigLHSw']
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/hyundai/interface.py
Expand Up @@ -69,6 +69,11 @@ def get_params(candidate, fingerprint):
tireStiffnessFront_civic = 192150
tireStiffnessRear_civic = 202500

ret.steerReactance = 0.7
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

ret.steerActuatorDelay = 0.1 # Default delay
tire_stiffness_factor = 1.

Expand Down
4 changes: 4 additions & 0 deletions selfdrive/car/mock/interface.py
Expand Up @@ -74,6 +74,10 @@ def get_params(candidate, fingerprint):
ret.longitudinalKiBP = [0.]
ret.longitudinalKiV = [0.]
ret.steerActuatorDelay = 0.
ret.steerReactance = 0.7
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

return ret

Expand Down
8 changes: 7 additions & 1 deletion selfdrive/car/toyota/carstate.py
Expand Up @@ -142,7 +142,13 @@ def update(self, cp, cp_cam):
self.standstill = not self.v_wheel > 0.001

self.angle_steers = cp.vl["STEER_ANGLE_SENSOR"]['STEER_ANGLE'] + cp.vl["STEER_ANGLE_SENSOR"]['STEER_FRACTION']
self.angle_steers_rate = cp.vl["STEER_ANGLE_SENSOR"]['STEER_RATE']

# Only use the reported steer rate from some Toyotas, since others are very noisy
if self.CP.carFingerprint in (CAR.RAV4, CAR.RAV4H, CAR.COROLLA):
self.angle_steers_rate = cp.vl["STEER_ANGLE_SENSOR"]['STEER_RATE']
else:
self.angle_steers_rate = 0.0

can_gear = int(cp.vl["GEAR_PACKET"]['GEAR'])
self.gear_shifter = parse_gear_shifter(can_gear, self.shifter_values)
self.main_on = cp.vl["PCM_CRUISE_2"]['MAIN_ON']
Expand Down
6 changes: 6 additions & 0 deletions selfdrive/car/toyota/interface.py
Expand Up @@ -76,6 +76,11 @@ def get_params(candidate, fingerprint):
ret.steerKiBP, ret.steerKpBP = [[0.], [0.]]
ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay

ret.steerReactance = 0.7
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

if candidate == CAR.PRIUS:
stop_and_go = True
ret.safetyParam = 66 # see conversion factor for STEER_TORQUE_EPS in dbc file
Expand All @@ -87,6 +92,7 @@ def get_params(candidate, fingerprint):
ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594
# TODO: Prius seem to have very laggy actuators. Understand if it is lag or hysteresis
ret.steerActuatorDelay = 0.25
ret.eonToFront = 0.0

elif candidate in [CAR.RAV4, CAR.RAV4H]:
stop_and_go = True if (candidate in CAR.RAV4H) else False
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/controlsd.py
Expand Up @@ -257,7 +257,7 @@ def state_control(plan, path_plan, CS, CP, state, events, v_cruise_kph, v_cruise
actuators.gas, actuators.brake = LoC.update(active, CS.vEgo, CS.brakePressed, CS.standstill, CS.cruiseState.standstill,
v_cruise_kph, v_acc_sol, plan.vTargetFuture, a_acc_sol, CP)
# Steering PID loop and lateral MPC
actuators.steer, actuators.steerAngle = LaC.update(active, CS.vEgo, CS.steeringAngle,
actuators.steer, actuators.steerAngle = LaC.update(active, CS.vEgo, CS.steeringAngle, CS.steeringRate, angle_offset,
CS.steeringPressed, CP, VM, path_plan)

# Send a "steering required alert" if saturation count has reached the limit
Expand Down

0 comments on commit 6813263

Please sign in to comment.