Skip to content

Commit

Permalink
Merge pull request #5 from saurabh1002/main
Browse files Browse the repository at this point in the history
Minor fix to python API and gitignore
  • Loading branch information
simone-ferrari authored Sep 11, 2024
2 parents 43ccf50 + 815b856 commit 9802145
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__pycache__
*/build/*
**/build/*
.vscode
3 changes: 2 additions & 1 deletion mad_icp/apps/mad_icp.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def main(data_path: Annotated[
p_th, b_min, b_ratio, num_keyframes, num_cores, realtime)

estimate_file_name = estimate_path / "estimate.txt"
estimate_file = open(estimate_file_name, 'w')
estimate_file = open(estimate_file_name, 'a')
estimate_file.truncate(0)

with InputDataInterface_lut[reader_type](data_path, min_range, max_range, topic=topic, sensor_hz=sensor_hz, apply_correction=apply_correction) as reader:
t_start = datetime.now()
Expand Down
5 changes: 1 addition & 4 deletions mad_icp/apps/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@
def write_transformed_pose(estimate_file, lidar_to_world, lidar_to_base):
base_to_lidar = np.linalg.inv(lidar_to_base)
base_to_world = np.dot(lidar_to_base, np.dot(lidar_to_world, base_to_lidar))
for row in range(3):
for col in range(4):
estimate_file.write(str(base_to_world[row, col]) + " ")
estimate_file.write("\n")
np.savetxt(estimate_file, base_to_world[:3].reshape(-1, 12))

0 comments on commit 9802145

Please sign in to comment.