CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
rpc
DebugShape.h
浏览该文件的文档.
1
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/MsgPack.h
"
10
#include "
carla/MsgPackAdaptors.h
"
11
#include "
carla/geom/BoundingBox.h
"
12
#include "
carla/geom/Location.h
"
13
#include "
carla/geom/Rotation.h
"
14
#include "
carla/rpc/Color.h
"
15
16
#ifdef _MSC_VER
17
#pragma warning(push)
18
#pragma warning(disable:4583)
19
#pragma warning(disable:4582)
20
#include <boost/variant2/variant.hpp>
21
#pragma warning(pop)
22
#else
23
#include <boost/variant2/variant.hpp>
24
#endif
25
26
namespace
carla
{
27
namespace
rpc {
28
29
// 定义 DebugShape 类,用于表示调试绘制的几何形状
30
class
DebugShape
{
31
public
:
32
33
// 点结构体,包含位置和大小
34
struct
Point
{
35
geom::Location
location
;
// 点的位置(geom::Location 类型)
36
float
size
;
// 点的大小
37
MSGPACK_DEFINE_ARRAY
(
location
,
size
);
// 使用 MsgPack 序列化,定义该结构的字段
38
};
39
40
// HUD 点结构体,包含位置和大小
41
struct
HUDPoint
{
42
geom::Location
location
;
// 点的位置(geom::Location 类型)
43
float
size
;
// 点的大小
44
MSGPACK_DEFINE_ARRAY
(
location
,
size
);
// 使用 MsgPack 序列化,定义该结构的字段
45
};
46
47
// 线段结构体,包含起始点、结束点和线的粗细
48
struct
Line
{
49
geom::Location
begin
;
// 线段的起始点
50
geom::Location
end
;
// 线段的结束点
51
float
thickness
;
// 线段的粗细
52
MSGPACK_DEFINE_ARRAY
(
begin
,
end
,
thickness
);
// 使用 MsgPack 序列化,定义该结构的字段
53
};
54
55
// HUD 线段结构体,包含起始点、结束点和线的粗细
56
struct
HUDLine
{
57
geom::Location
begin
;
// 线段的起始点
58
geom::Location
end
;
// 线段的结束点
59
float
thickness
;
// 线段的粗细
60
MSGPACK_DEFINE_ARRAY
(
begin
,
end
,
thickness
);
// 使用 MsgPack 序列化,定义该结构的字段
61
};
62
63
// 箭头结构体,包含线段和箭头大小
64
struct
Arrow
{
65
Line
line
;
// 箭头的线段
66
float
arrow_size
;
// 箭头的大小
67
MSGPACK_DEFINE_ARRAY
(
line
,
arrow_size
);
// 使用 MsgPack 序列化,定义该结构的字段
68
};
69
70
// HUD 箭头结构体,包含线段和箭头大小
71
struct
HUDArrow
{
72
HUDLine
line
;
// HUD 箭头的线段
73
float
arrow_size
;
// 箭头的大小
74
MSGPACK_DEFINE_ARRAY
(
line
,
arrow_size
);
// 使用 MsgPack 序列化,定义该结构的字段
75
};
76
77
// 方框结构体,包含边界框、旋转角度和线的粗细
78
struct
Box
{
79
geom::BoundingBox
box
;
// 方框的边界框
80
geom::Rotation
rotation
;
// 方框的旋转角度
81
float
thickness
;
// 方框的线粗细
82
MSGPACK_DEFINE_ARRAY
(
box
,
rotation
,
thickness
);
// 使用 MsgPack 序列化,定义该结构的字段
83
};
84
85
// HUD 方框结构体,包含边界框、旋转角度和线的粗细
86
struct
HUDBox
{
87
geom::BoundingBox
box
;
// 方框的边界框
88
geom::Rotation
rotation
;
// 方框的旋转角度
89
float
thickness
;
// 方框的线粗细
90
MSGPACK_DEFINE_ARRAY
(
box
,
rotation
,
thickness
);
// 使用 MsgPack 序列化,定义该结构的字段
91
};
92
93
// 字符串结构体,包含位置、文本和是否绘制阴影
94
struct
String
{
95
geom::Location
location
;
// 文本的绘制位置
96
std::string
text
;
// 要绘制的文本
97
bool
draw_shadow
;
// 是否绘制文本阴影
98
MSGPACK_DEFINE_ARRAY
(
location
,
text
,
draw_shadow
);
// 使用 MsgPack 序列化,定义该结构的字段
99
};
100
101
// 使用 boost::variant 存储多种几何形状的变种类型
102
boost::variant2::variant<Point, Line, Arrow, Box, String, HUDPoint, HUDLine, HUDArrow, HUDBox>
primitive
;
103
104
// 颜色,默认为红色(255u, 0u, 0u)
105
Color
color
= {255u, 0u, 0u};
106
107
// 生命周期,默认为 -1.0f 表示永远存在
108
float
life_time
= -1.0f;
109
110
// 是否为持久化线条,默认为 true
111
bool
persistent_lines
=
true
;
112
113
// 使用 MsgPack 序列化,定义该结构的字段
114
MSGPACK_DEFINE_ARRAY
(
primitive
,
color
,
life_time
,
persistent_lines
);
115
};
116
117
}
// namespace rpc
118
}
// namespace carla
BoundingBox.h
MsgPackAdaptors.h
MsgPack.h
Rotation.h
carla::geom::BoundingBox
Definition
LibCarla/source/carla/geom/BoundingBox.h:35
carla::geom::Location
Definition
geom/Location.h:28
carla::geom::Rotation
Definition
Rotation.h:27
carla::rpc::Color
Definition
rpc/Color.h:22
carla::rpc::DebugShape
Definition
DebugShape.h:30
carla::rpc::DebugShape::life_time
float life_time
Definition
DebugShape.h:108
carla::rpc::DebugShape::primitive
boost::variant2::variant< Point, Line, Arrow, Box, String, HUDPoint, HUDLine, HUDArrow, HUDBox > primitive
Definition
DebugShape.h:102
carla::rpc::DebugShape::persistent_lines
bool persistent_lines
Definition
DebugShape.h:111
carla::rpc::DebugShape::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(primitive, color, life_time, persistent_lines)
carla::rpc::DebugShape::color
Color color
Definition
DebugShape.h:105
Location.h
carla
CARLA模拟器的主命名空间。
Definition
Carla.cpp:139
Color.h
carla::rpc::DebugShape::Arrow
Definition
DebugShape.h:64
carla::rpc::DebugShape::Arrow::line
Line line
Definition
DebugShape.h:65
carla::rpc::DebugShape::Arrow::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(line, arrow_size)
carla::rpc::DebugShape::Arrow::arrow_size
float arrow_size
Definition
DebugShape.h:66
carla::rpc::DebugShape::Box
Definition
DebugShape.h:78
carla::rpc::DebugShape::Box::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(box, rotation, thickness)
carla::rpc::DebugShape::Box::rotation
geom::Rotation rotation
Definition
DebugShape.h:80
carla::rpc::DebugShape::Box::thickness
float thickness
Definition
DebugShape.h:81
carla::rpc::DebugShape::Box::box
geom::BoundingBox box
Definition
DebugShape.h:79
carla::rpc::DebugShape::HUDArrow
Definition
DebugShape.h:71
carla::rpc::DebugShape::HUDArrow::arrow_size
float arrow_size
Definition
DebugShape.h:73
carla::rpc::DebugShape::HUDArrow::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(line, arrow_size)
carla::rpc::DebugShape::HUDArrow::line
HUDLine line
Definition
DebugShape.h:72
carla::rpc::DebugShape::HUDBox
Definition
DebugShape.h:86
carla::rpc::DebugShape::HUDBox::thickness
float thickness
Definition
DebugShape.h:89
carla::rpc::DebugShape::HUDBox::box
geom::BoundingBox box
Definition
DebugShape.h:87
carla::rpc::DebugShape::HUDBox::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(box, rotation, thickness)
carla::rpc::DebugShape::HUDBox::rotation
geom::Rotation rotation
Definition
DebugShape.h:88
carla::rpc::DebugShape::HUDLine
Definition
DebugShape.h:56
carla::rpc::DebugShape::HUDLine::end
geom::Location end
Definition
DebugShape.h:58
carla::rpc::DebugShape::HUDLine::begin
geom::Location begin
Definition
DebugShape.h:57
carla::rpc::DebugShape::HUDLine::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(begin, end, thickness)
carla::rpc::DebugShape::HUDLine::thickness
float thickness
Definition
DebugShape.h:59
carla::rpc::DebugShape::HUDPoint
Definition
DebugShape.h:41
carla::rpc::DebugShape::HUDPoint::location
geom::Location location
Definition
DebugShape.h:42
carla::rpc::DebugShape::HUDPoint::size
float size
Definition
DebugShape.h:43
carla::rpc::DebugShape::HUDPoint::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(location, size)
carla::rpc::DebugShape::Line
Definition
DebugShape.h:48
carla::rpc::DebugShape::Line::end
geom::Location end
Definition
DebugShape.h:50
carla::rpc::DebugShape::Line::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(begin, end, thickness)
carla::rpc::DebugShape::Line::thickness
float thickness
Definition
DebugShape.h:51
carla::rpc::DebugShape::Line::begin
geom::Location begin
Definition
DebugShape.h:49
carla::rpc::DebugShape::Point
Definition
DebugShape.h:34
carla::rpc::DebugShape::Point::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(location, size)
carla::rpc::DebugShape::Point::size
float size
Definition
DebugShape.h:36
carla::rpc::DebugShape::Point::location
geom::Location location
Definition
DebugShape.h:35
carla::rpc::DebugShape::String
Definition
DebugShape.h:94
carla::rpc::DebugShape::String::text
std::string text
Definition
DebugShape.h:96
carla::rpc::DebugShape::String::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(location, text, draw_shadow)
carla::rpc::DebugShape::String::draw_shadow
bool draw_shadow
Definition
DebugShape.h:97
carla::rpc::DebugShape::String::location
geom::Location location
Definition
DebugShape.h:95
制作者
1.10.0