인턴하면서 새로 다루게 된 OpenSCENARIO에 대해 정리해보겠습니다!
해당 튜토리얼 참고하여 작성했습니다.
https://www.asam.net/index.php?eID=dumpFile&t=f&f=4092&token=d3b6a55e911b22179e3c0895fe2caae8f5492467
6. Reuse mechanisms
6.1 Parameters
6.2 Expressions → ${Expr}
Arithmetic operators
- Operators with highest precedence
- Unary Minus (-): numeric → numeric
- Round(반올림) operator (round): double → int
- Floor(내림) operator (floor): double → int
- Ceil(올림) operator (ceil): double → int
- Square root operator (sqrt): double → double
- Operators with middle precedence
- Power operator (pow): double, double → double
- Multiply operator (*): numeric, numeric → numeric
- Division operator (/): double, double → double
- Remainder operator(%): numeric, numeric → numeric
- Operators with lowest precedence
- Plus operator (+): numeric, numeric → numeric
- Minus operator (-): numeric, numeric → numeric
Boolean operators
- Negation operator (not)
- Conjunction operator (and)
- Disjunction operator (or)
# Example
## Arithmetic expressions
${pow(2, 8) - 1}
${-round(2.6)}
${1 + sqrt(9) * 2.2}
${1 + (sqrt(9) * 2.2)}
## Boolean expressions
${not $A and $B}
${(not $A) and $B}
${$A or $B and not $C}
${$A or ($B and (not $C))}
// 예시
<Dimensions width="${$defaultWidth + 12.3}" length="4.2" height="1.6"/>
NaN, infinity가 없으므로, 아래 사항들에 대해서 적절하게 예외처리를 해주어야 한다.
- The application detects arithmetic errors (division by zero, sqrt of a negative value, …).
- An unresolvable type mismatch occurs.
- An arithmetic overflow or underflow occurs.
6.3 Parameter value distribution file
6.4 Catalogs
: Multiple Scenario에서 재사용할 수 있도록 OpenScenario내의 요소들을 모아서 정의.
- 시나리오의 특정 요소에 대한 설명을 별도의 파일로 아웃소싱하여 시나리오에서 참조할 수 있도록 함
- 요소의 재사용성 & 가독성을 높임
- Vehicle, Pedestrian, MiscObject, Controller, Trajectory ,Route ,Environment , Maneuver
6.5 Parameters in catalogs
Catalog 파일은 재사용을 위해 설계되었습니다. Catalog 내에서 사용되는 모든 매개변수는 각 매개변수의 기본값을 설정하는 해당 ParameterDeclaration내에서 선언되어야 합니다. Catalog가 참조되면 해당 ParameterAssignment요소를 CatalogReference사용하여 이러한 기본값을 재정의할 수 있습니다.
예를 들어, catalog 정의에는 다음 ParameterDeclaration이 포함될 수 있습니다.
<ParameterDeclarations>
<ParameterDeclaration name = "x" value = "5"/>
<ParameterDeclaration name = "y" value = "7"/>
</ParameterDeclarations>
기본 시나리오에서 참조할 때 x 값은 다음 CatalogReference내에서 ParameterAssignment를 사용하여 재정의됩니다. 즉, catalog를 사용하려면 "$x"에 대한 모든 참조를 "0"으로 바꿔야 하고 "$y"에 대한 모든 참조를 기본값인 "7"로 바꿔야 합니다. catalog 내에서는 다른 매개변수를 참조할 수 없습니다.
<CatalogReference catalogName = "eg_catalog" entryName = "eg_entry">
<ParameterAssignments>
<ParameterAssignment parameterRef = "x" value = "0"/>
</ParameterAssignments>
</CatalogReference>
6.6 Resolving catalog references
카탈로그 참조는 이름으로 카탈로그를 찾고 해당 항목 이름( CatalogReference의 catalogName및 entryName)으로 이 카탈로그 내의 항목을 찾아서 확인됩니다. 이 특정 참조에 대한 매개변수를 확인하기 위해 ParameterAssignment을(를) 전달할 수 있습니다.
Catalog는 카탈로그 파일(예: "VehicleCatalog.xosc")에 정의됩니다. Catalog의 인스턴스는 해당 name속성으로 식별됩니다.
'임베디드 > Intern' 카테고리의 다른 글
ASAM OpenSCENARIO: User Guide | 8. Examples (0) | 2024.03.11 |
---|---|
ASAM OpenSCENARIO: User Guide | 7. Tutorial: How to create a scenario (0) | 2024.03.11 |
ASAM OpenSCENARIO: User Guide | 5. Scenario at runtime (1) | 2024.03.08 |
ASAM OpenSCENARIO: User Guide | 4. Components of a scenario (0) | 2024.03.08 |
ASAM OpenSCENARIO: User Guide | 3. General Concepts (6) | 2024.03.08 |