Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calibration range #20

Open
wisechengyi opened this issue Dec 24, 2016 · 1 comment
Open

calibration range #20

wisechengyi opened this issue Dec 24, 2016 · 1 comment

Comments

@wisechengyi
Copy link
Contributor

wisechengyi commented Dec 24, 2016

Currently the ranges are hardcoded

zTest = int(round(zLower, 0)) # Since range requires an integer, round zLower just for this case
for x in range( -20, 20, 4): testCoords += [[x, 15, 11]] # Center of XYZ grid
for y in range( 8, 24, 4): testCoords += [[ 0, y, 11]]
for z in range(zTest, 19, 1): testCoords += [[ 0, 15, z]]
# for x in range( -20, 20, 1): testCoords += [[x, 15, zTest]] # Center of XY, Bottom z
# for y in range( 8, 25, 1): testCoords += [[ 0, y, zTest]]
# for z in range(zTest, 25): testCoords += [[ 0, 15, z]]
for x in range( -20, 20, 4): testCoords += [[x, 15, 17]] # Center of XY, top z
for y in range( 12, 24, 4): testCoords += [[ 0, y, 17]]
direction = int(1)
for y in range(12, 25, 2):
for x in range(-20 * direction, 20 * direction, 2 * direction):
testCoords += [[x, y, zTest]]
direction *= -1
, but in practice, the real range also depends on how camera is mounted or zoomed in. For example, the effective range my camera can see for x axis is (-10, 10) whereas it's hardcoded (-20, 20). Hence I would like to propose to collect (x,y,z) at the 4 corners (mostly x and y) in order to determine the range and how fine-grained the calibration should be.

Example partial diff. Actual values should come from user assistance. Also append is used instead of += for performance reasons because += is making a new array on every use.

(venv)[tw-mbp-yic uArmCreatorStudio (master)]$ git diff
diff --git a/CalibrationsGUI.py b/CalibrationsGUI.py
index d50a6d3..97e3328 100644
--- a/CalibrationsGUI.py
+++ b/CalibrationsGUI.py
@@ -798,24 +798,22 @@ class CWPage5(QtWidgets.QWizardPage):
 
         # Test the z on 3 xy points
         zTest = int(round(zLower, 0))  # Since range requires an integer, round zLower just for this case
-        for x in range(  -20, 20, 4): testCoords += [[x,  15,    11]]  # Center of XYZ grid
-        for y in range(    8, 24, 4): testCoords += [[ 0,  y,    11]]
-        for z in range(zTest, 19, 1): testCoords += [[ 0, 15,     z]]
+        for x in range(  -10, 10, 1): testCoords.append([x,  15,    11])  # Center of XYZ grid
+        for y in range(    8, 24, 4): testCoords.append([ 0,  y,    11])
+        for z in range(zTest, 19, 1): testCoords.append([ 0, 15,     z])
 
         # for x in range(  -20, 20, 1): testCoords += [[x,  15, zTest]]  # Center of XY, Bottom z
         # for y in range(    8, 25, 1): testCoords += [[ 0,  y, zTest]]
         # for z in range(zTest, 25): testCoords += [[ 0, 15,     z]]
 
-        for x in range(  -20, 20, 4): testCoords += [[x,  15,    17]]  # Center of XY, top z
-        for y in range(   12, 24, 4): testCoords += [[ 0,  y,    17]]
+        for x in range(  -10, 10, 1): testCoords.append([x,  15,    17])  # Center of XY, top z
+        for y in range(   12, 24, 4): testCoords.append([ 0,  y,    17])
 
-
-
-        direction  = int(1)
+        direction = int(1)
         for y in range(12, 25, 2):
-            for x in range(-20 * direction, 20 * direction, 2 * direction):
-                testCoords += [[x, y, zTest]]
-            direction *= -1
+          for x in range(-10 * direction, 10 * direction, 2 * direction):
+            testCoords.append([x, y, zTest])
+          direction *= -1
@apockill
Copy link
Owner

You're definitely right. If there were some way to "Draw" the boundaries by dragging the robot arm around an area, then having the points be generated from those boundaries, i think that would be ideal.

That would also help the eventual future where multiple robot arm models will work with UCS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants