Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
90aff55
Added the Telemetry Logging Feature
batoolfazal Dec 20, 2025
4ad88ed
Deleted old readme files
batoolfazal Dec 20, 2025
983d6fc
Added telemetry master header : DroneSensors.h
batoolfazal Dec 21, 2025
807d487
Added telemetry master header : DroneControl.h
batoolfazal Dec 21, 2025
24b55c5
Add telemetry master header : TelemetryLogger.h
batoolfazal Dec 21, 2025
3cebac7
Logger System
batoolfazal Dec 21, 2025
4652c71
Logger System
batoolfazal Dec 21, 2025
2fee9c3
Logger System
batoolfazal Dec 21, 2025
8bfc949
Logger System
batoolfazal Dec 21, 2025
f714b7d
Update WaypointBuffer.h
batoolfazal Dec 21, 2025
246023d
Update WaypointBuffer.cpp
batoolfazal Dec 21, 2025
19665d4
Update ErrorLog.h
batoolfazal Dec 21, 2025
14c7689
Update ErrorLog.cpp
batoolfazal Dec 21, 2025
2b3a984
Control System
batoolfazal Dec 21, 2025
95589f6
Control System
batoolfazal Dec 21, 2025
b26a16a
Control System
batoolfazal Dec 21, 2025
967b562
Control System
batoolfazal Dec 21, 2025
b17ca31
Sensors
batoolfazal Dec 21, 2025
db0c594
Sensors
batoolfazal Dec 21, 2025
a44798c
Sensors
batoolfazal Dec 21, 2025
1afc57c
Sensors
batoolfazal Dec 21, 2025
127290e
Sensors
batoolfazal Dec 21, 2025
556481a
Telemetry System Demo
batoolfazal Dec 21, 2025
f52226c
Updated GenerateDroneFlightData.py
batoolfazal Dec 21, 2025
d248742
Added the Hazard Detection feature
batoolfazal Dec 21, 2025
7ef75d0
Merge branch 'Batool' of https://github.com/batoolfazal/CS221-Project…
batoolfazal Dec 21, 2025
18f1fa7
Revise README for Dynamic Hazard Detection System
batoolfazal Dec 21, 2025
42fb65e
updated telemetry feature
batoolfazal Dec 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions DroneFlightLog.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
timestamp,latitude,longitude,altitude,roll,pitch,yaw,vel_x,vel_y,vel_z,battery,signal
1766265264.3021,33.68441687,73.04788259,0.00,-5.29,-0.20,282.64,-3.29,-4.73,-0.63,100.0,87.9
1766265264.4021,33.68441183,73.04795667,2.50,-6.76,3.27,195.83,-1.39,-4.62,1.75,98.4,77.9
1766265264.5021,33.68444842,73.04800322,5.00,-13.28,12.42,232.90,-4.49,-2.53,-0.50,96.8,71.0
1766265264.6021,33.68445138,73.04797729,7.50,-3.25,-2.74,82.01,-1.74,4.45,-1.72,95.2,88.1
1766265264.7021,33.68447814,73.04805944,10.00,-8.98,-1.94,170.61,-2.06,2.79,0.03,93.6,92.4
1766265264.8021,33.68445274,73.04809570,12.50,13.31,-9.94,134.14,-3.59,-4.45,-1.47,92.0,95.2
1766265264.9021,33.68452322,73.04802450,15.00,-1.55,-10.78,29.89,0.28,1.25,-0.62,90.4,85.8
1766265265.0021,33.68453117,73.04810018,17.50,-13.30,0.41,127.33,-0.08,-0.28,1.22,88.8,70.8
1766265265.1021,33.68457631,73.04805673,20.00,-1.06,-2.63,129.77,-1.34,3.59,-0.01,87.2,81.0
1766265265.2021,33.68457987,73.04809277,22.50,-3.66,10.76,179.14,3.41,-4.76,0.89,85.6,88.9
1766265265.3021,33.68456901,73.04817255,23.46,11.96,2.88,80.42,-0.46,-2.19,0.48,84.0,88.6
1766265265.4021,33.68457706,73.04824395,26.76,-7.59,5.55,179.17,-0.56,-3.15,0.13,82.4,96.1
1766265265.5021,33.68455699,73.04831181,26.85,-8.51,2.37,58.71,-2.70,3.02,-1.66,80.8,77.8
1766265265.6021,33.68451590,73.04835658,26.69,-6.06,12.24,357.51,4.86,4.35,0.12,79.2,98.5
1766265265.7021,33.68460338,73.04840766,24.77,-13.96,-6.21,5.57,3.75,1.56,1.42,77.6,87.8
1766265265.8021,33.68452972,73.04838390,26.37,-0.37,-1.94,335.57,-3.33,-4.99,-1.82,76.0,89.4
1766265265.9021,33.68453423,73.04841100,24.54,-4.31,10.91,271.26,4.37,-4.37,-1.84,74.4,74.8
1766265266.0021,33.68444704,73.04834962,25.71,-14.64,-3.95,128.86,-0.71,4.49,0.82,72.8,77.6
1766265266.1021,33.68438806,73.04834437,25.29,-12.25,14.41,47.57,2.01,3.74,0.98,71.2,82.4
1766265266.2021,33.68444350,73.04829154,25.64,0.92,-13.70,236.26,-3.09,-3.09,1.74,69.6,94.2
1766265266.3021,33.68441334,73.04835841,26.01,-5.90,-1.17,2.70,0.91,-4.17,1.01,68.0,94.2
1766265266.4021,33.68435396,73.04845283,26.36,8.33,4.13,202.23,-4.66,-0.06,-0.15,66.4,98.0
1766265266.5021,33.68428352,73.04854532,26.90,7.18,-5.77,140.74,-1.45,-3.59,-1.43,64.8,86.6
1766265266.6021,33.68425663,73.04846698,23.24,5.16,-13.44,151.37,1.44,4.51,-1.66,63.2,84.0
1766265266.7021,33.68421394,73.04848235,25.94,12.66,-14.19,155.02,-3.36,-3.57,-0.04,61.6,97.7
1766265266.8021,33.68426366,73.04857784,26.05,10.53,-4.98,179.95,-2.60,0.27,-0.91,60.0,72.3
1766265266.9021,33.68424767,73.04857337,23.42,5.77,-0.13,149.20,4.00,1.03,0.04,58.4,89.9
1766265267.0021,33.68432884,73.04848689,24.23,-4.57,12.89,80.00,-3.99,2.49,1.65,56.8,75.1
1766265267.1021,33.68429004,73.04853025,25.03,-9.54,10.45,172.33,-0.45,-1.48,1.20,55.2,80.8
1766265267.2021,33.68436807,73.04858554,23.51,8.73,13.43,258.50,-3.13,-4.15,-0.44,53.6,84.5
1766265267.3021,33.68444203,73.04858357,23.90,-8.60,8.34,182.51,-4.88,-1.52,-1.45,52.0,71.1
1766265267.4021,33.68444441,73.04864998,26.88,-3.12,-8.46,355.73,-0.42,4.64,-0.96,50.4,86.3
1766265267.5021,33.68453361,73.04874355,23.23,13.87,-11.29,13.19,-0.31,-1.06,-1.56,48.8,96.6
1766265267.6021,33.68449752,73.04880382,25.04,14.43,-5.91,279.05,1.96,-2.42,0.32,47.2,77.4
1766265267.7021,33.68444311,73.04880299,24.65,-8.15,0.38,285.68,-3.13,-1.99,1.48,45.6,92.8
1766265267.8021,33.68453199,73.04886634,25.70,0.38,-0.79,274.96,-0.96,-0.30,-1.42,44.0,87.2
1766265267.9021,33.68459557,73.04889603,24.92,10.62,-7.30,34.18,-3.20,-4.30,0.32,42.4,83.2
1766265268.0021,33.68451936,73.04885478,25.54,-10.39,7.95,199.57,1.05,2.96,-0.09,40.8,98.6
1766265268.1021,33.68461036,73.04875659,26.51,-11.02,4.41,4.88,-2.44,-0.57,0.80,39.2,96.1
1766265268.2021,33.68462382,73.04867542,25.18,-0.80,12.09,243.62,2.29,-1.78,1.44,37.6,73.4
1766265268.3021,33.68467650,73.04874415,25.00,-12.06,-5.90,66.91,0.33,-0.99,1.58,36.0,96.4
1766265268.4021,33.68461251,73.04875903,22.50,-10.46,-11.56,189.37,-2.96,-2.13,1.29,34.4,79.7
1766265268.5021,33.68466067,73.04881747,20.00,11.96,-6.86,342.19,-2.56,-2.14,-0.55,32.8,90.7
1766265268.6021,33.68456133,73.04888973,17.50,-3.70,-7.92,295.38,-0.94,-2.40,-1.99,31.2,74.2
1766265268.7021,33.68451271,73.04898235,15.00,12.30,-0.70,8.71,-0.83,-0.76,-1.14,29.6,89.9
1766265268.8021,33.68457696,73.04904353,12.50,1.43,-8.88,9.82,-0.28,3.96,0.07,28.0,85.1
1766265268.9021,33.68460553,73.04905423,10.00,-6.54,-9.30,332.91,3.44,4.14,-0.57,26.4,74.5
1766265269.0021,33.68468106,73.04906902,7.50,3.11,-14.84,249.74,3.41,2.86,-0.45,24.8,81.4
1766265269.1021,33.68466439,73.04909922,5.00,9.86,0.73,337.04,3.67,2.13,0.54,23.2,100.0
1766265269.2021,33.68475453,73.04904076,2.50,0.70,5.01,28.93,0.20,-2.62,1.26,21.6,75.6
93 changes: 93 additions & 0 deletions HazardDetection/GenerateHazards.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
"""
Dynamic Hazard Generator for Drone Flight Simulation
"""

