Skip to content

Commit

Permalink
plotting map points
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicapple0 committed May 5, 2022
1 parent d4f7f3e commit 589fb7c
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 9 deletions.
7 changes: 3 additions & 4 deletions Mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ def plot(self, fig: plt.figure, show: bool = False):
@param[in] fig plt figure to plot on @todo do this
'''
# TODO: For now, plot all the keyframe feature points
points_global = np.empty((0, 2))
for kf in self.keyframes:
points_local = kf.featurePointsLocal
points_global = kf.convertFeaturesLocalToGlobal(points_local)

plt.scatter(points_global[:, 0], points_global[:, 1], marker='+', color='red',label='Map Points')
points_global = np.vstack((points_global,kf.getPrunedFeaturesGlobalPosition()))
plt.scatter(points_global[:, 0], points_global[:, 1], marker='+', color='g',alpha=.8,label='Map Points')

if show:
plt.show()
Expand Down
9 changes: 5 additions & 4 deletions RawROAMSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def run(self, startSeqInd: int = 0, endSeqInd: int = -1) -> None:
print("\nAdding keyframe...\n")

#old_kf.copyFromOtherKeyframe(possible_kf)
#self.map.addKeyframe(possible_kf)
self.map.addKeyframe(possible_kf)

# TODO: Aliasing above? old_kf is never assigned the object possible_kf,
# map ends up with a list of N pointers to the same keyframe
Expand All @@ -271,8 +271,9 @@ def run(self, startSeqInd: int = 0, endSeqInd: int = -1) -> None:
self.plot(prevImgCart, currImgCart, good_old, good_new, R, h,
seqInd, save = True, show = False)
else:
self.plot(prevImgCart, currImgCart, good_old, good_new, R, h,
seqInd, save = False, show = False)
if seqInd % 3 == 0:
self.plot(prevImgCart, currImgCart, good_old, good_new, R, h,
seqInd, save = False, show = False)
# Update incremental variables
blobCoord = good_new.copy()
prevImgCart = currImgCart
Expand Down Expand Up @@ -319,7 +320,7 @@ def plot(self,

ax2 = self.fig.add_subplot(1, 2, 2)
# TODO: Plotting for map points
#self.map.plot(self.fig, show=False)
self.map.plot(self.fig, show=False)

self.plotTraj(seqInd, R, h, save=False, show=False)

Expand Down
2 changes: 1 addition & 1 deletion g2o
Submodule g2o updated 574 files
Binary file modified img/roam_mapping/tiny_traj/0001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0005.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0006.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0007.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0008.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0009.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/roam_mapping/tiny_traj/0010.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 589fb7c

Please sign in to comment.