Skip to content

Commit

Permalink
Add Gernby's Resonant MPC Interp Steering
Browse files Browse the repository at this point in the history
Squashed commit of the following:
commit 00ebaf4
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Tue Mar 5 13:59:15 2019 -0600

    fixed sync issues between drives

commit b526de8
Author: Gernby <gernby2002@yahoo.com>
Date:   Mon Mar 4 19:30:00 2019 -0600

    updated resonant values

commit fee7d26
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Mar 4 13:31:51 2019 -0600

    Fixed clean-up mistake in boardd

commit e64c4da
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Mar 4 13:08:06 2019 -0600

    fixed syncfixed sync

commit e041263
Author: Greg Esmond <gernby2002@yahoo.com>
Date:   Mon Mar 4 10:59:48 2019 -0600

    reverted KiV adjustment and updated boardd synchronization

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 5, 2019
1 parent 62fb027 commit aafb281
Show file tree
Hide file tree
Showing 21 changed files with 365 additions and 94 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Expand Up @@ -3,6 +3,7 @@
.ipynb_checkpoints
.idea
.sconsign.dblite
.vscode
model2.png
a.out

Expand All @@ -22,13 +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
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -12,7 +12,9 @@ I will attempt to detail the changes in each of the branches here:

<b>kegman (0.5.9)</b> - this is the default branch which does not include Gernby's resonant feed forward steering (i.e. it's comma's default steering) - it now includes GM code (needs testing)

<b>kegman-plusGernbySteering (0.5.8 only)</b> - this branch is everything in the kegman branch PLUS a Gernby's LATEST feed forward steering. This also includes working code for GM cars. (thx to @jamezz for the code and @cryptokylan for submitting the GM stuff!)
<b>kegman-plusGernbySteering (0.5.9)</b> - this branch has everything in the kegman branch PLUS Gernby's latest resonant mpc interp steering

<b>kegman-plusGernbySteering (0.5.8)</b> - this branch is everything in the kegman branch PLUS a Gernby's LATEST feed forward steering. This also includes working code for GM cars. (thx to @jamezz for the code and @cryptokylan for submitting the GM stuff!)

<b>kegman-plusPilotAwesomeness (0.5.8 only)</b> - <u>If you have a Honda Pilot, OR Honda Ridgeline use this branch.</u> It has everything in kegman branch, uses my PID tuning + a magical older version of Gernby's FF steering which just happened to work very well across all driving conditions including slanted (crowned roads), wind gusts, road bumps, centering on curves, and keeping proper distance from curbs. I have yet to test a combination of FF steering and PID tuning that can beat the performance of this for Honda Pilots.

