Apollo
10.0
自动驾驶开放平台
lidar_point_label.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2018 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
#pragma once
17
18
namespace
apollo
{
19
namespace
perception {
20
namespace
lidar {
21
22
enum class
LidarPointLabel
{
23
UNKNOWN
= 0,
24
ROI
= 1,
25
GROUND
= 2,
26
OBJECT
= 3,
27
MAX_LABEL
,
28
};
// enum class LidarPointLabel
29
30
enum class
PointSemanticLabel
{
31
UNKNOWN
= 0,
32
IGNORE
= 1,
33
GROUND
= 2,
34
OBJECT
= 3,
35
CURB
= 4,
36
VEGETATION
= 5,
37
FENCE
= 6,
38
NOISE
= 7,
39
WALL
= 8,
40
MAX_LABEL
,
41
};
// enum class PointSemanticLabel
42
43
enum class
PointMotionLabel
{
44
UNKNOWN
= 0,
45
MOVING
= 1,
46
STATIONARY
= 2,
47
MAX_LABEL
,
48
};
// enum class PointMotionLabel
49
50
// save semantic label in last four bits
51
inline
void
SetSemanticLabel
(
PointSemanticLabel
label, uint8_t* value) {
52
*value &= 240;
// 240: 11110000
53
*value |=
static_cast<
uint8_t
>
(label);
54
}
55
56
inline
PointSemanticLabel
GetSemanticLabel
(uint8_t value) {
57
return
static_cast<
PointSemanticLabel
>
(value & 15);
58
}
59
60
inline
bool
IsSemanticLabelEqual
(
PointSemanticLabel
label, uint8_t value) {
61
return
(value & 15) ==
static_cast<
uint8_t
>
(label);
62
}
63
64
// save motion label in first four bits
65
inline
void
SetMotionLabel
(
PointMotionLabel
label, uint8_t* value) {
66
*value &= 15;
// 15: 00001111
67
*value = (
static_cast<
uint8_t
>
(label) << 4) | (*value);
68
}
69
70
inline
PointMotionLabel
GetMotionLabel
(uint8_t value) {
71
return
static_cast<
PointMotionLabel
>
(value >> 4);
72
}
73
74
inline
bool
IsMotionLabelEqual
(
PointMotionLabel
label, uint8_t value) {
75
return
(value >> 4) ==
static_cast<
uint8_t
>
(label);
76
}
77
78
}
// namespace lidar
79
}
// namespace perception
80
}
// namespace apollo
apollo::perception::lidar::GetSemanticLabel
PointSemanticLabel GetSemanticLabel(uint8_t value)
Definition
lidar_point_label.h:56
apollo::perception::lidar::PointSemanticLabel
PointSemanticLabel
Definition
lidar_point_label.h:30
apollo::perception::lidar::PointSemanticLabel::NOISE
@ NOISE
apollo::perception::lidar::PointSemanticLabel::WALL
@ WALL
apollo::perception::lidar::PointSemanticLabel::FENCE
@ FENCE
apollo::perception::lidar::PointSemanticLabel::IGNORE
@ IGNORE
apollo::perception::lidar::PointSemanticLabel::CURB
@ CURB
apollo::perception::lidar::PointSemanticLabel::VEGETATION
@ VEGETATION
apollo::perception::lidar::IsMotionLabelEqual
bool IsMotionLabelEqual(PointMotionLabel label, uint8_t value)
Definition
lidar_point_label.h:74
apollo::perception::lidar::LidarPointLabel
LidarPointLabel
Definition
lidar_point_label.h:22
apollo::perception::lidar::LidarPointLabel::UNKNOWN
@ UNKNOWN
apollo::perception::lidar::LidarPointLabel::MAX_LABEL
@ MAX_LABEL
apollo::perception::lidar::LidarPointLabel::OBJECT
@ OBJECT
apollo::perception::lidar::LidarPointLabel::ROI
@ ROI
apollo::perception::lidar::LidarPointLabel::GROUND
@ GROUND
apollo::perception::lidar::IsSemanticLabelEqual
bool IsSemanticLabelEqual(PointSemanticLabel label, uint8_t value)
Definition
lidar_point_label.h:60
apollo::perception::lidar::SetMotionLabel
void SetMotionLabel(PointMotionLabel label, uint8_t *value)
Definition
lidar_point_label.h:65
apollo::perception::lidar::SetSemanticLabel
void SetSemanticLabel(PointSemanticLabel label, uint8_t *value)
Definition
lidar_point_label.h:51
apollo::perception::lidar::GetMotionLabel
PointMotionLabel GetMotionLabel(uint8_t value)
Definition
lidar_point_label.h:70
apollo::perception::lidar::PointMotionLabel
PointMotionLabel
Definition
lidar_point_label.h:43
apollo::perception::lidar::PointMotionLabel::STATIONARY
@ STATIONARY
apollo::perception::lidar::PointMotionLabel::MOVING
@ MOVING
apollo
class register implement
Definition
arena_queue.h:37
modules
perception
common
lidar
common
lidar_point_label.h