Apollo 10.0
自动驾驶开放平台
apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE > 模板类 参考

#include <i_struct_s.h>

apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE > 的协作图:

Public 成员函数

 VoxelGridXYPyramid ()
 
 VoxelGridXYPyramid (unsigned int nr_scale, unsigned int nr_voxel_x_base, unsigned int nr_voxel_y_base, unsigned int dsf_x, unsigned int dsf_y, DATA_TYPE spatial_bound_x_min, DATA_TYPE spatial_bound_x_max, DATA_TYPE spatial_bound_y_min, DATA_TYPE spatial_bound_y_max, DATA_TYPE spatial_bound_z_min, DATA_TYPE spatial_bound_z_max)
 
void CleanUp ()
 
 ~VoxelGridXYPyramid ()
 
bool Alloc (unsigned int nr_scale, unsigned int nr_voxel_x_base, unsigned int nr_voxel_y_base, unsigned int dsf_x, unsigned int dsf_y, DATA_TYPE spatial_bound_x_min, DATA_TYPE spatial_bound_x_max, DATA_TYPE spatial_bound_y_min, DATA_TYPE spatial_bound_y_max, DATA_TYPE spatial_bound_z_min, DATA_TYPE spatial_bound_z_max)
 
bool Set (const DATA_TYPE *pc, unsigned int nr_points, unsigned int nr_point_element)
 
bool SetS (const float *pc, unsigned int nr_points, unsigned int nr_point_element)
 
bool Set (const DATA_TYPE *pc, unsigned int nr_scale, unsigned int nr_points, unsigned int nr_point_element, unsigned int nr_voxel_x_base, unsigned int nr_voxel_y_base, unsigned int dsf_x, unsigned int dsf_y, DATA_TYPE spatial_bound_x_min, DATA_TYPE spatial_bound_x_max, DATA_TYPE spatial_bound_y_min, DATA_TYPE spatial_bound_y_max, DATA_TYPE spatial_bound_z_min, DATA_TYPE spatial_bound_z_max)
 
unsigned int NrScale () const
 
unsigned int NrVoxel (unsigned int i=0) const
 
unsigned int NrVoxelX (unsigned int i=0) const
 
unsigned int NrVoxelY (unsigned int i=0) const
 
unsigned int NrVoxelZ (unsigned int i=0) const
 
unsigned int NrPoints (unsigned int scale) const
 
unsigned int NrPoints () const
 
unsigned int NrPointElement () const
 
bool Initialized () const
 
unsigned int GetDsfX () const
 
unsigned int GetDsfY () const
 
unsigned int GetDsfZ () const
 
VoxelGridXY< DATA_TYPE > & operator[] (unsigned int i)
 
const VoxelGridXY< DATA_TYPE > & operator[] (unsigned int i) const
 
VoxelGridXY< DATA_TYPE > & operator[] (int i)
 
const VoxelGridXY< DATA_TYPE > & operator[] (int i) const
 
const DATA_TYPE * ConstData () const
 
DATA_TYPE * Data ()
 

详细描述

template<typename DATA_TYPE>
class apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >

在文件 i_struct_s.h 第 1189 行定义.

构造及析构函数说明

◆ VoxelGridXYPyramid() [1/2]

template<typename DATA_TYPE >
apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::VoxelGridXYPyramid ( )

在文件 i_struct_s.h 第 1296 行定义.

1297 : pc_(nullptr),
1298 nr_points_(0),
1299 nr_point_element_(0),
1300 dsf_x_(0),
1301 dsf_y_(0),
1302 dsf_z_(0) {}

◆ VoxelGridXYPyramid() [2/2]

template<typename DATA_TYPE >
apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::VoxelGridXYPyramid ( unsigned int  nr_scale,
unsigned int  nr_voxel_x_base,
unsigned int  nr_voxel_y_base,
unsigned int  dsf_x,
unsigned int  dsf_y,
DATA_TYPE  spatial_bound_x_min,
DATA_TYPE  spatial_bound_x_max,
DATA_TYPE  spatial_bound_y_min,
DATA_TYPE  spatial_bound_y_max,
DATA_TYPE  spatial_bound_z_min,
DATA_TYPE  spatial_bound_z_max 
)
inline

在文件 i_struct_s.h 第 1192 行定义.

