Esempio n. 1
0
 def test_thread_starvation_group_sync_read(self):
     robot = stretch_body.robot.Robot()
     robot.end_of_arm.params['use_group_sync_read'] = 1
     print('Starting test_thread_starvation')
     print('Latency timer of %f' %
           robot.end_of_arm.params['dxl_latency_timer'])
     print('Testing on tool %s' % robot.params['tool'])
     robot.startup()
     try:
         for itr in range(100):  #Make large CPU load
             x = np.random.rand(3, 1000, 1000)
             x.tolist()
     except (IndexError, IOError) as e:
         self.fail("IndexError or IOError failure in comms")
     self.assertTrue(robot.end_of_arm.comm_errors.status['n_rx'] < 2)
     robot.end_of_arm.comm_errors.pretty_print()
     robot.stop()
Esempio n. 2
0
    robot.base.translate_by(x_m=-0.2,
                            v_m=base_vel_fast_m,
                            a_m=base_accel_fast_m)
    robot.lift.move_to(x_m=0)
    robot.arm.move_to(x_m=0.2)
    robot.push_command()

    time.sleep(4)

    # robot.stow()
    # robot.stop()

    return


if __name__ == "__main__":
    # Create two threads as follows
    try:
        robot = stretch_body.robot.Robot()
        robot.startup()

        p1 = Process(target=fear_audio)
        p1.start()
        p2 = Process(target=fear_gesture)
        p2.start()

        robot.stop()
    except:
        print("Error: unable to start thread")