diff --git a/apps/console_tools/multiply_timestamps_session_point_cloud_laz.cpp b/apps/console_tools/multiply_timestamps_session_point_cloud_laz.cpp index b2ecef37..73220ebb 100644 --- a/apps/console_tools/multiply_timestamps_session_point_cloud_laz.cpp +++ b/apps/console_tools/multiply_timestamps_session_point_cloud_laz.cpp @@ -94,6 +94,7 @@ bool load_pc(PointCloud& pc, const std::string& input_file_name) progress.finish(static_cast(p_count)); laszip_close_reader(laszip_reader); + laszip_destroy(laszip_reader); return true; } @@ -114,14 +115,16 @@ int main(int argc, char* argv[]) return 2; } + // exportLaz() treats timestamps as seconds and writes them as nanoseconds (x 1e9), + // so divide by 1e9 to keep the input's units. for (auto& t : pc.timestamps) { - t *= atof(argv[2]); + t *= atof(argv[3]) / 1e9; } if (!exportLaz(argv[2], pc.points_local, pc.intensities, pc.timestamps)) { - std::cout << "Problem with saving: '" << argv[3] << std::endl; + std::cout << "Problem with saving: '" << argv[2] << "'" << std::endl; } return 0; diff --git a/apps/console_tools/multiply_timestamps_session_trajectory_csv.cpp b/apps/console_tools/multiply_timestamps_session_trajectory_csv.cpp index 2ada6784..59fafaba 100644 --- a/apps/console_tools/multiply_timestamps_session_trajectory_csv.cpp +++ b/apps/console_tools/multiply_timestamps_session_trajectory_csv.cpp @@ -75,6 +75,9 @@ int main(int argc, char* argv[]) ltn.timestamps.second = 0.0; ltn.imu_om_fi_ka = { 0, 0, 0 }; + + ltn.timestamps.first *= atof(argv[3]); + local_trajectory.push_back(ltn); }