Skip to content

Commit

Permalink
Renew input command option to -i from -r.
Browse files Browse the repository at this point in the history
Fixed mistakes in README.md

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
  • Loading branch information
TaikiYamada4 committed Sep 27, 2024
1 parent b653c84 commit 27b354d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
14 changes: 7 additions & 7 deletions map/autoware_lanelet2_map_validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ requirements:
- The name list of available validators can be obtained from the `--print` option.
- The user can write any other field (like `version`) besides `requirements`.

Then, the `autoware_lanelet2_map_validator` will scan through the input yaml file given by the `--requirements_file, -r` option, and output the validation results to the directory given by the `--output_file_path, -o` option.
Then, the `autoware_lanelet2_map_validator` will scan through the input yaml file given by the `--input_requirements, -i` option, and output the validation results to the directory given by the `--output_directory, -o` option.

```bash
ros2 run autoware_lanelet2_map_validator autoware_lanelet2_map_validator --requirements_file ./requirements_set.yaml --output_file_path ./
ros2 run autoware_lanelet2_map_validator autoware_lanelet2_map_validator --input_requirements autoware_requirements_set.yaml --output_directory ./
```

When the `requirements_file` is thown to `autoware_lanelet2_map_validator`, it will output a `lanelet2_validation_results.yaml` file which looks like the following.
When the `input_requirements` is thown to `autoware_lanelet2_map_validator`, it will output a `lanelet2_validation_results.yaml` file which looks like the following.

Check warning on line 74 in map/autoware_lanelet2_map_validator/README.md

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (thown)

```yaml
requirements:
Expand Down Expand Up @@ -130,9 +130,9 @@ requirements:
passed: true
```

- `lanelet2_validation_results.yaml` inherits the input `requirements_file` and add results to it.
- `lanelet2_validation_results.yaml` inherits the yaml file of `input_requirements` and add results to it.
- `autoware_lanelet2_map_validator` adds a boolean `passed` field to each requirement. If all validators of the requirement have been passed, the `passed` field of the requirement will be `true` (`false` if not).
- The `passed` field is also given to each validator. If the validator found any issues the `passed` field will turn to be `false` (`true` if not), and adds an `issues` field which is a list of issues found. Each issues contains information of `serverity`, `primitive`, `id`, and `message`.
- The `passed` field is also given to each validator. If the validator found any issues the `passed` field will turn to be `false` (`true` if not), and adds an `issues` field which is a list of issues found. Each issues contains information of `severity`, `primitive`, `id`, and `message`.

### Available command options

Expand All @@ -141,8 +141,8 @@ requirements:
| `-h, --help` | Explains about this tool and show a list of options |
| `--print` | Only print all avalible checker, but dont run them |

Check warning on line 142 in map/autoware_lanelet2_map_validator/README.md

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (avalible)

Check warning on line 142 in map/autoware_lanelet2_map_validator/README.md

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (dont)
| `-m, --map_file` | Path to the map to be validated |
| `-r, --requirements_file` | Path to the yaml file where the list of requirements and validations is written |
| `-o, --output_file_path` | Path of the yaml file where the list of validation results will be written |
| `-i, --input_requirements` | Path to the yaml file where the list of requirements and validations is written |
| `-o, --output_directory` | Directory to save the list of validation results in a yaml format |
| `-v, --validator` | Comma separated list of regexes to filter the applicable validators. Will run all validators by default. Example: `routing_graph.*` to run all checks for the routing graph |
| `-p, --projector` | Projector used for loading lanelet map. Available projectors are: mgrs, utm, transverse_mercator. (default: mgrs) |
| `-l, --location` | Location of the map (for instanciating the traffic rules), e.g. de for Germany |

Check warning on line 148 in map/autoware_lanelet2_map_validator/README.md

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (instanciating)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
requirements:
- id: vm-04-01
validators:
- name: mapping.crosswalk.missing_regulatory_elements
- name: mapping.crosswalk.regulatory_element_details
- id: vm-05-01
validators:
- name: mapping.traffic_light.missing_regulatory_elements
- name: mapping.traffic_light.regulatory_element_details
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mapping.crosswalk.regulatory_element_details
This validator checks whether the details in the `crosswalk` subtype regulatory elements are valid.
This validator checks seven types of issues.

All output issues specify the crosswalk "lanelet" as the **primitive**, and the lanelet ID will be specified as the **ID**.
All output issues specify the crosswalk "regulatory element" as the **primitive**, and the lanelet ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mapping.traffic_light.regulatory_element_details
This validator checks whether the details in the `traffic_light` subtype regulatory elements are valid.
This validator checks four types of issues.

All output issues specify the traffic_light "linestring" as the **primitive**, and the linestring ID will be specified as the **ID**.
All output issues specify the traffic_light "regulatory element" as the **primitive**, and the linestring ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
Expand Down
16 changes: 8 additions & 8 deletions map/autoware_lanelet2_map_validator/src/lib/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ MetaConfig parseCommandLine(int argc, const char * argv[])

("map_file,m", po::value<std::string>(), "Path to the map to be validated")

("requirements_file,r", po::value<std::string>(),
"Path to the yaml file where the list of requirements and validations is written")
("input_requirements,i", po::value<std::string>(),
"Path to the yaml file where the list of requirements and validators is written")

("output_file_path,o", po::value<std::string>(),
"Path of the yaml file where the list of validation results will be written")
("output_directory,o", po::value<std::string>(),
"Directory to save the list of validation results in a yaml format")

("validator,v", po::value(&validation_config.checksFilter),
"Comma separated list of regexes to filter the applicable validators. Will run all "
Expand Down Expand Up @@ -83,11 +83,11 @@ MetaConfig parseCommandLine(int argc, const char * argv[])
config.command_line_config.mapFile =
vm["map_file"].as<decltype(config.command_line_config.mapFile)>();
}
if (vm.count("requirements_file") != 0) {
config.requirements_file = vm["requirements_file"].as<std::string>();
if (vm.count("input_requirements") != 0) {
config.requirements_file = vm["input_requirements"].as<std::string>();
}
if (vm.count("output_file_path") != 0) {
config.output_file_path = vm["output_file_path"].as<std::string>();
if (vm.count("output_directory") != 0) {
config.output_file_path = vm["output_directory"].as<std::string>();
}
if (
(vm.count("lat") != 0 && vm.count("lon") != 0) &&
Expand Down
13 changes: 13 additions & 0 deletions map/autoware_lanelet2_map_validator/test/test_requirement_set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 0.0.1
requirements:
- id: test-01
validators:
- name: mapping.crosswalk.missing_regulatory_elements
- name: mapping.crosswalk.regulatory_element_details
- id: test-02
validators:
- name: mapping.traffic_light.missing_regulatory_elements
- name: mapping.traffic_light.regulatory_element_details
- id: test-03
validators:
- name: mapping.stop_line.missing_regulatory_elements

0 comments on commit 27b354d

Please sign in to comment.