import random
import time

def generate_hazards(map_width, map_height, num_hazards, output_file):
"""Generate random hazards"""

hazard_types = {
"BIRD": {"duration": (5, 20), "severity": (2, 4), "desc": "Bird flock"},
"DRONE": {"duration": (10, 30), "severity": (3, 5), "desc": "Unauthorized drone"},
"WEATHER": {"duration": (30, 60), "severity": (1, 3), "desc": "Weather system"},
"DEBRIS": {"duration": (15, 45), "severity": (3, 5), "desc": "Falling debris"},
"AIRCRAFT": {"duration": (20, 40), "severity": (5, 5), "desc": "Aircraft nearby"}
}

hazards = []

print(f"🎲 Generating {num_hazards} hazards for {map_width}x{map_height} map")
print()

for i in range(num_hazards):
x = random.randint(0, map_width - 1)
y = random.randint(0, map_height - 1)

hazard_type = random.choice(list(hazard_types.keys()))
props = hazard_types[hazard_type]

duration = random.randint(*props["duration"])
severity = random.randint(*props["severity"])
timestamp = int(time.time()) + random.randint(0, 300)

description = f"{props['desc']} at sector {i+1}"

hazards.append({
'x': x,
'y': y,
'type': hazard_type,
'description': description,
'duration': duration,
'severity': severity,
'timestamp': timestamp
})

