Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_lanelet2_map_validator): introduce autoware_lanelet2_map_validator #118

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1d9f97e
introduce autoware_lanelet2_map_validator to autoware_tools
TaikiYamada4 Sep 13, 2024
43d2441
wrote description a little to README.md
TaikiYamada4 Sep 13, 2024
0419b74
style(pre-commit): autofix
pre-commit-ci[bot] Sep 13, 2024
37daad6
Restore commented out parts.
TaikiYamada4 Sep 13, 2024
b6d8b36
style(pre-commit): autofix
pre-commit-ci[bot] Sep 13, 2024
77416f2
Separate validation rules to samller pieces.
TaikiYamada4 Sep 17, 2024
ebefd7c
Split the validation code into smaller pieces.
TaikiYamada4 Sep 19, 2024
ea38dd1
Fixed test codes to use the separated codes
TaikiYamada4 Sep 19, 2024
e091ff6
Removed unused code which are already divided to smaller codes.
TaikiYamada4 Sep 19, 2024
359f359
Rename new_main.cpp to main.cpp
TaikiYamada4 Sep 19, 2024
e622c91
style(pre-commit): autofix
pre-commit-ci[bot] Sep 20, 2024
37489ec
Wrote detailed README.md
TaikiYamada4 Sep 27, 2024
b653c84
Fixed commit mistake
TaikiYamada4 Sep 27, 2024
27b354d
Renew input command option to `-i` from `-r`.
TaikiYamada4 Sep 27, 2024
9014a3c
style(pre-commit): autofix
pre-commit-ci[bot] Sep 27, 2024
fcbc7d8
Fixed long to uint64_t
TaikiYamada4 Sep 30, 2024
1685e7e
Fixed spelling
TaikiYamada4 Sep 30, 2024
077e7e6
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
18524be
Fixed typo
TaikiYamada4 Sep 30, 2024
dfdb4f0
Split long lines in the code
TaikiYamada4 Sep 30, 2024
ef09205
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
4e42996
Changed the entire structure.
TaikiYamada4 Sep 30, 2024
f9a16da
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
147ba6a
Fixed pre-commit.ci related stuff
TaikiYamada4 Sep 30, 2024
c14477e
Write more details about the relationship to lanelet2_validation.
TaikiYamada4 Oct 1, 2024
315dbf0
Added figure of the architecture
TaikiYamada4 Oct 3, 2024
2f7d839
Change the input/output to JSON
TaikiYamada4 Oct 3, 2024
f5ec766
Revised architecture image of autoware_lanelet2_map_validator
TaikiYamada4 Oct 10, 2024
8a2a8c2
fixed typo
TaikiYamada4 Oct 10, 2024
8f15908
Renew year numbers
TaikiYamada4 Oct 15, 2024
ef2f5ad
Fixed dependency
TaikiYamada4 Oct 15, 2024
b72177d
Fixed pointed out issues
TaikiYamada4 Oct 25, 2024
d16b54b
Improve error handling
TaikiYamada4 Oct 25, 2024
8b93027
Avoid clang format
TaikiYamada4 Oct 25, 2024
c2a437c
Removed redundant process.
TaikiYamada4 Oct 28, 2024
6f47702
Added approaches to the documents
TaikiYamada4 Oct 28, 2024
c114991
Fixed typo
TaikiYamada4 Oct 28, 2024
fe9d19a
Removed catch and improve io error handling
TaikiYamada4 Oct 28, 2024
98b4ee6
Fixed grammatical error.
TaikiYamada4 Oct 28, 2024
b405d14
Added stop_line validator to the table in the main README.md
TaikiYamada4 Oct 28, 2024
4570bbf
Renamed lib to common.
TaikiYamada4 Oct 28, 2024
118596e
Removed redundant under score
TaikiYamada4 Oct 28, 2024
d1e0a26
Removed redundant underscore again
TaikiYamada4 Oct 28, 2024
074c4f2
Changed years.
TaikiYamada4 Oct 29, 2024
2c9dca1
Removed underscore from test_regulatory_element_details.cpp
TaikiYamada4 Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style(pre-commit): autofix
  • Loading branch information