1199 {
1200 Alloc(nr_scale, nr_voxel_x_base, nr_voxel_y_base, dsf_x, dsf_y,
1201 spatial_bound_x_min, spatial_bound_x_max, spatial_bound_y_min,
1202 spatial_bound_y_max, spatial_bound_z_min, spatial_bound_z_max);
1203 }
bool Alloc(unsigned int nr_scale, unsigned int nr_voxel_x_base, unsigned int nr_voxel_y_base, unsigned int dsf_x, unsigned int dsf_y, DATA_TYPE spatial_bound_x_min, DATA_TYPE spatial_bound_x_max, DATA_TYPE spatial_bound_y_min, DATA_TYPE spatial_bound_y_max, DATA_TYPE spatial_bound_z_min, DATA_TYPE spatial_bound_z_max)

◆ ~VoxelGridXYPyramid()

template<typename DATA_TYPE >
apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::~VoxelGridXYPyramid ( )
inline

在文件 i_struct_s.h 第 1207 行定义.

成员函数说明

◆ Alloc()

template<typename DATA_TYPE >
bool apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::Alloc ( unsigned int  nr_scale,
unsigned int  nr_voxel_x_base,
unsigned int  nr_voxel_y_base,
unsigned int  dsf_x,
unsigned int  dsf_y,
DATA_TYPE  spatial_bound_x_min,
DATA_TYPE  spatial_bound_x_max,
DATA_TYPE  spatial_bound_y_min,
DATA_TYPE  spatial_bound_y_max,
DATA_TYPE  spatial_bound_z_min,
DATA_TYPE  spatial_bound_z_max 
)

在文件 i_struct_s.h 第 1305 行定义.

1310 {
1311 if (!nr_scale || !nr_voxel_x_base || !nr_voxel_y_base) {
1312 return false;
1313 }
1314
1315 unsigned int scale;
1316 unsigned int nr_voxel_x = nr_voxel_x_base;
1317 unsigned int nr_voxel_y = nr_voxel_y_base;
1318 unsigned int sf_x = (unsigned int)IPow((unsigned int)2, dsf_x);
1319 unsigned int sf_y = (unsigned int)IPow((unsigned int)2, dsf_y);
1320
1321 dsf_x_ = dsf_x;
1322 dsf_y_ = dsf_y;
1323 dsf_z_ = 0;
1324
1325 vgrids_.clear();
1326 vgrids_.resize(nr_scale);
1327
1328 for (scale = 0; scale < nr_scale; ++scale) {
1329 if (!vgrids_[scale].alloc(nr_voxel_x, nr_voxel_y, spatial_bound_x_min,
1330 spatial_bound_x_max, spatial_bound_y_min,
1331 spatial_bound_y_max, spatial_bound_z_min,
1332 spatial_bound_z_max)) {
1333 break;
1334 }
1335 nr_voxel_x /= sf_x;
1336 nr_voxel_y /= sf_y;
1337 }
1338
1339 if (scale == 0) {
1340 vgrids_.clear();
1341 return false;
1342 } else {
1343 if (scale != nr_scale) {
1344 vgrids_.resize(scale);
1345 }
1346 }
1347
1348 return (true);
1349}
float IPow(float a, float b)
Definition i_basic.h:142

◆ CleanUp()

template<typename DATA_TYPE >
void apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::CleanUp ( )

在文件 i_struct_s.h 第 1457 行定义.

1457 {
1458 pc_ = nullptr;
1459 vgrids_.clear();
1460 nr_points_ = nr_point_element_ = dsf_x_ = dsf_y_ = dsf_z_ = 0;
1461}

◆ ConstData()

template<typename DATA_TYPE >
const DATA_TYPE * apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::ConstData ( ) const
inline

在文件 i_struct_s.h 第 1284 行定义.

1284{ return pc_; }

◆ Data()

template<typename DATA_TYPE >
DATA_TYPE * apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::Data ( )
inline

在文件 i_struct_s.h 第 1286 行定义.

1286{ return pc_; }

◆ GetDsfX()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::GetDsfX ( ) const
inline

在文件 i_struct_s.h 第 1260 行定义.

1260{ return dsf_x_; }

◆ GetDsfY()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::GetDsfY ( ) const
inline

在文件 i_struct_s.h 第 1261 行定义.

1261{ return dsf_y_; }

