Saturday, 30 May 2015

Different ways to estimate relative pose during visual servoing

In order to obtain relative pose (pdHp) between current and desired pattern pose (cHp and cHpd) in camera frame, we can:

Method 1: Find rigid transformation between two set of pattern points (X_p and X_pd) in camera frame directly using a findRigidTransform() function described here.

Method 2: Calculate cHp and cHpd using the findRigidTransform() as the pattern points in local coordinate is known. The relative pose pdHp is calculated as:
pdHp = inv(cHpd) * cHp

Method 3: Calculate cHp and cHpd using the cv::solvePnP() function which finds an object pose from 3D-2D point correspondence. The relative pose is then calculated same as method 2.

According to the results, Method 1 is least stable and accurate as the estimated relative pose varies a lot and very different from the other two methods.
Method 2 and 3 have similar results in which Method 3 seems better since the rotation part is closer to Identity when the relative pose should be the same.

Summary: Method 3 is the best for the time being.

Thursday, 28 May 2015

Relative trajectory playback from different starting pose

1. Given a trajectory in the global frame, a relative trajectory (H_rela) can be generated as:
H_rela = inv(H_1) * H_i
Since the relative transformation is regard to local frame (first pose in the trajectory). H_rela(1) is Identity

2. For a new starting pose in the global frame H_start, a new trajectory begins at the starting pose is generated as:

H_new = H_start * H_rela
where H_new is in the global frame.

Tuesday, 5 May 2015

Git - update submodule

Update and merge/rebase local submodule with upstream:

git submodule update --remote --merge
git submodule update --remote --rebase

Under main project directory, see difference of submodule:
git diff --submodule


3 cases:
  • Same commit but submodule has dirty suffix
-Subproject commit c5c6bbaf616d64fbd873df7b7feecebb81b5aee7
+Subproject commit c5c6bbaf616d64fbd873df7b7feecebb81b5aee7-dirty

It means that git status in the submodule isn't clean. cd into the submodule and see what's going on.

  • Different commit, former one is correct (the one in main project)
-Subproject commit c4478af032e604bed605e82d04a248d75fa513f7
+Subproject commit c79d9c83c2864665ca3fd0b11e20a53716d0cbb0
If the former is right, add and commit the new version of the submodule in main project
  • Different commit, latter one is correct (the one in submodule)
If the latter is right, change the version that the submodule is at with:
git submodule update $submodule_name$






Reference:
[1] http://git-scm.com/book/en/v2/Git-Tools-Submodules
[2] http://stackoverflow.com/questions/6006494/git-submodule-modified-files-status