#include "test.h"
#include "OpenDrive.h"
#include "Random.h"
#include <carla/StopWatch.h>
#include <carla/ThreadPool.h>
#include <carla/geom/Location.h>
#include <carla/geom/Math.h>
#include <carla/opendrive/OpenDriveParser.h>
#include <carla/road/MapBuilder.h>
#include <carla/road/element/RoadInfoElevation.h>
#include <carla/road/element/RoadInfoGeometry.h>
#include <carla/road/element/RoadInfoMarkRecord.h>
#include <carla/road/element/RoadInfoVisitor.h>
#include <pugixml/pugixml.hpp>
#include <fstream>
#include <string>
函数 | |
static auto | get_total_road_marks (pugi::xml_object_range< pugi::xml_named_node_iterator > &lane_nodes, LaneSection &lane_section) |
获取车道节点中所有道路标记的总数,并对比解析得到的道路标记数量。 | |
TEST (road, get_waypoint) | |
TEST (road, iterate_waypoints) | |
TEST (road, parse_files) | |
TEST (road, parse_geometry) | |
TEST (road, parse_junctions) | |
TEST (road, parse_road) | |
TEST (road, parse_road_elevation) | |
TEST (road, parse_road_links) | |
static void | test_geometry (const pugi::xml_document &xml, boost::optional< Map > &map) |
static void | test_junctions (const pugi::xml_document &xml, boost::optional< Map > &map) |
static void | test_road_elevation (const pugi::xml_document &xml, boost::optional< Map > &map) |
static void | test_road_links (boost::optional< Map > &map) |
static void | test_roads (const pugi::xml_document &xml, boost::optional< Map > &map) |
定义一个名为test_roads的函数,它接受一个const引用的pugi::xml_document对象和一个boost::optional<Map>对象作为参数 | |
变量 | |
const std::string | BASE_PATH = LIBCARLA_TEST_CONTENT_FOLDER "/OpenDrive/" |
导入CARLA的实用工具命名空间,包含常用的功能函数和类。 | |
|
static |
获取车道节点中所有道路标记的总数,并对比解析得到的道路标记数量。
该函数遍历给定的车道节点范围,对每个车道节点中的道路标记进行解析和验证。 它计算了两种道路标记的总数:一种是实际解析得到的道路标记数量,另一种是 根据道路信息记录验证得到的道路标记数量。
lane_nodes | 车道节点的范围,这些节点包含了道路标记信息。 |
lane_section | 车道段对象,用于获取具体的车道信息。 |
定义一个极小的误差值,用于浮点数比较。
用于存储验证得到的道路标记总数。
用于存储解析得到的道路标记总数。
遍历车道节点范围。
计算并累加解析得到的道路标记数量。
获取当前车道节点的ID。
根据车道ID获取对应的车道对象。
断言车道对象不为空。
遍历当前车道节点中的所有道路标记节点。
获取道路标记的sOffset属性值。
获取道路标记的type属性值。
获取道路标记的material属性值。
获取道路标记的color属性值。
根据距离和sOffset获取对应的道路信息记录。
如果道路信息记录不为空,则进行验证。
断言距离误差在允许范围内。
断言道路标记类型相同。
断言道路标记材料相同。
断言道路标记颜色相同。
累加验证得到的道路标记数量。
返回一个包含两个整数的pair,分别表示验证和解析得到的道路标记总数。
在文件 test_opendrive.cpp 第 107 行定义.
引用了 carla::road::Lane::GetDistance(), carla::road::Lane::GetInfo() , 以及 carla::road::LaneSection::GetLane().
被这些函数引用 test_roads().
TEST | ( | road | , |
get_waypoint | ) |
在文件 test_opendrive.cpp 第 449 行定义.
引用了 carla::ThreadPool::AsyncRun(), util::OpenDrive::GetAvailableFiles(), carla::logging::log() , 以及 carla::ThreadPool::Post().
TEST | ( | road | , |
iterate_waypoints | ) |
在文件 test_opendrive.cpp 第 350 行定义.
引用了 carla::ThreadPool::AsyncRun(), util::OpenDrive::GetAvailableFiles(), carla::logging::log() , 以及 carla::ThreadPool::Post().
TEST | ( | road | , |
parse_files | ) |
在文件 test_opendrive.cpp 第 269 行定义.
引用了 util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load() , 以及 carla::opendrive::OpenDriveParser::Load().
TEST | ( | road | , |
parse_geometry | ) |
TEST | ( | road | , |
parse_junctions | ) |
TEST | ( | road | , |
parse_road | ) |
TEST | ( | road | , |
parse_road_elevation | ) |
TEST | ( | road | , |
parse_road_links | ) |
在文件 test_opendrive.cpp 第 280 行定义.
引用了 util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load() , 以及 test_road_links().
|
static |
在文件 test_opendrive.cpp 第 73 行定义.
引用了 pugi::xml_attribute::as_uint(), pugi::xml_node::attribute(), pugi::xml_node::child() , 以及 pugi::xml_node::children().
被这些函数引用 TEST().
|
static |
在文件 test_opendrive.cpp 第 211 行定义.
引用了 pugi::xml_node::child() , 以及 pugi::xml_node::children().
被这些函数引用 TEST().
|
static |
在文件 test_opendrive.cpp 第 38 行定义.
引用了 pugi::xml_attribute::as_uint(), pugi::xml_node::attribute(), pugi::xml_node::child() , 以及 pugi::xml_node::children().
被这些函数引用 TEST().
|
static |
|
static |
定义一个名为test_roads的函数,它接受一个const引用的pugi::xml_document对象和一个boost::optional<Map>对象作为参数
从XML文档中获取名为"OpenDRIVE"的子节点
从Map对象中获取当前存储的道路数量。
用于验证XML中的道路数量与Map中存储的道路数量是否一致。
从Map对象中获取当前道路的所有车道段数量
从"laneSection"节点中获取s属性
初始化车道总数为0
在文件 test_opendrive.cpp 第 151 行定义.
引用了 pugi::xml_node::child(), pugi::xml_node::children() , 以及 get_total_road_marks().
被这些函数引用 TEST().