Apollo 10.0
自动驾驶开放平台
apollo::cyber 命名空间参考

命名空间

namespace  base
 
namespace  benchmark
 
namespace  binary
 
namespace  blocker
 
namespace  class_loader
 
namespace  common
 
namespace  context
 
namespace  croutine
 
namespace  data
 
namespace  event
 
namespace  examples
 
namespace  io
 
namespace  logger
 
namespace  mainboard
 
namespace  message
 
namespace  plugin_manager
 
namespace  profiler
 
namespace  proto
 
namespace  record
 
namespace  scheduler
 
namespace  service_discovery
 
namespace  statistics
 
namespace  transport
 

class  ApolloRosConverter
 
class  ApolloRosMessageConverter
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  ApolloRosMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  BridgeArgument
 
struct  BridgeConf
 
class  Client
 Client get Response from a responding Service by sending a Request 更多...
 
class  ClientBase
 Base class of Client 更多...
 
class  Clock
 a singleton clock that can be used to get the current timestamp. 更多...
 
class  Component
 
class  Component< M0, M1, M2, NullType >
 
class  Component< M0, M1, NullType, NullType >
 
class  Component< M0, NullType, NullType, NullType >
 
class  Component< NullType, NullType, NullType, NullType >
 
class  ComponentBase
 
struct  ConverterConf
 
class  Duration
 
class  HeadingMsgFusion
 
class  ImuMsgConverter
 
struct  InputTypes
 
class  LidarPointcloud
 
class  LocalizationEstimate
 
class  MessageConverter
 
class  NavMsgConverter
 
class  Node
 Node is the fundamental building block of Cyber RT. 更多...
 
class  NodeChannelImpl
 The implementation for Node to create Objects connected by Channels. 更多...
 
class  NodeServiceImpl
 The implementation for Node to create Objects connected by Param. 更多...
 
class  NullType
 
class  OdometryMsgConverter
 
class  OdometryParser
 
struct  OutputTypes
 
class  Parameter
 A Parameter holds an apollo::cyber::proto::Param, It's more human-readable, you can use basic-value type and Protobuf values to construct a paramter. 更多...
 
class  ParameterClient
 Parameter Client is used to set/get/list parameter(s) by sending a request to ParameterServer 更多...
 
class  ParameterServer
 Parameter Service is a very important function of auto-driving. 更多...
 
struct  PluginDeclareInfo
 
class  PyChannelUtils
 
class  PyClient
 
class  PyDuration
 
class  PyNode
 
class  PyNodeUtils
 
class  PyParameter
 
class  PyParameterClient
 
class  PyParameterServer
 
class  PyRate
 
class  PyReader
 
class  PyService
 
class  PyServiceUtils
 
class  PyTime
 
class  PyTimer
 
class  PyWriter
 
class  Rate
 
class  Reader
 Reader subscribes a channel, it has two main functions: 更多...
 
class  ReaderBase
 Base Class for Reader Reader is identified by one apollo::cyber::proto::RoleAttribute, it contains the channel_name, channel_id that we subscribe, and host_name, process_id and node that we are located, and qos that describes our transportation quality. 更多...
 
struct  ReaderConfig
 
class  ReceiverManager
 One Channel is related to one Receiver. 更多...
 
class  RosApolloConverter
 
class  RosApolloMessageConverter
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 > > >
 
class  RosApolloMessageConverter< InputTypes< std::shared_ptr< InType0 >, std::shared_ptr< InType1 >, std::shared_ptr< InType2 >, std::shared_ptr< InType3 > >, OutputTypes< std::shared_ptr< OutType0 >, std::shared_ptr< OutType1 >, std::shared_ptr< OutType2 >, std::shared_ptr< OutType3 > > >
 
class  Service
 Service handles Request from the Client, and send a Response to it. 更多...
 
class  ServiceBase
 Base class for Service 更多...
 
class  SysMo
 
class  TaskManager
 
class  Time
 Cyber has builtin time type Time. 更多...
 
class  Timer
 Used to perform oneshot or periodic timing tasks 更多...
 