pre-commit-ci[bot] committed Sep 20, 2024
commit e622c910ee7ef0664777b8c2ba8ca89f1743902e
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_
#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_

#include <lanelet2_validation/Validation.h>
#include <lanelet2_validation/ValidatorFactory.h>
Expand All @@ -25,17 +25,15 @@ namespace validation
class MissingRegulatoryElementsForCrosswalksValidator : public lanelet::validation::MapValidator
{
public:

constexpr static const char * name() { return "mapping.crosswalk.missing_regulatory_elements"; }

lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override;

private:
lanelet::validation::Issues checkMissingRegulatoryElementsForCrosswalks(
const lanelet::LaneletMap & map);

};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__MISSING_REGULATORY_ELEMENTS_FOR_CROSSWALKS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALK_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALK_HPP_
#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALKS_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALKS_HPP_

#include <lanelet2_validation/Validation.h>
#include <lanelet2_validation/ValidatorFactory.h>
Expand All @@ -33,7 +33,7 @@ class RegulatoryElementsDetailsForCrosswalksValidator : public lanelet::validati
private:
lanelet::validation::Issues checkRegulatoryElementOfCrosswalks(const lanelet::LaneletMap & map);
};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALK_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__CROSSWALK__REGULATORY_ELEMENT_DETAILS_FOR_CROSSWALKS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace validation
class MissingRegulatoryElementsForStopLinesValidator : public lanelet::validation::MapValidator
{
public:

constexpr static const char * name() { return "mapping.stop_line.missing_regulatory_elements"; }

lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override;
Expand All @@ -34,7 +33,7 @@ class MissingRegulatoryElementsForStopLinesValidator : public lanelet::validatio
lanelet::validation::Issues checkMissingRegulatoryElementsForStopLines(
const lanelet::LaneletMap & map);
};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__STOP_LINE__MISSING_REGULATORY_ELEMENTS_FOR_STOP_LINES_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__STOP_LINE__MISSING_REGULATORY_ELEMENTS_FOR_STOP_LINES_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ namespace validation
class MissingRegulatoryElementsForTrafficLightsValidator : public lanelet::validation::MapValidator
{
public:

constexpr static const char * name() { return "mapping.traffic_light.missing_regulatory_elements"; }
constexpr static const char * name()
{
return "mapping.traffic_light.missing_regulatory_elements";
}

lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override;

private:
lanelet::validation::Issues checkMissingRegulatoryElementsForTrafficLights(
const lanelet::LaneletMap & map);
};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHT__MISSING_REGULATORY_ELEMENTS_FOR_TRAFFIC_LIGHTS_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHT__MISSING_REGULATORY_ELEMENTS_FOR_TRAFFIC_LIGHTS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHTS__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHTS__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_
#ifndef AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHT__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_
#define AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHT__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_

#include <lanelet2_validation/Validation.h>
#include <lanelet2_validation/ValidatorFactory.h>
Expand All @@ -28,15 +28,19 @@ class RegulatoryElementsDetailsForTrafficLightsValidator : public lanelet::valid
{
public:
// Write the validator's name here
constexpr static const char * name() { return "mapping.traffic_light.regulatory_element_details"; }
constexpr static const char * name()
{
return "mapping.traffic_light.regulatory_element_details";
}

lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override;

private:
bool isPedestrianTrafficLight(const std::vector<lanelet::ConstLineString3d> & traffic_lights);
lanelet::validation::Issues checkRegulatoryElementOfTrafficLights(const lanelet::LaneletMap & map);
lanelet::validation::Issues checkRegulatoryElementOfTrafficLights(
const lanelet::LaneletMap & map);
};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHTS__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__TRAFFIC_LIGHT__REGULATORY_ELEMENT_DETAILS_FOR_TRAFFIC_LIGHTS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ValidatorTemplate : public lanelet::validation::MapValidator

