rabbitKabbit commited on
Commit
2de8b98
·
verified ·
1 Parent(s): b667161

Add RTAB-Map point clouds and export script

Browse files
.gitattributes CHANGED
@@ -1422,3 +1422,7 @@ I12X/Metascenes1_Spatiallm1_MasterSlam4/objects/01_chandelier.glb filter=lfs dif
1422
  I12X/Metascenes1_Spatiallm1_MasterSlam4/objects/02_chandelier.glb filter=lfs diff=lfs merge=lfs -text
1423
  I12X/Metascenes1_Spatiallm1_MasterSlam4/scene_fixed.glb filter=lfs diff=lfs merge=lfs -text
1424
  I12X/Metascenes1_Spatiallm1_MasterSlam4/scene_physics.glb filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
1422
  I12X/Metascenes1_Spatiallm1_MasterSlam4/objects/02_chandelier.glb filter=lfs diff=lfs merge=lfs -text
1423
  I12X/Metascenes1_Spatiallm1_MasterSlam4/scene_fixed.glb filter=lfs diff=lfs merge=lfs -text
1424
  I12X/Metascenes1_Spatiallm1_MasterSlam4/scene_physics.glb filter=lfs diff=lfs merge=lfs -text
1425
+ I64/RTABMAP1/cloud.ply filter=lfs diff=lfs merge=lfs -text
1426
+ I12X/RTABMAP1/cloud.ply filter=lfs diff=lfs merge=lfs -text
1427
+ I12X/RTABMAP2/cloud.ply filter=lfs diff=lfs merge=lfs -text
1428
+ P64/RTABMAP1/cloud.ply filter=lfs diff=lfs merge=lfs -text
I12X/RTABMAP1/cloud.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b388ffdfc4badc2706d491981169fa6e36161cd6701c45ed077e82c5d3f5c837
3
+ size 17409890
I12X/RTABMAP1/export_clouds.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Export RTAB-Map .db files to xyz+RGB PLY point clouds.
3
+
4
+ Usage: python3 export_clouds.py [db_dir]
5
+ Requires: rtabmap-export on PATH, open3d.
6
+ Writes <name>_cloud.ply (with normals) and <name>_rgb.ply (xyz + RGB only) into <db_dir>/ply.
7
+ """
8
+ import subprocess
9
+ import sys
10
+ from pathlib import Path
11
+
12
+ import open3d as o3d
13
+
14
+ db_dir = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(".")
15
+ out_dir = db_dir / "ply"
16
+ out_dir.mkdir(exist_ok=True)
17
+
18
+ for db in sorted(db_dir.glob("*.db")):
19
+ # 1. Assemble the cloud from the depth images and optimized poses.
20
+ subprocess.run(
21
+ ["rtabmap-export", "--cloud", "--output_dir", str(out_dir), str(db)],
22
+ check=True,
23
+ )
24
+ raw = out_dir / f"{db.stem}_cloud.ply"
25
+
26
+ # 2. Drop normals and curvature so viewers show the real RGB colors.
27
+ pcd = o3d.io.read_point_cloud(str(raw))
28
+ pcd.normals = o3d.utility.Vector3dVector()
29
+ clean = out_dir / f"{db.stem}_rgb.ply"
30
+ o3d.io.write_point_cloud(str(clean), pcd)
31
+ print(f"{clean}: {len(pcd.points)} points")
I12X/RTABMAP2/cloud.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a23960a519f1f04c12de2e47e293d65f19c4d4f5c471bc9cdadb9047ec55b6f
3
+ size 22899179
I64/RTABMAP1/cloud.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5c730e23a6d32e850115807115b149512908ec63e3950094fa5ffebd008a015
3
+ size 15771827
P64/RTABMAP1/cloud.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0186407f9123526f9a0a99b565c27f0d15c4446adc423272bd1b1c5e25841ca8
3
+ size 21441260
README.md CHANGED
@@ -88,7 +88,7 @@ A trailing number is a run/capture index within the room.
88
  | [SpatialLM](https://github.com/manycore-research/SpatialLM), run with the fork [lehoangan02/SpatialLM](https://github.com/lehoangan02/SpatialLM) (`stage3/pipeline.py`, commit `a10e67a`; `.glb` files re-exported with `7021237`) | Room layout (walls, objects) from a point cloud | `Spatiallm1_*/room.glb`, `room_with_scan.glb` |
89
  | MetaScenes-style asset replacement (own scripts in `P64/Metascenes1_Spatiallm1_MasterSlam1/`), adapted from [MetaScenes](https://github.com/meta-scenes/MetaScenes) | Replaces each SpatialLM box with an Objaverse asset, then runs MetaScenes' physics step | `Metascenes1_*/` |
90
  | NeuCon | Mesh reconstruction (trimesh export) | `Bedroom1/NeuCon1/neucon.ply` |
91
- | RTAB-Map | RGB-D mapping, textured mesh | `P64/RTABMAP1/*.obj/.mtl/.jpg` |
92
 
93
  ## File reference
94
 
@@ -127,6 +127,22 @@ A trailing number is a run/capture index within the room.
127
  (`room_plane_fit.py`, `ply2obj.py`, `requirements.txt`, `room_plane_fit_out/`,
128
  `scan_mesh.*`).
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  ### `Spatiallm1_*/`
131
 
132
  `room.glb` is the predicted layout. `room_with_scan.glb` is the layout together
 
88
  | [SpatialLM](https://github.com/manycore-research/SpatialLM), run with the fork [lehoangan02/SpatialLM](https://github.com/lehoangan02/SpatialLM) (`stage3/pipeline.py`, commit `a10e67a`; `.glb` files re-exported with `7021237`) | Room layout (walls, objects) from a point cloud | `Spatiallm1_*/room.glb`, `room_with_scan.glb` |
89
  | MetaScenes-style asset replacement (own scripts in `P64/Metascenes1_Spatiallm1_MasterSlam1/`), adapted from [MetaScenes](https://github.com/meta-scenes/MetaScenes) | Replaces each SpatialLM box with an Objaverse asset, then runs MetaScenes' physics step | `Metascenes1_*/` |
90
  | NeuCon | Mesh reconstruction (trimesh export) | `Bedroom1/NeuCon1/neucon.ply` |
91
+ | RTAB-Map (`.db` recorded on the phone/tablet app, exported with `rtabmap-export`) | RGB-D mapping, textured mesh and RGB point cloud | `RTABMAP*/` |
92
 
93
  ## File reference
94
 
 
127
  (`room_plane_fit.py`, `ply2obj.py`, `requirements.txt`, `room_plane_fit_out/`,
128
  `scan_mesh.*`).
129
 
130
+ ### `RTABMAP*/` (RTAB-Map)
131
+
132
+ | File | Content |
133
+ |------|---------|
134
+ | `<name>.obj/.mtl/.jpg` | Textured mesh exported from the RTAB-Map app (`<name>` = recording timestamp `yymmdd-HHMMSS`) |
135
+ | `cloud.ply` | xyz + RGB point cloud, assembled from the depth images and optimized poses of the same `.db` |
136
+ | `export_clouds.py` | Script that makes the `.ply` from `.db` files (kept in `I12X/RTABMAP1/`) |
137
+
138
+ Producing the `.ply`: `python3 export_clouds.py <dir with .db files>` needs `rtabmap-export` on PATH and
139
+ `open3d`. It runs `rtabmap-export --cloud` (writes `<db>_cloud.ply` with normals), then drops normals
140
+ and curvature so viewers show the real colours, giving `<db>_rgb.ply`; that file is what is stored here,
141
+ renamed to `cloud.ply` (the `<name>` of its `.db` is the same as the mesh in that folder). The `.db` files themselves are not in the dataset (they are large); a trailing
142
+ `_1` on a db name is not part of `<name>`. Mapping: `P64/RTABMAP1` = `261104-120353`, `I64/RTABMAP1` =
143
+ `261105-111119`, `I12X/RTABMAP1` = `261106-090437`, `I12X/RTABMAP2` = `261106-091133`.
144
+ `I64/RTABMAP2` and `RTABMAP3` have no `.ply` yet (no `.db` available).
145
+
146
  ### `Spatiallm1_*/`
147
 
148
  `room.glb` is the predicted layout. `room_with_scan.glb` is the layout together