(traj, filename, verbose=False)
| 430 | |
| 431 | |
| 432 | def save_trajectory_tum_format(traj, filename, verbose=False): |
| 433 | traj = make_traj(traj) |
| 434 | tostr = lambda a: " ".join(map(str, a)) |
| 435 | with Path(filename).open("w") as f: |
| 436 | for i in range(traj.num_poses): |
| 437 | f.write( |
| 438 | f"{traj.timestamps[i]} {tostr(traj.positions_xyz[i])} {tostr(traj.orientations_quat_wxyz[i][[0,1,2,3]])}\n" |
| 439 | ) |
| 440 | if verbose: |
| 441 | print(f"Saved trajectory to {filename}") |
| 442 | |
| 443 | |
| 444 | def extract_metrics(file_path): |
no test coverage detected