class  TimerBucket
 
class  TimerComponent
 
struct  TimerOption
 The options of timer 更多...
 
struct  TimerTask
 
class  TimingWheel
 
class  Writer
 
class  WriterBase
 Base class for a Writer. 更多...
 

类型定义

template<typename M0 >
using CallbackFunc = std::function< void(const std::shared_ptr< M0 > &)>
 
using PyMsgWrapPtr = std::shared_ptr< message::PyMessageWrap >
 
using GlobalData = ::apollo::cyber::common::GlobalData
 
using AtomicRWLock = ::apollo::cyber::base::AtomicRWLock
 
using AtomicWriteLockGuard = ::apollo::cyber::base::WriteLockGuard< AtomicRWLock >
 
using AtomicReadLockGuard = ::apollo::cyber::base::ReadLockGuard< AtomicRWLock >
 

枚举

enum  ReturnCode { SUCC = 0 , FAIL = 1 }
 
enum  Relation : std::uint8_t { NO_RELATION = 0 , DIFF_HOST , DIFF_PROC , SAME_PROC }
 Describe relation between nodes, writers/readers... 更多...
 
enum  State : std::uint8_t { STATE_UNINITIALIZED = 0 , STATE_INITIALIZED , STATE_SHUTTING_DOWN , STATE_SHUTDOWN }
 

函数

std::unique_ptr< NodeCreateNode (const std::string &node_name, const std::string &name_space)
 
void OnShutdown (int sig)
 
void ExitHandle ()
 
bool Init (const char *binary_name, const std::string &dag_info)
 
void Clear ()
 
bool py_init (const std::string &module_name)
 
bool py_ok ()
 
void py_shutdown ()
 
bool py_is_shutdown ()
 
void py_waitforshutdown ()
 
 DEFINE_string (bridge_conf_path, "ros_bridge/conf/ros_bridge_conf.pb.txt", "ros config file path")
 
 DECLARE_string (bridge_conf_path)
 
std::string GetFullConverterClassName (const std::string &class_name)
 
void QuaternionToEuler (const double quaternion[4], double att[3])
 
double QuaternionToHeading (double yaw)
 
State GetState ()
 
void SetState (const State &state)
 
bool OK ()
 
bool IsShutdown ()
 
void WaitForShutdown ()
 
void AsyncShutdown ()
 
std::ostream & operator<< (std::ostream &os, const Duration &rhs)
 
std::ostream & operator<< (std::ostream &os, const Time &rhs)
 

变量

const uint32_t DEFAULT_PENDING_QUEUE_SIZE = 1
 
constexpr auto SERVICE_NAME_DELIMITER = "/"
 
constexpr auto GET_PARAMETER_SERVICE_NAME = "get_parameter"
 
constexpr auto SET_PARAMETER_SERVICE_NAME = "set_parameter"
 
constexpr auto LIST_PARAMETERS_SERVICE_NAME = "list_parameters"
 
const char RAWDATATYPE [] = "RawData"
 

类型定义说明

◆ AtomicReadLockGuard

◆ AtomicRWLock

◆ AtomicWriteLockGuard

◆ CallbackFunc

template<typename M0 >
using apollo::cyber::CallbackFunc = typedef std::function<void(const std::shared_ptr<M0>&)>

在文件 reader.h46 行定义.

◆ GlobalData

◆ PyMsgWrapPtr

using apollo::cyber::PyMsgWrapPtr = typedef std::shared_ptr<message::PyMessageWrap>

在文件 py_cyber.h187 行定义.

枚举类型说明

◆ Relation

enum apollo::cyber::Relation : std::uint8_t

Describe relation between nodes, writers/readers...

枚举值
NO_RELATION 
DIFF_HOST 
DIFF_PROC 
SAME_PROC 

在文件 types.h36 行定义.

36 : std::uint8_t {
37 NO_RELATION = 0,
38 DIFF_HOST, // different host
39 DIFF_PROC, // same host, but different process
40 SAME_PROC, // same process
41};
@ NO_RELATION
Definition types.h:37

