Skip to content

Commit

Permalink
Left TODO comments for tomorrow's work
Browse files Browse the repository at this point in the history
  • Loading branch information
liukeskywalker98 committed May 4, 2022
1 parent 59b0439 commit e7d4d0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def getPrunedFeaturesGlobalPosition(self):
featurePointsGlobal = self.prunedUndistortedLocals

# Then we need to convert to meters
#featurePointsGlobal *= RANGE_RESOLUTION_CART_M # px * (m/px) = m
featurePointsGlobal *= RANGE_RESOLUTION_CART_M # px * (m/px) = m

# Center origin at pose center

Expand Down
10 changes: 6 additions & 4 deletions RawROAMSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from Mapping import Keyframe, Map
from getFeatures import N_FEATURES_BEFORE_RETRACK, appendNewFeatures
from parseData import convertPolarImageToCartesian, getCartImageFromImgPaths, getPolarImageFromImgPaths, getRadarImgPaths
from parseData import convertPolarImageToCartesian, getCartImageFromImgPaths, getPolarImageFromImgPaths, getRadarImgPaths, RANGE_RESOLUTION_CART_M
from trajectoryPlotting import Trajectory, getGroundTruthTrajectory, plotGtAndEstTrajectory
from utils import convertRandHtoDeltas, f_arr, getRotationMatrix, plt_savefig_by_axis, radarImgPathToTimestamp
from Tracker import Tracker
Expand Down Expand Up @@ -172,12 +172,14 @@ def run(self, startSeqInd: int = 0, endSeqInd: int = -1) -> None:
print("Detected", np.rad2deg(rotAngleRad), "[deg] rotation")
estR = getRotationMatrix(-rotAngleRad)

R, h = tracker.getTransform(good_old, good_new, pixel = True)
R, h = tracker.getTransform(good_old, good_new, pixel = False)
# R = estR

# Solve for Motion Compensated Transform
p_w = old_kf.getPrunedFeaturesGlobalPosition() # centered
centered_new = good_new - RADAR_CART_CENTER
#TODO: Scatter p_w, then try the transform on the centered new points
# Scatter that on the same plot
centered_new = (good_new - RADAR_CART_CENTER) * RANGE_RESOLUTION_CART_M
# Initial Transform guess
T_wj = prev_pose @ np.block([[R, h],
[np.zeros((2,)), 1]])
Expand All @@ -188,7 +190,7 @@ def run(self, startSeqInd: int = 0, endSeqInd: int = -1) -> None:

# Extract new info
pose_vector = undistort_solution[3:]
transform = convertPoseToTransform(pose_vector)
transform = MDS.T_wj0_inv @ convertPoseToTransform(pose_vector)
R = transform[:2, :2]
h = transform[:2, 2:]
velocity = undistort_solution[:3]
Expand Down
4 changes: 3 additions & 1 deletion motionDistortion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
TODO: Run parse data to look at how the scanline moves. Adjust code to match
TODO: Verify code against math
TODO: Integration with the code. Adding mapping capability
TODO: Check arctan2 conventions for dT stuff. the image might be flipped because
images have the origin in the top left.
Plan:
Check out parse data
Expand Down Expand Up @@ -114,7 +116,7 @@ def compute_time_deltas(period, points):
'''
x = points[:, 0]
y = points[:, 1]
# scanline starts at positive x axis and moves clockwise
# scanline starts at positive x axis and moves clockwise (counter-clockwise?)
# We take midpoint pi/2 as 0
angles = np.arctan2(y, -x)
dT = period * angles / (2 * np.pi)
Expand Down

0 comments on commit e7d4d0c

Please sign in to comment.