Determining Steered Angle from Telemetry

Discussion in 'Automobilista 2 - General Discussion' started by GeekyDeaks, Apr 4, 2023.

  1. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    I unpacked a track bff with PCarsTools and I have installed content via CM, but don't find any crd file.
    The only crd files I see are for vehicles.
    Maybe you can describe a little bit more in detail where to find, thanks.
     
  2. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    Ok, that kinda helped. After looking at the source code for CM I could see the bff files it unpacks when installing tracks or vehicles and I can see the files I need in BOOTFLOW.bff rather than the track .bff files. They are also .trd, on my system not .crd, so I was also looking for the wrong thing. Not sure if that is because CM renames them?

    @viper4r - does that help?
     
    • Like Like x 1
  3. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    There is a rotation offset in there too.... be interesting to see how well it matches your findings
    I'll have a proper play over the weekend with this
     
    • Like Like x 2
  4. Racinglegend1234

    Racinglegend1234 AMS2 wiki founder AMS2 Club Member

    Joined:
    Jul 28, 2022
    Messages:
    5,493
    Likes Received:
    1,882
    • Like Like x 2
  5. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    This is maybe not the same rotation offset.
    GPS coordinates are for the positioning information in the game not relevant.
    Maybe this offset is used to get the CAD data aligned to the sun travel and night sky, but I am not sure.
    I am excited what you get out of it.
     
  6. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    That would make sense. I'm going to see how well the in-game parameters align first, but I suspect I'll end up using the values you kindly shared. I'll attribute your repo as the source, but are you ok with me remapping your values into a simple structure that I can add to my repo?
     
  7. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    I checked Adelaide for the reference point as an example.
    Used GPS coordinates from trd data (red marker):
    2023-11-29_16-06-30__34°55'49.3_S 138°37'17.5_E - Google Maps.jpg

    Used GPS coordinates I found:
    2023-11-29_16-06-52__Project Cars - live view. (https___github.com_eckhchri_pcars-ds-liveview).jpg

    I would say the points are around 300m away from each other.
    There is further a TrackCentre value in the trd data, which is -71.971; 0.000; 66.647; 1.0 for Adelaide.
    It looks like a X,Y,Z offset. If these are in meters and would try to move one of the points with these values I still will not reach the other point.
    In result I think these GPS coordinates from trd are not aligned with reference point of the mWorldPosition data from Shared Memory.
     
    • Like Like x 1
  8. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    Yes, you can do that, no problem.
     
    • Friendly Friendly x 1
  9. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    Another example Bathurst
    From trd the GPS coordinates are next to start/finish (red marker):
    2023-11-29_16-30-04__33°26'22.9_S 149°33'29.5_E - Google Maps.jpg

    And from my data:
    2023-11-29_16-28-38__Project Cars - live view. (https___github.com_eckhchri_pcars-ds-liveview).jpg

    I would say the X and Z offset between these two points is over 1 km.
     
  10. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    Hi @viper4r, just to let you know I ended up using your tweaks as the in-game ones were off by a fair bit as you already noted. It's looking pretty good

    [​IMG]

    The hidden tool you have in your live map to do the tweaks is pretty neat too. Might have to see about using that one for the GT7 offsets! :)
     
    Last edited: Dec 7, 2023
    • Like Like x 2
  11. Racinglegend1234

    Racinglegend1234 AMS2 wiki founder AMS2 Club Member

    Joined:
    Jul 28, 2022
    Messages:
    5,493
    Likes Received:
    1,882
    upload_2023-12-7_18-49-44.png
     
  12. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    Great to hear that it is working and the data is usable for this case.

    Additional note:
    If you use the recording feature of liveview and then export the file, there is the HTML file dev_gen_tm.html in the repository where you can upload a recording file and it prints a JSON array with all coordinate pairs from the recording, which I use to simply generate a trackmap.
     
    Last edited: Dec 7, 2023
    • Friendly Friendly x 1
    • Useful Useful x 1
  13. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    It's an absolute godsend. I had avoided the whole thing as I knew how much effort it was going to require and really I'd need to create a tool for the process. Finding that you have already done it and created the tool for determining the tweaks means I might be able to now tackle the GT7 tracks (or at least rope some friends into collecting the data!)
     
    • Like Like x 2
  14. racezilla

    racezilla Member AMS2 Club Member

    Joined:
    Mar 24, 2020
    Messages:
    68
    Likes Received:
    22
    I would really like to take a look at the car yaw velocity. Can the game output this? If so, does sim-to-motec record it? I cannot find any channel with this information.
     
  15. Racinglegend1234

    Racinglegend1234 AMS2 wiki founder AMS2 Club Member

    Joined:
    Jul 28, 2022
    Messages:
    5,493
    Likes Received:
    1,882
    You can check the sharedmemory folder of AMS2 to see if its output
     
    • Like Like x 1
  16. GeekyDeaks

    GeekyDeaks Member AMS2 Club Member

    Joined:
    Jan 17, 2022
    Messages:
    83
    Likes Received:
    47
    There is the following vector in the shared memory:

    float mAngularVelocity[VEC_MAX]; // [ UNITS = Radians per-second ]

    It might contain enough information, but it's not currently reported by the sim-to-motec scripts. i2 is able to derive some stuff too so looking at some maths channel examples might provide a way to do what you want with the current channels, but I think you might really need the orientation, which again is not reported (but probably should be, so I'll add that to the list).

    I'm bit busy to take a proper look at what the values truly mean, but adding the three vector channels is easy enough and I could take a look at it next week as I have some changes for the new LeMans track anyway as well as a bug fix that I was planning on pushing.
     
    • Like Like x 1
  17. racezilla

    racezilla Member AMS2 Club Member

    Joined:
    Mar 24, 2020
    Messages:
    68
    Likes Received:
    22
    Angular Velocity sounds like what I'd be looking for.
    If you need to get an idea whether mAngularVelocity is actually the yaw velocity (or "Yaw Rate", it's the same thing), you can create a math channel like:
    ('G Force Lat' [G]*9.81)/('Ground Speed' [km/h]/3.6) and compare it with the new channel.
    The above is what you suggested to do by using current channels, but this is where the issue lies for me. I need to compare the real angular velocity with the estimate above. There really no other way to do this other than having the actual value.
    I guess deriving orientation w.r.t. time would also work, as long as the orientation vectors are not obtained from GPS position. Treating the vehicle as a point loses the information I'm looking for.
     
  18. racezilla

    racezilla Member AMS2 Club Member

    Joined:
    Mar 24, 2020
    Messages:
    68
    Likes Received:
    22
    I'm not sure where this folder is, can you help me with that?
     
  19. Racinglegend1234

    Racinglegend1234 AMS2 wiki founder AMS2 Club Member

    Joined:
    Jul 28, 2022
    Messages:
    5,493
    Likes Received:
    1,882
    C:\Program Files (x86)\Steam\steamapps\common\Automobilista 2\Support\SharedMemory\AMS2_SharedMemoryExampleApp/sharedmemory.h
     
    • Like Like x 1
  20. Djangopass

    Djangopass Formula Vintage cars

    Joined:
    Jan 23, 2024
    Messages:
    29
    Likes Received:
    7
    Hi, new of ams2 but quite experienced with Motec with other sims. Is there a list of the available parameters that ams2 makes available in the Shared Memory?
     

Share This Page