◆ ReturnCode

枚举值
SUCC 
FAIL 

在文件 types.h28 行定义.

28 {
29 SUCC = 0,
30 FAIL = 1,
31};

◆ State

enum apollo::cyber::State : std::uint8_t
枚举值
STATE_UNINITIALIZED 
STATE_INITIALIZED 
STATE_SHUTTING_DOWN 
STATE_SHUTDOWN 

在文件 state.h34 行定义.

34 : std::uint8_t {
39};
@ STATE_INITIALIZED
Definition state.h:36
@ STATE_SHUTDOWN
Definition state.h:38
@ STATE_SHUTTING_DOWN
Definition state.h:37
@ STATE_UNINITIALIZED
Definition state.h:35

函数说明

◆ AsyncShutdown()

void apollo::cyber::AsyncShutdown ( )
inline

在文件 state.h56 行定义.

56 {
57 pid_t pid = getpid();
58 if (kill(pid, SIGINT) != 0) {
59 AERROR << strerror(errno);
60 }
61}
#define AERROR
Definition log.h:44

◆ Clear()

void apollo::cyber::Clear ( )

在文件 init.cc161 行定义.

161 {
162 std::lock_guard<std::mutex> lg(g_mutex);
163 if (GetState() == STATE_SHUTDOWN || GetState() == STATE_UNINITIALIZED) {
164 return;
165 }
166 SysMo::CleanUp();
167 TaskManager::CleanUp();
168 TimingWheel::CleanUp();
169 scheduler::CleanUp();
170 service_discovery::TopologyManager::CleanUp();
171 transport::Transport::CleanUp();
172 StopLogger();
173 SetState(STATE_SHUTDOWN);
174}
State GetState()
Definition state.cc:28

◆ CreateNode()

std::unique_ptr< Node > apollo::cyber::CreateNode ( const std::string &  node_name,
const std::string &  name_space 
)

在文件 cyber.cc33 行定义.

34 {
35 bool is_reality_mode = GlobalData::Instance()->IsRealityMode();
36 if (is_reality_mode && !OK()) {
37 // add some hint log
38 AERROR << "please initialize cyber firstly.";
39 return nullptr;
40 }
41 return std::unique_ptr<Node>(new Node(node_name, name_space));
42}
Definition node.h:31

◆ DECLARE_string()

apollo::cyber::DECLARE_string ( bridge_conf_path  )

◆ DEFINE_string()

apollo::cyber::DEFINE_string ( bridge_conf_path  ,
"ros_bridge/conf/ros_bridge_conf.pb.txt"  ,
"ros config file path"   
)

◆ ExitHandle()

void apollo::cyber::ExitHandle ( )

在文件 init.cc96 行定义.

96{ Clear(); }
void Clear()
Definition init.cc:161

◆ GetFullConverterClassName()

std::string apollo::cyber::GetFullConverterClassName ( const std::string &  class_name)

在文件 utils.h24 行定义.

24 {
25 static const std::string kNameSpace = "apollo::cyber::";
26 // If the class name already has namespace in it, do nothing.
27 if (class_name.find("::") != std::string::npos) {
28 return class_name;
29 }
30 return kNameSpace + class_name;
31}

◆ GetState()

State apollo::cyber::GetState ( )

在文件 state.cc28 行定义.

28{ return g_cyber_state.load(); }

◆ Init()

bool apollo::cyber::Init ( const char *  binary_name,
const std::string &  dag_info 
)

在文件 init.cc98 行定义.

