本文整理汇总了C++中StateVector::transpose方法的典型用法代码示例。如果您正苦于以下问题:C++ StateVector::transpose方法的具体用法?C++ StateVector::transpose怎么用?C++ StateVector::transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateVector
的用法示例。
在下文中一共展示了StateVector::transpose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: A
LQRController::UpdateGainsJob::UpdateGainsJob(LQRController * c, const StateMatrix & weights, const InputMatrix &input_weights, const StateVector & target)
: c_(c), target_(target)
{
if(!c)
return;
ROS_DEBUG_STREAM("target is "<<target.transpose());
const int n=weights.rows();
const int m=input_weights.rows();
input_offset_.resize(m,1);
gains_.resize(n,n);
//Computes a linearization around the target point
StateMatrix A(n,n);
InputMatrix B(n,m);
if(!c_->model_->getLinearization(target, A, B, input_offset_))
{
ROS_ERROR("Failed to get linearization");
c_=NULL;
return;
}
ROS_DEBUG_STREAM("************ Obtained linearization **********\n[A]\n"<<A<<std::endl<<"[B]"<<std::endl<<B<<std::endl<<"[input offset]"<<std::endl<<input_offset_<<"\n*************");
ROS_DEBUG("Sanity checks");
ROS_ASSERT(LQR::isCommandable(A,B));
// Compute new gains matrix
ROS_DEBUG("Computing LQR gains matrix. Hold on to your seatbelts...");
LQR::LQRDP<StateMatrix,InputMatrix,StateMatrix,InputMatrix>::runContinuous(A, B, weights, weights, input_weights, 0.01, 0.1, gains_);
ROS_DEBUG_STREAM("Done. Computed gains:\n***********\n"<<gains_<<"\n**********\n");
// Check validity
ROS_DEBUG("Checking gains matrix...");
bool test=LQR::isConverging(A,B,gains_);
ROS_ASSERT(test);
ROS_DEBUG("Valid gains matrix");
// assert(test);
}
示例2: CalculateNEES
double PerformanceEvaluator::CalculateNEES(SVref xEst,SCMref P,SVref xReal) {
StateVector x = xReal - xEst;
double NEES = x.transpose()*P.inverse()*x;
return NEES;
}