Apollo
11.0
自动驾驶开放平台
barrier_status_tracker.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
#include <deque>
19
#include <map>
20
#include <string>
21
#include <vector>
22
23
#include "
cyber/common/macros.h
"
24
#include "
modules/perception/common/lib/interface/base_init_options.h
"
25
26
namespace
apollo
{
27
namespace
perception {
28
namespace
lidar {
29
30
struct
StatusTrackerInitOptions
:
public
BaseInitOptions
{};
31
32
class
BarrierStatusTracker
{
33
public
:
34
BarrierStatusTracker
() =
default
;
35
virtual
~BarrierStatusTracker
() =
default
;
36
44
bool
Init
(
const
StatusTrackerInitOptions
& options =
StatusTrackerInitOptions
());
45
54
bool
Track
(
double
timestamp,
const
float
open_percent,
int
& status_id);
55
56
private
:
57
double
first_timestamp_ = 0.;
58
double
s_tracking_time_win_;
59
double
status_change_threshold_;
60
double
open_threshold_;
61
double
close_threshold_;
62
63
std::deque<std::pair<float, float>> prev_status_;
64
65
DISALLOW_COPY_AND_ASSIGN
(
BarrierStatusTracker
);
66
};
67
68
}
// namespace lidar
69
}
// namespace perception
70
}
// namespace apollo
base_init_options.h
apollo::perception::lidar::BarrierStatusTracker
Definition
barrier_status_tracker.h:32
apollo::perception::lidar::BarrierStatusTracker::Track
bool Track(double timestamp, const float open_percent, int &status_id)
Tracking status.
Definition
barrier_status_tracker.cc:44
apollo::perception::lidar::BarrierStatusTracker::BarrierStatusTracker
BarrierStatusTracker()=default
apollo::perception::lidar::BarrierStatusTracker::~BarrierStatusTracker
virtual ~BarrierStatusTracker()=default
apollo::perception::lidar::BarrierStatusTracker::Init
bool Init(const StatusTrackerInitOptions &options=StatusTrackerInitOptions())
Init BarrierStatusTracker config
Definition
barrier_status_tracker.cc:31
macros.h
DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition
macros.h:48
apollo
class register implement
Definition
arena_queue.h:37
apollo::perception::BaseInitOptions
Definition
base_init_options.h:23
apollo::perception::lidar::StatusTrackerInitOptions
Definition
barrier_status_tracker.h:30
modules
perception
barrier_recognition
tracker
barrier_status_tracker.h