private:
};
} // namespace validation
} // namespace lanelet
} // namespace validation
} // namespace lanelet

#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__VALIDATOR_TEMPLATE_HPP_
#endif // AUTOWARE_LANELET2_MAP_VALIDATOR__VALIDATORS__VALIDATOR_TEMPLATE_HPP_
4 changes: 2 additions & 2 deletions map/autoware_lanelet2_map_validator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>yaml-cpp</depend>

<depend>autoware_lanelet2_extension</depend>
<depend>lanelet2_core</depend>
<depend>lanelet2_io</depend>
Expand All @@ -20,6 +18,8 @@
<depend>lanelet2_routing</depend>
<depend>lanelet2_traffic_rules</depend>
<depend>lanelet2_validation</depend>
<depend>yaml-cpp</depend>


<test_depend>ament_cmake_ros</test_depend>

Expand Down
58 changes: 30 additions & 28 deletions map/autoware_lanelet2_map_validator/src/lib/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,44 @@ 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")
("requirements_file,r", po::value<std::string>(),
"Path to the yaml file where the list of requirements and validations 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_file_path,o", po::value<std::string>(),
"Path of the yaml file where the list of validation results will be written")

("validator,v", po::value(&validation_config.checksFilter),
"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")
("validator,v", po::value(&validation_config.checksFilter),
"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")

("projector,p", po::value(&config.projector_type)->composing(),
"Projector used for loading lanelet map. Available projectors are: mgrs, utm, "
"transverse_mercator. (default: mgrs)")
("projector,p", po::value(&config.projector_type)->composing(),
"Projector used for loading lanelet map. Available projectors are: mgrs, utm, "
"transverse_mercator. (default: mgrs)")

("location,l",
po::value(&validation_config.location)->default_value(validation_config.location),
"Location of the map (for instanciating the traffic rules), e.g. de for Germany")
("location,l",
po::value(&validation_config.location)->default_value(validation_config.location),
"Location of the map (for instanciating the traffic rules), e.g. de for Germany")

("participants", po::value(&validation_config.participants)->composing(),
"Participants for which the routing graph will be instanciated (default: vehicle)")
("participants", po::value(&validation_config.participants)->composing(),
"Participants for which the routing graph will be instanciated (default: vehicle)")

("lat",
po::value(&validation_config.origin.lat)
->default_value(validation_config.origin.lat),
"latitude coordinate of map origin. This is reguired for the transverse mercator "
"and utm projector.")
("lat",
po::value(&validation_config.origin.lat)
->default_value(validation_config.origin.lat),
"latitude coordinate of map origin. This is reguired for the transverse "
"mercator "
"and utm projector.")

("lon",
po::value(&validation_config.origin.lon)
->default_value(validation_config.origin.lon),
"longitude coofdinate of map origin. This is reguired for the transverse mercator "
"and utm projector.")
("lon",
po::value(&validation_config.origin.lon)
->default_value(validation_config.origin.lon),
"longitude coofdinate of map origin. This is reguired for the transverse "
"mercator "
"and utm projector.")

("print", "Only print all avalible checker, but dont run them");
("print", "Only print all avalible checker, but dont run them");
po::variables_map vm;
po::positional_options_description pos;
pos.add("map_file", 1);
Expand Down
2 changes: 1 addition & 1 deletion map/autoware_lanelet2_map_validator/src/lib/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ std::unique_ptr<lanelet::Projector> getProjector(const MetaConfig & config)
} else if (config.projector_type == projector_names::utm) {
return std::make_unique<lanelet::projection::UtmProjector>(lanelet::Origin{val_config.origin});
} else {
//std::cerr << "Set to default projector: MGRS projector" << std::endl;
// std::cerr << "Set to default projector: MGRS projector" << std::endl;
return std::make_unique<lanelet::projection::MGRSProjector>();
}
}
Expand Down
Loading
Loading