当前位置: 首页>>代码示例>>C++>>正文


C++ PointCloudPtr::end方法代码示例

本文整理汇总了C++中PointCloudPtr::end方法的典型用法代码示例。如果您正苦于以下问题:C++ PointCloudPtr::end方法的具体用法?C++ PointCloudPtr::end怎么用?C++ PointCloudPtr::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PointCloudPtr的用法示例。


在下文中一共展示了PointCloudPtr::end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printf

bool SQ_fitter_b<PointT>::minimize( const int &_type, 
				    const PointCloudPtr &_cloud,
				    const SQ_parameters &_in,
				    SQ_parameters &_out,
				    double &_error ) {
    
    // Parameters initially _in:
    _out = _in; 

    // Set necessary parameters
    int n = _cloud->points.size();
    int m = 13; 
    double p[m]; // Parameters of SQ
    double y[n]; // Values we want to achieve

    double opts[LM_OPTS_SZ];
    double info[LM_INFO_SZ];
    
    opts[0] = LM_INIT_MU;
    opts[1] = 1E-15;
    opts[2] = 1E-15;
    opts[3] = 1E-20;
    opts[4] = LM_DIFF_DELTA;

    struct levmar_data data;
    data.x = new double[n];
    data.y = new double[n];
    data.z = new double[n];
    data.num = n;


    int i; int ret;
    typename pcl::PointCloud<PointT>::iterator pit;
    for( pit = _cloud->begin(), i = 0; pit != _cloud->end(); ++pit, ++i ) {
      data.x[i] = (*pit).x;
      data.y[i] = (*pit).y;
      data.z[i] = (*pit).z;
    }

    // Set minimizer value to zero (could be 1, depending of what equation you are minimizing)
    for( i = 0; i < n; ++i ) { y[i] = 0.0; }
  
    // Initialize values for parameters p
    for( i = 0; i < 3; ++i ) { p[i] = _in.dim[i]; }
    for( i = 0; i < 2; ++i ) { p[i+3] = _in.e[i]; }
    for( i = 0; i < 3; ++i ) { p[i+5] = _in.trans[i]; }
    for( i = 0; i < 3; ++i ) { p[i+8] = _in.rot[i]; }
    p[11] = _in.alpha;
    p[12] = _in.k;

    printf("Initial p: %f %f %f %f %f %f %f %f %f %f %f alpha: %f k: %f \n",
	   p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12] );

    
    // Set limits
    double ub[m], lb[m];
    for( i = 0; i < 3; ++i ) { lb[i] = this->mLowerLim_dim[i]; ub[i] = this->mUpperLim_dim[i]; }
    for( i = 0; i < 2; ++i ) { lb[i+3] = this->mLowerLim_e; ub[i+3] = this->mUpperLim_e; }
    for( i = 0; i < 3; ++i ) { lb[i+5] = this->mLowerLim_trans[i]; ub[i+5] = this->mUpperLim_trans[i]; }
    for( i = 0; i < 3; ++i ) { lb[i+8] = this->mLowerLim_rot[i]; ub[i+8] = this->mUpperLim_rot[i]; }
    lb[11] = mLowerLim_alpha; ub[11] = mUpperLim_alpha;
    lb[12] = mLowerLim_k; ub[12] = mUpperLim_k;


    switch( _type ) {
    case SQ_FX_RADIAL: {
      ret = dlevmar_bc_der( fr_add_b,
			    Jr_add_b,
			    p, y, m, n,
			    lb, ub,
			    NULL,
			    5000,
			    opts, info,
			    NULL, NULL, (void*)&data );
 
    } break;

    case SQ_FX_ICHIM: {
      
      ret = dlevmar_bc_der( fi_add_b,
			    Ji_add_b,
			    p, y, m, n,
			    lb, ub,
			    NULL,
			    1000,
			    opts, info,
			    NULL, NULL, (void*)&data );
    } break;
      
    case SQ_FX_SOLINA: {
      
      ret = dlevmar_bc_der( fs_add_b,
			    Js_add_b,
			    p, y, m, n,
			    lb, ub,
			    NULL,
			    1000,
			    opts, info,
			    NULL, NULL, (void*)&data );
    } break;
//.........这里部分代码省略.........
开发者ID:ana-GT,项目名称:golems,代码行数:101,代码来源:SQ_fitter_b.hpp


注:本文中的PointCloudPtr::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。