◆ GetDsfZ()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::GetDsfZ ( ) const
inline

在文件 i_struct_s.h 第 1262 行定义.

1262{ return (0); }

◆ Initialized()

template<typename DATA_TYPE >
bool apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::Initialized ( ) const

在文件 i_struct_s.h 第 1464 行定义.

1464 {
1465 unsigned int i;
1466 if (vgrids_.empty()) {
1467 return false;
1468 }
1469 for (i = 0; i < vgrids_.size(); ++i) {
1470 if (!vgrids_[i].initialized()) {
1471 break;
1472 }
1473 }
1474 return (i == vgrids_.size());
1475}

◆ NrPointElement()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrPointElement ( ) const
inline

在文件 i_struct_s.h 第 1256 行定义.

1256{ return nr_point_element_; }

◆ NrPoints() [1/2]

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrPoints ( ) const
inline

在文件 i_struct_s.h 第 1254 行定义.

1254{ return nr_points_; }

◆ NrPoints() [2/2]

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrPoints ( unsigned int  scale) const
inline

在文件 i_struct_s.h 第 1250 行定义.

1250 {
1251 return (scale < vgrids_.size()) ? vgrids_[scale].nr_points() : 0;
1252 }

◆ NrScale()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrScale ( ) const
inline

在文件 i_struct_s.h 第 1232 行定义.

1232{ return (unsigned int)vgrids_.size(); }

◆ NrVoxel()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrVoxel ( unsigned int  i = 0) const
inline

在文件 i_struct_s.h 第 1234 行定义.

1234 {
1235 return (i < vgrids_.size()) ? vgrids_[i].nr_voxel() : 0;
1236 }

◆ NrVoxelX()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrVoxelX ( unsigned int  i = 0) const
inline

在文件 i_struct_s.h 第 1238 行定义.

1238 {
1239 return (i < vgrids_.size()) ? vgrids_[i].nr_voxel_x() : 0;
1240 }

◆ NrVoxelY()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrVoxelY ( unsigned int  i = 0) const
inline

在文件 i_struct_s.h 第 1242 行定义.

1242 {
1243 return (i < vgrids_.size()) ? vgrids_[i].nr_voxel_y() : 0;
1244 }

◆ NrVoxelZ()

template<typename DATA_TYPE >
unsigned int apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::NrVoxelZ ( unsigned int  i = 0) const
inline

在文件 i_struct_s.h 第 1246 行定义.

1246 {
1247 return (i < vgrids_.size()) ? vgrids_[i].nr_voxel_z() : 0;
1248 }

◆ operator[]() [1/4]

template<typename DATA_TYPE >
VoxelGridXY< DATA_TYPE > & apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::operator[] ( int  i)
inline

在文件 i_struct_s.h 第 1274 行定义.

1274 {
1275 assert(i >= 0 && i < static_cast<int>(vgrids_.size()));
1276 return vgrids_[i];
1277 }

◆ operator[]() [2/4]

template<typename DATA_TYPE >
const VoxelGridXY< DATA_TYPE > & apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::operator[] ( int  i) const
inline

在文件 i_struct_s.h 第 1279 行定义.

1279 {
1280 assert(i >= 0 && i < static_cast<int>(vgrids_.size()));
1281 return vgrids_[i];
1282 }

◆ operator[]() [3/4]

template<typename DATA_TYPE >
VoxelGridXY< DATA_TYPE > & apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::operator[] ( unsigned int  i)
inline

在文件 i_struct_s.h 第 1264 行定义.

1264 {
1265 assert(i >= 0 && i < vgrids_.size());
1266 return vgrids_[i];
1267 }

◆ operator[]() [4/4]

template<typename DATA_TYPE >
const VoxelGridXY< DATA_TYPE > & apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::operator[] ( unsigned int  i) const
inline

在文件 i_struct_s.h 第 1269 行定义.

1269 {
1270 assert(i >= 0 && i < vgrids_.size());
1271 return vgrids_[i];
1272 }

◆ Set() [1/2]

template<typename DATA_TYPE >
bool apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::Set ( const DATA_TYPE *  pc,
unsigned int  nr_points,
unsigned int  nr_point_element 
)

在文件 i_struct_s.h 第 1352 行定义.

