本文整理汇总了C++中eigen::Matrix4d::cols方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::cols方法的具体用法?C++ Matrix4d::cols怎么用?C++ Matrix4d::cols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::cols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
// initialize ROS
ros::init(argc, argv, "find_grasps");
ros::NodeHandle node("~");
GraspLocalizer::Parameters params;
// camera transforms (poses)
Eigen::Matrix4d base_tf, sqrt_tf;
base_tf << 0, 0.445417, 0.895323, 0.215,
1, 0, 0, -0.015,
0, 0.895323, -0.445417, 0.23,
0, 0, 0, 1;
sqrt_tf << 0.9366, -0.0162, 0.3500, -0.2863,
0.0151, 0.9999, 0.0058, 0.0058,
-0.3501, -0.0002, 0.9367, 0.0554,
0, 0, 0, 1;
params.cam_tf_left_ = base_tf * sqrt_tf.inverse();
params.cam_tf_right_ = base_tf * sqrt_tf;
// read ROS parameters
std::string cloud_topic;
std::string cloud_frame;
std::string svm_file_name;
std::vector<double> workspace;
std::vector<double> camera_pose;
int cloud_type;
bool parallel;
node.param("parallel", parallel, true);
node.param("cloud_topic", cloud_topic, CLOUD_TOPIC);
node.param("cloud_frame", cloud_frame, CLOUD_FRAME);
node.param("cloud_type", cloud_type, CLOUD_TYPE);
node.param("svm_file_name", svm_file_name, SVM_FILE_NAME);
node.param("num_threads", params.num_threads_, NUM_THREADS);
node.param("num_samples", params.num_samples_, NUM_SAMPLES);
node.param("num_clouds", params.num_clouds_, NUM_CLOUDS);
if (parallel) {
double finger_width, hand_outer_diameter, hand_depth;
node.param("finger_width", finger_width, FINGER_WIDTH);
node.param("hand_outer_diameter", hand_outer_diameter, HAND_OUTER_DIAMETER);
node.param("hand_depth", hand_depth, HAND_DEPTH);
params.finger_hand_ = new ParallelHand(finger_width, hand_outer_diameter, hand_depth);
}
//TODO else
node.param("init_bite", params.init_bite_, INIT_BITE);
node.param("hand_height", params.hand_height_, HAND_HEIGHT);
node.param("min_inliers", params.min_inliers_, MIN_HANDLE_INLIERS);
node.getParam("workspace", workspace);
node.getParam("camera_pose", camera_pose);
node.param("plotting", params.plotting_mode_, 0);
node.param("marker_lifetime", params.marker_lifetime_, 0.0);
Eigen::Matrix4d R;
for (int i=0; i < R.rows(); i++)
R.row(i) << camera_pose[i*R.cols()], camera_pose[i*R.cols() + 1], camera_pose[i*R.cols() + 2], camera_pose[i*R.cols() + 3];
Eigen::VectorXd ws(6);
ws << workspace[0], workspace[1], workspace[2], workspace[3], workspace[4], workspace[5];
params.workspace_ = ws;
std::cout << "-- Parameters --\n";
std::cout << " Input\n";
std::cout << " cloud_topic: " << cloud_topic << "\n";
std::cout << " cloud_frame: " << cloud_frame << "\n";
std::cout << " cloud_type: " << CLOUD_TYPES[cloud_type] << "\n";
std::cout << " Hand Search\n";
std::cout << " workspace: " << ws.transpose() << "\n";
std::cout << " num_samples: " << params.num_samples_ << "\n";
std::cout << " num_threads: " << params.num_threads_ << "\n";
std::cout << " num_clouds: " << params.num_clouds_ << "\n";
std::cout << " camera pose:\n" << R << std::endl;
std::cout << " Robot Hand Model\n";
//TODO: Make FingerGrasp printable.
// std::cout << " finger_width: " << params.finger_width_ << "\n";
// std::cout << " hand_outer_diameter: " << params.hand_outer_diameter_ << "\n";
// std::cout << " hand_depth: " << params.finger_width_ << "\n";
// std::cout << " init_bite: " << params.finger_width_ << "\n";
// std::cout << " hand_height: " << params.finger_width_ << "\n";
std::cout << " Antipodal Grasps Prediction\n";
std::cout << " svm_file_name: " << svm_file_name << "\n";
std::cout << " Handle Search\n";
std::cout << " min_inliers: " << params.min_inliers_ << "\n";
std::cout << " Visualization\n";
std::cout << " plot_mode: " << PLOT_MODES[params.plotting_mode_] << "\n";
std::cout << " marker_lifetime: " << params.marker_lifetime_ << "\n";
GraspLocalizer loc(node, cloud_topic, cloud_frame, cloud_type, svm_file_name, params);
loc.localizeGrasps();
return 0;
}