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

apollo::common 更多...

命名空间

namespace  adapter
 
namespace  color
 
namespace  math
 apollo::common::math
 
namespace  monitor
 apollo::common::monitor
 
namespace  util
 apollo::common::util
 

class  ClientWrapper
 Wrapper of cyber::Client which sends a topic with service name when SendRequst is invoked. 更多...
 
struct  ComCenteredDynamicBicycleModelConfig
 
class  DigitalFilter
 The DigitalFilter class is used to pass signals with a frequency lower than a certain cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency. 更多...
 
struct  DriveEvent
 
struct  EngageAdvice
 
struct  Extrinsics
 
struct  FrenetFramePoint
 
struct  GaussianInfo
 
struct  Header
 
class  KVDB
 Lightweight key-value database to store system-wide parameters. 更多...
 
struct  LatencyParam
 
struct  LatencyRecord
 
class  LatencyRecorder
 
struct  LatencyRecordMap
 
struct  LatencyReport
 
struct  LatencyStat
 
struct  LatencyTrack
 
class  MeanFilter
 The MeanFilter class is used to smoothen a series of noisy numbers, such as sensor data or the output of a function that we wish to be smoother. 更多...
 
struct  MlpModelConfig
 
struct  Path
 
struct  PathPoint
 
struct  Point2D
 
struct  Point3D
 
struct  PointENU
 
struct  PointLLH
 
struct  Polygon
 
struct  Quaternion
 
struct  RearCenteredKinematicBicycleModelConfig
 
struct  SLPoint
 
struct  SpeedPoint
 
class  Status
 A general class to denote the return status of an API call. 更多...
 
struct  StatusPb
 
struct  Trajectory
 
struct  TrajectoryPoint
 
struct  Transform
 
struct  VehicleConfig
 
class  VehicleConfigHelper
 @Brief This is a helper class that can load vehicle configurations. 更多...
 
struct  VehicleID
 
class  VehicleModel
 
struct  VehicleModelConfig
 
struct  VehicleMotion
 
struct  VehicleMotionPoint
 
struct  VehicleParam
 
struct  VehicleSignal
 
struct  VehicleState
 
class  VehicleStateProvider
 The class of vehicle state. 更多...
 

类型定义

using MF = MeanFilter
 
using uint8 = std::uint_fast8_t
 
using TimedValue = std::pair< uint8, double >
 
template<class EigenType >
using EigenVector = std::vector< EigenType, Eigen::aligned_allocator< EigenType > >
 
template<class EigenType >
using EigenDeque = std::deque< EigenType, Eigen::aligned_allocator< EigenType > >
 
template<typename T , class EigenType >
using EigenMap = std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > > >
 
template<typename T , class EigenType >
using EigenMultiMap = std::multimap< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > > >
 
using EigenVector3dVec = EigenVector< Eigen::Vector3d >
 
using EigenAffine3dVec = EigenVector< Eigen::Affine3d >
 

枚举

enum  Direction {
  EAST = 0 , WEST = 1 , SOUTH = 2 , NORTH = 3 ,
  NORTHEAST = 4 , SOUTHEAST = 5 , SOUTHWEST = 6 , NORTHWEST = 7
}
 
enum  ErrorCode {
  OK = 0 , CONTROL_ERROR = 1000 , CONTROL_INIT_ERROR = 1001 , CONTROL_COMPUTE_ERROR = 1002 ,
  CONTROL_ESTOP_ERROR = 1003 , PERFECT_CONTROL_ERROR = 1004 , CANBUS_ERROR = 2000 , CAN_CLIENT_ERROR_BASE = 2100 ,
  CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED = 2101 , CAN_CLIENT_ERROR_FRAME_NUM = 2102 , CAN_CLIENT_ERROR_SEND_FAILED = 2103 , CAN_CLIENT_ERROR_RECV_FAILED = 2104 ,
  LOCALIZATION_ERROR = 3000 , LOCALIZATION_ERROR_MSG = 3100 , LOCALIZATION_ERROR_LIDAR = 3200 , LOCALIZATION_ERROR_INTEG = 3300 ,
  LOCALIZATION_ERROR_GNSS = 3400 , PERCEPTION_ERROR = 4000 , PERCEPTION_ERROR_TF = 4001 , PERCEPTION_ERROR_PROCESS = 4002 ,
  PERCEPTION_FATAL = 4003 , PERCEPTION_ERROR_NONE = 4004 , PERCEPTION_ERROR_UNKNOWN = 4005 , PREDICTION_ERROR = 5000 ,
  PLANNING_ERROR = 6000 , PLANNING_ERROR_NOT_READY = 6001 , HDMAP_DATA_ERROR = 7000 , ROUTING_ERROR = 8000 ,
  ROUTING_ERROR_REQUEST = 8001 , ROUTING_ERROR_RESPONSE = 8002 , ROUTING_ERROR_NOT_READY = 8003 , END_OF_INPUT = 9000 ,
  HTTP_LOGIC_ERROR = 10000 , HTTP_RUNTIME_ERROR = 10001 , RELATIVE_MAP_ERROR = 11000 , RELATIVE_MAP_NOT_READY = 11001 ,
  DRIVER_ERROR_GNSS = 12000 , DRIVER_ERROR_VELODYNE = 13000 , STORYTELLING_ERROR = 14000
}
 
enum  VehicleBrand {
  LINCOLN_MKZ = 0 , GEM = 1 , LEXUS = 2 , TRANSIT = 3 ,
  GE3 = 4 , WEY = 5 , ZHONGYUN = 6 , CH = 7 ,
  DKIT = 8 , NEOLIX = 9
}
 

函数

void LpfCoefficients (const double ts, const double cutoff_freq, std::vector< double > *denominators, std::vector< double > *numerators)
 Get low-pass coefficients for digital filter.
 
void LpFirstOrderCoefficients (const double ts, const double settling_time, const double dead_time, std::vector< double > *denominators, std::vector< double > *numerators)
 Get first order low-pass coefficients for ZOH digital filter.
 
std::ostream & operator<< (std::ostream &os, const Status &s)
 

变量

const uint8 kMaxWindowSize = std::numeric_limits<uint8>::max() / 2
 

详细描述

apollo::common

The apollo::common namespace contains the code of the common module.

类型定义说明

◆ EigenAffine3dVec

using apollo::common::EigenAffine3dVec = typedef EigenVector<Eigen::Affine3d>

在文件 eigen_defs.h47 行定义.

◆ EigenDeque

template<class EigenType >
using apollo::common::EigenDeque = typedef std::deque<EigenType, Eigen::aligned_allocator<EigenType> >

在文件 eigen_defs.h36 行定义.

◆ EigenMap

template<typename T , class EigenType >
using apollo::common::EigenMap = typedef std::map<T, EigenType, std::less<T>, Eigen::aligned_allocator<std::pair<const T, EigenType> >>

在文件 eigen_defs.h39 行定义.

◆ EigenMultiMap

template<typename T , class EigenType >
using apollo::common::EigenMultiMap = typedef std::multimap<T, EigenType, std::less<T>, Eigen::aligned_allocator<std::pair<const T, EigenType> >>

在文件 eigen_defs.h43 行定义.

◆ EigenVector

template<class EigenType >
using apollo::common::EigenVector = typedef std::vector<EigenType, Eigen::aligned_allocator<EigenType> >

在文件 eigen_defs.h33 行定义.

◆ EigenVector3dVec

using apollo::common::EigenVector3dVec = typedef EigenVector<Eigen::Vector3d>

在文件 eigen_defs.h46 行定义.

◆ MF

using apollo::common::MF = typedef MeanFilter

在文件 mean_filter.cc26 行定义.

◆ TimedValue

using apollo::common::TimedValue = typedef std::pair<uint8, double>

在文件 mean_filter.cc28 行定义.

◆ uint8

using apollo::common::uint8 = typedef std::uint_fast8_t

在文件 mean_filter.cc27 行定义.

枚举类型说明

◆ Direction

枚举值
EAST 
WEST 
SOUTH 
NORTH 
NORTHEAST 
SOUTHEAST 
SOUTHWEST 
NORTHWEST 

在文件 direction.proto5 行定义.

◆ ErrorCode

枚举值
OK 
CONTROL_ERROR 
CONTROL_INIT_ERROR 
CONTROL_COMPUTE_ERROR 
CONTROL_ESTOP_ERROR 
PERFECT_CONTROL_ERROR 
CANBUS_ERROR 
CAN_CLIENT_ERROR_BASE 
CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED 
CAN_CLIENT_ERROR_FRAME_NUM 
CAN_CLIENT_ERROR_SEND_FAILED 
CAN_CLIENT_ERROR_RECV_FAILED 
LOCALIZATION_ERROR 
LOCALIZATION_ERROR_MSG 
LOCALIZATION_ERROR_LIDAR 
LOCALIZATION_ERROR_INTEG 
LOCALIZATION_ERROR_GNSS 
PERCEPTION_ERROR 
PERCEPTION_ERROR_TF 
PERCEPTION_ERROR_PROCESS 
PERCEPTION_FATAL 
PERCEPTION_ERROR_NONE 
PERCEPTION_ERROR_UNKNOWN 
PREDICTION_ERROR 
PLANNING_ERROR 
PLANNING_ERROR_NOT_READY 
HDMAP_DATA_ERROR 
ROUTING_ERROR 
ROUTING_ERROR_REQUEST 
ROUTING_ERROR_RESPONSE 
ROUTING_ERROR_NOT_READY 
END_OF_INPUT 
HTTP_LOGIC_ERROR 
HTTP_RUNTIME_ERROR 
RELATIVE_MAP_ERROR 
RELATIVE_MAP_NOT_READY 
DRIVER_ERROR_GNSS 
DRIVER_ERROR_VELODYNE 
STORYTELLING_ERROR 

在文件 error_code.proto6 行定义.

