From 6527a94aedacb868bf300071df08b1f7cb89bef8 Mon Sep 17 00:00:00 2001 From: Michael Soukup Date: Mon, 11 Aug 2014 16:20:37 +0200 Subject: [PATCH] small changes, cleanup, added docs/ --- config.py | 25 +++++++++++++------------ instructions.txt | 7 ------- quadrants.txt => quadrant-poses | 0 requirements.txt => requirements | 0 unittesting.py | 2 +- 5 files changed, 14 insertions(+), 20 deletions(-) delete mode 100644 instructions.txt rename quadrants.txt => quadrant-poses (100%) rename requirements.txt => requirements (100%) diff --git a/config.py b/config.py index f002268..c566309 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,6 @@ import math -DEBUG = True +DEBUG = True #prints information to stdout # GUI @@ -17,10 +17,10 @@ CTR_FPS = 60 #manual control # NETWORK # -# The IP address can be found in the PolyScope interface (tablet) of the robot. -# SETUP Robot -> Setup NETWORK (requires password) -> IP address +# The IP address can be found in the PolyScope interface (tablet) of the robot. Select: +# SETUP Robot -> Setup NETWORK (password: "ngr12") -> IP address UR5_IP = "129.241.187.119" -UR5_HOSTNAME = 'ur-2012208984' #requires dns. +UR5_HOSTNAME = 'ur-2012208984' #not used, requires dns. @@ -41,7 +41,7 @@ BLOCK_DIM = 0.0965 #TUNED # along the base x-axis, quadrant 1.0 corresponds to the base y-axis, etc. # Quardant 0 is recommended. TABLE_QUADRANT = 0 #[0..4) -TABLE_ORIGO_OFFSET = (-0.245, -0.003) #offset from origo along base x-axis +TABLE_ORIGO_OFFSET = (-0.245, -0.003) #offset from robot base origo along base x-axis TABLE_Z = -0.3337 #this should be fine-tuned on each setup TABLE_ARC = math.pi/2 @@ -97,9 +97,11 @@ T_DIR_CHANGE_COOLDOWN = 0.05 # Constraints are relative to the cylinder coordinate system. # Because of delay and fluctuations of parameters in the system, -# the calculation of projected positions are not correct. +# the estimated velocity at each time instant is not correct, consequently the +# calculation of projected positions are also not correct. # Therefore, an empirical offset is added in controller.update(). -# Consider this before changing control speed +# Consider this before changing control speed: It may be required to change the +# offsets in the code (not tested) R_MIN = 0.49 R_MAX = 0.75 THETA_MIN= -TABLE_ARC/2 @@ -132,8 +134,8 @@ Z_MAX = TABLE_Z + 2*BLOCK_DIM # Left trigger:2 # Right trigger:5 # -# Hat switch:0 (All or nothing for direction). returns (+-1, +-1) = (+-x. +-y) -# hx, hy = hat +# Hat switch:0 (All or nothing for direction). returns (+-1, +-1) = (+-x. +-y) = (hx, hy) + HATCODE = -1 #set to -1 to avoid polling hat HX = 10 HY = 11 @@ -141,7 +143,6 @@ HAT_MAP = { HX: (0,1,0), HY: (-1,0,0) #inverted } - #BUTTON_MAP = { # 4: (0,0,-1), # 5: (0,0,1) @@ -163,7 +164,7 @@ BUTTON_MAP = { #Buttons only (no hat) # This means that the trapezoidal velocity curve has the same slope at # start and end of a motion. (acceleration=deceleration) # -# Constraints in r and z-direction are specefied in levels to enable +# Coordinates in r and z-direction are specefied in block-space to enable # easier construction of loops. Note that the r-levels grow inwards, and # the z-levels grow upwards. DEFAULT_LOOP_VEL = 0.1 @@ -176,7 +177,7 @@ Z_LVL0 = TABLE_Z + BLOCK_DIM/2 #tool in middle of block THETA_EDGE_LEFT = -math.pi/4 + math.pi/74 #empirical. table is not exact THETA_EDGE_RIGHT = math.pi/4 - math.pi/74 -# Offsets when picking (and placing) blocks. +# Offsets when picking (and placing) blocks specified in cylinder space. # The place-block move is the reverse of the pick-block move, # such that the start/end offsets for pick-block are the end/start offsets # for place-block diff --git a/instructions.txt b/instructions.txt deleted file mode 100644 index 2d28f7e..0000000 --- a/instructions.txt +++ /dev/null @@ -1,7 +0,0 @@ -(Based on tests.) - -After security stop (red button), shut down and restart robot. -After stop during loop, exit and restart loop. (The robot doesnt continue where it stopped) - -When running the application, the robot has to be initialized (all lights green or teach mode) -When the application exits normally, the robot is set to freedrive mode (TEACH on tablet) diff --git a/quadrants.txt b/quadrant-poses similarity index 100% rename from quadrants.txt rename to quadrant-poses diff --git a/requirements.txt b/requirements similarity index 100% rename from requirements.txt rename to requirements diff --git a/unittesting.py b/unittesting.py index 12ad9c8..83df6c7 100755 --- a/unittesting.py +++ b/unittesting.py @@ -325,7 +325,7 @@ if __name__ == '__main__': ("Check z-levels", check_z_levels), ("Test unitary moves.", test_unitary_moves), ("Test multi-directional moves", test_multi_moves), - ("Check loop constraints", check_loop_constraints), + ("Check loop constraints and block positions", check_loop_constraints), ("Test URScript's movec", test_movec), ("Build four stories high", four_stories), ("Build small pyramid", small_pyramid)