MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / main

Function main

tools/xyz2pcd.cpp:91–119  ·  view source on GitHub ↗

---[ */

Source from the content-addressed store, hash-verified

89
90/* ---[ */
91int
92main (int argc, char** argv)
93{
94 print_info ("Convert a simple XYZ file to PCD format. For more information, use: %s -h\n", argv[0]);
95
96 if (argc < 3)
97 {
98 printHelp (argc, argv);
99 return (-1);
100 }
101
102 // Parse the command line arguments for .pcd and .ply files
103 std::vector<int> pcd_file_indices = parse_file_extension_argument (argc, argv, ".pcd");
104 std::vector<int> xyz_file_indices = parse_file_extension_argument (argc, argv, ".xyz");
105 if (pcd_file_indices.size () != 1 || xyz_file_indices.size () != 1)
106 {
107 print_error ("Need one input XYZ file and one output PCD file.\n");
108 return (-1);
109 }
110
111 // Load the first file
112 PointCloud<PointXYZ> cloud;
113 if (!loadCloud (argv[xyz_file_indices[0]], cloud))
114 return (-1);
115
116 // Convert to PCD and save
117 PCDWriter w;
118 w.writeBinaryCompressed (argv[pcd_file_indices[0]], cloud);
119}
120

Callers

nothing calls this directly

Calls 4

printHelpFunction · 0.70
loadCloudFunction · 0.70
sizeMethod · 0.45
writeBinaryCompressedMethod · 0.45

Tested by

no test coverage detected