[gd_scene load_steps=7 format=2]

[ext_resource path="res://Scenes/VehicleController/VehicleController.gd" type="Script" id=1]
[ext_resource path="res://Scenes/VehicleController/PIDController/PIDController.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/VehicleController/WheelController/WheelController.tscn" type="PackedScene" id=3]
[ext_resource path="res://Scenes/VehicleController/ForceCurve.tres" type="Curve" id=4]
[ext_resource path="res://Scenes/VehicleController/OmegaCurve.tres" type="Curve" id=5]

[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.9, 0.25, 1.7 )

[node name="VehicleController" type="RigidBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.35, 0 )
collision_layer = 0
mass = 1480.0
script = ExtResource( 1 )
force_curve = ExtResource( 4 )
omega_curve = ExtResource( 5 )

[node name="VehicleBody" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.35, 0 )

[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.11, 0 )
shape = SubResource( 1 )

[node name="FL" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.8, 0, -1.3 )

[node name="Wheel" type="Spatial" parent="FL"]

[node name="FR" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8, 0, -1.3 )

[node name="Wheel" type="Spatial" parent="FR"]

[node name="RL" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.8, 0, 1.3 )

[node name="Wheel" type="Spatial" parent="RL"]

[node name="RR" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8, 0, 1.3 )

[node name="Wheel" type="Spatial" parent="RR"]

[node name="SteeringController" parent="." instance=ExtResource( 2 )]
kp = 5000.0
ki = 500.0

[node name="OmegaController" parent="." instance=ExtResource( 2 )]
kp = 50000.0
ki = 10000.0
