Control Brakes parameters from vehicle LUA

Discussion in 'Programming' started by Olivier80, Sep 5, 2024.

  1. Olivier80

    Olivier80
    Expand Collapse

    Joined:
    Aug 20, 2024
    Messages:
    47
    I'd like to control brake parameters from vehicle LUA, i tried with a controller defined in the jbeam where "pressureWheels" is defined but i did not find how to access "pressureWheels" parameters from LUA.

    Is it something doable ?

    Thanks a lot for helping.
     
  2. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    3,489
    Wheels are accessible with wheels.wheels:
    Code:
      for i = 0, tableSizeC(wheels.wheels) - 1 do
        local wheel = wheels.wheels[i]
      end
    You can find the fields each wheel has in "lua\vehicle\wheels.lua" from line 919 onwards or with the dump() function.
     
  3. Olivier80

    Olivier80
    Expand Collapse

    Joined:
    Aug 20, 2024
    Messages:
    47
    Thanks a lot. I did try to use that but was not able to get what i wanted. I would want to modify only those parameters for rear and front wheels :

    parkingTorque
    brakeTorque
    enableABS
    absSlipRatioTarget

    For differentials control i was able to use a controller, i would like to do the same thing for brakes. Is it possible ?

    Edit : I was able to control brakes through wheels.wheelRotators. Sample code found inside linelock.lua.
     
    #3 Olivier80, Sep 5, 2024
    Last edited: Sep 29, 2024
  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