本文整理汇总了C++中eigen::Matrix3f::cols方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3f::cols方法的具体用法?C++ Matrix3f::cols怎么用?C++ Matrix3f::cols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Matrix3f
的用法示例。
在下文中一共展示了Matrix3f::cols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]) {
gengetopt_args_info args;
cmdline_parser(argc,argv,&args);
ros::init(argc, argv, "localizer");
geometry_msgs::PoseWithCovariance msg;
Localizer localizer;
localizer.setConeRadii(args.coneRadii_arg);
float alphas = 0.01;
localizer.setAlpha(alphas);
localizer.setUpdateRate(updateFreq);
ros::NodeHandle n;
ros::Publisher posWCov = n.advertise<geometry_msgs::PoseWithCovariance>("/pos", 1);
ros::Subscriber cntrl = n.subscribe("/cmd_vel_mux/input/navi", 1000, &Localizer::cmdUpdate, &localizer); // update the command velocities
//ros::Subscriber cntrl = n.subscribe("/odom", 1000, &Localizer::cmdUpdate, &localizer);
ros::Subscriber beams = n.subscribe("/scan", 1000, &Localizer::handleScans, &localizer);
ros::Rate loop_rate(updateFreq);
while (ros::ok()) {
if (localizer.scans.size() != 0) {
localizer.findFeature();
localizer.EKF();
}
msg.pose.position.x = localizer.getx();
msg.pose.position.y = localizer.gety();
msg.pose.orientation.x = localizer.getQuatx();
msg.pose.orientation.y = localizer.getQuaty();
msg.pose.orientation.z = localizer.getQuatz();
msg.pose.orientation.w = localizer.getQuatw();
Eigen::Matrix3f Covariance = localizer.getSigma();
int index = 0;
for (int i = 0; i < Covariance.rows(); i++) {
for (int k = 0; k < Covariance.cols(); k++) {
msg.covariance[index] = Covariance(i,k);
index++;
}
}
ros::spinOnce();
posWCov.publish(msg);
loop_rate.sleep();
}
return 0;
}