CARLA
 
载入中...
搜索中...
未找到
函数 | 变量
test_opendrive.cpp 文件参考
#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>
+ test_opendrive.cpp 的引用(Include)关系图:

浏览源代码.

函数

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的实用工具命名空间,包含常用的功能函数和类。
 

函数说明

◆ get_total_road_marks()

static auto get_total_road_marks ( pugi::xml_object_range< pugi::xml_named_node_iterator > & lane_nodes,
LaneSection & lane_section )
static

获取车道节点中所有道路标记的总数,并对比解析得到的道路标记数量。

该函数遍历给定的车道节点范围,对每个车道节点中的道路标记进行解析和验证。 它计算了两种道路标记的总数:一种是实际解析得到的道路标记数量,另一种是 根据道路信息记录验证得到的道路标记数量。

参数
lane_nodes车道节点的范围,这些节点包含了道路标记信息。
lane_section车道段对象,用于获取具体的车道信息。
返回
返回一个包含两个整数的pair,第一个整数是验证得到的道路标记总数, 第二个整数是解析得到的道路标记总数。
注解
使用Google Test的EXPECT宏进行断言验证。

定义一个极小的误差值,用于浮点数比较。

用于存储验证得到的道路标记总数。

用于存储解析得到的道路标记总数。

遍历车道节点范围。

计算并累加解析得到的道路标记数量。

获取当前车道节点的ID。

根据车道ID获取对应的车道对象。

断言车道对象不为空。

遍历当前车道节点中的所有道路标记节点。

获取道路标记的sOffset属性值。

获取道路标记的type属性值。

获取道路标记的material属性值。

获取道路标记的color属性值。

根据距离和sOffset获取对应的道路信息记录。

如果道路信息记录不为空,则进行验证。

断言距离误差在允许范围内。

断言道路标记类型相同。

断言道路标记材料相同。

断言道路标记颜色相同。

累加验证得到的道路标记数量。

返回一个包含两个整数的pair,分别表示验证和解析得到的道路标记总数。

在文件 test_opendrive.cpp107 行定义.

引用了 carla::road::Lane::GetDistance(), carla::road::Lane::GetInfo() , 以及 carla::road::LaneSection::GetLane().

被这些函数引用 test_roads().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ TEST() [1/8]

TEST ( road ,
get_waypoint  )

在文件 test_opendrive.cpp449 行定义.

引用了 carla::ThreadPool::AsyncRun(), util::OpenDrive::GetAvailableFiles(), carla::logging::log() , 以及 carla::ThreadPool::Post().

+ 函数调用图:

◆ TEST() [2/8]

TEST ( road ,
iterate_waypoints  )

在文件 test_opendrive.cpp350 行定义.

引用了 carla::ThreadPool::AsyncRun(), util::OpenDrive::GetAvailableFiles(), carla::logging::log() , 以及 carla::ThreadPool::Post().

+ 函数调用图:

◆ TEST() [3/8]

TEST ( road ,
parse_files  )

在文件 test_opendrive.cpp269 行定义.

引用了 util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load() , 以及 carla::opendrive::OpenDriveParser::Load().

+ 函数调用图:

◆ TEST() [4/8]

TEST ( road ,
parse_geometry  )

在文件 test_opendrive.cpp335 行定义.

引用了 BASE_PATH, util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load(), pugi::xml_document::load_file() , 以及 test_geometry().

+ 函数调用图:

◆ TEST() [5/8]

TEST ( road ,
parse_junctions  )

在文件 test_opendrive.cpp289 行定义.

引用了 BASE_PATH, util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load(), pugi::xml_document::load_file() , 以及 test_junctions().

+ 函数调用图:

◆ TEST() [6/8]

TEST ( road ,
parse_road  )

在文件 test_opendrive.cpp305 行定义.

引用了 BASE_PATH, util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load(), pugi::xml_document::load_file() , 以及 test_roads().

+ 函数调用图:

◆ TEST() [7/8]

TEST ( road ,
parse_road_elevation  )

在文件 test_opendrive.cpp320 行定义.

引用了 BASE_PATH, util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load(), pugi::xml_document::load_file() , 以及 test_road_elevation().

+ 函数调用图:

◆ TEST() [8/8]

TEST ( road ,
parse_road_links  )

在文件 test_opendrive.cpp280 行定义.

引用了 util::OpenDrive::GetAvailableFiles(), util::OpenDrive::Load(), carla::opendrive::OpenDriveParser::Load() , 以及 test_road_links().

+ 函数调用图:

◆ test_geometry()

static void test_geometry ( const pugi::xml_document & xml,
boost::optional< Map > & map )
static

在文件 test_opendrive.cpp73 行定义.

引用了 pugi::xml_attribute::as_uint(), pugi::xml_node::attribute(), pugi::xml_node::child() , 以及 pugi::xml_node::children().

被这些函数引用 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ test_junctions()

static void test_junctions ( const pugi::xml_document & xml,
boost::optional< Map > & map )
static

在文件 test_opendrive.cpp211 行定义.

引用了 pugi::xml_node::child() , 以及 pugi::xml_node::children().

被这些函数引用 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ test_road_elevation()

static void test_road_elevation ( const pugi::xml_document & xml,
boost::optional< Map > & map )
static

在文件 test_opendrive.cpp38 行定义.

引用了 pugi::xml_attribute::as_uint(), pugi::xml_node::attribute(), pugi::xml_node::child() , 以及 pugi::xml_node::children().

被这些函数引用 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ test_road_links()

static void test_road_links ( boost::optional< Map > & map)
static

在文件 test_opendrive.cpp248 行定义.

被这些函数引用 TEST().

+ 这是这个函数的调用关系图:

◆ test_roads()

static void test_roads ( const pugi::xml_document & xml,
boost::optional< Map > & map )
static

定义一个名为test_roads的函数,它接受一个const引用的pugi::xml_document对象和一个boost::optional<Map>对象作为参数

从XML文档中获取名为"OpenDRIVE"的子节点

从Map对象中获取当前存储的道路数量。

用于验证XML中的道路数量与Map中存储的道路数量是否一致。

从Map对象中获取当前道路的所有车道段数量

从"laneSection"节点中获取s属性

初始化车道总数为0

在文件 test_opendrive.cpp151 行定义.

引用了 pugi::xml_node::child(), pugi::xml_node::children() , 以及 get_total_road_marks().

被这些函数引用 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

变量说明

◆ BASE_PATH

const std::string BASE_PATH = LIBCARLA_TEST_CONTENT_FOLDER "/OpenDrive/"

导入CARLA的实用工具命名空间,包含常用的功能函数和类。

定义了OpenDrive XML文件的基本路径。

在文件 test_opendrive.cpp35 行定义.

被这些函数引用 TEST(), TEST(), TEST() , 以及 TEST().