58 for element
in elements:
63 x = float(pose.text.rsplit(
" ")[0])
64 y = float(pose.text.rsplit(
" ")[1])
65 z = float(pose.text.rsplit(
" ")[2])
69 if "cone_right" in name.text:
70 right.append((x, y, z, object_class))
71 elif "cone_left" in name.text:
72 left.append((x, y, z, object_class))
73 elif "tk_device" in name.text:
74 time_keeping.append((x, y, z, object_class))
76 unknown.append((x, y, z, object_class))
78 return {
"left": left,
"right": right,
"time_keeping": time_keeping,
"unknown": unknown}
94 start_position = (0.0, 0.0, 0.0)
95 start_orientation = (0.0, 0.0, 0.0)
97 yaml_file = OrderedDict({
98 "track": OrderedDict({
100 "lanesFirstWithLastConnected":
True,
101 "start": OrderedDict({
102 "position": f
'[{start_position[0]}, {start_position[1]}, {start_position[2]}]',
103 "orientation": f
'[{start_orientation[0]}, {start_orientation[1]}, {start_orientation[2]}]'}),
104 "earthToTrack": OrderedDict({
105 "position": f
'[{0.0}, {0.0}, {0.0}]',
106 "orientation": f
'[{0.0}, {0.0}, {0.0}]'}),
109 "time_keeping": time_keeping,
114 with open(Path(file_path).with_suffix(
'.yaml'),
"w+")
as f:
115 f.write(
"# Map file for PacSim\n")
118 yaml.dump(yaml_file, yaml_dumper)