|
From: <wa...@us...> - 2009-06-04 23:51:19
|
Revision: 16747
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=16747&view=rev
Author: wattsk
Date: 2009-06-04 23:51:12 +0000 (Thu, 04 Jun 2009)
Log Message:
-----------
Life test fixes and upgrades for wrist, arm and elbow
Modified Paths:
--------------
pkg/trunk/pr2/life_test/arm_life_test/arm_defs.xml
pkg/trunk/pr2/life_test/arm_life_test/full_arm.xml
pkg/trunk/pr2/life_test/arm_life_test/random_poses_right_cb.py
pkg/trunk/pr2/life_test/scripts/elbow_flex_life_test.py
pkg/trunk/pr2/life_test/scripts/wrist_test.py
pkg/trunk/pr2/life_test/simple_test/fake_test.py
pkg/trunk/pr2/life_test/src/life_test/life_test.py
pkg/trunk/pr2/life_test/src/life_test/ui.py
pkg/trunk/pr2/life_test/tests.xml
Added Paths:
-----------
pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch
Modified: pkg/trunk/pr2/life_test/arm_life_test/arm_defs.xml
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/arm_defs.xml 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/arm_life_test/arm_defs.xml 2009-06-04 23:51:12 UTC (rev 16747)
@@ -300,7 +300,7 @@
<anchor xyz="0 0 0" />
<limit min="-2.3" max="0.1" effort="30" velocity="${VELOCITY_LIMIT_SCALE*5.5}"
- k_position="100" k_velocity="3"
+ k_position="60" k_velocity="8"
safety_length_min="0.25" safety_length_max="0.1" />
<calibration reference_position="${-1.1606 + cal_r_elbow_flex_flag}" values="1.5 -1" />
Modified: pkg/trunk/pr2/life_test/arm_life_test/full_arm.xml
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/full_arm.xml 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/arm_life_test/full_arm.xml 2009-06-04 23:51:12 UTC (rev 16747)
@@ -1,10 +1,12 @@
<?xml version="1.0"?>
<robot name="test_arm">
+ <include filename="$(find pr2_defs)/calibration/default_cal.xml" />
<include filename="$(find pr2_defs)/defs/arm_defs.xml" />
<include filename="$(find pr2_defs)/defs/gripper_defs.xml" />
<include filename="$(find pr2_defs)/defs/body_defs.xml" />
- <include filename="$(find arm_life_test)/groups_arm.xml" />
+ <include filename="$(find life_test)/arm_life_test/groups_arm.xml" />
+
<pr2_torso name="base" parent="world">
<origin xyz="0 0 0" rpy="0 0 0" />
Modified: pkg/trunk/pr2/life_test/arm_life_test/random_poses_right_cb.py
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/random_poses_right_cb.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/arm_life_test/random_poses_right_cb.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -34,8 +34,7 @@
from std_msgs.msg import *
from robot_msgs.msg import *
-pub = rospy.Publisher('/r_arm_cartesian_pose_controller/command', PoseStamped)
-#pub = rospy.Publisher('/cartesian_trajectory_right/command', PoseStamped)
+pub = rospy.Publisher('r_arm_cartesian_pose_controller/command', PoseStamped)
def p(x, y, z, rx, ry, rz, w):
Modified: pkg/trunk/pr2/life_test/scripts/elbow_flex_life_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/elbow_flex_life_test.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/scripts/elbow_flex_life_test.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -88,9 +88,9 @@
while not rospy.is_shutdown():
if roll:
fore_roll.publish(Float64(1.0))
- arm_pos.publish(Float64(0.0))
+ arm_pos.publish(Float64(-0.05))
sleep(0.5)
- arm_pos.publish(Float64(-2.05))
+ arm_pos.publish(Float64(-2.00))
sleep(0.5)
except Exception, e:
print "Caught exception!"
Modified: pkg/trunk/pr2/life_test/scripts/wrist_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -114,9 +114,16 @@
else:
print "Spawned grip controller successfully"
+ if fixed_to_bar:
+ effort_flex = 1000
+ effort_roll = 1000
+ else:
+ effort_flex = 6
+ effort_roll = 3 # Turn down effort roll to make wrist flex up and down
+
+
+
effort_grip = -100
- effort_flex = 4
- effort_roll = 4
try:
while not rospy.is_shutdown():
@@ -128,8 +135,13 @@
pub_grip.publish(Float64(effort_grip))
pub_flex.publish(Float64(effort_flex))
- pub_roll.publish(Float64(effort_roll))
+ if fixed_to_bar and random.randint(0, 5) == 1:
+ pub_roll.publish(Float64(0))
+ else:
+ pub_roll.publish(Float64(effort_roll))
+
+
sleep(0.3)
finally:
Modified: pkg/trunk/pr2/life_test/simple_test/fake_test.py
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -57,7 +57,7 @@
self._diag_timer = wx.Timer(self, 1)
self.Bind(wx.EVT_TIMER, self.on_timer, self._diag_timer)
self._last_publish = rospy.get_time()
- self._diag_timer.Start(500, True)
+ self._diag_timer.Start(250, True)
# Load XRC
xrc_path = os.path.join(roslib.packages.get_pkg_dir('life_test'), 'xrc/gui.xrc')
Modified: pkg/trunk/pr2/life_test/src/life_test/life_test.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -86,6 +86,7 @@
self._test_name = test._name
self._log = {}
+ self._last_log_time = self._last_update_time
csv_name = strftime("%m%d%Y_%H%M%S", localtime(self._start_time)) + '_' + str(self._serial) + '_' + self._test_name + '.csv'
csv_name = csv_name.replace(' ', '_').replace('/', '__')
@@ -169,9 +170,10 @@
self._was_launched = launched
self._last_update_time = rospy.get_time()
- if alert or note != '':
+ if alert or note != '' or (running and self._last_log_time - rospy.get_time() > 7200):
self.write_csv_row(self._last_update_time, state, msg, note)
self._log[rospy.get_time()] = msg + ' ' + note
+ self._last_log_time = self._last_update_time
return alert, msg
@@ -284,17 +286,18 @@
self._test_complete = False
# Timeout for etherCAT diagnostics
- self.timer = wx.Timer(self, 1)
+ self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)
self.last_message_time = rospy.get_time()
- self.timeout_interval = 2.0
+ self.timeout_interval = 5.0
self._is_stale = True
# Timer for invent logging
- self.invent_timer = wx.Timer(self, 2)
+ self.invent_timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_invent_timer, self.invent_timer)
self._last_invent_time = rospy.get_time()
self.invent_timeout = 600
+ self.invent_timer.Start(self.invent_timeout * 500)
self._is_invent_stale = True
self._invent_note_id = None
@@ -311,6 +314,10 @@
# Somehow calling log function in destructor
print 'Stopping launches'
self.stop_test()
+
+ if self._diag_sub:
+ print 'Unregistering from diagnostics'
+ self._diag_sub.unregister()
def is_launched(self):
return self._test_launcher is not None
@@ -382,7 +389,8 @@
self._current_log[rospy.get_time()] = msg
self._manager.log_test_entry(self._test._name, self._machine, msg)
- wx.CallAfter(self.display_logs)
+ #self._log_ctrl.AppendText(
+ self.display_logs()
self.notify_operator(alert, msg)
@@ -414,14 +422,14 @@
if rospy.get_time() - self._last_invent_time > self.invent_timeout and self.is_launched():
self.update_invent()
- self.invent_timer.Start(self.invent_timeout * 500, True)
+ #self.invent_timer.Start(self.invent_timeout * 500, True)
def update_invent(self):
- # rospy.logerr('Updating invent')
+ rospy.logerr('Updating invent')
# Reset timer, last time
- self.invent_timer.Start(self.invent_timeout * 500, True)
+ #self.invent_timer.Start(self.invent_timeout * 500, True)
self._last_invent_time = rospy.get_time()
# Don't log anything if we haven't launched
@@ -465,7 +473,7 @@
def start_timer(self):
- self.timer.Start(1000, True)
+ self.timer.Start(1000 * self.timeout_interval, True)
def on_timer(self, event):
self._mutex.acquire()
@@ -481,11 +489,11 @@
self.stop_if_done()
self.update_controls(3)
else:
- self.start_timer()
+ #self.start_timer()
self._is_stale = False
self._mutex.release()
- self.Refresh()
+ #self.Refresh()
def update_controls(self, level = 3, msg = 'None'):
# Assumes it has the lock
@@ -560,10 +568,12 @@
self._test_launcher.stop()
self._manager.test_stop(self._machine)
self.log('Stopping test launch')
+ self._test_launcher = None
+ if self._diag_sub:
+ self._diag_sub.unregister()
self._diag_sub = None
- self._test_launcher = None
self._is_running = False
if event is not None: # In GUI thread
@@ -575,25 +585,23 @@
self._current_log[rospy.get_time()] = msg
self._manager.log_test_entry(self._test._name, self._machine, msg)
- wx.CallAfter(self.display_logs)
+ #wx.CallAfter(self.display_logs)
def display_logs(self):
- # Make them bottom of log visible...
- try:
- self._mutex.acquire()
- except:
- return
+ #try:
+ # self._mutex.acquire()
+ #except:
+ # rospy.logerr('Error attempting to acquire mutex!')
+ # return
self._log_ctrl.AppendText(self.print_cur_log())
- self._log_ctrl.Refresh()
- self._log_ctrl.Update()
+ #self._log_ctrl.Refresh()
+ #self._log_ctrl.Update()
self._current_log = {}
- self._mutex.release()
+ #self._mutex.release()
def diag_callback(self, message):
- #print 'Acquiring mutex for diagnostic callback'
self._mutex.acquire()
- #print 'Diagnostic mutex acquired'
self._diags.append(message)
self._mutex.release()
wx.CallAfter(self.new_msg)
@@ -623,12 +631,14 @@
rospy.logerr('Caught exception processing diagnostic msg.\nEx: %s' % traceback.format_exc())
self._mutex.release()
- self.Refresh()
+ #self.Refresh()
def make_launch_script(self):
launch = '<launch>\n'
launch += '<group ns="%s">' % self._machine
+
+ # Remap
launch += '<remap from="/diagnostics" to="/%s/diagnostics" />' % self._machine
# Init machine
launch += '<machine name="test_host_root" user="root" address="%s" ' % self._machine
Modified: pkg/trunk/pr2/life_test/src/life_test/ui.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/ui.py 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/src/life_test/ui.py 2009-06-04 23:51:12 UTC (rev 16747)
@@ -48,6 +48,8 @@
import glob
import wx
import time
+import traceback
+import threading
from wx import xrc
from wx import html
@@ -58,14 +60,10 @@
from cStringIO import StringIO
import struct
-import traceback
-
from invent_client.invent_client import Invent
from life_test import *
-import threading
-
class TestManagerFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, wx.ID_ANY, "Test Manager")
@@ -139,6 +137,7 @@
if self._tab_ctrl.DeletePage(idx + 1):
del self._test_monitors[serial]
del self._active_serials[idx]
+ #print 'Active serials after deletion', self._active_serials
def test_start_check(self, machine):
if machine in self._active_machines:
@@ -151,6 +150,7 @@
if machine in self._active_machines:
idx = self._active_machines.index(machine)
del self._active_machines[idx]
+ #print 'Active machines after delete:', self._active_machines
def load_invent_client(self):
# Loads invent client. Singleton, doesn't construct unless valid login
Modified: pkg/trunk/pr2/life_test/tests.xml
===================================================================
--- pkg/trunk/pr2/life_test/tests.xml 2009-06-04 23:29:28 UTC (rev 16746)
+++ pkg/trunk/pr2/life_test/tests.xml 2009-06-04 23:51:12 UTC (rev 16747)
@@ -9,6 +9,13 @@
rate="3" script="wrist_test/test_gui.launch"
type="Life Test" />
+ <test serial="6804213" name="Fixed Wrist Test"
+ desc="Test of wrist attached to a bar, jerking around."
+ rate="3" script="wrist_test/test_gui_bar.launch"
+ type="Life Test" />
+
+
+
<test serial="6804040" name="Head Life Test"
desc="Tests head on test cart, moving between [-0.4, 1.4] tilt, [-2.7, 2.7] pan."
rate="2.0" script="head_test/life_test/test_gui.launch"
Added: pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch
===================================================================
--- pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch (rev 0)
+++ pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch 2009-06-04 23:51:12 UTC (rev 16747)
@@ -0,0 +1,10 @@
+<launch>
+ <param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find life_test)/wrist_test/wrist.xml'" />
+
+ <node machine="test_host_root" pkg="pr2_etherCAT" type="pr2_etherCAT" args="-i eth0 -x robotdesc/pr2"/>
+
+ <!-- Don't calibrate wrist attached to bar. -->
+
+ <include file="$(find life_test)/wrist_test/life_test.launch" args="--bar" />
+
+</launch>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mm...@us...> - 2009-07-15 21:03:32
|
Revision: 18886
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=18886&view=rev
Author: mmwise
Date: 2009-07-15 21:03:21 +0000 (Wed, 15 Jul 2009)
Log Message:
-----------
changing to new head controller and getting rid of robot_msgs/JointCmd #1306
Modified Paths:
--------------
pkg/trunk/pr2/life_test/head_test/impact_test/test_gui.launch
pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch
pkg/trunk/pr2/life_test/head_test/life_test/test_controller.xml
pkg/trunk/pr2/life_test/scripts/run_head_test.py
Modified: pkg/trunk/pr2/life_test/head_test/impact_test/test_gui.launch
===================================================================
--- pkg/trunk/pr2/life_test/head_test/impact_test/test_gui.launch 2009-07-15 20:48:43 UTC (rev 18885)
+++ pkg/trunk/pr2/life_test/head_test/impact_test/test_gui.launch 2009-07-15 21:03:21 UTC (rev 18886)
@@ -1,4 +1,4 @@
-l<launch>
+<launch>
<param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find life_test)/head_test/impact_test/head.xml'" />
Modified: pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch
===================================================================
--- pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch 2009-07-15 20:48:43 UTC (rev 18885)
+++ pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch 2009-07-15 21:03:21 UTC (rev 18886)
@@ -2,6 +2,13 @@
<!-- Runs the test on or off the test cart. -->
<!-- May need to put in to to scripts folder -->
<node pkg="life_test" type="run_head_test.py" />
+
+ <group ns="head_controller" clear_params="true">
+ <param name="pan_link_name" type="string" value="head_pan_link" />
+ <param name="tilt_link_name" type="string" value="head_tilt_link" />
+ <param name="pan_output" type="string" value="head_pan_joint_position_controller" />
+ <param name="tilt_output" type="string" value="head_tilt_joint_position_controller" />
+ </group>
<node pkg="mechanism_control" type="spawner.py" args="$(find life_test)/head_test/life_test/test_controller.xml" />
Modified: pkg/trunk/pr2/life_test/head_test/life_test/test_controller.xml
===================================================================
--- pkg/trunk/pr2/life_test/head_test/life_test/test_controller.xml 2009-07-15 20:48:43 UTC (rev 18885)
+++ pkg/trunk/pr2/life_test/head_test/life_test/test_controller.xml 2009-07-15 21:03:21 UTC (rev 18886)
@@ -1,25 +1,25 @@
-<controllers>
-<controller name="head_controller" type="HeadPanTiltControllerNode">
- <controller name="head_pan_controller" topic="head_pan_controller" type="JointPositionController">
- <joint name="head_pan_joint" >
- <pid p="2.5" d="0.5" i="12.0" iClamp="0.5" />
- </joint>
- </controller>
+<controller type="HeadPositionController" name="head_controller"/>
+
+<controller name="head_pan_joint_position_controller" type="JointPositionController">
+ <joint name="head_pan_joint" >
+ <pid p="2.5" d="0.5" i="12.0" iClamp="0.5" />
+ </joint>
+</controller>
- <controller name="head_tilt_controller" topic="head_tilt_controller" type="JointPositionController">
- <joint name="head_tilt_joint" >
- <pid p="15" d="0.5" i="5" iClamp="1.0" />
- </joint>
- </controller>
+<controller name="head_tilt_joint_position_controller" type="JointPositionController">
+ <joint name="head_tilt_joint" >
+ <pid p="15" d="0.5" i="5" iClamp="1.0" />
+ </joint>
+</controller>
-</controller>
+
<controller name="laser_controller" topic="laser_controller" type="LaserScannerControllerNode">
<filter smoothing_factor="0.1" />
<joint name="laser_tilt_mount_joint">
<pid p="12" i=".1" d="1" iClamp="0.5" />
</joint>
- </controller>
+</controller>
</controllers>
Modified: pkg/trunk/pr2/life_test/scripts/run_head_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/run_head_test.py 2009-07-15 20:48:43 UTC (rev 18885)
+++ pkg/trunk/pr2/life_test/scripts/run_head_test.py 2009-07-15 21:03:21 UTC (rev 18886)
@@ -38,16 +38,26 @@
from time import sleep
import random
import rospy
-from robot_msgs.msg import JointCmd
+from mechanism_msgs.msg import JointStates, JointState
+
def point_head_client(pan, tilt):
- head_angles.publish(JointCmd(['head_pan_joint', 'head_tilt_joint'],[0.0,0.0],[pan, tilt],[0.0, 0.0],[0.0, 0.0]))
+ ps = JointState()
+ ps.name = 'head_pan_joint'
+ ps.position = pan
+ ts = JointState()
+ ts.name ='head_tilt_joint'
+ ts.position = tilt
+ js = JointStates()
+ js.joints = [ps, ts]
+ head_angles.publish(js)
+
sleep(0.5)
if __name__ == "__main__":
- head_angles = rospy.Publisher('head_controller/set_command_array', JointCmd)
+ head_angles = rospy.Publisher('head_controller/command', JointStates)
rospy.init_node('head_commander', anonymous=True)
sleep(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mm...@us...> - 2009-07-15 22:36:54
|
Revision: 18899
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=18899&view=rev
Author: mmwise
Date: 2009-07-15 22:36:51 +0000 (Wed, 15 Jul 2009)
Log Message:
-----------
removing dependancy on robot_msgs/JointCmd #1306
Modified Paths:
--------------
pkg/trunk/pr2/life_test/laser_tilt_test/life_test/run_laser_tilt_test.py
pkg/trunk/pr2/life_test/scripts/run_laser_tilt_test.py
Modified: pkg/trunk/pr2/life_test/laser_tilt_test/life_test/run_laser_tilt_test.py
===================================================================
--- pkg/trunk/pr2/life_test/laser_tilt_test/life_test/run_laser_tilt_test.py 2009-07-15 22:34:28 UTC (rev 18898)
+++ pkg/trunk/pr2/life_test/laser_tilt_test/life_test/run_laser_tilt_test.py 2009-07-15 22:36:51 UTC (rev 18899)
@@ -39,7 +39,7 @@
import random
import rospy
from std_msgs import *
-from robot_msgs.msg import JointCmd
+
from pr2_mechanism_controllers.srv import *
from mechanism_control import mechanism
Modified: pkg/trunk/pr2/life_test/scripts/run_laser_tilt_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/run_laser_tilt_test.py 2009-07-15 22:34:28 UTC (rev 18898)
+++ pkg/trunk/pr2/life_test/scripts/run_laser_tilt_test.py 2009-07-15 22:36:51 UTC (rev 18899)
@@ -39,7 +39,7 @@
import random
import rospy
from std_msgs import *
-from robot_msgs.msg import JointCmd
+
from pr2_mechanism_controllers.srv import *
from mechanism_control import mechanism
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-07-21 07:02:11
|
Revision: 19295
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19295&view=rev
Author: wattsk
Date: 2009-07-21 07:02:06 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
Updates in prep for wrist test with latest Test Manager version
Modified Paths:
--------------
pkg/trunk/pr2/life_test/head_test/life_test/test_gui.launch
pkg/trunk/pr2/life_test/scripts/wrist_test.py
pkg/trunk/pr2/life_test/simple_test/fake_test.py
pkg/trunk/pr2/life_test/src/life_test/life_test.py
pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
pkg/trunk/pr2/life_test/src/life_test/ui.py
pkg/trunk/pr2/life_test/tests.xml
pkg/trunk/pr2/life_test/wrist_test/test_gui.launch
pkg/trunk/pr2/life_test/xrc/gui.fbp
Removed Paths:
-------------
pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch
Modified: pkg/trunk/pr2/life_test/head_test/life_test/test_gui.launch
===================================================================
--- pkg/trunk/pr2/life_test/head_test/life_test/test_gui.launch 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/head_test/life_test/test_gui.launch 2009-07-21 07:02:06 UTC (rev 19295)
@@ -1,19 +1,16 @@
<launch>
<param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find life_test)/head_test/life_test/head.xml'" />
-
<node machine="test_host_root" pkg="pr2_etherCAT" type="pr2_etherCAT" args="-i eth0 -x robotdesc/pr2"/>
-
<!-- Calibration -->
<node pkg="mechanism_bringup" type="calibrate.py"
args="$(find life_test)/head_test/cal_head.xml"
output="screen" />
-
- <!-- Runtime Diagnostics Logging -->
- <!--node pkg="rosrecord" type="rosrecord"
- args="-f ~/wrist_test.bag /diagnostics" /-->
<include file="$(find life_test)/head_test/life_test/life_test.launch" />
+ <node pkg="life_test" type="ethercat_test_monitor.py" args="$(find life_test)/head_test/head_trans.csv" />
+
+
</launch>
Modified: pkg/trunk/pr2/life_test/scripts/wrist_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-07-21 07:02:06 UTC (rev 19295)
@@ -86,8 +86,9 @@
def main():
rospy.init_node('wrist_test', anonymous=True)
+
rospy.wait_for_service('spawn_controller')
-
+
resp = spawn_controller(xml_for_flex())
if len(resp.ok) < 1 or not ord(resp.ok[0]):
rospy.logerr("Failed to spawn effort controller")
@@ -114,17 +115,13 @@
else:
print "Spawned grip controller successfully"
- if fixed_to_bar:
- effort_flex = 1000
- effort_roll = 1000
- else:
- effort_flex = 6
- effort_roll = 3 # Turn down effort roll to make wrist flex up and down
-
-
-
+ effort_flex = rospy.get_param('flex_effort')
+ effort_roll = rospy.get_param('roll_effort')
+
effort_grip = -100
-
+
+ freq = rospy.get_param('cycle_rate')
+
try:
while not rospy.is_shutdown():
if random.randint(0, 1) == 1:
@@ -135,15 +132,11 @@
pub_grip.publish(Float64(effort_grip))
pub_flex.publish(Float64(effort_flex))
+ pub_roll.publish(Float64(effort_roll))
- if fixed_to_bar and random.randint(0, 5) == 1:
- pub_roll.publish(Float64(0))
- else:
- pub_roll.publish(Float64(effort_roll))
+ sleep(1.0 / freq)
- sleep(0.3)
-
finally:
kill_controller('grip_effort')
kill_controller('wrist_flex_effort')
Modified: pkg/trunk/pr2/life_test/simple_test/fake_test.py
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-07-21 07:02:06 UTC (rev 19295)
@@ -88,7 +88,8 @@
self._start_time = rospy.get_time()
def on_mech_timer(self, event = None):
- self._mech_timer.Start(10, True)
+ if not rospy.is_shutdown():
+ self._mech_timer.Start(10, True)
# Joint state is a sine, period 1s, Amplitude 2,
trig_arg = rospy.get_time() - self._start_time
@@ -169,8 +170,8 @@
self.range_param_ctrl.SetValue(range_param)
def on_timer(self, event = None):
- print 'Making message'
- self._diag_timer.Start(1000, True)
+ if not rospy.is_shutdown():
+ self._diag_timer.Start(1000, True)
level_dict = { "OK": 0, "Warn": 1, "Error": 2 }
Modified: pkg/trunk/pr2/life_test/src/life_test/life_test.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-07-21 07:02:06 UTC (rev 19295)
@@ -88,7 +88,6 @@
xrc_path = os.path.join(roslib.packages.get_pkg_dir('life_test'), 'xrc/gui.xrc')
self._panel = xrc.XmlResource(xrc_path).LoadPanel(self, 'test_panel')
- #self._test_data_panel = self._manager._xrc.LoadPanel(self, 'test_data')
self._test_desc = xrc.XRCCTRL(self._panel, 'test_desc')
self._test_desc.SetValue(self._test._desc)
@@ -388,7 +387,7 @@
self._launch_button.Enable(not self.is_launched())
self._close_button.Enable(not self.is_launched())
- def print_cur_log(self):
+ def display_logs(self):
kys = dict.keys(self._current_log)
kys.sort()
@@ -397,7 +396,8 @@
log_str += strftime("%m/%d/%Y %H:%M:%S: ",
localtime(ky)) + self._current_log[ky] + '\n'
- return log_str
+ self._log_ctrl.AppendText(log_str)
+ self._current_log = {}
def stop_if_done(self):
remain = self.calc_remaining()
@@ -426,11 +426,6 @@
if event is not None: # In GUI thread
self.update_controls()
-
- def display_logs(self):
-
- self._log_ctrl.AppendText(self.print_cur_log())
- self._current_log = {}
def status_callback(self, msg):
self._mutex.acquire()
@@ -450,7 +445,6 @@
self.stop_if_done()
self.update_controls(self._status_msg.test_ok, self._status_msg.message)
-
self._mutex.release()
@@ -469,10 +463,7 @@
# Include our launch file
launch += '<include file="$(find life_test)/%s" />' % self._test._launch_script
- # TODO: Check bag, make sure it's on the right topic
- # Record our diagnostics remaped back to local diagnostics
- launch += '<remap from="%s" to="/diagnostics" />' % local_diag_topic
- launch += ' <node pkg="rosrecord" type="rosrecord" args="-f /hwlog/test_runtime_automatic %s" />' % local_diag_topic
+ launch += ' <node pkg="rosrecord" type="rosrecord" args="-f /hwlog/test_runtime_automatic /diagnostics" />'
launch += '</group>\n</launch>'
@@ -520,7 +511,6 @@
self._monitor_panel.change_diagnostic_topic(local_diag)
self.update_controls()
- #self._diag_sub = rospy.Subscriber(local_diagnostics, DiagnosticMessage, self.diag_callback)
self._status_sub = rospy.Subscriber(local_status, TestStatus, self.status_callback)
Modified: pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-07-21 07:02:06 UTC (rev 19295)
@@ -60,6 +60,8 @@
self._num_errors = 0
self._num_errors_since_reset = 0
self._rx_count = 0
+ self._max_position = -1000000
+ self._min_position = 10000000
def reset(self):
self._ok = True
@@ -72,7 +74,7 @@
return True # Don't bother with uncalibrated joints
if self._continuous: # Reset position to home value
- normalized = position % (2*math.pi) - math.pi # Between -pi, pi
+ position = position % (2*math.pi) - math.pi # Between -pi, pi
# Reverse for joints that have negative search velocities
cal_bool = cal_reading % 2 == 0
@@ -97,8 +99,8 @@
diag.strings.append(DiagnosticString(value=self._joint, label="Joint"))
diag.strings.append(DiagnosticString(value=self._actuator, label="Actuator"))
- diag.values.append(DiagnosticString(value=self._positive, label="Positive Joint"))
- diag.values.append(DiagnosticString(value=self._continuous, label="Continuous Joint"))
+ diag.strings.append(DiagnosticString(value=str(self._positive), label="Positive Joint"))
+ diag.strings.append(DiagnosticString(value=str(self._continuous), label="Continuous Joint"))
diag.values.append(DiagnosticValue(value=float(self._ref_position), label="Reference Position"))
diag.values.append(DiagnosticValue(value=float(self._deadband), label="Deadband"))
diag.values.append(DiagnosticValue(value=float(self._rx_count), label="Mech State RX Count"))
@@ -123,6 +125,8 @@
diag.strings.append(DiagnosticString(value=str(act_exists), label='Actuator Exists'))
diag.strings.append(DiagnosticString(value=str(joint_exists), label='Joint Exists'))
+
+
# First check existance of joint, actuator
if not (act_exists and joint_exists):
diag.level = 2
@@ -151,6 +155,12 @@
diag.values.append(DiagnosticValue(value=self._num_errors, label='Total Errors'))
diag.values.append(DiagnosticValue(value=self._num_errors_since_reset, label='Errors Since Reset'))
+
+ self._max_position = max(self._max_position, position)
+ diag.values.append(DiagnosticValue(value = self._max_position, label='Max Obs. Position'))
+
+ self._min_position = min(self._min_position, position)
+ diag.values.append(DiagnosticValue(value = self._min_position, label='Min Obs. Position'))
return diag, self._ok
Modified: pkg/trunk/pr2/life_test/src/life_test/ui.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/ui.py 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/src/life_test/ui.py 2009-07-21 07:02:06 UTC (rev 19295)
@@ -244,7 +244,7 @@
p_desc = param_xml.attributes['desc'].value
p_val = param_xml.attributes['val'].value
- p_rate = int(param_xml.attributes['rate'].value) == 1
+ p_rate = param_xml.attributes['rate'].value == 'true'
test_params.append(TestParam(p_name, p_param_name,
Modified: pkg/trunk/pr2/life_test/tests.xml
===================================================================
--- pkg/trunk/pr2/life_test/tests.xml 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/tests.xml 2009-07-21 07:02:06 UTC (rev 19295)
@@ -1,4 +1,4 @@
-<!-- Stores key data on every test that can run through the test manager -->
+<!-- Stores data on every test that can run through the test manager -->
<tests>
<test serial="faketes" name="Simple Test"
short="Fake" trac="007"
@@ -9,11 +9,11 @@
<!-- Load test parameters -->
<param name="Rate" param_name="cycle_rate"
desc="Changes the frequency of the test"
- rate="1" val="1.0" />
+ rate="true" val="1.0" />
<param name="Choice Param" param_name="test_choice"
desc="Chooses between a few choices"
- val="A" rate="0" />
+ val="A" rate="false" />
</test>
<test serial="6804213" name="Free Wrist Test"
@@ -23,29 +23,29 @@
type="Life Test" >
<param name="Rate" param_name="cycle_rate"
desc="Frequency of commands"
- val="3.0" rate="1" />
+ val="3.0" rate="true" />
<param name="Flex Effort" param_name="flex_effort"
desc="Wrist Flex Effort"
- val="4.0" rate="0" />
+ val="4.0" rate="false" />
<param name="Roll Effort" param_name="roll_effort"
desc="Wrist Roll Effort"
- val="3.0" rate="0" />
+ val="3.0" rate="false" />
</test>
<test serial="6804213" name="Fixed Wrist Test"
short="Wrist" trac="438"
desc="Test of wrist attached to a bar, jerking around."
- rate="3" script="wrist_test/test_gui_bar.launch"
+ rate="3" script="wrist_test/test_gui.launch"
type="Life Test" >
<param name="Rate" param_name="cycle_rate"
desc="Frequency of commands"
- val="3.0" rate="1" />
+ val="3.0" rate="true" />
<param name="Flex Effort" param_name="flex_effort"
desc="Wrist Flex Effort"
- val="4.0" rate="0" />
+ val="100.0" rate="false" />
<param name="Roll Effort" param_name="roll_effort"
desc="Wrist Roll Effort"
- val="3.0" rate="0" />
+ val="100.0" rate="false" />
</test>
@@ -53,39 +53,65 @@
<test serial="6804040" name="Head Life Test"
short="Head" trac="289"
desc="Tests head on test cart, moving between [-0.4, 1.4] tilt, [-2.7, 2.7] pan."
- rate="2.0" script="head_test/life_test/test_gui.launch"
- type="Life Test" />
+ script="head_test/life_test/test_gui.launch"
+ type="Life Test" >
+ <param name="Cycle rate" param_name="cycle_rate"
+ desc="Cycle rate of head"
+ val="2.0" rate="true" />
+ </test>
<test serial="6804040" name="Head Impact Test"
short="Head" trac="288"
desc="Impacts head, pan and tilt"
- rate="0.25" script="head_test/impact_test/test_gui.launch"
- type="Impact Test" />
+ script="head_test/impact_test/test_gui.launch"
+ type="Impact Test" >
+ <param name="Cycle rate" param_name="cycle_rate"
+ desc="Cycle rate of head"
+ val="0.25" rate="true" />
+ </test>
<test serial="6804139" name="Arm Cable Wrap Test"
short="Cable" trac="320/400"
desc="Tests arm cables."
rate="1.0" script="arm_life_test/test_gui.launch"
- type="Life Test" />
+ type="Life Test" >
+ <param name="Forearm Roll" param_name="forearm_roll"
+ desc="Forearm roll true/false"
+ val="false" rate="false" />
+ </test>
<!-- Add forearm roll cycle rate values -->
<test serial="6804139" name="Arm Cable Wrap Test - With Roll"
short="Cable" trac="320/400"
desc="Tests arm cables."
- rate="1.0" script="arm_life_test/test_roll_gui.launch"
- type="Life Test" />
+ script="arm_life_test/test_gui.launch"
+ type="Life Test" >
+ <param name="Forearm Roll" param_name="forearm_roll"
+ desc="Forearm roll true/false"
+ val="true" rate="false" />
+ <param name="Forearm roll rate" param_name="fore_roll_rate"
+ desc="Forearm roll rate"
+ val="1.0" rate="true" />
+ </test>
<test serial="6804178" name="Full Arm Counterbalance Test"
short="Full CB" trac="402"
desc="Moves arm up and down for full counterbalance workout."
- rate="0.5" script="arm_life_test/test_gui_cb.launch"
- type="Life Test" />
+ script="arm_life_test/test_gui_cb.launch"
+ type="Life Test" >
+ <param name="Cycle rate" param_name="cycle_rate"
+ desc="Cycle rate of arm/CB"
+ val="0.5" rate="true" />
+ </test>
<test serial="6804178" name="Full Arm CB Test - Dummy Forearm"
short="Dummy CB" trac="402"
desc="Moves arm up and down for full counterbalance workout."
- rate="0.5" script="arm_life_test/test_gui_cb_forearm.launch"
- type="Life Test" />
-
+ script="arm_life_test/test_gui_cb_forearm.launch"
+ type="Life Test" >
+ <param name="Cycle rate" param_name="cycle_rate"
+ desc="Cycle rate of arm/CB"
+ val="0.5" rate="true" />
+ </test>
</tests>
Modified: pkg/trunk/pr2/life_test/wrist_test/test_gui.launch
===================================================================
--- pkg/trunk/pr2/life_test/wrist_test/test_gui.launch 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/wrist_test/test_gui.launch 2009-07-21 07:02:06 UTC (rev 19295)
@@ -9,7 +9,9 @@
args="$(find life_test)/wrist_test/wrist_cal.xml"
output="screen" />
-
- <include file="$(find life_test)/wrist_test/life_test.launch" />
+ <node pkg="life_test" type="wrist_test.py" />
+ <node pkg="life_test" type="ethercat_test_monitor.py" />
+
+
</launch>
Deleted: pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch
===================================================================
--- pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/wrist_test/test_gui_bar.launch 2009-07-21 07:02:06 UTC (rev 19295)
@@ -1,10 +0,0 @@
-<launch>
- <param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find life_test)/wrist_test/wrist.xml'" />
-
- <node machine="test_host_root" pkg="pr2_etherCAT" type="pr2_etherCAT" args="-i eth0 -x robotdesc/pr2"/>
-
- <!-- Don't calibrate wrist attached to bar. -->
-
- <include file="$(find life_test)/wrist_test/life_test.launch" args="--bar" />
-
-</launch>
Modified: pkg/trunk/pr2/life_test/xrc/gui.fbp
===================================================================
--- pkg/trunk/pr2/life_test/xrc/gui.fbp 2009-07-21 06:47:35 UTC (rev 19294)
+++ pkg/trunk/pr2/life_test/xrc/gui.fbp 2009-07-21 07:02:06 UTC (rev 19295)
@@ -1195,21 +1195,74 @@
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer46</property>
- <property name="orient">wxHORIZONTAL</property>
+ <property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
- <object class="spacer" expanded="1">
- <property name="height">0</property>
- <property name="permission">protected</property>
- <property name="width">0</property>
+ <object class="wxBoxSizer" expanded="1">
+ <property name="minimum_size"></property>
+ <property name="name">bSizer51</property>
+ <property name="orient">wxVERTICAL</property>
+ <property name="permission">none</property>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALL|wxALIGN_RIGHT</property>
+ <property name="proportion">0</property>
+ <object class="wxButton" expanded="1">
+ <property name="bg"></property>
+ <property name="context_help"></property>
+ <property name="default">0</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="font"></property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Close</property>
+ <property name="maximum_size"></property>
+ <property name="minimum_size"></property>
+ <property name="name">close_button</property>
+ <property name="permission">protected</property>
+ <property name="pos"></property>
+ <property name="size">60,-1</property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnButtonClick"></event>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
@@ -1267,63 +1320,11 @@
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
- <object class="wxBoxSizer" expanded="0">
+ <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer49</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALL</property>
- <property name="proportion">0</property>
- <object class="wxButton" expanded="1">
- <property name="bg"></property>
- <property name="context_help"></property>
- <property name="default">0</property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="label">Close</property>
- <property name="maximum_size"></property>
- <property name="minimum_size"></property>
- <property name="name">close_button</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size">60,-1</property>
- <property name="style"></property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="window_extra_style"></property>
- ...
[truncated message content] |
|
From: <wa...@us...> - 2009-07-21 21:50:55
|
Revision: 19331
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19331&view=rev
Author: wattsk
Date: 2009-07-21 21:50:50 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
Fixes to wrist test, test manager
Modified Paths:
--------------
pkg/trunk/pr2/life_test/arm_life_test/controller_cartesian_pose_right_forearm.launch
pkg/trunk/pr2/life_test/arm_life_test/full_arm.launch
pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb_forearm.launch
pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
pkg/trunk/pr2/life_test/scripts/impact_head_test.py
pkg/trunk/pr2/life_test/scripts/wrist_test.py
pkg/trunk/pr2/life_test/src/life_test/life_test.py
pkg/trunk/pr2/life_test/wrist_test/test_gui.launch
Modified: pkg/trunk/pr2/life_test/arm_life_test/controller_cartesian_pose_right_forearm.launch
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/controller_cartesian_pose_right_forearm.launch 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/arm_life_test/controller_cartesian_pose_right_forearm.launch 2009-07-21 21:50:50 UTC (rev 19331)
@@ -2,12 +2,12 @@
<!-- Cartesian wrench controller -->
<param name="r_arm_cartesian_wrench_controller/root_name" type="string" value="torso_lift_link" />
- <param name="r_arm_cartesian_wrench_controller/tip_name" type="string" value="r_forearm_roll_link" />
-<!-- Change above to forearm roll when fixed -->
+ <param name="r_arm_cartesian_wrench_controller/tip_name" type="string" value="r_elbow_flex_link" />
+
<!-- Cartesian twist controller -->
<param name="r_arm_cartesian_twist_controller/root_name" type="string" value="torso_lift_link" />
- <param name="r_arm_cartesian_twist_controller/tip_name" type="string" value="r_forearm_roll_link" />
+ <param name="r_arm_cartesian_twist_controller/tip_name" type="string" value="r_elbow_flex_link" />
<param name="r_arm_cartesian_twist_controller/output" type="string" value="r_arm_cartesian_wrench_controller" />
<param name="r_arm_cartesian_twist_controller/ff_trans" value="0.0" />
@@ -26,7 +26,7 @@
<!-- Cartesian pose controller -->
<param name="r_arm_cartesian_pose_controller/root_name" type="string" value="torso_lift_link" />
- <param name="r_arm_cartesian_pose_controller/tip_name" type="string" value="r_forearm_roll_link" />
+ <param name="r_arm_cartesian_pose_controller/tip_name" type="string" value="r_elbow_flex_link" />
<param name="r_arm_cartesian_pose_controller/output" type="string" value="r_arm_cartesian_twist_controller" />
<param name="r_arm_cartesian_pose_controller/p" value="20.0" />
Modified: pkg/trunk/pr2/life_test/arm_life_test/full_arm.launch
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/full_arm.launch 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/arm_life_test/full_arm.launch 2009-07-21 21:50:50 UTC (rev 19331)
@@ -1,20 +1,7 @@
<launch>
<param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find pr2_defs)/robots/r_arm.xacro.xml'" />
- <!--param name="robotdesc/pr2" command="$(find xacro)/xacro.py '$(find life_test)/arm_life_test/full_arm.xml'" /-->
<include file="$(find life_test)/init.machine" />
<include file="$(find life_test)/pr2_etherCAT.launch" />
-<!-- Arm Calibration -->
- <node pkg="mechanism_bringup" type="calibrate.py"
- args="$(find life_test)/arm_life_test/full_arm_cal.xml" />
-
-<!-- spacenav -->
- <!--node pkg="spacenav_node" type="spacenav_node" /-->
-
-<!-- Runtime Diagnostics Logging -->
- <node pkg="rosrecord" type="rosrecord" args="-f /hwlog/arm_life_test_runtime_automatic /diagnostics" />
-
-<!-- Tests launched separately -->
-
</launch>
Modified: pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb_forearm.launch
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb_forearm.launch 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb_forearm.launch 2009-07-21 21:50:50 UTC (rev 19331)
@@ -12,4 +12,7 @@
<include file="$(find life_test)/arm_life_test/run_random_poses_cb_forearm.launch" />
+ <node pkg="life_test" type="forearm_effort_controller.py"
+ args="r_forearm_roll_joint" />
+
</launch>
Modified: pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-07-21 21:50:50 UTC (rev 19331)
@@ -60,8 +60,10 @@
def __init__(self):
rospy.init_node('test_monitor', anonymous = True)
- csv_filename = rospy.myargv()[1] # CSV of device data
- self.create_trans_monitors(csv_filename)
+ self._trans_monitors = []
+ if len(rospy.myargv()) > 1:
+ csv_filename = rospy.myargv()[1] # CSV of device data
+ self.create_trans_monitors(csv_filename)
self._mutex = threading.Lock()
@@ -100,7 +102,7 @@
def create_trans_monitors(self, csv_filename):
- self._trans_monitors = []
+
trans_csv = csv.reader(open(csv_filename, 'rb'))
for row in trans_csv:
actuator = row[0].lstrip().rstrip()
@@ -120,9 +122,12 @@
status = TestStatus()
- if rospy.get_time() - self._ethercat_update_time > 3 or rospy.get_time() - self._mech_update_time > 1:
+ if rospy.get_time() - self._ethercat_update_time > 3:
status.test_ok = TestStatus.TEST_STALE
status.message = 'EtherCAT Master Stale'
+ elif rospy.get_time() - self._mech_update_time > 1:
+ status.message = 'Mechanism state stale'
+ status.test_ok = TestStatus.TEST_STALE
elif self._ethercat_ok and self._transmissions_ok:
status.test_ok = TestStatus.TEST_RUNNING
status.message = 'OK'
Modified: pkg/trunk/pr2/life_test/scripts/impact_head_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/impact_head_test.py 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/scripts/impact_head_test.py 2009-07-21 21:50:50 UTC (rev 19331)
@@ -56,10 +56,9 @@
import rospy
from std_msgs.msg import *
from mechanism_control import mechanism
-from robot_srvs.srv import SpawnController, KillController
+from mechanism_msgs.srv import SpawnController, KillController
from time import sleep
-## Create XML code for controller on the fly
def xml_for(controller, joint):
return '''\
<controller name=\"%s\" type=\"JointEffortControllerNode\">\
@@ -77,13 +76,14 @@
spawn_controller = rospy.ServiceProxy('spawn_controller', SpawnController)
kill_controller = rospy.ServiceProxy('kill_controller', KillController)
- resp = spawn_controller(xml_for(controller, joint))
- if len(resp.ok) < 1 or not ord(resp.ok[0]):
+ resp = spawn_controller(xml_for(controller, joint),1)
+ if len(resp.ok) < 1 or not resp.ok[0] == 1:
print "Failed to spawn effort controller"
+ sys.exit(100)
else:
print "Spawned controller %s successfully" % controller
- pub = rospy.Publisher("/%s/command" % controller, Float64)
+ pub = rospy.Publisher("%s/command" % controller, Float64)
try:
for i in range(0, 500):
@@ -99,7 +99,7 @@
finally:
kill_controller(controller)
sleep(5)
- sys.exit(0)
+ #sys.exit(0)
if __name__ == '__main__':
main()
Modified: pkg/trunk/pr2/life_test/scripts/wrist_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/scripts/wrist_test.py 2009-07-21 21:50:50 UTC (rev 19331)
@@ -52,16 +52,13 @@
import rospy
from std_msgs.msg import *
from mechanism_control import mechanism
-from robot_srvs.srv import SpawnController, KillController
+from mechanism_msgs.srv import SpawnController, KillController
from time import sleep
-spawn_controller = rospy.ServiceProxy('spawn_controller', SpawnController)
-kill_controller = rospy.ServiceProxy('kill_controller', KillController)
-pub_flex = rospy.Publisher("wrist_flex_effort/command", Float64)
-pub_grip = rospy.Publisher("grip_effort/command", Float64)
-pub_roll = rospy.Publisher("wrist_roll_effort/command", Float64)
+
+
## Create XML code for controller on the fly
def xml_for_flex():
return "\
@@ -81,25 +78,29 @@
<joint name=\"r_gripper_joint\" />\
</controller>"
-
-
-
def main():
rospy.init_node('wrist_test', anonymous=True)
rospy.wait_for_service('spawn_controller')
+
+ spawn_controller = rospy.ServiceProxy('spawn_controller', SpawnController)
+ kill_controller = rospy.ServiceProxy('kill_controller', KillController)
+
+ pub_grip = rospy.Publisher("grip_effort/command", Float64)
+ pub_flex = rospy.Publisher("wrist_flex_effort/command", Float64)
+ pub_roll = rospy.Publisher("wrist_roll_effort/command", Float64)
- resp = spawn_controller(xml_for_flex())
- if len(resp.ok) < 1 or not ord(resp.ok[0]):
- rospy.logerr("Failed to spawn effort controller")
+ resp = spawn_controller(xml_for_flex(), 1)
+ if len(resp.ok) < 1 or not resp.ok[0] == 1:
+ rospy.logerr("Failed to spawn effort controller, resp: %d" % resp.ok[0])
print xml_for_flex()
sys.exit(100)
else:
print "Spawned flex controller successfully"
- resp = spawn_controller(xml_for_roll())
- if len(resp.ok) < 1 or not ord(resp.ok[0]):
+ resp = spawn_controller(xml_for_roll(), 1)
+ if len(resp.ok) < 1 or not resp.ok[0] == 1:
rospy.logerr("Failed to spawn effort controller roll")
print xml_for_roll()
sys.exit(101)
@@ -107,23 +108,24 @@
print "Spawned flex controller successfully"
- resp = spawn_controller(xml_for_grip())
- if len(resp.ok) < 1 or not ord(resp.ok[0]):
+ resp = spawn_controller(xml_for_grip(), 1)
+ if len(resp.ok) < 1 or not resp.ok[0] == 1:
rospy.logerr("Failed to spawn effort controller roll")
print xml_for_grip()
sys.exit(102)
else:
print "Spawned grip controller successfully"
- effort_flex = rospy.get_param('flex_effort')
- effort_roll = rospy.get_param('roll_effort')
-
+ print 'Getting parameters'
+ effort_flex = float(rospy.get_param('flex_effort'))
+ effort_roll = float(rospy.get_param('roll_effort'))
effort_grip = -100
- freq = rospy.get_param('cycle_rate')
+ freq = float(rospy.get_param('cycle_rate'))
try:
while not rospy.is_shutdown():
+ print 'Publishing commands'
if random.randint(0, 1) == 1:
effort_flex = effort_flex * -1
@@ -134,7 +136,6 @@
pub_flex.publish(Float64(effort_flex))
pub_roll.publish(Float64(effort_roll))
-
sleep(1.0 / freq)
finally:
Modified: pkg/trunk/pr2/life_test/src/life_test/life_test.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-07-21 21:50:50 UTC (rev 19331)
@@ -411,6 +411,7 @@
def stop_test(self, event = None):
if self.is_launched():
+ print 'Shutting down test'
self.on_halt_motors(None)
self._test_launcher.shutdown()
self._manager.test_stop(self._machine)
@@ -454,6 +455,7 @@
# Remap
launch += '<remap from="/diagnostics" to="%s" />' % local_diag_topic
+
# Init machine
launch += '<machine name="test_host_root" user="root" address="%s" ' % self._machine
launch += 'ros-root="$(env ROS_ROOT)" ros-package-path="$(env ROS_PACKAGE_PATH)" default="never"/>'
Modified: pkg/trunk/pr2/life_test/wrist_test/test_gui.launch
===================================================================
--- pkg/trunk/pr2/life_test/wrist_test/test_gui.launch 2009-07-21 21:41:32 UTC (rev 19330)
+++ pkg/trunk/pr2/life_test/wrist_test/test_gui.launch 2009-07-21 21:50:50 UTC (rev 19331)
@@ -5,10 +5,11 @@
<!-- Calibration -->
+ <!--
<node pkg="mechanism_bringup" type="calibrate.py"
args="$(find life_test)/wrist_test/wrist_cal.xml"
output="screen" />
-
+-->
<node pkg="life_test" type="wrist_test.py" />
<node pkg="life_test" type="ethercat_test_monitor.py" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-08-09 02:57:52
|
Revision: 21210
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=21210&view=rev
Author: wattsk
Date: 2009-08-09 02:57:45 +0000 (Sun, 09 Aug 2009)
Log Message:
-----------
Fixed trans_monitor and ethercat_test_monitor to use diagnostic_msgs/KeyValue
Modified Paths:
--------------
pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
pkg/trunk/pr2/life_test/simple_test/fake_test.py
pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
Modified: pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-08-09 02:42:05 UTC (rev 21209)
+++ pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-08-09 02:57:45 UTC (rev 21210)
@@ -39,7 +39,7 @@
roslib.load_manifest('life_test')
from mechanism_msgs.msg import MechanismState
-from diagnostic_msgs.msg import *
+from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
from std_srvs.srv import *
@@ -140,7 +140,9 @@
self.test_status_pub.publish(status)
- self.diag_pub.publish(status = self._trans_status)
+ array = DiagnosticArray()
+ array.status = self._trans_status
+ self.diag_pub.publish(array)
# DISABLE FOR TESTING
# Halt the test if we have a bad transmission
Modified: pkg/trunk/pr2/life_test/simple_test/fake_test.py
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-08-09 02:42:05 UTC (rev 21209)
+++ pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-08-09 02:57:45 UTC (rev 21210)
@@ -39,7 +39,7 @@
import wx
import sys
-from diagnostic_msgs.msg import DiagnosticMessage, DiagnosticStatus, KeyValue, DiagnosticString
+from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
from std_srvs.srv import *
from mechanism_msgs.msg import MechanismState, JointState, ActuatorState
@@ -57,7 +57,7 @@
def __init__(self, parent):
wx.Frame.__init__(self, parent, wx.ID_ANY, 'Fake Test')
- self.diag_pub = rospy.Publisher('/diagnostics', DiagnosticMessage)
+ self.diag_pub = rospy.Publisher('/diagnostics', DiagnosticArray)
self.mech_pub = rospy.Publisher('mechanism_state', MechanismState)
self._mech_timer = wx.Timer(self, 2)
@@ -187,7 +187,7 @@
def publish_diag(self, level, choice):
- msg = DiagnosticMessage()
+ msg = DiagnosticArray()
stat = DiagnosticStatus()
msg.status.append(stat)
Modified: pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-08-09 02:42:05 UTC (rev 21209)
+++ pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-08-09 02:57:45 UTC (rev 21210)
@@ -95,15 +95,14 @@
diag.name = "Trans. Monitor: %s" % self._joint
diag.message = "OK"
diag.values = [ ]
- diag.strings = [ ]
- diag.strings.append(KeyValue(value=self._joint, label="Joint"))
- diag.strings.append(KeyValue(value=self._actuator, label="Actuator"))
- diag.strings.append(KeyValue(value=str(self._positive), label="Positive Joint"))
- diag.strings.append(KeyValue(value=str(self._continuous), label="Continuous Joint"))
- diag.values.append(KeyValue(value=float(self._ref_position), label="Reference Position"))
- diag.values.append(KeyValue(value=float(self._deadband), label="Deadband"))
- diag.values.append(KeyValue(value=float(self._rx_count), label="Mech State RX Count"))
+ diag.values.append(KeyValue("Joint", self._joint))
+ diag.values.append(KeyValue("Actuator", self._actuator))
+ diag.values.append(KeyValue("Positive Joint", str(self._positive)))
+ diag.values.append(KeyValue("Continuous Joint", str(self._continuous)))
+ diag.values.append(KeyValue("Reference Position", str(self._ref_position)))
+ diag.values.append(KeyValue("Deadband", str(self._deadband)))
+ diag.values.append(KeyValue("Mech State RX Count", str(self._rx_count)))
# Check if we can find both the joint and actuator
@@ -122,8 +121,8 @@
calibrated = (mech_state.joint_states[joint_names.index(self._joint)].is_calibrated == 1)
- diag.strings.append(KeyValue(value=str(act_exists), label='Actuator Exists'))
- diag.strings.append(KeyValue(value=str(joint_exists), label='Joint Exists'))
+ diag.values.append(KeyValue('Actuator Exists', str(act_exists)))
+ diag.values.append(KeyValue('Joint Exists', str(joint_exists)))
@@ -147,20 +146,20 @@
diag.message = 'Broken'
diag.level = 2
- diag.strings.insert(0, KeyValue(value=diag.message, label='Transmission Status'))
- diag.strings.insert(1, KeyValue(value=reading_msg, label='Current Reading'))
- diag.strings.append(KeyValue(value=str(calibrated), label='Is Calibrated'))
- diag.values.append(KeyValue(value=cal_reading, label='Calibration Reading'))
- diag.values.append(KeyValue(value=position, label='Joint Position'))
+ diag.values.insert(0, KeyValue('Transmission Status', diag.message))
+ diag.values.insert(1, KeyValue('Current Reading', reading_msg))
+ diag.values.append(KeyValue('Is Calibrated', str(calibrated)))
+ diag.values.append(KeyValue('Calibration Reading',str(cal_reading)))
+ diag.values.append(KeyValue('Joint Position', str(position)))
- diag.values.append(KeyValue(value=self._num_errors, label='Total Errors'))
- diag.values.append(KeyValue(value=self._num_errors_since_reset, label='Errors Since Reset'))
+ diag.values.append(KeyValue('Total Errors', str(self._num_errors)))
+ diag.values.append(KeyValue('Errors Since Reset', str(self._num_errors_since_reset)))
self._max_position = max(self._max_position, position)
- diag.values.append(KeyValue(value = self._max_position, label='Max Obs. Position'))
+ diag.values.append(KeyValue('Max Obs. Position', str(self._max_position)))
self._min_position = min(self._min_position, position)
- diag.values.append(KeyValue(value = self._min_position, label='Min Obs. Position'))
+ diag.values.append(KeyValue('Min Obs. Position', str(self._min_position)))
return diag, self._ok
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-08-17 21:06:48
|
Revision: 22033
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=22033&view=rev
Author: wattsk
Date: 2009-08-17 21:06:37 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
Updates from hot box test (left arm, head)
Modified Paths:
--------------
pkg/trunk/pr2/life_test/arm_life_test/random_poses_left.py
pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch
pkg/trunk/pr2/life_test/scripts/run_head_test.py
Modified: pkg/trunk/pr2/life_test/arm_life_test/random_poses_left.py
===================================================================
--- pkg/trunk/pr2/life_test/arm_life_test/random_poses_left.py 2009-08-17 21:05:00 UTC (rev 22032)
+++ pkg/trunk/pr2/life_test/arm_life_test/random_poses_left.py 2009-08-17 21:06:37 UTC (rev 22033)
@@ -33,13 +33,13 @@
import rospy
from geometry_msgs.msg import PoseStamped
-#pub = rospy.Publisher('cartesian_pose/command', PoseStamped)
-pub = rospy.Publisher('cartesian_trajectory_left/command', PoseStamped)
+#pub = rospy.Publisher('l_arm_cartesian_pose_controller/command', PoseStamped)
+pub = rospy.Publisher('/l_arm_cartesian_trajectory_controller/command', PoseStamped)
def p(x, y, z, rx, ry, rz, w):
m = PoseStamped()
- m.header.frame_id = 'base_link'
+ m.header.frame_id = '/base_link'
m.header.stamp = rospy.get_rostime()
m.pose.position.x = x
m.pose.position.y = y
Modified: pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch
===================================================================
--- pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch 2009-08-17 21:05:00 UTC (rev 22032)
+++ pkg/trunk/pr2/life_test/head_test/life_test/life_test.launch 2009-08-17 21:06:37 UTC (rev 22033)
@@ -3,14 +3,7 @@
<!-- May need to put in to to scripts folder -->
<node pkg="life_test" type="run_head_test.py" />
- <group ns="head_controller" clear_params="true">
- <param name="pan_link_name" type="string" value="head_pan_link" />
- <param name="tilt_link_name" type="string" value="head_tilt_link" />
- <param name="pan_output" type="string" value="head_pan_joint_position_controller" />
- <param name="tilt_output" type="string" value="head_tilt_joint_position_controller" />
- </group>
+ <include file="$(find pr2_default_controllers)/head_position_controller.launch" />
- <node pkg="mechanism_control" type="spawner.py" args="$(find life_test)/head_test/life_test/test_controller.xml" />
-
<node pkg="life_test" type="laser_test.bash" />
</launch>
\ No newline at end of file
Modified: pkg/trunk/pr2/life_test/scripts/run_head_test.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/run_head_test.py 2009-08-17 21:05:00 UTC (rev 22032)
+++ pkg/trunk/pr2/life_test/scripts/run_head_test.py 2009-08-17 21:06:37 UTC (rev 22033)
@@ -62,11 +62,9 @@
sleep(1)
while 1:
- #point_head_client(0.0, -0.4)
pan = random.uniform(-2.7, 2.7)
print pan
tilt = random.uniform(-0.5, 1.35)
print tilt
- #point_head_client(0.0, 1.2)
point_head_client(pan, tilt)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-09-04 06:36:48
|
Revision: 23819
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=23819&view=rev
Author: wattsk
Date: 2009-09-04 06:36:31 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
Auto power start, use bays, GUI changes to Test Manager
Modified Paths:
--------------
pkg/trunk/pr2/life_test/bin/gui
pkg/trunk/pr2/life_test/manifest.xml
pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
pkg/trunk/pr2/life_test/simple_test/fake_test.py
pkg/trunk/pr2/life_test/simple_test/test.launch
pkg/trunk/pr2/life_test/src/life_test/life_test.py
pkg/trunk/pr2/life_test/src/life_test/test_param.py
pkg/trunk/pr2/life_test/src/life_test/ui.py
pkg/trunk/pr2/life_test/tests.xml
pkg/trunk/pr2/life_test/xrc/gui.fbp
pkg/trunk/pr2/life_test/xrc/gui.xrc
Added Paths:
-----------
pkg/trunk/pr2/life_test/head_test/head_trans.csv
pkg/trunk/pr2/life_test/scripts/test_monitor.py
pkg/trunk/pr2/life_test/simple_test/fake_listeners.yaml
pkg/trunk/pr2/life_test/src/life_test/ethercat_listener.py
pkg/trunk/pr2/life_test/src/life_test/test_bay.py
pkg/trunk/pr2/life_test/src/life_test/trans_listener.py
pkg/trunk/pr2/life_test/wg_test_rooms.xml
Removed Paths:
-------------
pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
Modified: pkg/trunk/pr2/life_test/bin/gui
===================================================================
--- pkg/trunk/pr2/life_test/bin/gui 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/bin/gui 2009-09-04 06:36:31 UTC (rev 23819)
@@ -46,4 +46,4 @@
except Exception, e:
print "Caught exception in TestManagerApp Main Loop"
import traceback
- trackback.print_exc()
+ traceback.print_exc()
Added: pkg/trunk/pr2/life_test/head_test/head_trans.csv
===================================================================
--- pkg/trunk/pr2/life_test/head_test/head_trans.csv (rev 0)
+++ pkg/trunk/pr2/life_test/head_test/head_trans.csv 2009-09-04 06:36:31 UTC (rev 23819)
@@ -0,0 +1 @@
+head_pan_motor,head_pan_joint,0.0,0.1,0,1
\ No newline at end of file
Modified: pkg/trunk/pr2/life_test/manifest.xml
===================================================================
--- pkg/trunk/pr2/life_test/manifest.xml 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/manifest.xml 2009-09-04 06:36:31 UTC (rev 23819)
@@ -2,18 +2,11 @@
<description brief="Runs life/impact tests on test carts and robots">
- This package contains the scripts needed to run a life and impact tests on
-robots and test carts.
+ This package contains the scripts needed to run burn in and life tests on PR2 components.
-To launch on test cart, go to {part}_test/ and 'roslaunch test_cart.launch'
-To launch on robot, go to {part}_test and 'roslaunch life_test.launch'
-
-If the part also has an impact test, go to:
-{part}_test/(life or impact)_test/
-and launch the tests as above.
-
-When launching on robot, part must be calibrated with power on.
-
+ Use Test Manager to run tests:
+ roscd life_test
+ bin/gui
</description>
<author>Kevin Watts</author>
<review status="na" notes=""/>
Modified: pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/scripts/ethercat_test_monitor.py 2009-09-04 06:36:31 UTC (rev 23819)
@@ -58,7 +58,7 @@
class EtherCATTestMonitorNode():
def __init__(self):
- rospy.init_node('test_monitor', anonymous = True)
+ rospy.init_node('test_monitor')
self._trans_monitors = []
if len(rospy.myargv()) > 1:
@@ -102,7 +102,6 @@
def create_trans_monitors(self, csv_filename):
-
trans_csv = csv.reader(open(csv_filename, 'rb'))
for row in trans_csv:
actuator = row[0].lstrip().rstrip()
Added: pkg/trunk/pr2/life_test/scripts/test_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/scripts/test_monitor.py (rev 0)
+++ pkg/trunk/pr2/life_test/scripts/test_monitor.py 2009-09-04 06:36:31 UTC (rev 23819)
@@ -0,0 +1,150 @@
+#!/usr/bin/env python
+#
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Willow Garage, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Author: Kevin Watts
+
+PKG = 'life_test'
+
+import roslib
+roslib.load_manifest(PKG)
+
+import rospy
+
+from life_test.msg import TestStatus
+
+from diagnostic_msgs.msg import DiagnosticArray
+from std_srvs.srv import *
+
+import traceback
+import sys
+
+def create_listener(params, listeners):
+ if not (params.has_key('type') and params.has_key('file')):
+ rospy.logerr('Params "type" and "file" weren\'t found!')
+ return False
+
+ file = params['file']
+ type = params['type']
+
+ try:
+ import_str = '%s.%s' % (PKG, file)
+ __import__(import_str)
+ pypkg = sys.modules[import_str]
+ listener_type = getattr(pypkg, type)
+ except:
+ rospy.logerr('Couldn\'t load listener %s from %s. Exception: %s' % (type, file, traceback.format_exc()))
+ return False
+
+ try:
+ listener = listener_type()
+ except:
+ rospy.logerr('Listener %s failed to construct.\nException: %s' % (type, traceback.format_exc()))
+ return False
+
+ if not listener.create(params):
+ return False
+
+ listeners.append(listener)
+ return True
+
+# Listeners need: reset, halt, init, check_ok
+class TestMonitor:
+ def __init__(self):
+ rospy.init_node('test_monitor')
+
+ self._listeners = []
+
+ my_params = rospy.get_param("~")
+
+ for ns, listener_param in my_params.iteritems():
+ if not create_listener(listener_param, self._listeners):
+ rospy.logfatal('Listener failed to initialize. Exiting')
+ sys.exit()
+
+ self._status_pub = rospy.Publisher('test_status', TestStatus)
+ self._diag_pub = rospy.Publisher('/diagnostics', DiagnosticArray)
+
+ self.reset_srv = rospy.Service('reset_test', Empty, self.reset_test)
+ self.halt_srv = rospy.Service('halt_test', Empty, self.halt_test)
+
+ def reset_test(self, srv):
+ for listener in self._listeners:
+ listener.reset()
+ return EmptyResponse()
+
+ def halt_test(self, srv):
+ for listener in self._listeners:
+ listener.halt()
+ return EmptyResponse()
+
+ def publish_status(self):
+ status = 0
+ messages = []
+
+ array = DiagnosticArray()
+ for listener in self._listeners:
+ stat, msg, diags = listener.check_ok()
+ status = max(status, stat)
+ if msg != '':
+ messages.append(msg)
+ if diags:
+ array.status.extend(diags)
+
+ if len(self._listeners) == 0:
+ status = 3
+ messages = [ 'No listeners' ]
+
+ if len(array.status) > 0:
+ self._diag_pub.publish(array)
+
+ test_stat = TestStatus()
+ test_stat.test_ok = int(status)
+ test_stat.message = ', '.join(messages)
+ if test_stat.test_ok == 0:
+ test_stat.message = 'OK'
+
+ self._status_pub.publish(test_stat)
+
+if __name__ == '__main__':
+ try:
+ tm = TestMonitor()
+
+ rate = rospy.Rate(1.0)
+ while not rospy.is_shutdown():
+ rate.sleep()
+ tm.publish_status()
+ except:
+ traceback.print_exc()
+ rospy.logerr(traceback.format_exc())
Added: pkg/trunk/pr2/life_test/simple_test/fake_listeners.yaml
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/fake_listeners.yaml (rev 0)
+++ pkg/trunk/pr2/life_test/simple_test/fake_listeners.yaml 2009-09-04 06:36:31 UTC (rev 23819)
@@ -0,0 +1,20 @@
+ethercat:
+ type: EthercatListener
+ file: ethercat_listener
+trans:
+ type: TransmissionListener
+ file: trans_listener
+ linear_trans:
+ joint: fake_joint
+ actuator: fake_motor
+ max: 2
+ min: -2
+ up_ref: 0
+ deadband: 0.1
+ cont_trans:
+ joint: cont_joint
+ actuator: cont_motor
+ up_ref: 0
+ down_ref: 3.14
+ wrap: 6.28
+ deadband: 0.1
\ No newline at end of file
Modified: pkg/trunk/pr2/life_test/simple_test/fake_test.py
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/simple_test/fake_test.py 2009-09-04 06:36:31 UTC (rev 23819)
@@ -41,14 +41,14 @@
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
from std_srvs.srv import *
-from mechanism_msgs.msg import MechanismState, JointState, ActuatorState
+from pr2_mechanism_msgs.msg import MechanismState, JointState, ActuatorState
import os
import time
import rospy
-import threading
+from time import sleep
from wx import xrc
import math
@@ -110,6 +110,19 @@
jnt_st.applied_effort = float(-2 * sine)
jnt_st.commanded_effort = float(-2 * sine)
jnt_st.is_calibrated = 1
+
+ cont_st = JointState()
+ cont_st.name = 'cont_joint'
+ cont_st.position = 5 * float(0.5 * sine)
+ cont_st.velocity = 2.5 * float(0.5 * cosine)
+ cont_st.is_calibrated = 1
+
+ cont_act_st = ActuatorState()
+ cont_act_st.name = 'cont_motor'
+ cont_act_st.calibration_reading = 14
+ wrapped_position = (cont_st.position % 6.28)
+ if wrapped_position > 3.14:
+ cont_act_st.calibration_reading = 13
# Use same position as above, with 100:1 reduction -> Ampltitude 200
act_st = ActuatorState()
@@ -122,9 +135,9 @@
act_st.velocity = float(200 * cosine)
# Only one that makes a difference
- act_st.calibration_reading = 14
+ act_st.calibration_reading = 13
if sine > 0.0 and self._cal_box.IsChecked():
- act_st.calibration_reading = 13
+ act_st.calibration_reading = 14
act_st.calibration_rising_edge_valid = 1
act_st.calibration_falling_edge_valid = 1
@@ -143,8 +156,8 @@
mech_st = MechanismState()
mech_st.time = rospy.get_time()
- mech_st.actuator_states = [ act_st ]
- mech_st.joint_states = [ jnt_st ]
+ mech_st.actuator_states = [ act_st, cont_act_st ]
+ mech_st.joint_states = [ jnt_st, cont_st ]
self.mech_pub.publish(mech_st)
@@ -170,6 +183,7 @@
self.range_param_ctrl.SetValue(range_param)
def on_timer(self, event = None):
+ sleep(0.1)
if not rospy.is_shutdown():
self._diag_timer.Start(1000, True)
Modified: pkg/trunk/pr2/life_test/simple_test/test.launch
===================================================================
--- pkg/trunk/pr2/life_test/simple_test/test.launch 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/simple_test/test.launch 2009-09-04 06:36:31 UTC (rev 23819)
@@ -1,5 +1,7 @@
<launch>
<node pkg="life_test" type="fake_test.py" />
- <node pkg="life_test" type="ethercat_test_monitor.py" args="$(find life_test)/simple_test/fake_trans.csv" />
-</launch>
\ No newline at end of file
+ <node pkg="life_test" type="test_monitor.py" name="monitor" >
+ <rosparam command="load" file="$(find life_test)/simple_test/fake_listeners.yaml" />
+ </node>
+</launch>
Added: pkg/trunk/pr2/life_test/src/life_test/ethercat_listener.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/ethercat_listener.py (rev 0)
+++ pkg/trunk/pr2/life_test/src/life_test/ethercat_listener.py 2009-09-04 06:36:31 UTC (rev 23819)
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+#
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Willow Garage, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Author: Kevin Watts
+PKG = 'life_test'
+
+import roslib
+roslib.load_manifest(PKG)
+
+from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
+from std_srvs.srv import *
+
+import rospy
+
+import threading
+
+class EthercatListener:
+ def __init__(self):
+ self._diag_sub = rospy.Subscriber('/diagnostics', DiagnosticArray, self._diag_callback)
+ self._mutex = threading.Lock()
+
+ self._ok = True
+ self._update_time = 0
+ self._reset_motors = rospy.ServiceProxy('reset_motors', Empty)
+ self._halt_motors = rospy.ServiceProxy('halt_motors', Empty)
+
+ # Doesn't do anything
+ def create(self, params):
+ return True
+
+ def halt(self):
+ self._halt_motors()
+
+ def reset(self):
+ self._reset_motors()
+
+ def _diag_callback(self, msg):
+ self._mutex.acquire()
+ for stat in msg.status:
+ if stat.name == 'EtherCAT Master':
+ self._ok = (stat.level == 0)
+ self._update_time = rospy.get_time()
+ break
+ self._mutex.release()
+
+ def check_ok(self):
+ self._mutex.acquire()
+ msg = ''
+ stat = 0
+ if not self._ok:
+ stat = 2
+ msg = 'EtherCAT Error'
+
+ if rospy.get_time() - self._update_time > 3:
+ stat = 3
+ msg = 'EtherCAT Stale'
+ if self._update_time == 0:
+ msg = 'No EtherCAT Data'
+
+ self._mutex.release()
+ return stat, msg, None
+
Modified: pkg/trunk/pr2/life_test/src/life_test/life_test.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-09-04 06:18:52 UTC (rev 23818)
+++ pkg/trunk/pr2/life_test/src/life_test/life_test.py 2009-09-04 06:36:31 UTC (rev 23819)
@@ -2,7 +2,7 @@
#
# Software License Agreement (BSD License)
#
-# Copyright (c) 2008, Willow Garage, Inc.
+# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@
from email.mime.base import MIMEBase
from email import Encoders
-
+import roslaunch
from roslaunch_caller import roslaunch_caller
@@ -94,9 +94,10 @@
self._test_desc.SetValue(self._test._desc)
self._launch_button = xrc.XRCCTRL(self._panel, 'launch_test_button')
- self._launch_button.Bind(wx.EVT_BUTTON, self.launch_test)
+ self._launch_button.Bind(wx.EVT_BUTTON, self.start_stop_test)
- self._test_machine_ctrl = xrc.XRCCTRL(self._panel, 'test_machine_ctrl')
+ self._test_bay_ctrl = xrc.XRCCTRL(self._panel, 'test_machine_ctrl')
+ self._test_bay_ctrl.SetItems(self._manager.room.get_bay_names(test.needs_power()))
self._end_cond_type = xrc.XRCCTRL(self._panel, 'end_cond_type')
self._end_cond_type.SetStringSelection('Continuous')
@@ -117,9 +118,6 @@
self._halt_button = xrc.XRCCTRL(self._panel, 'halt_motors_button')
self._halt_button.Bind(wx.EVT_BUTTON, self.on_halt_motors)
- self._stop_button = xrc.XRCCTRL(self._panel, 'stop_test_button')
- self._stop_button.Bind(wx.EVT_BUTTON, self.stop_test)
-
self._user_log = xrc.XRCCTRL(self._panel, 'user_log_input')
self._user_submit = xrc.XRCCTRL(self._panel, 'user_submit_button')
self._user_submit.Bind(wx.EVT_BUTTON, self.on_user_entry)
@@ -135,6 +133,31 @@
self._send_log_button = xrc.XRCCTRL(self._panel, 'send_test_log_button')
self._send_log_button.Bind(wx.EVT_BUTTON, self.on_send_test_log)
+ # Power control
+ self._power_board_text = xrc.XRCCTRL(self._panel, 'power_board_text')
+ self._power_board_text.SetBackgroundColour("White")
+ self._power_board_text.SetValue("Test Not Running")
+
+ self._power_run_button = xrc.XRCCTRL(self._panel, 'power_run_button')
+ self._power_run_button.Bind(wx.EVT_BUTTON, self.on_power_run)
+
+ self._power_standby_button = xrc.XRCCTRL(self._panel, 'power_standby_button')
+ self._power_standby_button.Bind(wx.EVT_BUTTON, self.on_power_standby)
+
+
+ self._power_reset_button = xrc.XRCCTRL(self._panel, 'power_reset_button')
+ self._power_reset_button.Bind(wx.EVT_BUTTON, self.on_power_reset)
+
+
+ self._power_disable_button = xrc.XRCCTRL(self._panel, 'power_disable_button')
+ self._power_disable_button.Bind(wx.EVT_BUTTON, self.on_power_disable)
+
+
+ # Bay data
+ self._power_sn_text = xrc.XRCCTRL(self._panel, 'power_sn_text')
+ self._power_breaker_text = xrc.XRCCTRL(self._panel, 'power_breaker_text')
+ self._machine_text = xrc.XRCCTRL(self._panel, 'machine_text')
+
# Add runtime to the panel...
self._notebook = xrc.XRCCTRL(self._panel, 'test_data_notebook')
wx.CallAfter(self.create_monitor)
@@ -144,7 +167,7 @@
self.SetSizer(self._sizer)
self.Layout()
- self._machine = None
+ self._bay = None
self._current_log = {}
self._diag_msgs = {}
@@ -175,18 +198,17 @@
self.update_controls()
self.on_end_choice()
-
+
+
def create_monitor(self):
self._monitor_panel = MonitorPanel(self._notebook)
self._monitor_panel.SetSize(wx.Size(400, 500))
self._notebook.AddPage(self._monitor_panel, "Runtime Monitor")
-
def __del__(self):
- # Somehow calling log function in destructor
self.stop_test()
- if self._status_sub:
+ if self._status_sub is not None:
self._status_sub.unregister()
def is_launched(self):
@@ -236,11 +258,19 @@
self.notify_operator(3, 'Log Requested.', string.join(names, ','))
def on_close(self, event):
- self.update_test_record('Closing down test.')
- self.update_invent()
- self.record_test_log()
- self.notify_operator(1, 'Closing.')
+ try:
+ #bi = wx.BusyInfo("Closing test and logging, please wait.")
+ #wx.Yield()
+ self.update_test_record('Closing down test.')
+ self.update_invent()
+ self.record_test_log()
+ self.notify_operator(1, 'Closing.')
+ #bi.Destroy()
+ except:
+ rospy.logerr('Exception on close: %s' % traceback.format_exc())
+
self._manager.close_tab(self._serial)
+
def update_test_record(self, note = ''):
@@ -251,7 +281,10 @@
if alert > 0 or note != '':
self._current_log[rospy.get_time()] = message
- self._manager.log_test_entry(self._test._name, self._machine, message)
+ if self._bay is not None:
+ self._manager.log_test_entry(self._test._name, self._bay.name, message)
+ else:
+ self._manager.log_test_entry(self._test._name, 'None', message)
self.display_logs()
if alert > 0:
@@ -331,7 +364,7 @@
interval = rospy.get_time() - self.last_message_time
- if interval > self.timeout_interval: # or interval < 0:
+ if interval > self.timeout_interval:
# Make EtherCAT status stale
self._is_running = False
self._is_stale = True
@@ -344,6 +377,29 @@
self._mutex.release()
+ def on_power_run(self):
+ self._manager.power_run(self._bay)
+
+ def on_power_standby(self):
+ self._manager.power_standby(self._bay)
+
+ def on_power_reset(self):
+ self._manager.power_reset(self._bay)
+
+ def on_power_disable(self):
+ self._manager.power_disable(self._bay)
+
+ def update_board(self, value):
+ if value == "Standby":
+ self._power_board_text.SetBackgroundColour("Orange")
+ self._power_board_text.SetValue("Standby")
+ elif value == "On":
+ self._power_board_text.SetBackgroundColour("Light Green")
+ self._power_board_text.SetValue("Running")
+ else:
+ self._power_board_text.SetBackgroundColour("Red")
+ self._power_board_text.SetValue("Disabled")
+
def update_controls(self, level = 4, msg = 'None'):
# Assumes it has the lock
if not self.is_launched():
@@ -367,7 +423,6 @@
self._reset_button.Enable(self.is_launched())
self._halt_button.Enable(self.is_launched())
- self._stop_button.Enable(self.is_launched())
# FIX
remaining = self.calc_remaining()
@@ -385,10 +440,18 @@
self._active_time_ctrl.SetValue(self._record.get_active_str())
self._elapsed_time_ctrl.SetValue(self._record.get_elapsed_str())
- self._test_machine_ctrl.Enable(not self.is_launched())
- self._launch_button.Enable(not self.is_launched())
+ self._test_bay_ctrl.Enable(not self.is_launched())
+ #self._launch_button.Enable(not self.is_launched())
self._close_button.Enable(not self.is_launched())
+
+ # Power buttons
+ self._power_run_button.Enable(self.is_launched() and self._bay.board is not None)
+ self._power_standby_button.Enable(self.is_launched() and self._bay.board is not None)
+ self._power_reset_button.Enable(self.is_launched() and self._bay.board is not None)
+ self._power_disable_button.Enable(self.is_launched() and self._bay.board is not None)
+
+
def display_logs(self):
kys = dict.keys(self._current_log)
kys.sort()
@@ -403,6 +466,8 @@
def stop_if_done(self):
remain = self.calc_remaining()
+
+ self._stop_count = 0
# Make sure we've had five consecutive seconds of
# negative time before we shutdown
@@ -411,25 +476,6 @@
self._test_complete = True
self.stop_test()
- def stop_test(self, event = None):
- if self.is_launched():
- print 'Shutting down test'
- self.on_halt_motors(None)
- self._test_launcher.shutdown()
- self._manager.test_stop(self._machine)
- self.update_test_record('Stopping test launch')
- self._test_launcher = None
-
- if self._status_sub:
- self._status_sub.unregister()
- self._status_sub = None
-
- self._is_running = False
-
- if event is not None: # In GUI thread
- self.update_controls()
-
-
def status_callback(self, msg):
self._mutex.acquire()
self._status_msg = msg
@@ -453,20 +499,21 @@
def make_launch_script(self, local_diag_topic):
launch = '<launch>\n'
- launch += '<group ns="%s">' % self._machine
+ launch += '<group ns="%s">' % self._bay.name
# Remap
launch += '<remap from="/diagnostics" to="%s" />' % local_diag_topic
# Init machine
- launch += '<machine name="test_host_root" user="root" address="%s" ' % self._machine
+ launch += '<machine name="test_host_root" user="root" address="%s" ' % self._bay.machine
launch += 'ros-root="$(env ROS_ROOT)" ros-package-path="$(env ROS_PACKAGE_PATH)" default="never"/>'
- launch += '<machine name="test_host" address="%s" ' % self._machine
+ launch += '<machine name="test_host" address="%s" ' % self._bay.machine
launch += 'ros-root="$(env ROS_ROOT)" ros-package-path="$(env ROS_PACKAGE_PATH)" />'
# Include our launch file
launch += '<include file="$(find life_test)/%s" />' % self._test._launch_script
+ # Will set bag name to be serial
launch += ' <node pkg="rosrecord" type="rosrecord" args="-f /hwlog/test_runtime_automatic /diagnostics" />'
launch += '</group>\n</launch>'
@@ -477,39 +524,112 @@
# Put in master file
# Add subscriber to diagnostics
# Launch file, subscribe diagnostics
- def launch_test(self, event):
+ def start_stop_test(self, event):
+ if self.is_launched():
+ self.stop_test_user()
+ else:
+ self.launch_test()
+
+ self.update_controls()
+
+ def stop_test_user(self):
+ dialog = wx.MessageDialog(self, 'Are you sure you want to stop this test?', 'Confirm Stop Test', wx.OK|wx.CANCEL)
+ if dialog.ShowModal() != wx.ID_OK:
+ return
+
+ self.stop_test()
+
+ def stop_test(self):
+ if self.is_launched():
+ self._launch_button.Enable(False)
+ if self._bay.board is not None:
+ self._manager.power_disable(self._bay)
+ self._power_board_text.SetBackgroundColour("White")
+ self._power_board_text.SetValue("Test Not Running")
+
+ # Machine, board stats
+ self._machine_text.SetValue("Not running")
+ self._power_sn_text.SetValue("Not running")
+ self._power_breaker_text.SetValue("Not running")
+ #bi = wx.BusyInfo('Stopping test, please wait')
+ #wx.Yield()
+ print 'Shutting down test'
+ self.on_halt_motors(None)
+ self._test_launcher.shutdown()
+ self._manager.test_stop(self._bay)
+ self.update_test_record('Stopping test launch')
+ self._test_launcher = None
+ #bi.Destroy()
+ self._launch_button.Enable(True)
+ self._launch_button.SetLabel("Launch")
+
+ if self._status_sub:
+ self._status_sub.unregister()
+ self._status_sub = None
+
+ self._is_running = False
+
+ def launch_test(self):
dialog = wx.MessageDialog(self, 'Are you sure you want to launch?', 'Confirm Launch', wx.OK|wx.CANCEL)
if dialog.ShowModal() != wx.ID_OK:
return
+
+ self._launch_button.Enable(False)
+ #bi = wx.BusyInfo("Launching test, please wait")
+ #wx.Yield()
# Get machine, end condition, etc
- machine = self._test_machine_ctrl.GetStringSelection()
- if not self._manager.test_start_check(machine):
- wx.MessageBox('Machine in use, select again!', 'Machine in use', wx.OK|wx.ICON_ERROR, self)
+ bay_name = self._test_bay_ctrl.GetStringSelection()
+ bay = self._manager.room.get_bay(bay_name)
+ if bay is None:
+ wx.MessageBox('Select test bay', 'Select Bay', wx.OK|wx.ICON_ERROR, self)
+ self._launch_button.Enable(True)
return
+
+ if not self._manager.test_start_check(bay, self._serial):
+ wx.MessageBox('Test bay in use, select again!', 'Test bay in use', wx.OK|wx.ICON_ERROR, self)
+ self._launch_button.Enable(True)
+ return
- self._machine = machine
- local_diag = '/' + self._machine + '/diagnostics'
+ self._bay = bay
- self.update_test_record('Launching test %s on machine %s.' % (self._test._name, self._machine))
+ if self._bay.board is not None:
+ ...
[truncated message content] |