Skip to content

Commit

Permalink
Enable arm/lift thread by default
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-binit committed Oct 6, 2021
1 parent 08b9aea commit b26053c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion body/stretch_body/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self):

# ########### Device Methods #############

def startup(self, threaded=False):
def startup(self, threaded=True):
Device.startup(self, threaded=threaded)
success = self.motor.startup(threaded=False)
self.__update_status()
Expand Down
2 changes: 1 addition & 1 deletion body/stretch_body/lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self):
self.motor.set_motion_limits(self.translate_to_motor_rad(self.soft_motion_limits['current'][0]),
self.translate_to_motor_rad(self.soft_motion_limits['current'][1]))
# ########### Device Methods #############
def startup(self, threaded=False):
def startup(self, threaded=True):
Device.startup(self, threaded=threaded)
success= self.motor.startup(threaded=False)
self.__update_status()
Expand Down
8 changes: 4 additions & 4 deletions body/test/test_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_vel_guarded_contact(self):
"""
a = stretch_body.arm.Arm()
a.motor.disable_sync_mode()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))
a.pull_status()
if not a.motor.status['pos_calibrated']:
self.fail('test requires arm to be homed')
Expand Down Expand Up @@ -54,14 +54,14 @@ def test_vel_guarded_contact(self):

def test_valid_startup_status(self):
a = stretch_body.arm.Arm()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))
self.assertNotEqual(a.status['pos'],0)

def test_homing(self):
"""Test arm homes correctly.
"""
a = stretch_body.arm.Arm()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))

a.home(single_stop=False)
time.sleep(2)
Expand All @@ -75,7 +75,7 @@ def test_move_arm_with_soft_limits(self):
"""
a = stretch_body.arm.Arm()
a.motor.disable_sync_mode()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))
a.pull_status()
if not a.motor.status['pos_calibrated']:
self.fail('test requires arm to be homed')
Expand Down
8 changes: 4 additions & 4 deletions body/test/test_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TestLift(unittest.TestCase):
def test_vel_guarded_contact(self):
l = stretch_body.lift.Lift()
l.motor.disable_sync_mode()
self.assertTrue(l.startup())
self.assertTrue(l.startup(threaded=False))
l.pull_status()
if not l.motor.status['pos_calibrated']:
self.fail('test requires lift to be homed')
Expand Down Expand Up @@ -43,14 +43,14 @@ def test_vel_guarded_contact(self):

def test_valid_startup_status(self):
l = stretch_body.lift.Lift()
self.assertTrue(l.startup())
self.assertTrue(l.startup(threaded=False))
self.assertNotEqual(l.status['pos'],0)

def test_homing(self):
"""Test lift homes correctly.
"""
l = stretch_body.lift.Lift()
self.assertTrue(l.startup())
self.assertTrue(l.startup(threaded=False))
l.home()
l.push_command()
time.sleep(1)
Expand All @@ -63,7 +63,7 @@ def test_move_lift_with_soft_limits(self):
"""
l = stretch_body.lift.Lift()
l.motor.disable_sync_mode()
self.assertTrue(l.startup())
self.assertTrue(l.startup(threaded=False))
l.pull_status()
if not l.motor.status['pos_calibrated']:
self.fail('test requires lift to be homed')
Expand Down
4 changes: 2 additions & 2 deletions body/test/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TestSync(unittest.TestCase):

def test_runstop_sync_disabled(self):
a = stretch_body.arm.Arm()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))
a.motor.disable_sync_mode()
a.push_command()

Expand Down Expand Up @@ -81,7 +81,7 @@ def test_runstop_sync_enabled(self):
Check that runstop still works when using motor sync enable/disable
"""
a = stretch_body.arm.Arm()
self.assertTrue(a.startup())
self.assertTrue(a.startup(threaded=False))
a.motor.enable_sync_mode()
a.push_command()

Expand Down
2 changes: 1 addition & 1 deletion tools/bin/stretch_arm_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
args=parser.parse_args()

a=arm.Arm()
if not a.startup():
if not a.startup(threaded=False):
exit()
a.home(single_stop= not args.double)
a.stop()
Expand Down
2 changes: 1 addition & 1 deletion tools/bin/stretch_arm_jog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
large_move_m=0.1

a=arm.Arm()
if not a.startup():
if not a.startup(threaded=False):
exit()
a.motor.disable_sync_mode()
a.push_command()
Expand Down
4 changes: 2 additions & 2 deletions tools/bin/stretch_hardware_echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
b=base.Base()
b.startup()
a=arm.Arm()
a.startup()
a.startup(threaded=False)
l=lift.Lift()
l.startup()
l.startup(threaded=False)
print('Version: stretch_body: %s'%stretch_body.__version__)
print('---------- Boards ----------')
print('Pimu: %s'%p.board_info['board_version'])
Expand Down
2 changes: 1 addition & 1 deletion tools/bin/stretch_lift_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
args=parser.parse_args()

l=lift.Lift()
if not l.startup():
if not l.startup(threaded=False):
exit()
l.home()
l.stop()
Expand Down
2 changes: 1 addition & 1 deletion tools/bin/stretch_lift_jog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


l=lift.Lift()
if not l.startup():
if not l.startup(threaded=False):
exit()
l.motor.disable_sync_mode()
l.push_command()
Expand Down

0 comments on commit b26053c

Please sign in to comment.