Skip to content

Commit

Permalink
Refactor to use one checker per rule (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Sep 12, 2024
1 parent 1e48d73 commit ef5474d
Show file tree
Hide file tree
Showing 56 changed files with 1,748 additions and 931 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,27 @@ An example configuration file for using this Checker Bundle within the ASAM Qual
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>

<Param name="InputFile" value="template.xosc" />
<Param name="InputFile" value="my_openscenarioxml_file.xosc" />

<CheckerBundle application="xoscBundle">
<Param name="resultFile" value="xosc_bundle_report.xqar" />
<Checker checkerId="basic_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="schema_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="data_type_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="parameters_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="reference_xosc" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_xml_valid_xml_document" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_xml_root_tag_is_openscenario" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_xml_fileheader_is_present" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_xml_version_is_defined" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_xml_valid_schema" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_uniquely_resolvable_entity_references" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_resolvable_signal_id_in_traffic_signal_state_action" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_resolvable_traffic_signal_controller_by_traffic_signal_controller_ref" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_valid_actor_reference_in_private_actions" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_resolvable_entity_references" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_resolvable_variable_reference" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_resolvable_storyboard_element_reference" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_reference_control_unique_element_names_on_same_level" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_parameters_valid_parameter_declaration_in_catalogs" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_data_type_allowed_operators" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_data_type_non_negative_transition_time_in_light_state_action" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xosc_positive_duration_in_phase" maxLevel="1" minLevel="3" />
</CheckerBundle>

<ReportModule application="TextReport">
Expand Down
87 changes: 75 additions & 12 deletions checker_bundle_doc.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,112 @@
# Checker bundle: xoscBundle

* Build version: 0.1.0
* Description: ASAM OpenScenario XML checker bundle
* Description: OpenScenario checker bundle

## Parameters

* InputFile: The path of the input file.
* InputFile

## Checkers

### basic_xosc
### check_asam_xosc_xml_valid_xml_document

* Description: Check if basic properties of input file are properly set
* Description: The given file to check must be a valid XML document.
* Addressed rules:
* asam.net:xosc:1.0.0:xml.valid_xml_document

### schema_xosc
### check_asam_xosc_xml_root_tag_is_openscenario

* Description: Check if xml properties of input file are properly set
* Description: The root element of a valid XML document must be OpenSCENARIO.
* Addressed rules:
* asam.net:xosc:1.0.0:xml.root_tag_is_openscenario

### check_asam_xosc_xml_fileheader_is_present

* Description: Below the root element a tag with FileHeader must be defined.
* Addressed rules:
* asam.net:xosc:1.0.0:xml.fileheader_is_present

### check_asam_xosc_xml_version_is_defined

* Description: The FileHeader tag must have the attributes revMajor and revMinor and of type unsignedShort.
* Addressed rules:
* asam.net:xosc:1.0.0:xml.version_is_defined

### check_asam_xosc_xml_valid_schema

* Description: Input xml file must be valid according to the schema.
* Addressed rules:
* asam.net:xosc:1.0.0:xml.valid_schema

### reference_xosc
### check_asam_xosc_reference_control_uniquely_resolvable_entity_references

* Description: Check if xml properties of input file are properly set
* Description: Input xml file must be valid according to the schema.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.uniquely_resolvable_entity_references

### check_asam_xosc_reference_control_resolvable_signal_id_in_traffic_signal_state_action

* Description: TrafficSignalStateAction:name -> Signal ID must exist within the given road network.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.resolvable_signal_id_in_traffic_signal_state_action

### check_asam_xosc_reference_control_resolvable_traffic_signal_controller_by_traffic_signal_controller_ref

* Description: The trafficSignalController according to the trafficSignalControllerRef property must exist within the scenarios RoadNetwork definition.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.resolvable_traffic_signal_controller_by_traffic_signal_controller_ref

### check_asam_xosc_reference_control_valid_actor_reference_in_private_actions

* Description: In a ManeuverGroup, if the defined action is a private action an actor must be defined.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.valid_actor_reference_in_private_actions

### check_asam_xosc_reference_control_resolvable_entity_references

* Description: A named reference in the EntityRef must be resolvable.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.resolvable_entity_references

### check_asam_xosc_reference_control_resolvable_variable_reference

* Description: The VariableDeclaration according to the variableRef property must exist within the ScenarioDefinition.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.resolvable_variable_reference

### check_asam_xosc_reference_control_resolvable_storyboard_element_reference

* Description: The attribute storyboardElementRef shall point to an existing element of the corresponding type and shall be uniquely resolvable.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.resolvable_storyboard_element_reference

### check_asam_xosc_reference_control_unique_element_names_on_same_level

* Description: Element names at each level shall be unique at that level.
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.unique_element_names_on_same_level

### parameters_xosc
### check_asam_xosc_parameters_valid_parameter_declaration_in_catalogs

* Description: Check if parameters properties of input file are properly set
* Description: All parameters used within a catalog shall be declared within their ParameterDeclaration in the same catalog, which sets a default value for each parameter.
* Addressed rules:
* asam.net:xosc:1.2.0:parameters.valid_parameter_declaration_in_catalogs

### data_type_xosc
### check_asam_xosc_data_type_allowed_operators

* Description: Check if data_type properties of input file are properly set
* Description: Expressions in OpenSCENARIO must only use the allowed operands.
* Addressed rules:
* asam.net:xosc:1.2.0:data_type.allowed_operators

### check_asam_xosc_data_type_non_negative_transition_time_in_light_state_action

* Description: Expressions in OpenSCENARIO must only use the allowed operands.
* Addressed rules:
* asam.net:xosc:1.2.0:data_type.non_negative_transition_time_in_light_state_action

### check_asam_xosc_positive_duration_in_phase

* Description: Expressions in OpenSCENARIO must only use the allowed operands.
* Addressed rules:
* asam.net:xosc:1.2.0:data_type.positive_duration_in_phase
Loading

0 comments on commit ef5474d

Please sign in to comment.