{"name":"Arma 3: AICarSteeringComponent","title":"Arma 3: AICarSteeringComponent","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_AICarSteeringComponent","revid":352456,"updated":"2024-02-11T14:31:40Z","aliases":["AICarSteeringComponent","Arma 3 AICarSteeringComponent"],"markdown":"#### Config\n\n```cpp\nclass AICarSteeringComponent\n{\n    // controls working parameters of steering PID controller (Kp, Ki, Kd)\n    steeringPIDWeights[] = { 1.2, 0.1, 0.2 };\n    // controls working parameters of speed PID controller (Kp, Ki, Kd)\n    speedPIDWeights[] = { 0.7, 0.2, 0.0 };\n\n    // remapping of maxSpeed of vehicle, for fast vehicles we want to lower the used speed\n    doRemapSpeed = true;\n    remapSpeedRange[] = { 30.0, 70.0 };\n    remapSpeedScalar[] = { 1.0, 0.35 };\n\n    // prediction ahead is used for both steering and analysing of shape to modify the speed\n    doPredictForward = true;\n    predictForwardRange[] = { 1, 20 };\n    // steer ahead is a point to steer to, saturated down to given range, in meters\n    steerAheadSaturation[] = { 0.01, 0.4 };\n\n    // set method of predicting safe speed\n\n    speedPredictionMethod = 2;\n    // 0 - three angles method\n    // 1 - wheel direction method\n    // 2 - combined method\n    // three coef's to determine how much given angle should influence slowing down\n    wheelAngleCoef = 0.7;\n    forwardAngleCoef = 0.7;\n    steeringAngleCoef = 1.0;\n    differenceAngleCoef = 1.0;\n\n    // for how long we allow to be not moving, before we consider us stuck\n    stuckMaxTime = 3.0;\n\n    // overtaking is part of collision avoidance\n    allowOvertaking = true;\n    allowCollisionAvoidance = true;\n    // allow using movement vector as direction\n    allowDrifting = false;\n\n    // parameters of predictionMethod = 1\n    maxWheelAngleDiff = 0.2616;\n    minSpeedToKeep = 0.1;\n\n    // how strong AI will turn when commanded left/right\n    commandTurnFactor = 1.0;\n};\n```\n\n#### Scripting commands\n\nuseAISteeringComponent true/false\n\n- enable or disable new ai driving across all vehicles driven locally on the machine.\n\nvehicle forceFollowRoad true/false\n\n- forces AI driver to stick to immediate road, as long as the path is near the road\n\nvehicle setConvoySeparation 20\n\n- sets distance between following vehicles, should be set for all vehicles in convoy with the same value.\n\nvehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]\n\n- sets a custom path for a vehicle, behaves like Move command but with ability to send path through list of points. Accepts array of arrays (3 or 4 elements). Either (x,y,z) or (x,y,z,wantedSpeed)","sections":[{"heading":"Config","level":4,"markdown":"```cpp\nclass AICarSteeringComponent\n{\n    // controls working parameters of steering PID controller (Kp, Ki, Kd)\n    steeringPIDWeights[] = { 1.2, 0.1, 0.2 };\n    // controls working parameters of speed PID controller (Kp, Ki, Kd)\n    speedPIDWeights[] = { 0.7, 0.2, 0.0 };\n\n    // remapping of maxSpeed of vehicle, for fast vehicles we want to lower the used speed\n    doRemapSpeed = true;\n    remapSpeedRange[] = { 30.0, 70.0 };\n    remapSpeedScalar[] = { 1.0, 0.35 };\n\n    // prediction ahead is used for both steering and analysing of shape to modify the speed\n    doPredictForward = true;\n    predictForwardRange[] = { 1, 20 };\n    // steer ahead is a point to steer to, saturated down to given range, in meters\n    steerAheadSaturation[] = { 0.01, 0.4 };\n\n    // set method of predicting safe speed\n\n    speedPredictionMethod = 2;\n    // 0 - three angles method\n    // 1 - wheel direction method\n    // 2 - combined method\n    // three coef's to determine how much given angle should influence slowing down\n    wheelAngleCoef = 0.7;\n    forwardAngleCoef = 0.7;\n    steeringAngleCoef = 1.0;\n    differenceAngleCoef = 1.0;\n\n    // for how long we allow to be not moving, before we consider us stuck\n    stuckMaxTime = 3.0;\n\n    // overtaking is part of collision avoidance\n    allowOvertaking = true;\n    allowCollisionAvoidance = true;\n    // allow using movement vector as direction\n    allowDrifting = false;\n\n    // parameters of predictionMethod = 1\n    maxWheelAngleDiff = 0.2616;\n    minSpeedToKeep = 0.1;\n\n    // how strong AI will turn when commanded left/right\n    commandTurnFactor = 1.0;\n};\n```"},{"heading":"Scripting commands","level":4,"markdown":"useAISteeringComponent true/false\n\n- enable or disable new ai driving across all vehicles driven locally on the machine.\n\nvehicle forceFollowRoad true/false\n\n- forces AI driver to stick to immediate road, as long as the path is near the road\n\nvehicle setConvoySeparation 20\n\n- sets distance between following vehicles, should be set for all vehicles in convoy with the same value.\n\nvehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]\n\n- sets a custom path for a vehicle, behaves like Move command but with ability to send path through list of points. Accepts array of arrays (3 or 4 elements). Either (x,y,z) or (x,y,z,wantedSpeed)"}],"categories":["Arma 3: Vehicle Configuration"],"groups":["Configuration"]}