1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.34 Bug Reporting thread
    Solutions and more information may already be available.

Enable steering wheel movement in AI driving mode

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by whyhowie, May 3, 2023.

  1. whyhowie

    whyhowie
    Expand Collapse

    Joined:
    May 3, 2023
    Messages:
    2
    Greetings! I'm new to BeamNG and I'm currently working on an autonomous driving research project.

    To provide a more authentic experience, I'm wondering if there is a way to let the AI turn our physical steering wheel (Logitech G923) during the AI driving/autonomous mode. If the game does not have built-in support for such a function, is it possible to get the AI inputs to the car so we can send them to the steering wheel?

    Not sure if anyone has asked this question before, so thanks in advance!
     
    • Like Like x 1
  2. Yoi_Tsuitachi

    Yoi_Tsuitachi
    Expand Collapse

    Joined:
    Sep 25, 2021
    Messages:
    179
    You cant, I'm 99.99% sure. If you wanted to make it, it might be hard because AI just follows a line. It doesn't find a path in unmarked territory like a real car; it has chosen routes that are selected randomly attached to an AI path. You would probably have to go into the code of the steering wheel, too. It's a unique problem, but you might have a head start on it if the AI corresponds to the "Input Data" UI app (which I doubt it does).

    Good luck trying to figure it out!
     
  3. stenyak

    stenyak
    Expand Collapse
    Programmer & Global Moderator
    BeamNG Team

    Joined:
    Aug 6, 2012
    Messages:
    1,978
    This is not possible, and is not something you can "enable" as in, simply toggling a checkbox on/off. It would require programming control logic to apply torques to the hardware, then control the overshooting, oscillations, etc so it reaches and stays at the desired angles. It's not in our roadmap.
     
  4. whyhowie

    whyhowie
    Expand Collapse

    Joined:
    May 3, 2023
    Messages:
    2
    Thanks! I actually just wrote a PID controller in Python with the logitech-steering-wheel package. The tech team at BeamNG suggested that I use the Electrics sensor to get the steering input and adjust the physical steering wheel accordingly.

    Here is a video demo. I've made some tweaking later so it is now much stabler.
     
    • Like Like x 1
  5. stenyak

    stenyak
    Expand Collapse
    Programmer & Global Moderator
    BeamNG Team

    Joined:
    Aug 6, 2012
    Messages:
    1,978
    You were mentioning issues with losing ffb exclusivity, etc. You may want to, instead of handling FFB on your own externally, use the in-game FFB api, so it all stays in one place. That would be the obj:sendForceFeedback(...) calls in hydros.lua, where you will notice how we currenty actively send a torque of 0Nm while AI is driving (your logic could take over at that point).
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice