Apollo 10.0
自动驾驶开放平台
apollo::audio::DirectionDetection类 参考

#include <direction_detection.h>

apollo::audio::DirectionDetection 的协作图:

Public 成员函数

 DirectionDetection ()
 
 ~DirectionDetection ()
 
std::pair< Point3D, double > EstimateSoundSource (std::vector< std::vector< double > > &&channels_vec, const std::string &respeaker_extrinsic_file, const int sample_rate, const double mic_distance)
 

详细描述

在文件 direction_detection.h44 行定义.

构造及析构函数说明

◆ DirectionDetection()

apollo::audio::DirectionDetection::DirectionDetection ( )

在文件 direction_detection.cc36 行定义.

36{}

◆ ~DirectionDetection()

apollo::audio::DirectionDetection::~DirectionDetection ( )

在文件 direction_detection.cc38 行定义.

38{}

成员函数说明

◆ EstimateSoundSource()

std::pair< Point3D, double > apollo::audio::DirectionDetection::EstimateSoundSource ( std::vector< std::vector< double > > &&  channels_vec,
const std::string &  respeaker_extrinsic_file,
const int  sample_rate,
const double  mic_distance 
)

在文件 direction_detection.cc40 行定义.

43 {
44 if (!respeaker2imu_ptr_.get()) {
45 respeaker2imu_ptr_.reset(new Eigen::Matrix4d);
46 LoadExtrinsics(respeaker_extrinsic_file, respeaker2imu_ptr_.get());
47 }
48 double degree =
49 EstimateDirection(move(channels_vec), sample_rate, mic_distance);
50 Eigen::Vector4d source_position(kDistance * sin(degree),
51 kDistance * cos(degree), 0, 1);
52 source_position = (*respeaker2imu_ptr_) * source_position;
53
54 Point3D source_position_p3d;
55 source_position_p3d.set_x(source_position[0]);
56 source_position_p3d.set_y(source_position[1]);
57 source_position_p3d.set_z(source_position[2]);
58 degree = NormalizeAngle(degree);
59 return {source_position_p3d, degree};
60}
float cos(Angle16 a)
Definition angle.cc:42
float sin(Angle16 a)
Definition angle.cc:25
double NormalizeAngle(const double angle)
Normalize angle to [-PI, PI).
Definition math_utils.cc:53

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