Spaces:
Sleeping
Sleeping
Update services/utils.py
Browse files- services/utils.py +7 -2
services/utils.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
import random
|
|
|
|
| 2 |
|
| 3 |
def simulate_gps_coordinates(frame_count):
|
| 4 |
-
base_lat = 17.385044 #
|
| 5 |
base_lon = 78.486671
|
|
|
|
| 6 |
offset = frame_count * 0.0001
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import random
|
| 2 |
+
import math
|
| 3 |
|
| 4 |
def simulate_gps_coordinates(frame_count):
|
| 5 |
+
base_lat = 17.385044 # Hyderabad coordinates
|
| 6 |
base_lon = 78.486671
|
| 7 |
+
# Simulate a more realistic movement pattern (e.g., a slight curve)
|
| 8 |
offset = frame_count * 0.0001
|
| 9 |
+
lat_offset = math.sin(frame_count * 0.01) * 0.0005 # Add sinusoidal variation
|
| 10 |
+
lon_offset = offset + math.cos(frame_count * 0.01) * 0.0003
|
| 11 |
+
return [base_lat + lat_offset + random.uniform(-0.0002, 0.0002),
|
| 12 |
+
base_lon + lon_offset + random.uniform(-0.0002, 0.0002)]
|