Skip to content

Commit

Permalink
not consistant test passing
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Aug 26, 2018
1 parent 90ac027 commit c52a14f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Rendered Scene Test
./fakeslam.py
```

NOTE: The test currently doesn't work well.
NOTE: The test currently doesn't work reliably. It seems adding a small amount of Gaussian noise to the point positions can cause the optimizer to fall into really bad local minima. This may just be caused by poor initialization, as I'm not sure how stable Essential matricies are.

TODO: Investigate why? Use the OpenGL projection matrix to get the real vertex coords and fake the matcher.
TODO: Investigate the stability of Essential matrix recovery.

DONE
-----
Expand Down
16 changes: 6 additions & 10 deletions fakeslam.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
pos_x = 0
dir_x = True
while 1:
fn += 1

# render
frame, verts = r.draw([pos_x,0,0])

# add gaussian noise
verts += np.random.normal(0.0, 1.0, verts.shape)
verts += np.random.normal(0.0, 0.1, verts.shape)

# ground truth pose
pose = np.eye(4)
Expand All @@ -50,13 +53,6 @@
dir_x = True
pos_x += 0.5 * (1 if dir_x else -1)

"""
fn += 1
if fn == 5:
slam.mapp.optimize(verbose=True, rounds=10)
#print(slam.mapp.serialize())
while 1:
break
time.sleep(1)
"""
if fn > 20:
slam.mapp.optimize(verbose=True, local_window=None, rounds=10)

2 changes: 2 additions & 0 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def fundamentalToRt(F):
if np.sum(R.diagonal()) < 0:
R = np.dot(np.dot(U, W.T), Vt)
t = U[:, 2]

# TODO: Resolve ambiguities in better ways. This is wrong.
if t[2] < 0:
t *= -1

Expand Down

0 comments on commit c52a14f

Please sign in to comment.