Apollo 11.0
自动驾驶开放平台
storytelling.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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 *****************************************************************************/
17
20
21namespace apollo {
22namespace storytelling {
23
25 frame_manager_ = std::make_shared<FrameManager>(node_);
26 story_tellers_.emplace_back(new CloseToJunctionTeller(frame_manager_));
27
29 AERROR << "Unable to load storytelling conf file: "
31 return false;
32 }
33
34 story_writer_ =
35 node_->CreateWriter<Stories>(config_.topic_config().storytelling_topic());
36
37 // Init all tellers.
38 for (const auto& teller : story_tellers_) {
39 teller->Init(config_);
40 }
41
42 return true;
43}
44
46 frame_manager_->StartFrame();
47
48 // Query all tellers.
49 for (const auto& teller : story_tellers_) {
50 teller->Update(&stories_);
51 }
52
53 // Send stories.
54 apollo::common::util::FillHeader("Storytelling", &stories_);
55 story_writer_->Write(stories_);
56
57 frame_manager_->EndFrame();
58 return true;
59}
60
61} // namespace storytelling
62} // namespace apollo
bool GetProtoConfig(T *config) const
const std::string & ConfigFilePath() const
std::shared_ptr< Node > node_
bool Proc() override
The Proc logic of the component, which called by the CyberRT frame.
#define AERROR
Definition log.h:44
class register implement
Definition arena_queue.h:37