print(f"Hazard {i+1}: ({x},{y}) - {hazard_type} [Sev:{severity}/5, {duration}s]")

# Sort by severity (highest first)
hazards.sort(key=lambda h: h['severity'], reverse=True)

# Save to file
with open(output_file, 'w') as f:
f.write(f"# Hazard Detection Data\n")
f.write(f"# Map: {map_width}x{map_height}\n")
f.write(f"# Total: {num_hazards} hazards\n")
f.write(f"# Format: X Y TYPE DESCRIPTION DURATION SEVERITY TIMESTAMP\n\n")

for h in hazards:
f.write(f"{h['x']} {h['y']} {h['type']} \"{h['description']}\" ")
f.write(f"{h['duration']} {h['severity']} {h['timestamp']}\n")

print(f"\n✅ Saved to '{output_file}'")

# Statistics
print("\n📊 STATISTICS:")
for htype in hazard_types:
count = sum(1 for h in hazards if h['type'] == htype)
print(f" {htype}: {count}")
print()


if __name__ == "__main__":
print("="*60)
print("HAZARD GENERATOR")
print("="*60)
print()

# Light scenario
generate_hazards(60, 40, 5, "hazards_light.txt")
print()

# Medium scenario
generate_hazards(60, 40, 15, "hazards_medium.txt")
print()

# Heavy scenario
generate_hazards(60, 40, 30, "hazards_heavy.txt")

print("="*60)
print("✅ All scenarios generated!")
print("="*60)

Loading