Exemple #1
0
def test_offroadcondition():
    cond = OSC.OffroadCondition(20)
    OSC.prettyprint(cond.get_element())
Exemple #2
0
    pyoscx.SimulationTimeCondition(0, pyoscx.Rule.greaterThan))
act = pyoscx.Act('my_act', starttrigger)
act.add_maneuver_group(mangr)

## create the story
storyparam = pyoscx.ParameterDeclarations()
storyparam.add_parameter(
    pyoscx.Parameter('$owner', pyoscx.ParameterType.string, targetname))
story = pyoscx.Story('mystory', storyparam)
story.add_act(act)

## create the storyboard
stoptrigger = pyoscx.EntityTrigger('stop_simulation',
                                   0.5,
                                   pyoscx.ConditionEdge.rising,
                                   pyoscx.OffroadCondition(0.5),
                                   targetname,
                                   triggeringpoint='stop')
sb = pyoscx.StoryBoard(init, stoptrigger)
sb.add_story(story)

## create the scenario
sce = pyoscx.Scenario('adapt_speed_example',
                      'Mandolin',
                      paramdec,
                      entities=entities,
                      storyboard=sb,
                      roadnetwork=road,
                      catalog=catalog)
# display the scenario
pyoscx.prettyprint(sce.get_element())