Skip to content

Commit

Permalink
Add licence and copyright info to all files and format if required
Browse files Browse the repository at this point in the history
  • Loading branch information
omersahintas committed Jul 8, 2021
1 parent 47359dd commit 97b78cc
Show file tree
Hide file tree
Showing 143 changed files with 533 additions and 133 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

from __future__ import division
import numpy as np
import warnings
Expand Down
3 changes: 3 additions & 0 deletions p3iv_core/src/p3iv_core/bindings/interaction_dataset/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import warnings
from p3iv_types.vehicle import Vehicle
from p3iv_types.vehicle import VehicleSensorFOV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import lanelet2
import os
Expand Down Expand Up @@ -37,11 +38,3 @@ def track_reader(scenario_name, interaction_dataset_dir, track_file_number=0):
timestamp_max = max(timestamp_max, track.time_stamp_ms_last)

return track_dictionary


if __name__ == "__main__":
from pprint import pprint

t = track_reader("DR_DEU_Merging_MT")
pprint(t)
print("Test passed")
3 changes: 3 additions & 0 deletions p3iv_core/src/p3iv_core/configurations/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

from __future__ import division
import os
import yaml
Expand Down
3 changes: 2 additions & 1 deletion p3iv_core/src/p3iv_core/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import os
import pickle
Expand Down
5 changes: 3 additions & 2 deletions p3iv_modules/src/p3iv_modules/action/act.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import numpy as np
from copy import deepcopy
Expand All @@ -22,7 +24,6 @@ def determine_the_optimal_motion_plan(motion_plans):
best_index = [
i
for i in range(len(motion_plans))
if motion_plans[i].motion is not None
and motion_plans[i].cost == lowest_cost
if motion_plans[i].motion is not None and motion_plans[i].cost == lowest_cost
][0]
return best_index
2 changes: 2 additions & 0 deletions p3iv_modules/src/p3iv_modules/decision/basic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import numpy as np
from p3iv_types.decision_base import DecisionBase
Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/execute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

from p3iv_utils.consoleprint import Print2Console
import pprint

Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/action.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import p3iv_types

Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/decision_making.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import p3iv_types

Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/perception.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import numpy as np
import p3iv_types
Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/planning.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import p3iv_types

Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/prediction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import numpy as np
import p3iv_types
Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/interfaces/understanding.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import abc
import numpy as np
import p3iv_types
Expand Down
3 changes: 3 additions & 0 deletions p3iv_modules/src/p3iv_modules/modules.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import sys
import warnings
import traceback
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)

import numpy as np


Expand Down Expand Up @@ -37,7 +40,7 @@ def __len__(self):
return 2

def __repr__(self):
return 'Point(%s, %s)' % (self.x, self.y)
return "Point(%s, %s)" % (self.x, self.y)


class Polygon(object):
Expand Down Expand Up @@ -127,9 +130,7 @@ def seg_arc_intersect(seg, origin, radius, arc):

D = D / t_max

coef = np.array([1,
2 * np.dot(D, (A - O)),
norm(A - O) ** 2 - r ** 2])
coef = np.array([1, 2 * np.dot(D, (A - O)), norm(A - O) ** 2 - r ** 2])
coef = np.round(coef, decimals=8)

sol = np.roots(coef)
Expand All @@ -146,7 +147,7 @@ def seg_arc_intersect(seg, origin, radius, arc):
if on_arc(arc, ang):
return (P, None)
else:
return (None,)*2
return (None,) * 2
else:
# two distinct roots, two possible intersection points
ret = [None] * 2
Expand Down Expand Up @@ -220,7 +221,7 @@ def in_fov(fov, b, a):
return (a > a2) or (a < a1)
else:
# why not return "a2 < a < a1"?
return (a2 < a < a1)
return a2 < a < a1


def p_in_tri(p, tri):
Expand Down Expand Up @@ -278,6 +279,7 @@ def p_in_wedge(p, wedge):

return False


def segment_interpolation_points(beg, end, dx, n=0, equal=True, inc_end=True):
"""
Generator that returns segment interpolation points.
Expand Down Expand Up @@ -316,28 +318,28 @@ def segment_interpolation_points(beg, end, dx, n=0, equal=True, inc_end=True):
raise ValueError

if not precise and equal:
offset = (d - n*dx) / 2
offset = (d - n * dx) / 2
else:
offset = 0

yield beg

for i in range(1, int(n)):
yield beg + (i*dx + offset) * direction
yield beg + (i * dx + offset) * direction

if inc_end:
yield end


def _test_segment_interp():
beg = [0,0]
end = [0,1]
beg = [0, 0]
end = [0, 1]

print('\ndx =', 0.07)
print("\ndx =", 0.07)
for i in segment_interpolation_points(beg, end, 0.07):
print(i)

print('\nn =', 5)
print("\nn =", 5)
for i in segment_interpolation_points(beg, end, 0.1, n=5):
print(i)

Expand All @@ -361,8 +363,8 @@ def _test_arc():
print(pts)


if __name__ == '__main__':
if __name__ == "__main__":
_test_arc()

print('segment interp')
print("segment interp")
_test_segment_interp()
Loading

0 comments on commit 97b78cc

Please sign in to comment.