# HG changeset patch # User Nicolas Saunier # Date 1288906807 14400 # Node ID 290fceb125d222ea45d25f585cf7bcd690bd9ef9 # Parent a8c6d544f015dd61915463b4b4f0e75046ebe80a moved road user types and added plotting for all road users diff -r a8c6d544f015 -r 290fceb125d2 python/moving.py --- a/python/moving.py Wed Nov 03 22:51:38 2010 -0400 +++ b/python/moving.py Thu Nov 04 17:40:07 2010 -0400 @@ -247,6 +247,16 @@ # use shapely polygon contains pass +################## +# Moving Objects +################## + +userTypeNames = ['car', + 'pedestrian', + 'twowheels', + 'bus' + 'truck'] + class MovingObject(STObject): '''Class for moving objects i.e. with a trajectory and a geometry (volume) (constant) @@ -320,6 +330,15 @@ # def computeVelocities(self): +def plotRoadUsers(objects, colors): + '''Colors is a PlottingPropertyValues instance''' + from matplotlib.pyplot import figure, axis + figure() + for obj in objects: + obj.draw(colors.get(obj.userType)) + axis('equal') + + # need for a class representing the indicators, their units, how to print them in graphs... class TemporalIndicator: '''Class for temporal indicators diff -r a8c6d544f015 -r 290fceb125d2 python/ubc_utils.py --- a/python/ubc_utils.py Wed Nov 03 22:51:38 2010 -0400 +++ b/python/ubc_utils.py Thu Nov 04 17:40:07 2010 -0400 @@ -6,12 +6,6 @@ __metaclass__ = type -userTypeNames = ['car', - 'pedestrian', - 'twowheels', - 'bus' - 'truck'] - fileTypeNames = ['feature', 'object', 'prototype',