export driving scenario to asam openscenario file -凯发k8网页登录

main content

export driving scenario to asam openscenario file

asam openscenario® is an open file format that describes the dynamic content of driving scenarios. using the driving scenario designer app, you can export road networks, actors, and trajectories from a driving scenario to an asam openscenario file.

the app supports exporting driving scenarios to asam openscenario file versions 1.0 and 1.1.

to programmatically export a driving scenario to an asam openscenario file, use the object function of the object.

load scenario file

to open the driving scenario designer app, enter this command at the matlab® command prompt:

drivingscenariodesigner

to load an existing scenario file, on the app toolstrip, select open > scenario file. the file you select must be a valid driving scenario session file with the .mat file extension. alternatively, you can create a new scenario by using the driving scenario designer app, and then export that scenario to an asam openscenario file. for information about how to create a scenario, see .

navigate to and open this driving scenario, where matlabroot is your matlab root folder:

matlabroot/toolbox/driving/drivingdata/cutinscenario.mat

the scenario canvas pane displays the scenario, in which an ego vehicle and a target vehicle travel on a straight road with predefined trajectories such that the target vehicle cuts into the ego lane.

example scenario where non-ego vehicle cuts into the ego lane.

this scenario contains these asam openscenario actions:

  • speedaction — the ego vehicle travels with an initial speed of 15 m/s and then stops momentarily when it reaches a specified waypoint. the ego vehicle then travels at a speed of 10 m/s until the end of the scenario.

  • visibilityaction — the target vehicle enters the scenario after 3 seconds.

  • followtrajectoryaction — the vehicles explicitly follow their trajectories, specified using waypoints.

run the scenario and observe the behaviors of the two vehicles.

export to asam openscenario

to export the road network, actors, and trajectories in the scenario to an asam openscenario file, on the app toolstrip, select export > asam openscenario file.

export menu for openscenario in driving scenario designer app

the app opens the asam openscenario export dialog box.

asam openscenario export dialog box

on the openscenario tab, specify these options:

  • file path — specifies a name and location for the output asam openscenario file with either the .xosc or .xml file extension. by default, the app saves the file in the current working directory. to specify a different file location, click browse. if a file with the specified name already exists, the app overwrites the existing file.

  • file version — specifies the asam openscenario version for the output file as version 1.0 or version 1.1.

    default: version 1.0

on the opendrive tab, specify information for the associated asam opendrive® file using these options:

  • file version — specifies the asam opendrive version for the output file as version 1.4, version 1.5, or version 1.6.

    default: version 1.4

  • export actors — select this parameter to export actors to the asam opendrive file.

    default: on

once you have specified the file information, click export. the app creates an asam openscenario file, which describes the dynamic behaviors of actors in the scenario, as well as additional data files. each data file contains information about a specific scenario element, such as a vehicle or pedestrian. the name of each data file has the prefix filename_, where filename is the name specified using the file path option.

data fileelement of scenario
filename_opendrive.xodrroad network and barriers in the scenario
filename_vehiclecatalog.xoscproperties of vehicles
filename_pedestriancatalog.xoscproperties of pedestrians

note

the app exports data files based on the contents of the scenario. for example, if the scenario does not contain any pedestrians, then the data file filename_pedestriancatalog.xosc is not exported.

asam openscenario representations

the exported files contain representations of driving scenario actors and their parameters in the asam openscenario format.

name, class, and actor properties

the app exports the name, class, and actor properties for each actor to a vehicle element within the filename_vehiclecatalog file.


  
    

asam openscenario vehicles include parameters without equivalent actor characteristics. this table shows the default values for those asam openscenario parameters for various types of exported actors.

vehicle parameterdefault value in exported file
cartruckbicycle
maxacceleration5.3645 m/s20.897 m/s20.231 m/s2
maxdeceleration6 m/s20.474 m/s27 m/s2
maxspeed39 m/s30 m/s22 m/s
maxsteering0.5 rad0.5 rad0.61 rad
trackwidthwidth of vehiclewidth of vehicle0
wheeldiameter0.381 m0.5715 m0.571 m

this table describes how each attribute in the exported file maps to the actor properties in the app.

exported attribute in asam openscenarioconversion from actor properties
x-coordinate of center of bounding boxx-coordinate of actor position rearoverhang 0.5 * length
y-coordinate of center of bounding boxy-coordinate of actor position
z-coordinate of center of bounding boxz-coordinate of actor position
positionx of front axlex-coordinate of actor position frontoverhangrearoverhang length
positionz of front axle0.5 * wheeldiameter
positionx of rear axlex-coordinate of actor position
positionz of rear axle0.5 * wheeldiameter

waypoints

the app exports the waypoints of an actor to the trajectory element of the followtrajectoryaction in the init section of the output asam openscenario file. the trajectory element defines the motion of the associated vehicle in the world position format using a polyline. setting trajectoryfollowingmode to position forces the actor to strictly adhere to the specified trajectory. exported trajectories do not include a time dimension.


  
    
       
         
           
             
               
                 
               
             
             
               
                 
               
             
           
         
      
            
      
    
  

note

  • the app interpolates additional waypoints between the ones specified in the driving scenario, to generate smooth trajectories for exported actors in the output asam openscenario file.

  • the app does not support exporting reverse waypoints of actors to an asam openscenario file.

speed

when the speed of a vehicle changes in the scenario, the app exports this information to a speedaction element in the output asam openscenario file. the app exports speed changes as a constant rate of change toward a target speed by setting the dynamicsdimension and dynamicsshape attributes of the speedactiondynamics element to rate and linear, respectively.


  
    
      
      
        
      
    
  

wait time

when an actor in a driving scenario uses the wait (s) parameter, the app exports this information using the delay attribute of the condition element that triggers the event that executes the next speedaction.

in this sample code, the ego vehicle stops at the specified waypoint for 0.5 seconds and then continues traveling forward. the event ds_event_ego4 specifies that the ego vehicle comes to a rest position. the code represents the wait time information using the delay attribute of the ds_cond5 condition, which triggers the event after ds_event_ego4. as a result, the ego vehicle waits for 0.5 seconds after coming to rest before it begins moving again.


  
    
      
        
          
          
            
          
        
      
    
  
  
    
      
        
          
            
          
          
            
              
                
              
            
          
        
      
    
  


  
    
      
        
          
          
            
          
        
      
    
  
  
    
      
        
          
        
      
    
  

actor spawn and despawn

when you enable the actor spawn and despawn parameter, with valid values for the entry time (s) and exit time (s) parameters, the app exports this information using the visibilityaction element.


  

limitations

the driving scenario designer app does not support all components of the asam openscenario specification. this table shows the list of supported elements and attributes.

supported element or attribute
absolutetargetspeed
act
action
actors
axle
axles
boundingbox
byentitycondition
byvaluecondition
catalogreference
center
clothoid
condition
conditiongroup
dimensions
directory
entities
entitycondition
entityobject
entityref
event
file
fileheader
followtrajectoryaction
init
longitudinalaction
maneuver
maneuvergroup
miscobject
openscenario
pedestrian
performance
polyline
position
private
privateaction
reachpositioncondition
roadnetwork
route
routingaction
scenarioobject
shape
simulationtimecondition
speedaction
speedactiontarget
story
storyboard
storyboardelementstatecondition
teleportaction
trajectory
trigger
triggeringentities
vehicle
vehiclecataloglocation
vertex
visibilityaction
waypoint
worldposition

see also

apps

objects

functions

  • |

related topics

external websites

    网站地图