Skip to content
Snippets Groups Projects
Commit 310a9e6a authored by Ziqi Zhou's avatar Ziqi Zhou
Browse files

feat: poc integrate qc chcker

parent 13e1c596
No related branches found
No related tags found
No related merge requests found
Showing
with 740 additions and 2385 deletions
......@@ -11,6 +11,22 @@ bazel_dep(name = "eigen", version = "3.4.0.bcr.2")
# rules_cc cannot be a dev_dependency yet: https://github.com/bazelbuild/rules_proto/issues/203
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_python", version = "1.4.1")
# bazel_dep(name = "pybind11_bazel", version = "2.13.6")
# Configure Python toolchain
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.12",
)
use_repo(python, "python_3_12")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "qc_checker_deps",
python_version = "3.12",
requirements_lock = ":requirements.txt",
)
use_repo(pip, "qc_checker_deps")
# Non-module dependencies
non_module_dependencies = use_extension("@road_logic_suite//ThirdParty:dependencies.bzl", "non_module_dependencies")
......@@ -19,10 +35,13 @@ use_repo(non_module_dependencies, "mantle_api")
use_repo(non_module_dependencies, "map_sdk")
use_repo(non_module_dependencies, "rtree")
use_repo(non_module_dependencies, "units_nhh")
use_repo(non_module_dependencies, "qc_checker")
use_repo(non_module_dependencies, "qc_baselib")
# use_repo(non_module_dependencies, "pybind11")
# Development dependencies
# potential issue with googletest as dev_dependency, see: https://github.com/bazelbuild/bazel/issues/22187
bazel_dep(name = "googletest", version = "1.16.0", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.16.0", dev_dependency = True)
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True)
......
This diff is collapsed.
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<CheckerResults version="v1.0.0-rc.1">
<CheckerBundle build_date="2025-06-05" description="OpenDrive checker bundle" name="xodrBundle" version="v1.0.0-rc.1" summary="23 checker(s) are executed. 5 checker(s) are completed. 18 checker(s) are skipped. 0 checker(s) have internal error and 0 checker(s) do not contain status.">
<Param name="InputFile" value="/home/zzq/projects/openpass/road-logic-suite/RoadLogicSuite/Tests/Data/Maps/road_with_traffic_signs.xodr"/>
<Param name="resultFile" value="/home/zzq/projects/openpass/road-logic-suite/Result.xqar"/>
<Checker status="completed" checkerId="check_asam_xodr_xml_valid_xml_document" description="The input file must be a valid XML document." summary="0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.0.0:xml.valid_xml_document"/>
</Checker>
<Checker status="completed" checkerId="check_asam_xodr_xml_root_tag_is_opendrive" description="The root element of a valid XML document must be OpenSCENARIO." summary="0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.0.0:xml.root_tag_is_opendrive"/>
</Checker>
<Checker status="completed" checkerId="check_asam_xodr_xml_fileheader_is_present" description="Below the root element a tag with FileHeader must be defined." summary="0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.0.0:xml.fileheader_is_present"/>
</Checker>
<Checker status="completed" checkerId="check_asam_xodr_xml_version_is_defined" description="The FileHeader tag must have the attributes revMajor and revMinor and of type unsignedShort." summary="0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.0.0:xml.version_is_defined"/>
</Checker>
<Checker status="completed" checkerId="check_asam_xodr_xml_valid_schema" description="Input xml file must be valid according to the schema." summary="4 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.0.0:xml.valid_schema"/>
<Issue issueId="0" description="Issue flagging when input file does not follow its version schema" level="1" ruleUID="asam.net:xodr:1.0.0:xml.valid_schema">
<Locations description="Element 'elevationProfile': Missing child element(s). Expected is ( elevation ).">
<FileLocation column="0" row="11"/>
</Locations>
</Issue>
<Issue issueId="1" description="Issue flagging when input file does not follow its version schema" level="1" ruleUID="asam.net:xodr:1.0.0:xml.valid_schema">
<Locations description="Element 'signal', attribute 'country': 'DE' is not a valid value of the union type 'e_countryCode'.">
<FileLocation column="0" row="47"/>
</Locations>
</Issue>
<Issue issueId="2" description="Issue flagging when input file does not follow its version schema" level="1" ruleUID="asam.net:xodr:1.0.0:xml.valid_schema">
<Locations description="Element 'validity': This element is not expected. Expected is one of ( dependency, reference, positionRoad, positionInertial, userData, include, dataQuality ).">
<FileLocation column="0" row="49"/>
</Locations>
</Issue>
<Issue issueId="3" description="Issue flagging when input file does not follow its version schema" level="1" ruleUID="asam.net:xodr:1.0.0:xml.valid_schema">
<Locations description="Element 'signal', attribute 'country': 'DE' is not a valid value of the union type 'e_countryCode'.">
<FileLocation column="0" row="51"/>
</Locations>
</Issue>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_level_true_one_side" description="Check if there is any @Level=False after being True until the lane border." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.lane.level_true_one_side"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_access_no_mix_of_deny_or_allow" description="Check if there is mixed content on access rules for the same sOffset on lanes." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.lane.access.no_mix_of_deny_or_allow"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_link_lanes_across_lane_sections" description="Lanes that continues across the lane sections shall be connected in both directions." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.4.0:road.lane.link.lanes_across_lane_sections"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_linkage_is_junction_needed" description="Two roads shall only be linked directly, if the linkage is clear. If the relationship to successor or predecessor is ambiguous, junctions shall be used." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.4.0:road.linkage.is_junction_needed"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_link_zero_width_at_start" description="Lanes that have a width of zero at the beginning of the lane section shall have no predecessor element." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.lane.link.zero_width_at_start"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_link_zero_width_at_end" description="Lanes that have a width of zero at the end of the lane section shall have no successor element." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.lane.link.zero_width_at_end"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_link_new_lane_appear" description="If a new lane appears besides, only the continuing lane shall be connected to the original lane, not the appearing lane." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.4.0:road.lane.link.new_lane_appear"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_junctions_connection_connect_road_no_incoming_road" description="Connecting roads shall not be incoming roads." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.4.0:junctions.connection.connect_road_no_incoming_road"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_junctions_connection_one_connection_element" description="Each connecting road shall be represented by exactly one element. A connecting road may contain as many lanes as required." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:junctions.connection.one_connection_element"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_junctions_connection_one_link_to_incoming" description="Each connecting road shall be associated with at most one &lt;connection&gt; element per incoming road. A connecting road shall only have the &lt;laneLink&gt; element for that direction." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.8.0:junctions.connection.one_link_to_incoming"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_junctions_connection_start_along_linkage" description="The value &quot;start&quot; shall be used to indicate that the connecting road runs along the linkage indicated in the element." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:junctions.connection.start_along_linkage"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_junctions_connection_end_opposite_linkage" description="The value &quot;end&quot; shall be used to indicate that the connectingroad runs along the opposite direction of the linkage indicated in the element." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:junctions.connection.end_opposite_linkage"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_geometry_parampoly3_length_match" description="The actual curve length, as determined by numerical integration over the parameter range, should match '@Length'." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.geometry.parampoly3.length_match"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_lane_border_overlap_with_inner_lanes" description="Lane borders shall not intersect inner lanes." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.4.0:road.lane.border.overlap_with_inner_lanes"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_geometry_parampoly3_arclength_range" description="If @prange='arcLength', p shall be chosen in [0, @Length from geometry]." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.geometry.parampoly3.arclength_range"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_road_geometry_parampoly3_normalized_range" description="If @prange='normalized', p shall be chosen in [0, 1]." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:road.geometry.parampoly3.normalized_range"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_performance_avoid_redundant_info" description="Redundant elements should be avoided." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:performance.avoid_redundant_info"/>
</Checker>
<Checker status="skipped" checkerId="check_asam_xodr_lane_smoothness_contact_point_no_horizontal_gaps" description="Two connected drivable lanes shall have no horizontal gaps." summary="Preconditions are not satisfied. Skip the check. 0 issue(s) are found.">
<AddressedRule ruleUID="asam.net:xodr:1.7.0:lane_smoothness.contact_point_no_horizontal_gaps"/>
</Checker>
</CheckerBundle>
</CheckerResults>
......@@ -27,12 +27,23 @@ cc_library(
name = "road_logic_suite",
srcs = ["road_logic_suite.cpp"],
hdrs = ["road_logic_suite.h"],
data = [
"@qc_checker",
],
linkopts = [
"-lpython3.12", # Link against Python shared library
"-ldl",
"-lutil",
],
visibility = ["//visibility:public"],
deps = [
":map_converter_config",
"//RoadLogicSuite/Internal:road_logic_suite_impl",
"//RoadLogicSuite/Internal/MapConversion:mantle_map_converter", # for map loader
"@bazel_tools//tools/cpp/runfiles",
"@map_sdk//:map_api",
"@python_3_12//:python_headers",
# "@pybind11",
],
alwayslink = True,
)
......
......@@ -27,4 +27,18 @@ TEST(MapLoaderTest, GivenInvalidMap_WhenLoadMap_ThenThrow)
EXPECT_THROW([[maybe_unused]] auto map = suite.LoadMap(GetResolvedMapPath(invalid_map_file)), std::runtime_error);
}
TEST(MapLoaderTest, GivenInvalidMap_WhenLoadIssueMap_ThenThrow)
{
// Given
const auto invalid_map_file = "road_with_multisections.xodr";
// When
RoadLogicSuite suite{};
// Then
EXPECT_NO_THROW([[maybe_unused]] auto map = suite.LoadMap(GetResolvedMapPathInternal(invalid_map_file)));
// EXPECT_THROW([[maybe_unused]] auto map = suite.LoadMap(GetResolvedMapPathInternal(invalid_map_file)),
// std::runtime_error);
}
} // namespace road_logic_suite::test
......@@ -13,12 +13,200 @@
#include "RoadLogicSuite/Internal/MapConversion/mantle_map_converter.h"
#include "RoadLogicSuite/Internal/road_logic_suite_impl.h"
#include "tools/cpp/runfiles/runfiles.h"
#include <MantleAPI/Common/vector.h>
#include <Python.h>
#include <pugixml/pugixml.hpp>
// #include <pybind11/embed.h>
#include <filesystem>
#include <fstream> // for std::ofstream
#include <sstream> // for std::ostringstream
namespace road_logic_suite
{
namespace details
{
std::string GenerateConfigFile(const std::string& map_file_path, const std::string& result_file_path)
{
std::ostringstream xml;
// some rules need to be checked
xml << R"(<?xml version="1.0" encoding="UTF-8" standalone="no"?>)"
<< "\n<Config>\n"
<< " <Param name=\"InputFile\" value=\"" << map_file_path << "\" />\n"
<< " <CheckerBundle application=\"xodrBundle\">\n"
<< " <Param name=\"resultFile\" value=\"" << result_file_path << "\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_xml_valid_xml_document\" maxLevel=\"1\" minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_xml_root_tag_is_opendrive\" maxLevel=\"1\" minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_xml_fileheader_is_present\" maxLevel=\"1\" minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_xml_version_is_defined\" maxLevel=\"1\" minLevel=\"3\" />\n"
// << " <Checker checkerId=\"check_asam_xodr_xml_valid_schema\" maxLevel=\"1\" minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_level_true_one_side\" maxLevel=\"1\" minLevel=\"3\" "
"/>\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_access_no_mix_of_deny_or_allow\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_link_lanes_across_lane_sections\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_linkage_is_junction_needed\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_link_zero_width_at_start\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_link_zero_width_at_end\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_link_new_lane_appear\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_junctions_connection_connect_road_no_incoming_road\" "
"maxLevel=\"1\" minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_junctions_connection_one_connection_element\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_junctions_connection_one_link_to_incoming\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_junctions_connection_start_along_linkage\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_junctions_connection_end_opposite_linkage\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_geometry_parampoly3_length_match\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_lane_border_overlap_with_inner_lanes\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_geometry_parampoly3_arclength_range\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_road_geometry_parampoly3_normalized_range\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_performance_avoid_redundant_info\" maxLevel=\"1\" "
"minLevel=\"3\" />\n"
<< " <Checker checkerId=\"check_asam_xodr_lane_smoothness_contact_point_no_horizontal_gaps\" "
"maxLevel=\"1\" minLevel=\"3\" />\n"
<< " </CheckerBundle>\n"
<< "</Config>";
std::string tmp_path = "/tmp/generated_qc_config.xml";
std::ofstream file(tmp_path);
file << xml.str();
return tmp_path;
}
// bool RunQcChecker(const std::string& config_path)
// {
// std::string error;
// std::unique_ptr<bazel::tools::cpp::runfiles::Runfiles> runfiles(
// bazel::tools::cpp::runfiles::Runfiles::CreateForTest(&error));
// if (runfiles == nullptr)
// {
// std::cerr << "Failed to create runfiles: " << error << std::endl;
// return false;
// }
// // Debug: Check what's actually in the runfiles directory
// const char* runfiles_dir = std::getenv("RUNFILES_DIR");
// if (runfiles_dir)
// {
// std::cout << "RUNFILES_DIR: " << runfiles_dir << std::endl;
// // List all files in runfiles to see what's there
// std::string ls_command = "find " + std::string(runfiles_dir) + " -type f | head -20";
// std::cout << "Files in runfiles:" << std::endl;
// std::system(ls_command.c_str());
// // Specifically look for qc_checker
// std::string find_command = "find " + std::string(runfiles_dir) + " -name '*qc*' -type f";
// std::cout << "QC-related files:" << std::endl;
// std::system(find_command.c_str());
// // Check external directory structure
// std::string external_command = "ls -la " + std::string(runfiles_dir) + "/";
// std::cout << "Runfiles root contents:" << std::endl;
// std::system(external_command.c_str());
// }
// // Try different possible locations
// std::vector<std::string> possible_paths = {"_main/qc_checker",
// "external/_main~non_module_dependencies~qc_checker/qc_checker",
// "_main~non_module_dependencies~qc_checker/qc_checker",
// "qc_checker/qc_checker"};
// for (const auto& path : possible_paths)
// {
// std::string full_path = runfiles->Rlocation(path);
// std::cout << "Trying path: " << path << " -> " << full_path << std::endl;
// struct stat buffer;
// if (stat(full_path.c_str(), &buffer) == 0)
// {
// std::cout << "Found file at: " << full_path << std::endl;
// if (access(full_path.c_str(), X_OK) == 0)
// {
// std::cout << "File is executable, using it" << std::endl;
// std::string command = full_path + " -c " + config_path;
// std::cout << "command: " << command << std::endl;
// int exit_code = std::system(command.c_str());
// return exit_code == 0;
// }
// }
// }
// std::cerr << "qc_checker executable not found in any expected location" << std::endl;
// return false;
// }
bool RunQcChecker(const std::string& config_path)
{
std::string error;
std::unique_ptr<bazel::tools::cpp::runfiles::Runfiles> runfiles(
bazel::tools::cpp::runfiles::Runfiles::CreateForTest(&error));
if (runfiles == nullptr)
{
std::cerr << "Failed to create runfiles: " << error << std::endl;
return false;
}
// Try both bzlmod and legacy paths
std::vector<std::string> possible_paths = {
"_main~non_module_dependencies~qc_checker/qc_checker", // bzlmod path
"_main/qc_checker", // legacy path
"qc_checker/qc_checker" // direct path
};
for (const auto& path : possible_paths)
{
std::string qc_tool = runfiles->Rlocation(path);
// Check if file exists and is executable
struct stat buffer;
if (stat(qc_tool.c_str(), &buffer) == 0 && access(qc_tool.c_str(), X_OK) == 0)
{
std::string command = qc_tool + " -c " + config_path;
int exit_code = std::system(command.c_str());
return exit_code == 0;
}
}
std::cerr << "qc_checker executable not found in any expected location" << std::endl;
return false;
}
bool HasIssuesInReport(const std::string& result_file_path)
{
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file(result_file_path.c_str());
if (!result)
{
throw std::runtime_error("Failed to parse result.xqar: " + std::string(result.description()));
}
// Search for any <issue> tag anywhere in the document
// check if error tag exists
// print issue message in the future
auto issue_node = doc.select_node("//Issue");
return issue_node.node();
}
} // namespace details
RoadLogicSuite::RoadLogicSuite() : impl_(std::make_unique<RoadLogicSuiteImpl>()) {}
RoadLogicSuite::RoadLogicSuite(MapConverterConfig& converter_config)
......@@ -30,6 +218,22 @@ RoadLogicSuite::~RoadLogicSuite() = default;
std::unique_ptr<map_api::Map> RoadLogicSuite::LoadMap(const std::string& map_file) const
{
const std::string result_file = "/tmp/qc_result.xqar";
const std::string config_file = details::GenerateConfigFile(map_file, result_file);
// const std::string qc_tool = "./qc_checker";
if (!details::RunQcChecker(config_file))
{
throw std::runtime_error("Failed to run QC checker tool.");
}
if (details::HasIssuesInReport(result_file))
{
throw std::runtime_error("QC Checker reported issues in map file: " + map_file);
}
if (!impl_->LoadFile(map_file))
{
throw std::runtime_error("RoadLogicSuite load map file " + map_file + " failed.");
......
load("@road_logic_suite//ThirdParty/libOpenDRIVE:libOpenDrive.bzl", "lib_open_drive")
load("@road_logic_suite//ThirdParty/units:units.bzl", "units_nhh")
load("@road_logic_suite//ThirdParty/rtree:rtree.bzl", "rtree")
load("@road_logic_suite//ThirdParty/bazel_clang_tidy:bazel_clang_tidy.bzl", "bazel_clang_tidy")
load("@road_logic_suite//ThirdParty/libOpenDRIVE:libOpenDrive.bzl", "lib_open_drive")
load("@road_logic_suite//ThirdParty/mantle_api:mantle_api.bzl", "mantle_api")
load("@road_logic_suite//ThirdParty/map_sdk:map_sdk.bzl", "map_sdk")
load("@road_logic_suite//ThirdParty/pybind11:pybind11.bzl", "pybind11")
load("@road_logic_suite//ThirdParty/qc_baselib:qc_baselib.bzl", "qc_baselib")
load("@road_logic_suite//ThirdParty/qc_checker:qc_checker.bzl", "qc_checker")
load("@road_logic_suite//ThirdParty/rtree:rtree.bzl", "rtree")
load("@road_logic_suite//ThirdParty/units:units.bzl", "units_nhh")
def _non_module_dependencies_impl(_ctx):
"""
......@@ -14,6 +17,9 @@ def _non_module_dependencies_impl(_ctx):
rtree()
mantle_api()
map_sdk()
qc_checker()
qc_baselib()
pybind11()
non_module_dependencies = module_extension(
implementation = _non_module_dependencies_impl,
......
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "pybind11",
hdrs = glob(["include/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
deps = [
"@python_3_12//:python_headers",
],
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
_TAG = "2.13.6"
def pybind11():
maybe(
http_archive,
name = "pybind11",
build_file = "//ThirdParty/pybind11:pybind11.BUILD",
url = "https://github.com/pybind/pybind11/archive/refs/tags/v{tag}.tar.gz".format(tag = _TAG),
sha256 = "e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20",
strip_prefix = "pybind11-{tag}".format(tag = _TAG),
type = "tar.gz",
)
# filegroup(
# name = "qc_baselib",
# srcs = glob(["qc_baselib/**/*.py"]),
# visibility = ["//visibility:public"],
# )
py_library(
name = "qc_baselib",
srcs = glob(["qc_baselib/**/*.py"]),
visibility = ["//visibility:public"],
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
_TAG = "1.0.0"
def qc_baselib():
maybe(
http_archive,
name = "qc_baselib",
build_file = "//ThirdParty/qc_baselib:qc_baselib.BUILD",
url = "https://github.com/asam-ev/qc-baselib-py/archive/refs/tags/v{tag}.tar.gz".format(tag = _TAG),
sha256 = "ab35f8b8e12cc3d6e31c3c42cdee3a6a171e47e29cd17ac972a1a8fd8a510cd1",
strip_prefix = "qc-baselib-py-{tag}".format(tag = _TAG),
type = "tar.gz",
)
pydantic==2.11.5
# alias(
# name = "qc_checker",
# actual = "@qc_checker//:qc_checker",
# visibility = ["@road_logic_suite//:__subpackages__"],
# )
load("@rules_python//python:defs.bzl", "py_binary")
# filegroup(
# name = "qc_checker",
# srcs = glob(["qc_opendrive/**/*.py"]),
# visibility = ["//visibility:public"],
# )
py_binary(
name = "qc_checker",
srcs = glob(["qc_opendrive/**/*.py"]),
data = glob(["qc_opendrive/schema/**/*.xsd"]),
main = "main.py",
visibility = ["//visibility:public"],
deps = [
"@qc_baselib",
"@qc_checker_deps//lxml",
"@qc_checker_deps//numpy",
"@qc_checker_deps//pyclothoids",
"@qc_checker_deps//pydantic",
"@qc_checker_deps//pydantic_xml",
# "@qc_checker_deps//qc_baselib",
"@qc_checker_deps//scipy",
"@qc_checker_deps//semver",
"@qc_checker_deps//transforms3d",
"@qc_checker_deps//xmlschema",
],
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
_TAG = "1.0.0"
def qc_checker():
maybe(
http_archive,
name = "qc_checker",
build_file = "//ThirdParty/qc_checker:qc_checker.BUILD",
url = "https://github.com/asam-ev/qc-opendrive/archive/refs/tags/v{tag}.tar.gz".format(tag = _TAG),
sha256 = "61d8c9b51e00f2694c64189a6d9cfb17dad99fbe2d16ea7e5603e7ee06b67188",
strip_prefix = "qc-opendrive-{tag}".format(tag = _TAG),
type = "tar.gz",
)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>
<!-- <Param name="InputFile"
value="{{ input_file }}" /> -->
<Param name="InputFile"
value="/home/zzq/projects/openpass/road-logic-suite/RoadLogicSuite/Tests/Data/Maps/road_with_traffic_signs.xodr"
/>
<CheckerBundle application="xodrBundle">
<Param name="resultFile" value="/home/zzq/projects/openpass/road-logic-suite/Result.xqar" />
<Checker checkerId="check_asam_xodr_xml_valid_xml_document" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_xml_root_tag_is_opendrive" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_xml_fileheader_is_present" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_xml_version_is_defined" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_xml_valid_schema" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_level_true_one_side" maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_access_no_mix_of_deny_or_allow" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_link_lanes_across_lane_sections" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_linkage_is_junction_needed" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_link_zero_width_at_start" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_link_zero_width_at_end" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_link_new_lane_appear" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_junctions_connection_connect_road_no_incoming_road"
maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_junctions_connection_one_connection_element"
maxLevel="1" minLevel="3" />
<Checker checkerId="check_asam_xodr_junctions_connection_one_link_to_incoming" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_junctions_connection_start_along_linkage" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_junctions_connection_end_opposite_linkage" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_geometry_parampoly3_length_match" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_lane_border_overlap_with_inner_lanes" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_geometry_parampoly3_arclength_range" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_road_geometry_parampoly3_normalized_range" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_performance_avoid_redundant_info" maxLevel="1"
minLevel="3" />
<Checker checkerId="check_asam_xodr_lane_smoothness_contact_point_no_horizontal_gaps"
maxLevel="1" minLevel="3" />
</CheckerBundle>
<!-- <ReportModule application="TextReport">
<Param name="strInputFile" value="/home/zzq/projects/openpass/road-logic-suite/Result.xqar" />
<Param name="strReportFile" value="/home/zzq/projects/openpass/road-logic-suite/Report.txt" />
</ReportModule> -->
</Config>
pydantic
pydantic_xml
lxml
numpy
pyclothoids
transforms3d
xmlschema
scipy
semver
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements.txt requirements.in
#
annotated-types==0.7.0
# via pydantic
elementpath==5.0.1
# via xmlschema
lxml==5.4.0
# via -r requirements.in
numpy==2.2.6
# via
# -r requirements.in
# scipy
# transforms3d
pybind11==2.13.6
# via pyclothoids
pyclothoids==0.2.0
# via -r requirements.in
pydantic==2.11.5
# via
# -r requirements.in
# pydantic-xml
pydantic-core==2.33.2
# via
# pydantic
# pydantic-xml
pydantic-xml==2.17.0
# via -r requirements.in
scipy==1.15.3
# via -r requirements.in
semver==3.0.4
# via -r requirements.in
transforms3d==0.4.2
# via -r requirements.in
typing-extensions==4.13.2
# via
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.1
# via pydantic
xmlschema==4.0.1
# via -r requirements.in
qc_baselib @ git+https://github.com/asam-ev/qc-baselib-py@main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment