Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: OpenPilot

  1. #11
    Verified VCDS User
    Join Date
    Apr 2014
    Location
    US 2014 GTI Drivers Edition/DSG
    Posts
    590
    Post Thanks / Like
    instead of bouncing back and forth, can't you just teach it to follow the centerline and use side line as fallback/secondary?

  2. #12
    FoRT jyoung8607's Avatar
    Join Date
    Feb 2014
    Location
    Cincinnati, OH
    Posts
    2,384
    Post Thanks / Like
    Got some coarsely tuned PIDs dialed-in today. Amateur cinematography and peanut gallery commentary provided by my sons in the backseat.







    There's still some ground to be gained, I'm going to revisit tuning when we get rid of all this snow and salt spray obscuring lane markings everywhere, but it's now very usable on the highway and pretty decent on side/rural roads. I've still got a lot of safety coding yet to be done, but this is going to be a quality OP port.

    Once steering is dialed in, I want to do a little work with ACC. We're still using the stock ACC, and probably will for the foreseeable future, but we could could layer on some functionality. After VCDS recoding to permit resume after short stop/resume from steering wheel button, we can monitor for distance to the vehicle in front, and simulate the resume button press to resume anytime. With that same button press simulation, we can use map-based speed limit data we get from OpenStreetMap to adjust the ACC setpoint.

    Most of OP's code requires really specific data about every single model and year of vehicle, and it's a really cumbersome thing to maintain. I think I can make this code work for MQB in a very general way, and then process the VIN_01 messages to get the VIN, identify the chassis from that, and keep a lookup table of supported MQB vehicle-classes with their associated tuning constants. That will work really well in the USA, but RoW vehicles don't encode nearly so much vehicle type info into the VIN, so (as one example) distinguishing a RoW Golf from a Golf Sportwagen from a Golf Alltrack when they're all chassis AU may be difficult. Thoughts welcome if anyone knows a way to tell those apart from an Auto-Scan or similar.
    Last edited by jyoung8607; 02-01-2019 at 03:53 PM.
    Silence gives consent.

  3. Likes Uwe, D-Dub liked this post
  4. #13
    FoRT jyoung8607's Avatar
    Join Date
    Feb 2014
    Location
    Cincinnati, OH
    Posts
    2,384
    Post Thanks / Like




    PID loops more or less work. Safeties are about two thirds done. Added some code to simulate LDW_02 messages to the instrument cluster, for yellow/green passive/active and left/right lane visibility. For S&Gs I added automatic detection of the car's configured speed units (MPH vs KPH), and later I want to go back and obey terminal 58 dimming for brightness. Lots more to do, but what we have is working pretty decent. If anyone else wants to give this code a try, we're at a point where I could talk you through building the CAN bus tap. No mods required to the car.

    https://github.com/jyoung8607/openpi...lfdrive/car/vw

    Code:
    # TODO: additional signals
    #  * EPS HCA support detection (throw steering error on engage if not supported)
    #  * ACC speed setpoint
    #  * ACC following distance setpoint
    #  * ACC distance to car in front
    #  * Test ACC sensor blind/other error to make sure OP can react clearly and promptly
    #  * GRA_ACC_01 steering wheel buttons for events, and to send cancels and speed changes
    #  * Dimmung messages for EON screen brightness
    #  * (( Klemmen_Status_01 for virtual terminal 15, but goes in Panda safety ))
    #  * (( VIN_01 for auto platform ID, but probably goes in fingerprint or init ))
    #  * ESP_05 ESP_Autohold_aktiv provides DSG and maybe even manual auto-hold state, may be important for auto-resume
    #  * ESP_05 ESP_Verzoeg_EPB_verf may signify presence of an EPB, implying ACC stop-and-go support
    #  * EPB_01 EPB_Status and friends tell us lots about the EPB, if present, still need to track down handbrake
    #  * ACC_06 ACC_Typ may indicate stop-and-go support, @cben = 1, @jyoung8607 = 2
    
    # TODO: Safety
    #  * Seatbelt works to disable. Turns out stock ACC doesn't care, so OP gets to handle. Need to spam ACC cancel.
    #  * Door open detection works to disable. ACC dies immediately anyway, but tested manually.
    #  * Brake pressed. Obviously knocks out stock ACC. Have not made this explicit/redundant in OP yet.
    #  * ESP disabled detection works, but stock ACC re-enables and creates a timing/conflict with OP, need to spam cancel.
    #  * Gas pressed. Trivial but haven't done yet. Will need to spam ACC cancel.
    #  * Control steering torque and ramp rate once we have a reasonable tune model.
    
    # TODO: generic platform detection
    #  * Collect 3x VIN_01 messages and detect chassis (e.g., AU=Golf Mk7) with inherent networking model
    #  * Optionally, collect Motor_Code_01 for transmission type
    
    # TODO: bus layout detection
    #  * At J533 gateway/extended? Required to have any control over ACC long term, even a "lite" model
    #  * At R242 camera? More traditional, but no possibility of controlling ACC
    #  * At J533 gateway/running gear? Needed for lowline J533 in cars without ACC. Will fingerprint differently.
    # FIXME: Temporarily use a hardcoded J533 vs R242 location during development.
    Last edited by jyoung8607; 02-11-2019 at 06:07 PM.
    Silence gives consent.

  5. Likes Zenerdiode, Uwe, NEtech, DGMotors, D-Dub, kamold liked this post
  6. #14
    Verified VCDS User Zenerdiode's Avatar
    Join Date
    Jun 2014
    Location
    Newcastle, England
    Posts
    944
    Post Thanks / Like
    Very impressed indeed, Jason. However, I'm glad you're still behind the wheel:

    # TODO: Safety
    ...
    In my line of work (Railway Signalling) anything computer based that life depends on; require the computer to be guaranteed to fail-safe. How? By running three identical processors, each in their own chassis, with identical firmware and each processor executing each MC instruction in unison. The output of each processor is compared by the other two by redundancy management circuits and if two agree and the other one doesn't, the rogue one is physically disabled by the other two deliberately rupturing its security fuse. When two out of three are running, if they disagree the system effectively throws itself on its sword.

    # TODO: Buy a Futaba controller so I can drive this thing remotely.

  7. Likes Uwe, jyoung8607, PetrolDave liked this post
  8. #15
    FoRT jyoung8607's Avatar
    Join Date
    Feb 2014
    Location
    Cincinnati, OH
    Posts
    2,384
    Post Thanks / Like
    OpenPilot running disengaged/datalogging on the Tail of the Dragon:



    Silence gives consent.

  9. Likes D-Dub, Eric, NEtech, Uwe liked this post
  10. #16
    Verified VCDS User
    Join Date
    Apr 2014
    Location
    US 2014 GTI Drivers Edition/DSG
    Posts
    590
    Post Thanks / Like
    missing all the vroom vroom

  11. Likes jyoung8607 liked this post
  12. #17
    Benevolent Dictator Uwe's Avatar
    Join Date
    Jan 2014
    Location
    Earth
    Posts
    24,688
    Post Thanks / Like
    Blog Entries
    1
    Quote Originally Posted by jyoung8607 View Post
    OpenPilot running disengaged/datalogging on the Tail of the Dragon:
    Disengaged was probably A Good Thing. I'm only 5:30 into it so far, but it seems pretty obvious that it wouldn't have handled the tighter curves correctly at all.

    -Uwe-
    The engineering problems are likely insurmountable. It would be like proposing to land a rocket booster section on a barge floating in the middle of the ocean.

  13. #18
    FoRT jyoung8607's Avatar
    Join Date
    Feb 2014
    Location
    Cincinnati, OH
    Posts
    2,384
    Post Thanks / Like
    Quote Originally Posted by D-Dub View Post
    missing all the vroom vroom
    My GoPro video sucked The only mount I had was an in-car headrest setup intended for demonstrating OpenPilot, something to get the cluster and steering wheel in frame, and its forward view was obstructed. Also it picked up a lot of wind buffeting.

    Next year my telemetry will be coming from a strapped down VCDS rig, and I'll see about a better GoPro location and a wind shielded mic. I saw a few guys running rear hatch mounted wind shielded mics and I think I'll try something similar for best vroom vroom.

    Silence gives consent.

  14. Likes Uwe, D-Dub liked this post
  15. #19
    FoRT jyoung8607's Avatar
    Join Date
    Feb 2014
    Location
    Cincinnati, OH
    Posts
    2,384
    Post Thanks / Like
    Quote Originally Posted by Uwe View Post
    Disengaged was probably A Good Thing. I'm only 5:30 into it so far, but it seems pretty obvious that it wouldn't have handled the tighter curves correctly at all.
    Oh, it wasn't going to do anything at all, especially at speed. If you don't see those lane recognition lines, OP wouldn't even try to steer, even if engaged. You only see those lines pop up on the straighter parts, the model won't recognize sharper curves.

    I did try a late night drive alone super low speed, and managed to find another "bug"... The steering rack has a safety that pops off when it's asked to apply the exact same torque value for greater than 6 seconds. So I need to introduce a tiny bit of noise. I already found out there's a 180 second limit on how long it's willing to steer in total before faulting out. I cheated around that by turning off steering for one frame/2ms every time there's a zero crossing/change of direction.

    Anyway, there's still like 40 things wrong with it, but that's down from 50 when I loaded half of your brain-trust onboard and went for BBQ, and they're still alive, so it's going pretty well! I actually had it dialed in really, really well on the Florida-to-North Carolina leg of my trip last week, it's approaching trustable on the highway. Which is, of course, exactly how it's going to go Skynet on me.
    Last edited by jyoung8607; 04-18-2019 at 10:23 PM.
    Silence gives consent.

  16. Likes Uwe, Eric, D-Dub liked this post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •