---[ */
| 89 | |
| 90 | /* ---[ */ |
| 91 | int |
| 92 | main (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 |
nothing calls this directly
no test coverage detected