15 #include <mrpt/3rdparty/tclap/CmdLine.h> 16 #include <mrpt/maps/CSimplePointsMap.h> 17 #include <mrpt/obs/CObservationPointCloud.h> 18 #include <mrpt/system/filesystem.h> 21 static TCLAP::CmdLine
cmd(
"kitti2mm");
23 static TCLAP::ValueArg<std::string>
argInput(
24 "i",
"input",
"KITTI .bin pointcloud file.",
true,
"kitti-00.bin",
27 static TCLAP::ValueArg<std::string>
argOutput(
28 "o",
"output",
"Output file to write to.",
true,
"out.mm",
"out.mm",
cmd);
30 static TCLAP::ValueArg<std::string>
argLayer(
31 "l",
"layer",
"Target layer name (Default: \"raw\").",
false,
"raw",
"raw",
34 static TCLAP::ValueArg<uint64_t>
argID(
35 "",
"id",
"Metric map numeric ID (Default: none).",
false, 0,
"[ID]",
cmd);
37 static TCLAP::ValueArg<std::string>
argLabel(
38 "",
"label",
"Metric map label string (Default: none).",
false,
"label",
41 int main(
int argc,
char** argv)
46 if (!
cmd.parse(argc, argv))
return 1;
50 auto obs = mrpt::obs::CObservationPointCloud::Create();
51 obs->setAsExternalStorage(
52 f, mrpt::obs::CObservationPointCloud::ExternalStorageFormat::
57 mrpt::format(
"Error loading kitti scan file: '%s'",
f.c_str()));
61 mm.
layers[
"raw"] = std::move(obs->pointcloud);
68 "Error writing to target file '%s'",
71 catch (
const std::exception& e)
73 std::cerr << mrpt::exception_to_str(e);
std::map< layer_name_t, mrpt::maps::CMetricMap::Ptr > layers
static TCLAP::ValueArg< uint64_t > argID("", "id", "Metric map numeric ID (Default: none).", false, 0, "[ID]", cmd)
Generic container of pointcloud(s), extracted features and other maps.
Generic representation of pointcloud(s) and/or extracted features.
static TCLAP::ValueArg< std::string > argLabel("", "label", "Metric map label string (Default: none).", false, "label", "[label]", cmd)
std::optional< std::string > label
static TCLAP::ValueArg< std::string > argOutput("o", "output", "Output file to write to.", true, "out.mm", "out.mm", cmd)
static TCLAP::CmdLine cmd("kitti2mm")
int main(int argc, char **argv)
static TCLAP::ValueArg< std::string > argInput("i", "input", "KITTI .bin pointcloud file.", true, "kitti-00.bin", "kitti-00.bin", cmd)
bool save_to_file(const std::string &fileName) const
static TCLAP::ValueArg< std::string > argLayer("l", "layer", "Target layer name (Default: \aw\.", false, "raw", "raw", cmd)
std::optional< uint64_t > id