1354 {
1355 if (!pc || !nr_points || !nr_point_element || vgrids_.empty()) {
1356 return false;
1357 }
1358
1359 unsigned int scale, nr_scale = (unsigned int)vgrids_.size();
1360
1361 pc_ = pc;
1362 nr_points_ = nr_points;
1363 nr_point_element_ = nr_point_element;
1364
1365 for (scale = 0; scale < nr_scale; ++scale) {
1366 if (!vgrids_[scale].set(pc, nr_points, nr_point_element)) {
1367 break;
1368 }
1369 }
1370
1371 // break in the middle - last (NrScale - s) grids are invalid
1372 if (scale < nr_scale) {
1373 vgrids_.resize(scale);
1374 }
1375
1376 return (vgrids_.size() == nr_scale);
1377}

◆ Set() [2/2]

template<typename DATA_TYPE >
bool apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::Set ( const DATA_TYPE *  pc,
unsigned int  nr_scale,
unsigned int  nr_points,
unsigned int  nr_point_element,
unsigned int  nr_voxel_x_base,
unsigned int  nr_voxel_y_base,
unsigned int  dsf_x,
unsigned int  dsf_y,
DATA_TYPE  spatial_bound_x_min,
DATA_TYPE  spatial_bound_x_max,
DATA_TYPE  spatial_bound_y_min,
DATA_TYPE  spatial_bound_y_max,
DATA_TYPE  spatial_bound_z_min,
DATA_TYPE  spatial_bound_z_max 
)

在文件 i_struct_s.h 第 1408 行定义.

1414 {
1415 if (!pc || !nr_scale || !nr_points || !nr_point_element || !nr_voxel_x_base ||
1416 !nr_voxel_y_base) {
1417 return false;
1418 }
1419
1420 unsigned int i, s;
1421 pc_ = pc;
1422 nr_points_ = nr_points;
1423 nr_point_element_ = nr_point_element;
1424
1425 dsf_x_ = dsf_x;
1426 dsf_y_ = dsf_y;
1427 dsf_z_ = 0;
1428
1429 vgrids_.clear();
1430 vgrids_.resize(nr_scale);
1431
1432 // Set the base level pyramid
1433 if (!vgrids_[0].set(pc_, nr_points, nr_point_element, nr_voxel_x_base,
1434 nr_voxel_y_base, spatial_bound_x_min, spatial_bound_x_max,
1435 spatial_bound_y_min, spatial_bound_y_max,
1436 spatial_bound_z_min, spatial_bound_z_max)) {
1437 vgrids_.clear();
1438 return false;
1439 }
1440
1441 for (s = 1; s < nr_scale; ++s) {
1442 if (!IDownsampleVoxelGridXY(vgrids_[s - 1], &vgrids_[s], dsf_x_, dsf_y_)) {
1443 break;
1444 }
1445 }
1446
1447 if (s < nr_scale) {
1448 for (i = 0; i < (nr_scale - s); ++i) {
1449 vgrids_.pop_back();
1450 }
1451 }
1452
1453 return (vgrids_.size() == nr_scale); // check if all scales are valid
1454}
bool IDownsampleVoxelGridXY(const VoxelGridXY< T > &src, VoxelGridXY< T > *dst, unsigned int dsf_dim_x, unsigned int dsf_dim_y)

◆ SetS()

template<typename DATA_TYPE >
bool apollo::perception::algorithm::VoxelGridXYPyramid< DATA_TYPE >::SetS ( const float *  pc,
unsigned int  nr_points,
unsigned int  nr_point_element 
)

在文件 i_struct_s.h 第 1380 行定义.

1382 {
1383 if (!pc || !nr_points || !nr_point_element || vgrids_.empty()) {
1384 return false;
1385 }
1386
1387 unsigned int scale, nr_scale = (unsigned int)vgrids_.size();
1388
1389 pc_ = pc;
1390 nr_points_ = nr_points;
1391 nr_point_element_ = nr_point_element;
1392
1393 for (scale = 0; scale < nr_scale; ++scale) {
1394 if (!vgrids_[scale].set_s(pc, nr_points, nr_point_element)) {
1395 break;
1396 }
1397 }
1398
1399 // break in the middle - last (NrScale - s) grids are invalid
1400 if (scale < nr_scale) {
1401 vgrids_.resize(scale);
1402 }
1403
1404 return (vgrids_.size() == nr_scale);
1405}

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