lokesh341 commited on
Commit
98596a8
·
verified ·
1 Parent(s): 589f7a3

Update services/utils.py

Browse files
Files changed (1) hide show
  1. 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 # Example: Hyderabad coordinates
5
  base_lon = 78.486671
 
6
  offset = frame_count * 0.0001
7
- return [base_lat + random.uniform(-0.001, 0.001), base_lon + offset]
 
 
 
 
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)]