Adding lidar sensor handling

This commit is contained in:
2026-07-08 20:58:21 -06:00
parent 8fc5088c01
commit 04f3e2ba07
19 changed files with 145 additions and 31 deletions
@@ -7,6 +7,16 @@
script = ExtResource("1_hqf45")
metadata/_custom_type_script = "uid://cr4oydwvmm28y"
[node name="Label" type="Label" parent="." unique_id=749031600]
custom_minimum_size = Vector2(200, 0)
offset_left = -100.0
offset_top = 90.0
offset_right = 100.0
offset_bottom = 178.0
theme_override_font_sizes/font_size = 64
text = "10.0 g"
horizontal_alignment = 1
[node name="Panel" type="Panel" parent="." unique_id=1154284634]
visible = false
offset_left = -103.0
@@ -32,17 +42,13 @@ default_color = Color(0, 1, 0, 1)
begin_cap_mode = 2
end_cap_mode = 2
[node name="Label" type="Label" parent="." unique_id=749031600]
offset_right = 40.0
offset_bottom = 23.0
[node name="MovableControl" type="Control" parent="." unique_id=345939378 node_paths=PackedStringArray("move_target")]
layout_mode = 3
anchors_preset = 0
offset_left = -103.0
offset_top = -103.0
offset_right = 106.0
offset_bottom = 106.0
offset_bottom = 183.0
mouse_filter = 1
script = ExtResource("2_pog3i")
move_target = NodePath("..")
@@ -24,8 +24,9 @@ func _update_data():
return
var lateral_gs = host_vehicle.lateral_accel
var accel_g = lateral_gs.length() / Constants.g
var x_vec = Vector2(lateral_gs.x, 0)
accel_vector.points = [origin, lateral_gs * 4]
x_vector.points = [origin, x_vec * 4]
y_vector.points = [x_vec * 4, lateral_gs * 4]
var end_point = Vector2(lateral_gs.y, -lateral_gs.x)
var forward = Vector2(0, -lateral_gs.x)
accel_vector.points = [origin, end_point * 4]
x_vector.points = [forward * 4, end_point * 4]
y_vector.points = [origin, forward * 4]
label.text = str(round(accel_g*10)/10) + ' g'
+5 -5
View File
@@ -8,21 +8,21 @@ script = ExtResource("1_hmdxp")
metadata/_custom_type_script = "uid://b3rfje1auw6to"
[node name="Panel" type="Panel" parent="." unique_id=1393400967]
offset_right = 460.0
offset_right = 300.0
offset_bottom = 120.0
[node name="Label" type="Label" parent="." unique_id=1070194714]
offset_right = 460.0
offset_right = 300.0
offset_bottom = 120.0
theme_override_font_sizes/font_size = 80
text = "Alt: 99999 ft"
theme_override_font_sizes/font_size = 64
text = "99999 ft"
horizontal_alignment = 1
vertical_alignment = 1
[node name="MovableControl" type="Control" parent="." unique_id=1186292353 node_paths=PackedStringArray("move_target")]
layout_mode = 3
anchors_preset = 0
offset_right = 460.0
offset_right = 300.0
offset_bottom = 120.0
mouse_filter = 1
script = ExtResource("2_34sps")
@@ -14,4 +14,4 @@ func _ready() -> void:
func _update_data():
if label_node == null:
return
label_node.text = 'Alt: ' + str(int(round(host_vehicle.altitude_m * Constants.M2FT))) + ' ft'
label_node.text = str(int(round(host_vehicle.altitude_m * Constants.M2FT))) + ' ft'
+3
View File
@@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://dhxuhkb8inhqa"]
[node name="Lidar2d" type="Node3D" unique_id=679038150]
+1 -1
View File
@@ -26,7 +26,7 @@ offset_left = -50.0
offset_top = -22.0
offset_right = 50.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 32
theme_override_font_sizes/font_size = 48
horizontal_alignment = 1
[node name="Line2D" type="Line2D" parent="." unique_id=1285997474]
+1 -1
View File
@@ -26,7 +26,7 @@ offset_left = -50.0
offset_top = -22.0
offset_right = 50.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 32
theme_override_font_sizes/font_size = 48
horizontal_alignment = 1
[node name="Line2D" type="Line2D" parent="." unique_id=1446923009]
@@ -16,4 +16,4 @@ func _update_data():
if sprite == null or label == null:
return
sprite.rotation = host_vehicle.pitch_rad
label.text = str(round(rad_to_deg(host_vehicle.pitch_rad)*10)/10) + " \u00B0"
label.text = str(int(rad_to_deg(host_vehicle.pitch_rad))) + " \u00B0"
+1 -1
View File
@@ -15,4 +15,4 @@ func _update_data():
if sprite == null or label == null:
return
sprite.rotation = host_vehicle.roll_rad
label.text = str(abs(round(rad_to_deg(host_vehicle.roll_rad)*10)/10)) + " \u00B0"
label.text = str(abs(int(rad_to_deg(host_vehicle.roll_rad)))) + " \u00B0"
+1 -1
View File
@@ -14,7 +14,7 @@ offset_bottom = 40.0
[node name="SpeedLabel" type="Label" parent="VBoxContainer" unique_id=2101712075]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_font_sizes/font_size = 64
text = "10"
horizontal_alignment = 1