本文整理汇总了C++中Trajectory::load方法的典型用法代码示例。如果您正苦于以下问题:C++ Trajectory::load方法的具体用法?C++ Trajectory::load怎么用?C++ Trajectory::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trajectory
的用法示例。
在下文中一共展示了Trajectory::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
namespace bpo = boost::program_options;
namespace bfs = boost::filesystem;
bpo::options_description opts_desc("Allowed options");
bpo::positional_options_description p;
string sseq_path;
string traj_path;
string map_path;
double resolution;
double max_range;
opts_desc.add_options()
("help,h", "produce help message")
("sseq", bpo::value(&sseq_path)->required(), "StreamSequence, i.e. asus data.")
("traj", bpo::value(&traj_path)->required(), "Trajectory from slam in CLAMS format.")
("map", bpo::value(&map_path)->required(), "Where to save the output map.")
("resolution", bpo::value(&resolution)->default_value(0.01), "Resolution of the voxel grid used for filtering.")
("max-range", bpo::value(&max_range)->default_value(MAX_RANGE_MAP), "Maximum range to use when building the map from the given trajectory, in meters.")
;
p.add("sseq", 1);
p.add("traj", 1);
p.add("map", 1);
bpo::variables_map opts;
bool badargs = false;
try {
bpo::store(bpo::command_line_parser(argc, argv).options(opts_desc).positional(p).run(), opts);
bpo::notify(opts);
}
catch(...) { badargs = true; }
if(opts.count("help") || badargs) {
cout << "Usage: " << bfs::basename(argv[0]) << " [OPTS] SSEQ TRAJ MAP" << endl;
cout << " A map will be generated from SSEQ and TRAJ. It will be saved to MAP." << endl;
cout << endl;
cout << opts_desc << endl;
return 1;
}
Trajectory traj;
traj.load(traj_path);
StreamSequenceBase::ConstPtr sseq = StreamSequenceBase::initializeFromDirectory(sseq_path);
cout << "Building map from " << endl;
cout << " " << sseq_path << endl;
cout << " " << traj_path << endl;
cout << "Saving to " << map_path << endl;
Cloud::Ptr map = SlamCalibrator::buildMap(sseq, traj, max_range, resolution);
pcl::io::savePCDFileBinary(map_path, *map);
return 0;
}