def test_endofroadcond(): cond = OSC.EndOfRoadCondition(20) OSC.prettyprint(cond.get_element())
targetname + str(i), pyoscx.TeleportAction(pyoscx.LanePosition(100 + i * 20, 0, -1, 1))) init.add_init_action( targetname + str(i), pyoscx.AbsoluteSpeedAction( 60, pyoscx.TransitionDynamics(pyoscx.DynamicsShapes.step, pyoscx.DynamicsDimension.time, 1))) event = pyoscx.Event('speedchange', pyoscx.Priority.overwrite, maxexecution=10) event.add_action('restart', pyoscx.TeleportAction(pyoscx.LanePosition(0, 0, -1, 1))) trig_cond = pyoscx.EndOfRoadCondition(0) event.add_trigger( pyoscx.EntityTrigger('trigger', 0, pyoscx.ConditionEdge.rising, trig_cond, targetname + str(i))) man = pyoscx.Maneuver('mymaneuver') man.add_event(event) mangr = pyoscx.ManeuverGroup('mangr', maxexecution=3) mangr.add_maneuver(man) mangr.add_actor(targetname + str(i)) act.add_maneuver_group(mangr) ## create the storyboard sb = pyoscx.StoryBoard(