Beispiel #1
0
def test_abs_sync_action():

    asa = OSC.AbsoluteSynchronizeAction('Ego',
                                        OSC.WorldPosition(0, 0, 0, 0, 0, 0),
                                        OSC.WorldPosition(10, 0, 0, 0, 0, 0),
                                        20)
    OSC.prettyprint(asa.get_element())
Beispiel #2
0
        pyoscx.TransitionDynamics(pyoscx.DynamicsShapes.step,
                                  pyoscx.DynamicsDimension.time, 1)))

init.add_init_action(targetname,
                     pyoscx.TeleportAction(pyoscx.LanePosition(30, 0, -3, 0)))
init.add_init_action(
    targetname,
    pyoscx.AbsoluteSpeedAction(
        20,
        pyoscx.TransitionDynamics(pyoscx.DynamicsShapes.step,
                                  pyoscx.DynamicsDimension.time, 1)))

## target action

tar_action = pyoscx.AbsoluteSynchronizeAction(
    egoname, pyoscx.LanePosition(200, 0, -1, 0),
    pyoscx.LanePosition(200, 0, -2, 0), 10)

tar_event = pyoscx.Event('target_event', pyoscx.Priority.overwrite)
tar_event.add_trigger(
    pyoscx.ValueTrigger(
        'ego_start', 0, pyoscx.ConditionEdge.none,
        pyoscx.SimulationTimeCondition(3, pyoscx.Rule.greaterThan)))
tar_event.add_action('tar_action', tar_action)

tar_man = pyoscx.Maneuver('target_man')
tar_man.add_event(tar_event)

tar_man_gr = pyoscx.ManeuverGroup('target_man_gr')
tar_man_gr.add_maneuver(tar_man)
tar_man_gr.add_actor(targetname)
Beispiel #3
0
entities.add_scenario_object(targetname,pyoscx.CatalogReference('VehicleCatalog','car_blue'))

### create init

init = pyoscx.Init()

init.add_init_action(egoname,pyoscx.TeleportAction(pyoscx.LanePosition(50,0,-2,0)))
init.add_init_action(egoname,pyoscx.AbsoluteSpeedAction(10,pyoscx.TransitionDynamics(pyoscx.DynamicsShapes.step,pyoscx.DynamicsDimension.time,1)))

init.add_init_action(targetname,pyoscx.TeleportAction(pyoscx.LanePosition(30,0,-3,0)))
init.add_init_action(targetname,pyoscx.AbsoluteSpeedAction(20,pyoscx.TransitionDynamics(pyoscx.DynamicsShapes.step,pyoscx.DynamicsDimension.time,1)))


## target action

tar_action = pyoscx.AbsoluteSynchronizeAction(egoname,pyoscx.LanePosition(200,0,-1,0),pyoscx.LanePosition(200,0,-2,0),10,target_tolerance_master=1,target_tolerance=1)

tar_event = pyoscx.Event('target_event',pyoscx.Priority.overwrite)
tar_event.add_trigger(pyoscx.ValueTrigger('ego_start',0,pyoscx.ConditionEdge.none,pyoscx.SimulationTimeCondition(3,pyoscx.Rule.greaterThan)))
tar_event.add_action('tar_action',tar_action)

tar_man = pyoscx.Maneuver('target_man')
tar_man.add_event(tar_event)

tar_man_gr = pyoscx.ManeuverGroup('target_man_gr')
tar_man_gr.add_maneuver(tar_man)
tar_man_gr.add_actor(targetname)


## act
act = pyoscx.Act('myact',pyoscx.ValueTrigger('start',0,pyoscx.ConditionEdge.none,pyoscx.SimulationTimeCondition(0,pyoscx.Rule.greaterThan)))