Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwutk committed Feb 25, 2024
1 parent 2483d58 commit 2ed036f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spatialyze/video_processor/utils/insert_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def point(idx: int, p: P, h: float | None):
prevHeading: float | None = None
prevPoint = None
tuplesWithPoints: list[PointTuple[Point]] = []
for i in range(st, en + 1):
i = i - st
for idx in range(st, en + 1):
i = idx - st
t = tuples[i]
if t is None:
assert prevPoint is not None
npPrevPoint = np.array(prevPoint)
npCurrPoint: None | npt.NDArray = None
for jdx in range(i, en + 1):
for jdx in range(idx, en + 1):
j = jdx - st
nt = tuples[j]
if nt is None:
Expand All @@ -65,11 +65,11 @@ def point(idx: int, p: P, h: float | None):
break
assert isinstance(npCurrPoint, np.ndarray)
x, y, z = np.array(npCurrPoint)
t = point(i, (float(x), float(y), float(z)), None)
t = point(idx, (float(x), float(y), float(z)), None)
prevPoint = float(x), float(y), float(z)
else:
prevPoint = t[4]
tuplesWithPoints.append(point(i, Point(prevPoint), t[5]))
tuplesWithPoints.append(point(idx, Point(prevPoint), t[5]))

tuplesWithPointsHeadings: list[PointTuple[Point]] = []
for i, t in enumerate(tuplesWithPoints):
Expand Down

0 comments on commit 2ed036f

Please sign in to comment.