98 {
99 const char* apollo_runtime_path = std::getenv("APOLLO_RUNTIME_PATH");
100 if (apollo_runtime_path != nullptr) {
101 if (std::filesystem::is_directory(
102 std::filesystem::status(apollo_runtime_path))) {
103 std::filesystem::current_path(apollo_runtime_path);
104 }
105 }
106
107 std::lock_guard<std::mutex> lg(g_mutex);
108 if (GetState() != STATE_UNINITIALIZED) {
109 return false;
110 }
111
112 InitLogger(binary_name);
113 auto thread = const_cast<std::thread*>(async_logger->LogThread());
114 scheduler::Instance()->SetInnerThreadAttr("async_log", thread);
115 SysMo::Instance();
116 std::signal(SIGINT, OnShutdown);
117 // Register exit handlers
118 if (!g_atexit_registered) {
119 if (std::atexit(ExitHandle) != 0) {
120 AERROR << "Register exit handle failed";
121 return false;
122 }
123 AINFO << "Register exit handle succ.";
124 g_atexit_registered = true;
125 }
126 SetState(STATE_INITIALIZED);
127
128 auto global_data = GlobalData::Instance();
129 if (global_data->IsMockTimeMode()) {
130 auto node_name = kClockNode + std::to_string(getpid());
131 clock_node = std::unique_ptr<Node>(new Node(node_name));
132 auto cb =
133 [](const std::shared_ptr<const apollo::cyber::proto::Clock>& msg) {
134 if (msg->has_clock()) {
135 Clock::Instance()->SetNow(Time(msg->clock()));
136 }
137 };
138 clock_node->CreateReader<apollo::cyber::proto::Clock>(kClockChannel, cb);
139 }
140
141 if (dag_info != "") {
142 std::string dump_path;
143 if (dag_info.length() > 200) {
144 std::string truncated = dag_info.substr(0, 200);
145 dump_path = common::GetEnv("APOLLO_ENV_WORKROOT", "/apollo") + "/dumps/" +
146 truncated;
147 } else {
148 dump_path = common::GetEnv("APOLLO_ENV_WORKROOT", "/apollo") + "/dumps/" +
149 dag_info;
150 }
151 google::SetCommandLineOption("bvar_dump_file", dump_path.c_str());
152 } else {
153 statistics::Statistics::Instance()->DisableChanVar();
154 }
155 google::SetCommandLineOption("bvar_dump_exclude", "*qps");
156 google::SetCommandLineOption("bvar_dump", "true");
157
158 return true;
159}
#define AINFO
Definition log.h:42
void SetState(const State &state)
Definition state.cc:30
::apollo::cyber::Time Time

◆ IsShutdown()

bool apollo::cyber::IsShutdown ( )
inline

在文件 state.h46 行定义.

46 {
48}

◆ OK()

bool apollo::cyber::OK ( )
inline

在文件 state.h44 行定义.

44{ return GetState() == STATE_INITIALIZED; }

◆ OnShutdown()

void apollo::cyber::OnShutdown ( int  sig)

在文件 init.cc89 行定义.

89 {
90 (void)sig;
91 if (GetState() != STATE_SHUTDOWN) {
92 SetState(STATE_SHUTTING_DOWN);
93 }
94}

◆ operator<<() [1/2]

std::ostream & apollo::cyber::operator<< ( std::ostream &  os,
const Duration rhs 
)

在文件 duration.cc114 行定义.

114 {
115 std::ios::fmtflags before(os.flags());
116 os << std::fixed << std::setprecision(9) << rhs.ToSecond() << "s";
117 os.flags(before);
118 return os;
119}
double ToSecond() const
Definition duration.cc:48

◆ operator<<() [2/2]

std::ostream & apollo::cyber::operator<< ( std::ostream &  os,
const Time rhs 
)

在文件 time.cc164 行定义.

164 {
165 os << rhs.ToString();
166 return os;
167}
std::string ToString() const
convert time to a string.
Definition time.cc:89

◆ py_init()

bool apollo::cyber::py_init ( const std::string &  module_name)
inline

在文件 py_cyber.h47 行定义.

47 {
48 static bool inited = false;
49 if (inited) {
50 AINFO << "cyber already inited.";
51 return true;
52 }
53
54 if (!Init(module_name.c_str())) {
55 AERROR << "cyber::Init failed:" << module_name;
56 return false;
57 }
58 inited = true;
59 AINFO << "cyber init succ.";
60 return true;
61}

◆ py_is_shutdown()

