[Prescan] Prescan与Simulink联合

笔记翻译自prescan帮助文档,侵删

基本结构

在这里插入图片描述

BlockDescription
Self input port & demuxContaining data of the object itself
Trajectory blocksContaining 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 blockContaining control logics. This block is only present in case user specified control is selected in the GUI.
Dynamics blockContaining 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 blockSending 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 blockContaining signals retrieved from Game Controller (Logitech MOMO, G27,G29 or Custom) control.
Sensors input port & demux blockContaining signals retrieved from the sensors.
Visualization Actuator mux &output port blocksSending data to the visualization port blocks.

Prescan使用非虚拟总线的形式进行与Simulink的数据交互

碰撞检测选项:

Component碰撞模型
VehiclesActual geometry
BuildingsActual geometry
Traffic SignsActual geometry
Information BoardsOnly poles
Matrix Sign / Information PlateActual geometry (Detectability the same as the parent overhang).
Nature ElementsRough shape
Road segmentsNone
UnderlaysNone
User-Defined ModelsActual 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三种功能对应的参数变化表格:

SensorVariableConversion
TISDrift Type0: None 1: Gaussian 2: Unidirectional
TISNoise Type0: Additive 1: Multiplicative
AIRDetection Type0: BoundingBox 1: Bounding Box Center 2: CenterOfGravity

Model Data API

worldmodel存储了试验中的大部分信息,包括对objects、objects之间的关系、照明信息、天气参数等。
大部分worldmodel参数都可以读取、修改。

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

Objects

每个目标的ID都是确定且唯一的。使用Model Data API之前需要确认目标是存在的。(Matlab isfield命令)

field namedescription
IDunique identification number of the object
nameUnique name for general purposes, e.g. “StraightRoad_1”.
objectTypeNameThe object type, e.g. “StraightRoad”, the object is a straight road.
modelFileThe model filename (e.g. car.osg) or the node name within the parent model, e.g. “BrakeLightR”
modelLocationAn 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
objectTypeIDObject type. Consult the prescan.types.ObjectTypeID enumeration for available values
numericalIDUnique identification number on the compilation sheet in Matlab/Simulink.
descriptionA 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
collisionDetectableSpecifies if the object participates in collision detection
poseContains the position and orientation of the object
subTypePossible 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.
childAn array of children objects. An object can have multiple children, e.g. a car can have multiple wheels.
lightList of light sources. Light sources are treated separately. A single object can have multiple light sources, e.g. a car can have multiple lights.
staticModelWhen 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.
materialIDA 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
animationSome actors can be animated. The animation index and update time are passed through.

Sun

field namedescription
powerRatioUnitless 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 namedescription
Field nameDescription
enabledSpecifies if the fog calculation is enabled
nameThe name of the selected fog configuration
colorThe color of the fog
startThe fog starts at this distance from the observer [m]
visibilityThe fog ends at this distance from the observer [m]
modeCan be “exp”, “exp2” or “linear”
densityThe density of the fog is calculated from the visibility: density = –ln(0.005)/(1.6*visibility).

Precipitation

这里的降水表示的是降雨或降雪

field namedescription
subTypetypeNone 1. typeRain Rain 2. typeSnow Snow
nameThe name of the favorite, if selected in the editor, for example “Default Moderate_Rain”
animationSpecifies if the particles should be animated or not
colorThe color of the precipitation particles
densityNumber of particles per 1000 m3
directionThe movement direction of the particles
hardnessA measure for the opacity of the particles [0-1], where 0 means fully transparent and 1 means fully opaque
particleSizeThe size of the particles [m]
shapeThe filename of the image file used for the particle, for example “Snow.tga”
shutterTimeThe shuttertime influences the length of the rain streaks [s]
oscillationAmplitudeThe amplitude of the snowflake dynamics, default 0.06 [m]
oscillationPeriodThe period of the snowflake dynamics, default 1.5

Sensor Models

field namedescription
cammodel [deprecated]Used for the RemoteViewerFederate and VisViewer
viewerproxymodelUsed by the VisViewer
airsensormodelUsed by the AIR sensor
almsmodelUsed by the Analytical Lane Marker sensor
brsmodelUsed by the Bound Rectangle sensor
cameramodelUsed by the Camera, Fisheye, Depth and Image Segmentation sensors
collisiondetectionmodelUsed by the Collision detection sensor
communicationmodelUsed by the IR Beacon, IR OBU, RF Beacon, RF OBU
dynamicsmodelUsed for the vehicle dynamics generation
lanemarkermodelUsed by the Lane Marker sensor
lidarmodelUsed by the Lidar sensor
ocsmodelUsed by the Object Camera sensor
radarmodelUsed by the Radar sensor
tismodelUsed by the Technology Independent sensor
radarmodelUsed by the Radar sensor
tismodelUsed by the Technology Independent sensor
ultrasonicmodelUsed 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
    《太多了,看官方文档吧》
  • 3
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值