From 5d77f0fb55e3e23c7767524844d0dced002dc049 Mon Sep 17 00:00:00 2001 From: Michael Soukup Date: Wed, 6 Aug 2014 14:43:57 +0200 Subject: [PATCH] draft for instructions --- TODO | 11 ++++++++--- demo.py | 22 +++++++++++++++++++--- instructions.txt | 8 ++++++++ ur5controller.pyc | Bin 12848 -> 12840 bytes 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 instructions.txt diff --git a/TODO b/TODO index a674f6c..0eae50a 100644 --- a/TODO +++ b/TODO @@ -3,12 +3,17 @@ - Make user for robot demo (give sudo) (OK) - Make script, place at desktop (OK) - Add author -- Run tests. +- Run tests. (OK) (write manual) TESTS: - Test with router connected to internjet (PASSED) -- Shutdown everything, restart. (without network) +- Shutdown everything, restart. (without network) (PASSED, but maybe requires to change IP) - Test manual control, especially boundaries and force monitor. (PASSED) - Test loops. (PASSED) -- Provoke exceptions that can halt the demo app. + +Provoke exceptions that can halt the demo app: + Press stop on tablet during loop, manual control and menu (PASSED, but requires to restart the robot.) + Provoke security stop --------------''----------------- (PASSED. When looping, exit and restart the loop. It doesnt pick up where it left.) + Shutdown robot -------------------''------------------- (PASSED. The application can continue withour restart when rebooting the robot) + Close application ----------------''------------------ (PASSED) diff --git a/demo.py b/demo.py index 02e849b..bfd5a71 100755 --- a/demo.py +++ b/demo.py @@ -47,6 +47,14 @@ class UR5Demo(object): if error: msg.append(error) + msg.append("Stopping robot...") + self._disptxt(msg) + try: + self.controller.robot.stopl(acc=0.2) + except Exception, e: + msg.append("Could not stop robot: %s" % e) + self._disptxt(msg) + msg.append("Setting robot to freedrive mode...") self._disptxt(msg) try: @@ -60,7 +68,7 @@ class UR5Demo(object): self._disptxt(msg) if self.controller: self.controller.cleanup() - time.sleep(2) # Give the UR5 threads a chance to terminate + time.sleep(1) # Give the UR5 threads a chance to terminate msg.append("Exit...") self._disptxt(msg) pygame.quit() @@ -69,11 +77,19 @@ class UR5Demo(object): else: return 0 + def go_home_pos(self): - self._disptxt(["Going to home configuration..."]) + msg = ["Going to home configuration..."] + self._disptxt(msg) pose = self.controller.cylinder2cartesian(config.R_HOME, config.THETA_HOME, config.Z_HOME) move = pose + [0.5, 0.1, 0] - self.controller.exec_move(move, wait=True) + try: + self.controller.exec_move(move, wait=True) + except Exception, e: + msg.append("Error: %s" % e) + self._disptxt(msg) + time.sleep(2) + def freedrive(self): self.controller.set_freedrive(True) diff --git a/instructions.txt b/instructions.txt new file mode 100644 index 0000000..2602a9d --- /dev/null +++ b/instructions.txt @@ -0,0 +1,8 @@ +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/ur5controller.pyc b/ur5controller.pyc index fb30325790515bb06aeb94e4423548340854c33f..448cee26ff45147e6524d70b47d9a472024d0859 100644 GIT binary patch delta 44 ycmdmxvLc0*`7?ZY_qBc GGZz4h;13-D