Skip to content

Commit

Permalink
fix #14592
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 25, 2024
1 parent d3c12c7 commit f4c8de1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/plot_trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def getOptions(args=None):
+ " Default 'ds' plots Distance vs. Speed")
optParser.add_option("--persons", category="processing", action="store_true",
default=False, help="plot person trajectories")
optParser.add_option("--meso", category="processing", action="store_true",
default=False, help="plot meso trajectories")
optParser.add_option("-s", "--show", category="processing", action="store_true",
default=False, help="show plot directly")
optParser.add_option("--csv-output", category="output", dest="csv_output", help="write plot as csv", metavar="FILE")
Expand Down Expand Up @@ -153,6 +155,8 @@ def main(options):
if options.persons:
element = 'person'
location = 'edge'
elif options.meso:
location = 'edge'

routes = defaultdict(list) # vehID -> recorded edges
# vehID -> (times, speeds, distances, accelerations, angles, xPositions, yPositions, kilometrage)
Expand All @@ -175,7 +179,7 @@ def main(options):
suffix = shortFileNames[fileIndex]
if len(suffix) > 0:
vehID += "#" + suffix
if options.persons:
if options.persons or options.meso:
edge = vehicle.edge
else:
edge = vehicle.lane[0:vehicle.lane.rfind('_')]
Expand Down

0 comments on commit f4c8de1

Please sign in to comment.