bool apollo::cyber::py_is_shutdown ( )
inline

在文件 py_cyber.h67 行定义.

67{ return IsShutdown(); }
bool IsShutdown()
Definition state.h:46

◆ py_ok()

bool apollo::cyber::py_ok ( )
inline

在文件 py_cyber.h63 行定义.

63{ return OK(); }

◆ py_shutdown()

void apollo::cyber::py_shutdown ( )
inline

在文件 py_cyber.h65 行定义.

65{ return Clear(); }

◆ py_waitforshutdown()

void apollo::cyber::py_waitforshutdown ( )
inline

在文件 py_cyber.h69 行定义.

69{ return WaitForShutdown(); }
void WaitForShutdown()
Definition state.h:50

◆ QuaternionToEuler()

void apollo::cyber::QuaternionToEuler ( const double  quaternion[4],
double  att[3] 
)
inline

在文件 quaternion_math.h22 行定义.

22 {
23 double dcm21 =
24 2 * (quaternion[2] * quaternion[3] + quaternion[0] * quaternion[1]);
25 double dcm20 =
26 2 * (quaternion[1] * quaternion[3] - quaternion[0] * quaternion[2]);
27 double dcm22 = quaternion[0] * quaternion[0] - quaternion[1] * quaternion[1] -
28 quaternion[2] * quaternion[2] + quaternion[3] * quaternion[3];
29 double dcm01 =
30 2 * (quaternion[1] * quaternion[2] - quaternion[0] * quaternion[3]);
31 double dcm11 = quaternion[0] * quaternion[0] - quaternion[1] * quaternion[1] +
32 quaternion[2] * quaternion[2] - quaternion[3] * quaternion[3];
33
34 att[0] = std::asin(dcm21); // the angle rotate respect to X
35 att[1] = std::atan2(-dcm20, dcm22); // the angle rotate respect to Y
36 att[2] = std::atan2(dcm01, dcm11); // the angle rotate respect to Z
37
38 return;
39}

◆ QuaternionToHeading()

double apollo::cyber::QuaternionToHeading ( double  yaw)
inline

在文件 quaternion_math.h41 行定义.

41 {
42 double a = std::fmod(yaw + M_PI_2 + M_PI, 2.0 * M_PI);
43 if (a < 0.0) {
44 a += (2.0 * M_PI);
45 }
46 return a - M_PI;
47}

◆ SetState()

void apollo::cyber::SetState ( const State state)

在文件 state.cc30 行定义.

30{ g_cyber_state.store(state); }

◆ WaitForShutdown()

void apollo::cyber::WaitForShutdown ( )
inline

在文件 state.h50 行定义.

50 {
51 while (!IsShutdown()) {
52 std::this_thread::sleep_for(std::chrono::milliseconds(200));
53 }
54}

变量说明

◆ DEFAULT_PENDING_QUEUE_SIZE

const uint32_t apollo::cyber::DEFAULT_PENDING_QUEUE_SIZE = 1

在文件 reader.h50 行定义.

◆ GET_PARAMETER_SERVICE_NAME

constexpr auto apollo::cyber::GET_PARAMETER_SERVICE_NAME = "get_parameter"
constexpr

在文件 parameter_service_names.h26 行定义.

◆ LIST_PARAMETERS_SERVICE_NAME

constexpr auto apollo::cyber::LIST_PARAMETERS_SERVICE_NAME = "list_parameters"
constexpr

在文件 parameter_service_names.h28 行定义.

◆ RAWDATATYPE

const char apollo::cyber::RAWDATATYPE[] = "RawData"

在文件 py_cyber.h109 行定义.

◆ SERVICE_NAME_DELIMITER

constexpr auto apollo::cyber::SERVICE_NAME_DELIMITER = "/"
constexpr

在文件 parameter_service_names.h25 行定义.

◆ SET_PARAMETER_SERVICE_NAME

constexpr auto apollo::cyber::SET_PARAMETER_SERVICE_NAME = "set_parameter"
constexpr

在文件 parameter_service_names.h27 行定义.