Apollo 10.0
自动驾驶开放平台
apollo::v2x::OsInterFace类 参考

#include <os_interface.h>

apollo::v2x::OsInterFace 的协作图:

Public 成员函数

 OsInterFace ()
 
 ~OsInterFace ()
 
bool InitFlag ()
 
void GetLocalizationFromOs (const std::shared_ptr<::apollo::localization::LocalizationEstimate > &msg)
 
void GetPlanningAdcFromOs (const std::shared_ptr<::apollo::planning::ADCTrajectory > &msg)
 
void SendV2xObuTrafficLightToOs (const std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight > &msg)
 
void SendV2xTrafficLightToOs (const std::shared_ptr<::apollo::v2x::IntersectionTrafficLightData > &msg)
 
void SendV2xObstacles2Sys (const std::shared_ptr< apollo::v2x::V2XObstacles > &msg)
 
void SendV2xTrafficLight4Hmi2Sys (const std::shared_ptr<::apollo::perception::TrafficLightDetection > &msg)
 

详细描述

在文件 os_interface.h44 行定义.

构造及析构函数说明

◆ OsInterFace()

apollo::v2x::OsInterFace::OsInterFace ( )

在文件 os_interface.cc34 行定义.

35 : node_(::apollo::cyber::CreateNode("v2x_os_interface")),
36 init_flag_(false) {
37 init_flag_ = !!node_ && InitReaders() && InitWriters();
38}
std::unique_ptr< Node > CreateNode(const std::string &node_name, const std::string &name_space)
Definition cyber.cc:33

◆ ~OsInterFace()

apollo::v2x::OsInterFace::~OsInterFace ( )

在文件 os_interface.cc40 行定义.

40{}

成员函数说明

◆ GetLocalizationFromOs()

void apollo::v2x::OsInterFace::GetLocalizationFromOs ( const std::shared_ptr<::apollo::localization::LocalizationEstimate > &  msg)

在文件 os_interface.cc83 行定义.

84 {
85 AINFO << "get localization result from os";
86 std::lock_guard<std::mutex> lg(mutex_localization_);
87 msg->CopyFrom(current_localization_);
88}
#define AINFO
Definition log.h:42

◆ GetPlanningAdcFromOs()

void apollo::v2x::OsInterFace::GetPlanningAdcFromOs ( const std::shared_ptr<::apollo::planning::ADCTrajectory > &  msg)

在文件 os_interface.cc90 行定义.

91 {
92 AINFO << "get planning adc from os";
93 std::unique_lock<std::mutex> lg(mutex_planning_);
94 cond_planning_.wait(lg, [this]() { return flag_planning_new_; });
95 flag_planning_new_ = false;
96 msg->CopyFrom(adc_trajectory_msg_);
97}

◆ InitFlag()

bool apollo::v2x::OsInterFace::InitFlag ( )
inline

在文件 os_interface.h50 行定义.

50{ return init_flag_; }

◆ SendV2xObstacles2Sys()

void apollo::v2x::OsInterFace::SendV2xObstacles2Sys ( const std::shared_ptr< apollo::v2x::V2XObstacles > &  msg)

在文件 os_interface.cc109 行定义.

110 {
111 if (nullptr == msg) {
112 return;
113 }
114 AINFO << "send v2x obu traffic_light to os";
115 SendMsgToOs(v2x_obstacles_internal_writer_.get(), msg);
116 AINFO << "v2x obu traffic_light result: " << msg->DebugString();
117}

◆ SendV2xObuTrafficLightToOs()

void apollo::v2x::OsInterFace::SendV2xObuTrafficLightToOs ( const std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight > &  msg)

在文件 os_interface.cc99 行定义.

100 {
101 if (nullptr == msg) {
102 return;
103 }
104 AINFO << "send v2x obu traffic_light to os";
105 SendMsgToOs(v2x_obu_traffic_light_writer_.get(), msg);
106 AINFO << "v2x obu traffic_light result: " << msg->DebugString();
107}

◆ SendV2xTrafficLight4Hmi2Sys()

void apollo::v2x::OsInterFace::SendV2xTrafficLight4Hmi2Sys ( const std::shared_ptr<::apollo::perception::TrafficLightDetection > &  msg)

在文件 os_interface.cc129 行定义.

130 {
131 if (nullptr == msg) {
132 return;
133 }
134 AINFO << "send v2x tl4hmi to os";
135 SendMsgToOs(v2x_traffic_light_hmi_writer_.get(), msg);
136 AINFO << "v2x tl4hmi result: " << msg->DebugString();
137}

◆ SendV2xTrafficLightToOs()

void apollo::v2x::OsInterFace::SendV2xTrafficLightToOs ( const std::shared_ptr<::apollo::v2x::IntersectionTrafficLightData > &  msg)

在文件 os_interface.cc119 行定义.

120 {
121 if (nullptr == msg) {
122 return;
123 }
124 AINFO << "send v2x traffic_light to os";
125 SendMsgToOs(v2x_traffic_light_writer_.get(), msg);
126 AINFO << "v2x traffic_light result: " << msg->DebugString();
127}

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