Apollo 10.0
自动驾驶开放平台
apollo::control::PostprocessorSubmodule类 参考final

#include <postprocessor_submodule.h>

类 apollo::control::PostprocessorSubmodule 继承关系图:
apollo::control::PostprocessorSubmodule 的协作图:

Public 成员函数

std::string Name () const
 Get name of the node
 
bool Init () override
 Initialize the submodule
 
bool Proc (const std::shared_ptr< ControlCommand > &control_command) override
 
- Public 成员函数 继承自 apollo::cyber::Component< ControlCommand >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< ControlCommand > &msg0, const std::shared_ptr< NullType > &msg1, const std::shared_ptr< NullType > &msg2, const std::shared_ptr< NullType > &msg3)
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 postprocessor_submodule.h40 行定义.

成员函数说明

◆ Init()

bool apollo::control::PostprocessorSubmodule::Init ( )
overridevirtual

Initialize the submodule

返回
If initialized

实现了 apollo::cyber::ComponentBase.

在文件 postprocessor_submodule.cc42 行定义.

42 {
43 postprocessor_writer_ =
44 node_->CreateWriter<ControlCommand>(FLAGS_control_command_topic);
45 ACHECK(postprocessor_writer_ != nullptr);
46 return true;
47}
std::shared_ptr< Node > node_
#define ACHECK(cond)
Definition log.h:80

◆ Name()

std::string apollo::control::PostprocessorSubmodule::Name ( ) const

Get name of the node

返回
Name of the node

在文件 postprocessor_submodule.cc38 行定义.

38 {
39 return FLAGS_postprocessor_submodule_name;
40}

◆ Proc()

bool apollo::control::PostprocessorSubmodule::Proc ( const std::shared_ptr< ControlCommand > &  control_command)
override
参数
control_command
返回
true
false

在文件 postprocessor_submodule.cc49 行定义.

50 {
51 const auto start_time = Clock::Instance()->Now();
52 ControlCommand control_command;
53 // get all fields from control_core_command for now
54 control_command = *control_core_command;
55
56 // estop handling
57 if (control_core_command->header().status().error_code() != ErrorCode::OK) {
58 AWARN_EVERY(100) << "Estop triggered! No control core method executed!";
59 control_command.set_speed(0);
60 control_command.set_throttle(0);
61 control_command.set_brake(FLAGS_soft_estop_brake);
62 control_command.set_gear_location(Chassis::GEAR_DRIVE);
63 }
64
65 // set header
66 control_command.mutable_header()->set_lidar_timestamp(
67 control_core_command->header().lidar_timestamp());
68 control_command.mutable_header()->set_camera_timestamp(
69 control_core_command->header().camera_timestamp());
70 control_command.mutable_header()->set_radar_timestamp(
71 control_core_command->header().radar_timestamp());
72
73 common::util::FillHeader(Name(), &control_command);
74 const auto end_time = Clock::Instance()->Now();
75
76 // measure latency
77 static apollo::common::LatencyRecorder latency_recorder(
78 FLAGS_control_command_topic);
79 latency_recorder.AppendLatencyRecord(
80 control_command.header().lidar_timestamp(), start_time, end_time);
81
82 postprocessor_writer_->Write(control_command);
83
84 return true;
85}
std::string Name() const
Get name of the node
#define AWARN_EVERY(freq)
Definition log.h:84

该类的文档由以下文件生成: