diff options
author | damic014 <damic014@umn.edu> | 2019-11-26 01:51:01 -0600 |
---|---|---|
committer | damic014 <damic014@umn.edu> | 2019-11-26 16:07:50 -0600 |
commit | 801718e1f0933c083e25f8389d2d0c8f803c45a7 (patch) | |
tree | 30d724bbb21ee6ad6730d6eb90e1c5ba4ba8ea32 | |
parent | Add encoder measurements via thread. This should help with linear encoder acc... (diff) | |
download | ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar.gz ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar.bz2 ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar.lz ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar.xz ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.tar.zst ee4511w-801718e1f0933c083e25f8389d2d0c8f803c45a7.zip |
Modify test_System to verify that threaded encoder measurements are working as expected. Run this to check before actually running the system.
Diffstat (limited to '')
-rw-r--r-- | System/test_System.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/System/test_System.py b/System/test_System.py index 21ed336..c05affc 100644 --- a/System/test_System.py +++ b/System/test_System.py @@ -2,20 +2,12 @@ # DO NOT TEST ON ASSEMBLED PHYSICAL SYSTEM! It will probably break it.
import time
-from system import System
-
-# Return a speed based on current encoder angle.
-# Convert an angle to speed (180 degrees = max speed)
-def control_function(angle):
- return (abs(angle) / 180.0) * 100.0
+from System.system import System
# Main program
sys = System(angular_units = 'Radians')
while 1:
angle, linear = sys.measure()
- print(angle)
- """speed = control_function(angle)
- print(speed)
- sys.adjust(speed)"""
- time.sleep(0.05)
+ print("Angle: " + str(angle) + ", Linear: " + str(linear))
+ time.sleep(0.2)
|