Apollo 10.0
自动驾驶开放平台
apollo::perception::camera::CameraTrackingComponent类 参考

#include <camera_tracking_component.h>

类 apollo::perception::camera::CameraTrackingComponent 继承关系图:
apollo::perception::camera::CameraTrackingComponent 的协作图:

Public 成员函数

 CameraTrackingComponent ()=default
 
 ~CameraTrackingComponent ()=default
 
bool Init () override
 
bool Proc (const std::shared_ptr< onboard::CameraFrame > &message) override
 
- Public 成员函数 继承自 apollo::cyber::Component< onboard::CameraFrame >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< onboard::CameraFrame > &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_
 

详细描述

在文件 camera_tracking_component.h34 行定义.

构造及析构函数说明

◆ CameraTrackingComponent()

apollo::perception::camera::CameraTrackingComponent::CameraTrackingComponent ( )
default

◆ ~CameraTrackingComponent()

apollo::perception::camera::CameraTrackingComponent::~CameraTrackingComponent ( )
default

成员函数说明

◆ Init()

bool apollo::perception::camera::CameraTrackingComponent::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 camera_tracking_component.cc31 行定义.

31 {
32 CameraTrackingComponentConfig camera_tracking_component_config;
33 if (!GetProtoConfig(&camera_tracking_component_config)) {
34 return false;
35 }
36 AINFO << "Camera Tracking Component config: "
37 << camera_tracking_component_config.DebugString();
38 output_channel_name_ = camera_tracking_component_config.output_channel_name();
39 writer_ =
40 node_->CreateWriter<onboard::SensorFrameMessage>(output_channel_name_);
41
42 sensor_manager_ = algorithm::SensorManager::Instance();
43
44 PluginParam plugin_param = camera_tracking_component_config.plugin_param();
45 std::string tracker_name = plugin_param.name();
46 camera_obstacle_tracker_.reset(
47 BaseObstacleTrackerRegisterer::GetInstanceByName(tracker_name));
48 if (nullptr == camera_obstacle_tracker_) {
49 AERROR << "Failed to get camera obstacle tracker instance.";
50 return false;
51 }
52
53 ObstacleTrackerInitOptions tracker_init_options;
54 tracker_init_options.config_path = plugin_param.config_path();
55 tracker_init_options.config_file = plugin_param.config_file();
56 tracker_init_options.image_width =
57 camera_tracking_component_config.image_width();
58 tracker_init_options.image_height =
59 camera_tracking_component_config.image_height();
60 tracker_init_options.gpu_id = camera_tracking_component_config.gpu_id();
61 if (!camera_obstacle_tracker_->Init(tracker_init_options)) {
62 AERROR << "Failed to init camera obstacle tracker.";
63 return false;
64 }
65 return true;
66}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::perception::camera::CameraTrackingComponent::Proc ( const std::shared_ptr< onboard::CameraFrame > &  message)
override

在文件 camera_tracking_component.cc68 行定义.

69 {
71 AINFO << std::setprecision(16)
72 << "Enter Tracking component, message timestamp: " << message->timestamp
73 << " current timestamp: " << Clock::NowInSeconds();
74
75 auto out_message = std::make_shared<onboard::SensorFrameMessage>();
76 bool status = InternalProc(message, out_message);
77
78 if (status) {
79 writer_->Write(out_message);
80 AINFO << "Send camera tracking output message.";
81 }
82 return status;
83}
Set the behavior of the
Definition future.h:29
#define PERF_FUNCTION(...)
Definition profiler.h:54

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