[Prescan] Prescan與Simulink聯合

筆記翻譯自prescan幫助文檔,侵刪

基本結構

在這裏插入圖片描述

Block Description
Self input port & demux Containing data of the object itself
Trajectory blocks Containing all trajectories. If multiple trajectories are coupled to one actor,a switch enables the user to switch between them. If the user has generated a path definition file the object elapsed track velocity can be manipulated. Note: An actor (linked to a trajectory) stops at the end of the trajectory.
Control block Containing control logics. This block is only present in case user specified control is selected in the GUI.
Dynamics block Containing the vehicle dynamics. This block can contain simple dynamics or user specified dynamics. In case no dynamics is selected an empty dynamics block is inserted, in order to enable the user to insert manually dynamics. The empty dynamics block contains a mux block to the state port, in order to help the user supplying the correct signals to the state port.
State output port block Sending the state signals to the state port block at experiment level. Be aware that the state port contains two modes: dynamics & positioning. Always check whether the desired mode is selected.
Game Controller input port & HID Controller demux block Containing signals retrieved from Game Controller (Logitech MOMO, G27,G29 or Custom) control.
Sensors input port & demux block Containing signals retrieved from the sensors.
Visualization Actuator mux &output port blocks Sending data to the visualization port blocks.

Prescan使用非虛擬總線的形式進行與Simulink的數據交互

碰撞檢測選項:

Component 碰撞模型
Vehicles Actual geometry
Buildings Actual geometry
Traffic Signs Actual geometry
Information Boards Only poles
Matrix Sign / Information Plate Actual geometry (Detectability the same as the parent overhang).
Nature Elements Rough shape
Road segments None
Underlays None
User-Defined Models Actual geometry
Generated infrastructure (Guardrail,line placement, etc) No

具體設置見General Settings對話框。
Prescan提供了三種形式的自動化測試方式:

  • Test Automation : 參數直接進行修改,不對GUI做任何修改
  • Test Automation with rebuild:先rebuild試驗,可以結合命令行界面實現。
  • Data Model API :允許用戶使用腳本自行修改。

Test Automation

535未完
數值類這裏不說了,只需要注意角度的單位是deg,下表給出了drift type、noise type、detection type三種功能對應的參數變化表格:

Sensor Variable Conversion
TIS Drift Type 0: None 1: Gaussian 2: Unidirectional
TIS Noise Type 0: Additive 1: Multiplicative
AIR Detection Type 0: BoundingBox 1: Bounding Box Center 2: CenterOfGravity

Model Data API

worldmodel存儲了試驗中的大部分信息,包括對objects、objects之間的關係、照明信息、天氣參數等。
大部分worldmodel參數都可以讀取、修改。

Filed name Short description
experimentName [readonly] The name of the experiment. Must not be modified.
experimentDescription The description of the experiment. This field might be omitted in the worldmodel if no description was added during experiment creation
sensorRandomSeed The random seed value which is used to initialize random generator of the experiment. Using the same random seed guarantees repeatability of the experiment.
experimentOrigin The origin of the experiment specified as a longitude, latitude and altitude.
simulationConfiguration [read-only] Specifies the frequency the simulation is running.
object An array with all configurable objects in the experiment
material An array of materials available in the experiment. Some objects refer to one of the materials defined in this array.
connectionTable Specifies the connection between road lane segments
userObjectType An array with objects grouped by their type. The information from this array is used by certain sensors, e.g. Image Segmentation Sensor
articulatedActor An array with relationships (e.g. tuck/trailer) between objects in the experiment.
sun Configuration of the sun
sky Configuration of the sky
terrain Configuration of the terrain. Few types of terrain can be used, e.g. grass, desert,etc.
weather Configuration of the weather, e.g. fog and precipitation. This field might be empty if no weather was specified in the PreScan GUI
physicsEnvironment Settings of the physics environment. One can change the air density, gravitation,air temperature, etc.

Objects

每個目標的ID都是確定且唯一的。使用Model Data API之前需要確認目標是存在的。(Matlab isfield命令)

field name description
ID unique identification number of the object
name Unique name for general purposes, e.g. “StraightRoad_1”.
objectTypeName The object type, e.g. “StraightRoad”, the object is a straight road.
modelFile The model filename (e.g. car.osg) or the node name within the parent model, e.g. “BrakeLightR”
modelLocation An object may have a 3D Model associated with it.The location of the file is determined by an enumeration value: 1. mlUnknown: Nothing is known about existence or location 2.mlNone: There is no model 3.mlContainer: There is no model but there may be children 4. mlModelDepo: The model is located in the modeldepo 5. mlExperimentDir: The model is located in the experiment folder (Models subfolder) 6.mlParentModel: The model is embedded in the parent’s model
objectTypeID Object type. Consult the prescan.types.ObjectTypeID enumeration for available values
numericalID Unique identification number on the compilation sheet in Matlab/Simulink.
description A description of the object sensorDetectable Specifies if the object is detectable by any sensor sensorDetectionColor Some sensors use the color to uniquely identify the object. If the field doesn’t exists for a given object a default color of the object type will be used
collisionDetectable Specifies if the object participates in collision detection
pose Contains the position and orientation of the object
subType Possible subtypes are: 1. typeBasic: No extra data 2.typeUnderlay 3.typeVehicle 4.typeRoad 5.typeDirtSpot 6.typeAbstractObject 7.typeTrafficSignPole 8.typeTrafficSignPlate 9.typeTrailer 10.typeHuman 11.typeTrafficSignElement 12.typeInformationBoard 13.typeRoadMarkin If an object has no further information it is of typeBasic. Examples of typeBasic objects are: Non-car vehicles (and their children), Buildings, Nature elements, Highway overhang children, Light element pivots and Sensor holders.
child An array of children objects. An object can have multiple children, e.g. a car can have multiple wheels.
light List of light sources. Light sources are treated separately. A single object can have multiple light sources, e.g. a car can have multiple lights.
staticModel When a scene contains many objects of the same type, that are never changed individually (e.g. trees), a graphics system can optimize memory. The following flag specifies if an object is static: 1: This object’s 3D model is equal to all other models of this type 0: This object’s 3D model may differ from other models of this type.
materialID A unique identification number of the material of this object. A list of materials can be found in the worldmodel.material array recolorMap The filename of a recolor map, a texture that specifies (in its alpha component) which parts of a 3D Model are recolored. The filename is searched for in the /ModelDepo/Visual folder
animation Some actors can be animated. The animation index and update time are passed through.

Sun

field name description
powerRatio Unitless quotient of set power and the power of a default sun (in case of explicit definition: 688 W/m2).

Weather

weather包括了兩個部分:Fog和Precipitation

Fog

field name description
Field name Description
enabled Specifies if the fog calculation is enabled
name The name of the selected fog configuration
color The color of the fog
start The fog starts at this distance from the observer [m]
visibility The fog ends at this distance from the observer [m]
mode Can be “exp”, “exp2” or “linear”
density The density of the fog is calculated from the visibility: density = –ln(0.005)/(1.6*visibility).

Precipitation

這裏的降水錶示的是降雨或降雪

field name description
subType typeNone 1. typeRain Rain 2. typeSnow Snow
name The name of the favorite, if selected in the editor, for example “Default Moderate_Rain”
animation Specifies if the particles should be animated or not
color The color of the precipitation particles
density Number of particles per 1000 m3
direction The movement direction of the particles
hardness A measure for the opacity of the particles [0-1], where 0 means fully transparent and 1 means fully opaque
particleSize The size of the particles [m]
shape The filename of the image file used for the particle, for example “Snow.tga”
shutterTime The shuttertime influences the length of the rain streaks [s]
oscillationAmplitude The amplitude of the snowflake dynamics, default 0.06 [m]
oscillationPeriod The period of the snowflake dynamics, default 1.5

Sensor Models

field name description
cammodel [deprecated] Used for the RemoteViewerFederate and VisViewer
viewerproxymodel Used by the VisViewer
airsensormodel Used by the AIR sensor
almsmodel Used by the Analytical Lane Marker sensor
brsmodel Used by the Bound Rectangle sensor
cameramodel Used by the Camera, Fisheye, Depth and Image Segmentation sensors
collisiondetectionmodel Used by the Collision detection sensor
communicationmodel Used by the IR Beacon, IR OBU, RF Beacon, RF OBU
dynamicsmodel Used for the vehicle dynamics generation
lanemarkermodel Used by the Lane Marker sensor
lidarmodel Used by the Lidar sensor
ocsmodel Used by the Object Camera sensor
radarmodel Used by the Radar sensor
tismodel Used by the Technology Independent sensor
radarmodel Used by the Radar sensor
tismodel Used by the Technology Independent sensor
ultrasonicmodel Used by the Ultrasonic sensor

Utility functions

prescan.experiment

filename = prescan.experiment.getDefaultFilename()
[value, result] = prescan.experiment.getFieldValue(inStruct, name)
simOut = prescan.experiment.runWithDataModels(models, varargin)
[inStruct, result] = prescan.experiment.setFieldValue(inStruct, name, value)
[isValid, resultMsg] = prescan.experiment.validate(models, path)

  • prescan.worldmodel
  • prescan.sensors
    《太多了,看官方文檔吧》
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章