Skip to content

Commit 80369f9

Browse files
authored
Merge pull request #275 from TAMS-Group/pr-various
various improvements
2 parents 6363d53 + 83b362c commit 80369f9

14 files changed

Lines changed: 55 additions & 26 deletions

File tree

imu_monitor/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
2+
if(POLICY CMP0048)
3+
cmake_policy(SET CMP0048 NEW)
4+
endif()
35
project(imu_monitor)
46

57
find_package(catkin REQUIRED)

imu_monitor/scripts/imu_monitor.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def __init__(self):
2626
self.odom_sub = rospy.Subscriber('base_odometry/odometer', Odometer, self.odom_cb)
2727

2828
# diagnostics
29-
self.pub_diag = rospy.Publisher('/diagnostics', DiagnosticArray)
29+
self.pub_diag = rospy.Publisher('/diagnostics', DiagnosticArray, queue_size= 1)
30+
31+
self.diag_timer = rospy.Timer(rospy.Duration(1), self.publish_diagnostics)
3032

3133

3234
def imu_cb(self, msg):
@@ -44,14 +46,16 @@ def odom_cb(self, msg):
4446
self.start_time = rospy.Time.now()
4547
self.start_angle = self.last_angle
4648
self.dist = dist
47-
49+
4850
# do imu test if possible
4951
if rospy.Time.now() > self.start_time + rospy.Duration(10.0):
5052
self.drift = fabs(self.start_angle - self.last_angle)*180/(pi*10)
5153
self.start_time = rospy.Time.now()
5254
self.start_angle = self.last_angle
5355
self.last_measured = rospy.Time.now()
54-
56+
57+
def publish_diagnostics(self, event):
58+
with self.lock:
5559
# publish diagnostics
5660
d = DiagnosticArray()
5761
d.header.stamp = rospy.Time.now()
@@ -77,7 +81,7 @@ def odom_cb(self, msg):
7781
elif age < 3600:
7882
last_measured = '%f minutes ago'%(age/60)
7983
else:
80-
last_measured = '%f hours ago'%(age/3600)
84+
last_measured = '%f hours ago'%(age/3600)
8185
ds.values = [
8286
KeyValue('Last measured', last_measured),
8387
KeyValue('Drift (deg/sec)', str(drift)) ]

pr2_bringup/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
2+
if(POLICY CMP0048)
3+
cmake_policy(SET CMP0048 NEW)
4+
endif()
35
project(pr2_bringup)
46

57
# Load catkin and all dependencies required for this package

pr2_bringup/config/dualstereo_camera.launch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<param name="height" type="int" value="480" />
3232
<param name="imager_rate" type="double" value="25" />
3333

34+
<param name="trig_timestamp_topic" type="str" value="head_camera_trigger/trigger" />
3435
<param name="frame_id" type="str" value="wide_stereo_optical_frame" />
3536
<param name="first_packet_offset" type="double" value="0.0025" />
3637
<param name="ext_trig" type="bool" value="True" />

pr2_bringup/config/kinect2_bridge.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<arg name="start_manager" default="true" />
2323

2424
<node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager)" args="manager"
25-
if="$(arg start_manager)" machine="pr2-head" output="screen"/>
25+
if="$(arg start_manager)" machine="pr2-head" output="screen" respawn="true"/>
2626

2727
<node pkg="nodelet" type="nodelet" name="$(arg base_name)_bridge" machine="pr2-head"
2828
args="load kinect2_bridge/kinect2_bridge_nodelet $(arg nodelet_manager)"

pr2_camera_synchronizer/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
2+
if(POLICY CMP0048)
3+
cmake_policy(SET CMP0048 NEW)
4+
endif()
35
project(pr2_camera_synchronizer)
46

57
# Load catkin and all dependencies required for this package

pr2_camera_synchronizer/src/pr2_camera_synchronizer/synchronizer_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def update_diagnostics(self):
604604
self.diagnostic_pub.publish(da)
605605

606606
def spin(self):
607-
self.diagnostic_pub = rospy.Publisher("/diagnostics", DiagnosticArray)
607+
self.diagnostic_pub = rospy.Publisher("/diagnostics", DiagnosticArray, queue_size= 1)
608608
try:
609609
reset_count = 0
610610
rospy.loginfo("Camera synchronizer is running...")

pr2_computer_monitor/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
2+
if(POLICY CMP0048)
3+
cmake_policy(SET CMP0048 NEW)
4+
endif()
35
project(pr2_computer_monitor)
6+
47
# Load catkin and all dependencies required for this package
5-
# TODO: remove all from COMPONENTS that are not catkin packages.
68
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs)
79

810
if(CATKIN_ENABLE_TESTING)

pr2_computer_monitor/scripts/ntp_monitor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ def ntp_monitor(ntp_hostname, offset=500, self_offset=500, diag_hostname=None,
111111
if (abs(measured_offset) > error_offset):
112112
st.level = DiagnosticStatus.ERROR
113113
st.message = "NTP Offset Too High"
114-
115114
else:
116-
st.level = DiagnosticStatus.ERROR
115+
st.level = DiagnosticStatus.WARN
117116
st.message = "Error Running ntpdate. Returned %d" % res
118117
st.values = [ KeyValue("Offset (us)", "N/A"),
119118
KeyValue("Offset tolerance (us)", str(off)),

pr2_controller_configuration/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
2+
if(POLICY CMP0048)
3+
cmake_policy(SET CMP0048 NEW)
4+
endif()
35
project(pr2_controller_configuration)
46

57
# Load catkin and all dependencies required for this package

0 commit comments

Comments
 (0)