6 {
7 // No error, returns on success.
8 OK = 0;
9
10 // Control module error codes start from here.
11 CONTROL_ERROR = 1000;
12 CONTROL_INIT_ERROR = 1001;
16
17 // Canbus module error codes start from here.
18 CANBUS_ERROR = 2000;
24
25 // Localization module error codes start from here.
26 LOCALIZATION_ERROR = 3000;
31
32 // Perception module error codes start from here.
33 PERCEPTION_ERROR = 4000;
36 PERCEPTION_FATAL = 4003;
39
40 // Prediction module error codes start from here.
41 PREDICTION_ERROR = 5000;
42
43 // Planning module error codes start from here
44 PLANNING_ERROR = 6000;
46
47 // HDMap module error codes start from here
48 HDMAP_DATA_ERROR = 7000;
49
50 // Routing module error codes
51 ROUTING_ERROR = 8000;
55
56 // Indicates an input has been exhausted.
57 END_OF_INPUT = 9000;
58
59 // HTTP request error codes.
60 HTTP_LOGIC_ERROR = 10000;
61 HTTP_RUNTIME_ERROR = 10001;
62
63 // Relative Map error codes.
64 RELATIVE_MAP_ERROR = 11000; // general relative map error code
66
67 // Driver error codes.
68 DRIVER_ERROR_GNSS = 12000;
70
71 // Storytelling error codes.
72 STORYTELLING_ERROR = 14000;
73}
@ CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED

◆ VehicleBrand

枚举值
LINCOLN_MKZ 
GEM 
LEXUS 
TRANSIT 
GE3 
WEY 
ZHONGYUN 
CH 
DKIT 
NEOLIX 

在文件 vehicle_config.proto29 行定义.

函数说明

◆ LpfCoefficients()

void apollo::common::LpfCoefficients ( const double  ts,
const double  cutoff_freq,
std::vector< double > *  denominators,
std::vector< double > *  numerators 
)

Get low-pass coefficients for digital filter.

参数
tsTime interval between signals.
cutoff_freqCutoff of frequency to filter high-frequency signals out.
denominatorsDenominator coefficients for digital filter.
numeratorsNumerator coefficients for digital filter.

在文件 digital_filter_coefficients.cc27 行定义.

29 {
30 denominators->clear();
31 numerators->clear();
32 denominators->reserve(3);
33 numerators->reserve(3);
34
35 double wa = 2.0 * M_PI * cutoff_freq; // Analog frequency in rad/s
36 double alpha = wa * ts / 2.0; // tan(Wd/2), Wd is discrete frequency
37 double alpha_sqr = alpha * alpha;
38 double tmp_term = std::sqrt(2.0) * alpha + alpha_sqr;
39 double gain = alpha_sqr / (1.0 + tmp_term);
40
41 denominators->push_back(1.0);
42 denominators->push_back(2.0 * (alpha_sqr - 1.0) / (1.0 + tmp_term));
43 denominators->push_back((1.0 - std::sqrt(2.0) * alpha + alpha_sqr) /
44 (1.0 + tmp_term));
45
46 numerators->push_back(gain);
47 numerators->push_back(2.0 * gain);
48 numerators->push_back(gain);
49}

◆ LpFirstOrderCoefficients()

void apollo::common::LpFirstOrderCoefficients ( const double  ts,
const double  settling_time,
const double  dead_time,
std::vector< double > *  denominators,
std::vector< double > *  numerators 
)

Get first order low-pass coefficients for ZOH digital filter.

参数
tssampling time.
settlingtime: time required for an output to reach and remain within a given error band
deadtime: time delay
denominatorsDenominator coefficients for digital filter.
numeratorsNumerator coefficients for digital filter.

在文件 digital_filter_coefficients.cc51 行定义.

54 {
55 // sanity check
56 if (ts <= 0.0 || settling_time < 0.0 || dead_time < 0.0) {
57 AERROR << "time cannot be negative";
58 return;
59 }
60
61 const size_t k_d = static_cast<size_t>(dead_time / ts);
62 double a_term;
63
64 denominators->clear();
65 numerators->clear();
66 denominators->reserve(2);
67 numerators->reserve(k_d + 1); // size depends on dead-time
68
69 if (settling_time == 0.0) {
70 a_term = 0.0;
71 } else {
72 a_term = exp(-1 * ts / settling_time);
73 }
74
75 denominators->push_back(1.0);
76 denominators->push_back(-a_term);
77 numerators->insert(numerators->end(), k_d, 0.0);
78 numerators->push_back(1 - a_term);
79}
#define AERROR
Definition log.h:44

◆ operator<<()

std::ostream & apollo::common::operator<< ( std::ostream &  os,
const Status s 
)
inline

在文件 status.h124 行定义.

124 {
125 os << s.ToString();
126 return os;
127}
std::string ToString() const
returns a string representation in a readable format.
Definition status.h:98

变量说明

◆ kMaxWindowSize

const uint8 apollo::common::kMaxWindowSize = std::numeric_limits<uint8>::max() / 2

在文件 mean_filter.cc30 行定义.