|
From: <tf...@us...> - 2009-02-27 22:04:52
|
Revision: 11896
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=11896&view=rev
Author: tfoote
Date: 2009-02-27 22:04:51 +0000 (Fri, 27 Feb 2009)
Log Message:
-----------
deleting ntp_monitor package and copying the one script into runtime_monitor
Modified Paths:
--------------
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/manifest.xml
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/pre.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf_manip.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prg.launch
Added Paths:
-----------
pkg/trunk/hardware_test/runtime_monitor/scripts/ntp_monitor.py
Removed Paths:
-------------
pkg/trunk/util/ntp_monitor/
Copied: pkg/trunk/hardware_test/runtime_monitor/scripts/ntp_monitor.py (from rev 10497, pkg/trunk/util/ntp_monitor/ntp_monitor.py)
===================================================================
--- pkg/trunk/hardware_test/runtime_monitor/scripts/ntp_monitor.py (rev 0)
+++ pkg/trunk/hardware_test/runtime_monitor/scripts/ntp_monitor.py 2009-02-27 22:04:51 UTC (rev 11896)
@@ -0,0 +1,77 @@
+#!/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 the Willow Garage 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.
+
+import roslib
+roslib.load_manifest('ntp_monitor')
+
+from robot_msgs.msg import *
+import sys
+import rospy
+import socket
+import subprocess
+
+import time
+
+import re
+
+NAME = 'ntp_monitor'
+
+def ntp_monitor():
+ if len(sys.argv) < 2:
+ print "Please pass host as argument"
+ return
+ else:
+ pub = rospy.Publisher("/diagnostics", DiagnosticMessage)
+ rospy.init_node(NAME, anonymous=True)
+
+ hostname = socket.gethostbyaddr(socket.gethostname())[0]
+
+ while not rospy.is_shutdown():
+ p = subprocess.Popen(["ntpdate", "-q", sys.argv[1]], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ res = p.wait()
+ (o,e) = p.communicate()
+ if (res == 0):
+ offset = float(re.search("offset (.*),", o).group(1))*1000000
+ if (abs(offset) < 500):
+ stat = DiagnosticStatus(0,hostname + " NTP offset", "Acceptable synchronization", [DiagnosticValue(offset,"offset (us)")],[])
+ print offset
+ else:
+ stat = DiagnosticStatus(2,hostname + " NTP offset", "Offset too great", [DiagnosticValue(offset,"offset (us)")],[])
+ else:
+ stat = DiagnosticStatus(2,hostname + ": NTP offset", "Failure to run ntpdate -q", [],[])
+
+ pub.publish(DiagnosticMessage(None, [stat]))
+ time.sleep(1)
+
+if __name__ == "__main__":
+ ntp_monitor()
Modified: pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/manifest.xml
===================================================================
--- pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/manifest.xml 2009-02-27 22:03:16 UTC (rev 11895)
+++ pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/manifest.xml 2009-02-27 22:04:51 UTC (rev 11896)
@@ -24,6 +24,5 @@
<depend package="imu_node"/>
<depend package="dcam"/>
<depend package="robot_pose_ekf"/>
- <depend package="ntp_monitor"/>
<depend package="spacenav_node"/>
</package>
Modified: pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/pre.launch
===================================================================
--- pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/pre.launch 2009-02-27 22:03:16 UTC (rev 11895)
+++ pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/pre.launch 2009-02-27 22:04:51 UTC (rev 11896)
@@ -62,9 +62,9 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/pre_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="pre2" machine="three"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="pre2" machine="four"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="three"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="four"/>
</launch>
Modified: pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf.launch
===================================================================
--- pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf.launch 2009-02-27 22:03:16 UTC (rev 11895)
+++ pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf.launch 2009-02-27 22:04:51 UTC (rev 11896)
@@ -64,9 +64,9 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/prf_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
</launch>
Modified: pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf_manip.launch
===================================================================
--- pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf_manip.launch 2009-02-27 22:03:16 UTC (rev 11895)
+++ pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prf_manip.launch 2009-02-27 22:04:51 UTC (rev 11896)
@@ -77,9 +77,9 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/prf_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
</launch>
Modified: pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prg.launch
===================================================================
--- pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prg.launch 2009-02-27 22:03:16 UTC (rev 11895)
+++ pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_alpha/prg.launch 2009-02-27 22:04:51 UTC (rev 11896)
@@ -52,9 +52,9 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/prg_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
- <node pkg="ntp_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
+ <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
<!-- Stereo cam -->
<group ns="stereo">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|