Apollo 10.0
自动驾驶开放平台
third_party_perception_base.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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
21#pragma once
22
23#include <memory>
24#include <mutex>
25#include <string>
26
27#include "cyber/node/node.h"
28#include "cyber/node/reader.h"
29#include "modules/common_msgs/chassis_msgs/chassis.pb.h"
31#include "modules/common_msgs/sensor_msgs/sensor_image.pb.h"
32#include "modules/common_msgs/localization_msgs/localization.pb.h"
33#include "modules/common_msgs/perception_msgs/perception_obstacle.pb.h"
35#include "modules/third_party_perception/proto/radar_obstacle.pb.h"
36
41namespace apollo {
42namespace third_party_perception {
43
45 public:
46 explicit ThirdPartyPerception(apollo::cyber::Node* const node);
48 virtual ~ThirdPartyPerception() = default;
49 std::string Name() const;
52 void Stop();
53
54 // Upon receiving localization data
55 void OnLocalization(
57 // Upon receiving chassis data
58 void OnChassis(const apollo::canbus::Chassis& message);
59 // publish perception obstacles when timer is triggered
60 virtual bool Process(apollo::perception::PerceptionObstacles* const response);
61
62 protected:
68 std::shared_ptr<apollo::cyber::Node> node_ = nullptr;
69 std::shared_ptr<
72 std::shared_ptr<apollo::cyber::Reader<apollo::canbus::Chassis>>
73 chassis_reader_ = nullptr;
74};
75
76} // namespace third_party_perception
77} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Node is the fundamental building block of Cyber RT.
Definition node.h:44
Reader subscribes a channel, it has two main functions:
Definition reader.h:69
std::shared_ptr< apollo::cyber::Reader< apollo::canbus::Chassis > > chassis_reader_
std::shared_ptr< apollo::cyber::Reader< apollo::localization::LocalizationEstimate > > localization_reader_
void OnChassis(const apollo::canbus::Chassis &message)
virtual bool Process(apollo::perception::PerceptionObstacles *const response)
apollo::localization::LocalizationEstimate localization_
void OnLocalization(const apollo::localization::LocalizationEstimate &message)
class register implement
Definition arena_queue.h:37