35namespace localization {
65 res.
x = this->x * (1 - scale) + loc_msg.
x * scale;
66 res.
y = this->y * (1 - scale) + loc_msg.
y * scale;
67 res.
z = this->z * (1 - scale) + loc_msg.
z * scale;
69 Eigen::Quaterniond quatd1(this->qw, this->qx, this->qy, this->qz);
70 Eigen::Quaterniond quatd2(loc_msg.
qw, loc_msg.
qx, loc_msg.
qy, loc_msg.
qz);
71 Eigen::Quaterniond res_quatd = quatd1.slerp(scale, quatd2);
72 res.
qx = res_quatd.x();
73 res.
qy = res_quatd.y();
74 res.
qz = res_quatd.z();
75 res.
qw = res_quatd.w();
77 res.
std_x = this->std_x * (1 - scale) + loc_msg.
std_x * scale;
78 res.
std_y = this->std_y * (1 - scale) + loc_msg.
std_y * scale;
79 res.
std_z = this->std_z * (1 - scale) + loc_msg.
std_z * scale;
85template <
class MessageType>
89 typename std::list<std::pair<double, MessageType>>::iterator
ListIterator;
95 bool PushNewMessage(
const double timestamp,
const MessageType &msg);
98 bool GetMessage(
const double timestamp, MessageType *msg);
103 void GetAllMessages(std::list<std::pair<double, MessageType>> *msg_list);
117template <
class MessageType>
121 typename std::list<std::pair<double, MessageType>>::iterator
ListIterator;
127 bool QueryMessage(
const double timestamp, MessageType *msg,
128 double timeout_s = 0.01);
131 bool WaitMessageBufferOk(
const double timestamp,
132 std::map<double, ListIterator> *msg_map,
133 std::list<std::pair<double, MessageType>> *msg_list,
138 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
150#define LOC_INFO_NUM 3
158 return visual_manage;
161 bool Init(
const std::string &map_folder,
const std::string &map_visual_folder,
162 const Eigen::Affine3d &velodyne_extrinsic,
175 bool GetZoneIdFromMapFolder(
const std::string &map_folder,
176 const unsigned int resolution_id,
int *zone_id);
181 std::thread visual_thread_;
182 std::atomic<bool> stop_visualization_;
bool QueryMessage(const double timestamp, MessageType *msg, double timeout_s=0.01)
std::list< std::pair< double, MessageType > >::iterator ListIterator
~IntepolationMessageBuffer()
bool GetMessageBefore(const double timestamp, MessageType *msg)
std::list< std::pair< double, MessageType > >::iterator ListIterator
bool PopOldestMessage(MessageType *msg)
pthread_mutex_t buffer_mutex_
bool GetMessage(const double timestamp, MessageType *msg)
void SetCapacity(const unsigned int capacity)
std::list< std::pair< double, MessageType > > msg_list_
void GetAllMessages(std::list< std::pair< double, MessageType > > *msg_list)
bool PushNewMessage(const double timestamp, const MessageType &msg)
std::map< double, ListIterator > msg_map_
unsigned int BufferSize()
The engine to draw all elements for visualization.
void StartVisualization()
void AddLidarLocMessage(const LocalizationMsg &lidar_loc_msg)
void AddFusionLocMessage(const LocalizationMsg &fusion_loc_msg)
static VisualizationManager & GetInstance()
void AddLidarFrame(const LidarVisFrame &lidar_frame)
bool Init(const std::string &map_folder, const std::string &map_visual_folder, const Eigen::Affine3d &velodyne_extrinsic, const VisualMapParam &map_param)
void AddGNSSLocMessage(const LocalizationMsg &gnss_loc_msg)
EigenVector< Eigen::Vector3d > EigenVector3dVec
unsigned int frame_id
The frame index.
::apollo::common::EigenVector3dVec pt3ds
The 3D point cloud in this frame.
double timestamp
The time stamp.
LocalizationMsg interpolate(const double scale, const LocalizationMsg &loc_msg)
The data structure to store parameters of a map
unsigned int fusion_loc_info_buffer_capacity
unsigned int lidar_loc_info_buffer_capacity
unsigned int lidar_frame_buffer_capacity
std::string map_visual_folder
Eigen::Affine3d velodyne_extrinsic
unsigned int gnss_loc_info_buffer_capacity
EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::string map_folder
The engine for localization visualization.