Expand Down
5 changes: 5 additions & 0 deletions 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,6 +344,9 @@ 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);
Expand All @@ -359,6 +363,7 @@ struct CarParams {
steerRateCost @40 :Float32; # Lateral MPC cost on steering rate
steerControlType @46 :SteerControlType;
radarOffCan @47 :Bool; # True when radar objects aren't visible on CAN
syncID @55 :Int16; # SyncID is optional

steerActuatorDelay @48 :Float32; # Steering wheel actuator delay in seconds
openpilotLongitudinalControl @50 :Bool; # is openpilot doing the longitudinal control?
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
10 changes: 7 additions & 3 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 All @@ -88,10 +91,12 @@ def remaining(self):
return self._remaining

# Maintain loop rate by calling this at the end of each loop
def keep_time(self):
def keep_time(self, offset=0.):
lagged = self.monitor_time()
if self._remaining > 0:
time.sleep(self._remaining)
elif not offset == 0.:
self._next_frame_time += offset
return lagged

# this only monitor the cumulative lag, but does not enforce a rate
Expand All @@ -105,4 +110,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
115 changes: 85 additions & 30 deletions selfdrive/boardd/boardd.cc
Expand Up @@ -64,6 +64,10 @@ pthread_t safety_setter_thread_handle = -1;
pthread_t pigeon_thread_handle = -1;
bool pigeon_needs_init;

int big_recv;
uint32_t big_data[RECV_SIZE*2];
uint16_t sync_id;

void pigeon_init();
void *pigeon_thread(void *crap);

Expand All @@ -90,7 +94,8 @@ void *safety_setter_thread(void *s) {

auto safety_model = car_params.getSafetyModel();
auto safety_param = car_params.getSafetyParam();
LOGW("setting safety model: %d with param %d", safety_model, safety_param);
sync_id = car_params.getSyncID();
LOGW("setting safety model: %d with param %d and sync id %d", safety_model, safety_param, sync_id);

int safety_setting = 0;
switch (safety_model) {
Expand Down Expand Up @@ -212,15 +217,23 @@ void handle_usb_issue(int err, const char func[]) {
// TODO: check other errors, is simply retrying okay?
}

void can_recv(void *s) {
bool can_recv(void *s, uint64_t locked_wake_time, bool force_send) {
int err;
uint32_t data[RECV_SIZE/4];
int recv;
uint32_t f1, f2;
int recv, big_index;
uint32_t f1, f2, address;
bool frame_sent;
uint64_t cur_time;
frame_sent = false;

// do recv
pthread_mutex_lock(&usb_lock);

cur_time = 1e-3 * nanos_since_boot();
if (locked_wake_time > cur_time) {
// Short sleep occurs after usb_lock to ensure sync timing
usleep(locked_wake_time - cur_time);
}
do {
err = libusb_bulk_transfer(dev_handle, 0x81, (uint8_t*)data, RECV_SIZE, &recv, TIMEOUT);
if (err != 0) { handle_usb_issue(err, __func__); }
Expand All @@ -232,38 +245,61 @@ void can_recv(void *s) {

pthread_mutex_unlock(&usb_lock);

// return if length is 0
if (recv <= 0) {
return;
// return if both buffers are empty
if ((big_recv <= 0) && (recv <= 0)) {
return true;
}

// create message
capnp::MallocMessageBuilder msg;
cereal::Event::Builder event = msg.initRoot<cereal::Event>();
event.setLogMonoTime(nanos_since_boot());

auto canData = event.initCan(recv/0x10);

// populate message
big_index = big_recv/0x10;
for (int i = 0; i<(recv/0x10); i++) {
big_data[(big_index + i)*4] = data[i*4];
big_data[(big_index + i)*4+1] = data[i*4+1];
big_data[(big_index + i)*4+2] = data[i*4+2];
big_data[(big_index + i)*4+3] = data[i*4+3];
big_recv += 0x10;
if (data[i*4] & 4) {
// extended
canData[i].setAddress(data[i*4] >> 3);
//printf("got extended: %x\n", data[i*4] >> 3);
address = data[i*4] >> 3;
//printf("got extended: %x\n", big_data[i*4] >> 3);
} else {
// normal
canData[i].setAddress(data[i*4] >> 21);
address = data[i*4] >> 21;
}
canData[i].setBusTime(data[i*4+1] >> 16);
int len = data[i*4+1]&0xF;
canData[i].setDat(kj::arrayPtr((uint8_t*)&data[i*4+2], len));
canData[i].setSrc((data[i*4+1] >> 4) & 0xff);
if (address == sync_id) force_send = true;
}
if (force_send) {
frame_sent = true;

// send to can
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
zmq_send(s, bytes.begin(), bytes.size(), 0);
capnp::MallocMessageBuilder msg;
cereal::Event::Builder event = msg.initRoot<cereal::Event>();
event.setLogMonoTime(nanos_since_boot());

auto can_data = event.initCan(big_recv/0x10);

// populate message
for (int i = 0; i<(big_recv/0x10); i++) {
if (big_data[i*4] & 4) {
// extended
can_data[i].setAddress(big_data[i*4] >> 3);
//printf("got extended: %x\n", big_data[i*4] >> 3);
} else {
// normal
can_data[i].setAddress(big_data[i*4] >> 21);
}
can_data[i].setBusTime(big_data[i*4+1] >> 16);
int len = big_data[i*4+1]&0xF;
can_data[i].setDat(kj::arrayPtr((uint8_t*)&big_data[i*4+2], len));
can_data[i].setSrc((big_data[i*4+1] >> 4) & 0xff);
}

// send to can
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
zmq_send(s, bytes.begin(), bytes.size(), 0);
big_recv = 0;
}

return frame_sent;
}

void can_health(void *s) {
Expand Down Expand Up @@ -447,11 +483,30 @@ void *can_recv_thread(void *crap) {
void *publisher = zmq_socket(context, ZMQ_PUB);
zmq_bind(publisher, "tcp://*:8006");

// run at ~200hz
bool frame_sent, skip_once, force_send;
uint64_t wake_time, locked_wake_time, last_long_sleep;
force_send = true;
last_long_sleep = 1e-3 * nanos_since_boot();
wake_time = last_long_sleep;

while (!do_exit) {
can_recv(publisher);
// 5ms
usleep(5*1000);

frame_sent = can_recv(publisher, locked_wake_time, force_send);
// drain the Panda twice at 4.5ms intervals, then once at 1.0ms interval (twice max if sync_id is set)
if (frame_sent == true || skip_once == true) {
last_long_sleep = 1e-3 * nanos_since_boot();
skip_once = frame_sent;
wake_time += 4500;
force_send = false;
if (last_long_sleep < wake_time) {
usleep(wake_time - last_long_sleep);
}
}
else {
force_send = ((sync_id == 0) || (locked_wake_time > last_long_sleep));
wake_time += 1000;
locked_wake_time = wake_time;
}
}
return NULL;
}
Expand Down
5 changes: 3 additions & 2 deletions selfdrive/can/parser.cc
Expand Up @@ -296,6 +296,7 @@ class CANParser {

void update(uint64_t sec, bool wait) {
int err;
int frame_count;

// recv from can
zmq_msg_t msg;
Expand All @@ -311,7 +312,7 @@ class CANParser {
err = zmq_msg_recv(&msg, subscriber, ZMQ_DONTWAIT);
}
if (err < 0) break;

frame_count++;
// format for board, make copy due to alignment issues, will be freed on out of scope
auto amsg = kj::heapArray<capnp::word>((zmq_msg_size(&msg) / sizeof(capnp::word)) + 1);
memcpy(amsg.begin(), zmq_msg_data(&msg), zmq_msg_size(&msg));
Expand All @@ -324,7 +325,7 @@ class CANParser {

UpdateCans(sec, cans);
}

if (frame_count > 1) printf(" %d frames received!", frame_count);
UpdateValid(sec);

zmq_msg_close(&msg);
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/chrysler/interface.py
Expand Up @@ -138,7 +138,7 @@ def update(self, c):
# ******************* do can recv *******************
canMonoTimes = []

self.cp.update(int(sec_since_boot() * 1e9), False)
self.cp.update(int(sec_since_boot() * 1e9), True)

self.CS.update(self.cp)

Expand Down
6 changes: 5 additions & 1 deletion 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 Expand Up @@ -138,7 +142,7 @@ def update(self, c):
# ******************* do can recv *******************
canMonoTimes = []

self.cp.update(int(sec_since_boot() * 1e9), False)
self.cp.update(int(sec_since_boot() * 1e9), True)

self.CS.update(self.cp)

Expand Down
7 changes: 6 additions & 1 deletion 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 Expand Up @@ -196,7 +201,7 @@ def get_params(candidate, fingerprint):
# returns a car.CarState
def update(self, c):

self.pt_cp.update(int(sec_since_boot() * 1e9), False)
self.pt_cp.update(int(sec_since_boot() * 1e9), True)
self.CS.update(self.pt_cp)

# create message
Expand Down

0 comments on commit aafb281

Please sign in to comment.