From 1a32b59522ab37472797d5aa41e64c06a1f621fd Mon Sep 17 00:00:00 2001 From: Michael Goerner Date: Wed, 1 Dec 2021 14:02:33 +0000 Subject: [PATCH 1/7] fixup dependency & add melodic workaround --- pr2_ethercat/CMakeLists.txt | 10 ++++++++-- pr2_ethercat/package.xml | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pr2_ethercat/CMakeLists.txt b/pr2_ethercat/CMakeLists.txt index cb68c9a..e226c36 100644 --- a/pr2_ethercat/CMakeLists.txt +++ b/pr2_ethercat/CMakeLists.txt @@ -10,15 +10,21 @@ find_package(catkin REQUIRED COMPONENTS pr2_controller_manager ethercat_hardware realtime_tools - diagnostic_updater) + diagnostic_updater + cpp_common) find_package(Boost REQUIRED COMPONENTS system thread) include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) -catkin_package() +catkin_package(DEPENDS CATKIN_DEPENDS cpp_common) add_definitions(-O3) +# needed to circumvent LD_LIBRARY_PATH being emptied through ethercat_grant +# in addition to not propagating ros_ethercat_loop RUNPATH to dependencies, in contrast to RPATH +SET(GCC_NEWDTAGS_LINK_FLAGS "-Wl,--disable-new-dtags") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_NEWDTAGS_LINK_FLAGS}") + add_executable(pr2_ethercat src/main.cpp) target_link_libraries(pr2_ethercat rt ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_dependencies(pr2_ethercat ${catkin_EXPORTED_TARGETS}) diff --git a/pr2_ethercat/package.xml b/pr2_ethercat/package.xml index ee4c9ab..fc57833 100644 --- a/pr2_ethercat/package.xml +++ b/pr2_ethercat/package.xml @@ -20,6 +20,7 @@ realtime_tools diagnostic_msgs diagnostic_updater + cpp_common pr2_controller_manager roscpp @@ -28,4 +29,5 @@ realtime_tools diagnostic_msgs diagnostic_updater + cpp_common From 83af4a23a596120c35ea5dc82b4c51d627bdb6a9 Mon Sep 17 00:00:00 2001 From: Michael Goerner Date: Fri, 28 Jan 2022 11:23:28 +0000 Subject: [PATCH 2/7] kinect2: respawn the nodelet manager This is the most likely one to break because it runs the actual nodelets! Respawning this one will automatically trigger the nodelet nodes to respawn as well due to the nodelet-bond communication. --- pr2_bringup/config/kinect2_bridge.launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr2_bringup/config/kinect2_bridge.launch b/pr2_bringup/config/kinect2_bridge.launch index e71bdf6..80c0f30 100644 --- a/pr2_bringup/config/kinect2_bridge.launch +++ b/pr2_bringup/config/kinect2_bridge.launch @@ -22,7 +22,7 @@ + if="$(arg start_manager)" machine="pr2-head" output="screen" respawn="true"/> Date: Fri, 22 Apr 2022 09:41:01 +0000 Subject: [PATCH 3/7] imu_monitor: publish drift diagnostics from the beginning To avoid the item showing up as missing in the dashboard --- imu_monitor/scripts/imu_monitor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/imu_monitor/scripts/imu_monitor.py b/imu_monitor/scripts/imu_monitor.py index 58e63fc..b55dd28 100755 --- a/imu_monitor/scripts/imu_monitor.py +++ b/imu_monitor/scripts/imu_monitor.py @@ -26,7 +26,9 @@ def __init__(self): self.odom_sub = rospy.Subscriber('base_odometry/odometer', Odometer, self.odom_cb) # diagnostics - self.pub_diag = rospy.Publisher('/diagnostics', DiagnosticArray) + self.pub_diag = rospy.Publisher('/diagnostics', DiagnosticArray, queue_size= 1) + + self.diag_timer = rospy.Timer(rospy.Duration(1), self.publish_diagnostics) def imu_cb(self, msg): @@ -44,14 +46,16 @@ def odom_cb(self, msg): self.start_time = rospy.Time.now() self.start_angle = self.last_angle self.dist = dist - + # do imu test if possible if rospy.Time.now() > self.start_time + rospy.Duration(10.0): self.drift = fabs(self.start_angle - self.last_angle)*180/(pi*10) self.start_time = rospy.Time.now() self.start_angle = self.last_angle self.last_measured = rospy.Time.now() - + + def publish_diagnostics(self, event): + with self.lock: # publish diagnostics d = DiagnosticArray() d.header.stamp = rospy.Time.now() @@ -77,7 +81,7 @@ def odom_cb(self, msg): elif age < 3600: last_measured = '%f minutes ago'%(age/60) else: - last_measured = '%f hours ago'%(age/3600) + last_measured = '%f hours ago'%(age/3600) ds.values = [ KeyValue('Last measured', last_measured), KeyValue('Drift (deg/sec)', str(drift)) ] From c9dfa77bbcd01ae0a2de2871056a4b1a21b284d2 Mon Sep 17 00:00:00 2001 From: pr2 Date: Mon, 30 May 2022 19:01:28 +0000 Subject: [PATCH 4/7] Revert "Took out unnecessary setting of trig_timestamp_topic in the wge100 multi-configurator. It was harmless here, but if you copy it, you can get into trouble." It's not harmless, it removed an error. wtf... This reverts commit 81b70cff946b5077528ea7b5d7f350c72c7e9b50. --- pr2_bringup/config/dualstereo_camera.launch | 1 + 1 file changed, 1 insertion(+) diff --git a/pr2_bringup/config/dualstereo_camera.launch b/pr2_bringup/config/dualstereo_camera.launch index 356fecb..2ffc542 100644 --- a/pr2_bringup/config/dualstereo_camera.launch +++ b/pr2_bringup/config/dualstereo_camera.launch @@ -31,6 +31,7 @@ + From 53e362315aef64916123cf1461b116be569a2658 Mon Sep 17 00:00:00 2001 From: Michael Goerner Date: Mon, 30 May 2022 19:01:51 +0000 Subject: [PATCH 5/7] set queue_size explicitly --- .../src/pr2_camera_synchronizer/synchronizer_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr2_camera_synchronizer/src/pr2_camera_synchronizer/synchronizer_classes.py b/pr2_camera_synchronizer/src/pr2_camera_synchronizer/synchronizer_classes.py index 533dc4e..c9bda95 100755 --- a/pr2_camera_synchronizer/src/pr2_camera_synchronizer/synchronizer_classes.py +++ b/pr2_camera_synchronizer/src/pr2_camera_synchronizer/synchronizer_classes.py @@ -604,7 +604,7 @@ def update_diagnostics(self): self.diagnostic_pub.publish(da) def spin(self): - self.diagnostic_pub = rospy.Publisher("/diagnostics", DiagnosticArray) + self.diagnostic_pub = rospy.Publisher("/diagnostics", DiagnosticArray, queue_size= 1) try: reset_count = 0 rospy.loginfo("Camera synchronizer is running...") From cc6a9c6c10b8392a9296a82dc7f2d3bda0510453 Mon Sep 17 00:00:00 2001 From: Michael Goerner Date: Thu, 8 Sep 2022 12:16:40 +0000 Subject: [PATCH 6/7] degrade ntpdate error to warning It's not worth raising an error just because the server connection was not sufficiently quick once. We see this on our machines every now and then. If this is a permanent error condition it could escalate at some point but that just adds additional complexity here. A warning should alert you enough if it doesn't go away and you observe unusual behavior. --- pr2_computer_monitor/scripts/ntp_monitor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pr2_computer_monitor/scripts/ntp_monitor.py b/pr2_computer_monitor/scripts/ntp_monitor.py index 09e2013..fe69930 100755 --- a/pr2_computer_monitor/scripts/ntp_monitor.py +++ b/pr2_computer_monitor/scripts/ntp_monitor.py @@ -111,9 +111,8 @@ def ntp_monitor(ntp_hostname, offset=500, self_offset=500, diag_hostname=None, if (abs(measured_offset) > error_offset): st.level = DiagnosticStatus.ERROR st.message = "NTP Offset Too High" - else: - st.level = DiagnosticStatus.ERROR + st.level = DiagnosticStatus.WARN st.message = "Error Running ntpdate. Returned %d" % res st.values = [ KeyValue("Offset (us)", "N/A"), KeyValue("Offset tolerance (us)", str(off)), From 83b362ca907d54eb8604d6330ff97301aeec66d4 Mon Sep 17 00:00:00 2001 From: v4hn Date: Mon, 6 Mar 2023 15:57:58 +0100 Subject: [PATCH 7/7] get rid of cmake build-time warnings - cmake drops support for <2.8.12 in the future - CMP0048 is only available from 3.0, but complains if it is unset so explicitly set the policy if we compile on newer cmake (very likely). --- imu_monitor/CMakeLists.txt | 6 ++++-- pr2_bringup/CMakeLists.txt | 6 ++++-- pr2_camera_synchronizer/CMakeLists.txt | 6 ++++-- pr2_computer_monitor/CMakeLists.txt | 8 +++++--- pr2_controller_configuration/CMakeLists.txt | 6 ++++-- pr2_ethercat/CMakeLists.txt | 6 ++++-- pr2_robot/CMakeLists.txt | 5 ++++- pr2_run_stop_auto_restart/CMakeLists.txt | 6 ++++-- 8 files changed, 33 insertions(+), 16 deletions(-) diff --git a/imu_monitor/CMakeLists.txt b/imu_monitor/CMakeLists.txt index fcdc8c1..61b014c 100644 --- a/imu_monitor/CMakeLists.txt +++ b/imu_monitor/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(imu_monitor) find_package(catkin REQUIRED) diff --git a/pr2_bringup/CMakeLists.txt b/pr2_bringup/CMakeLists.txt index 694f110..95fbd64 100644 --- a/pr2_bringup/CMakeLists.txt +++ b/pr2_bringup/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_bringup) # Load catkin and all dependencies required for this package diff --git a/pr2_camera_synchronizer/CMakeLists.txt b/pr2_camera_synchronizer/CMakeLists.txt index 3a24df4..aa2c12c 100644 --- a/pr2_camera_synchronizer/CMakeLists.txt +++ b/pr2_camera_synchronizer/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_camera_synchronizer) # Load catkin and all dependencies required for this package diff --git a/pr2_computer_monitor/CMakeLists.txt b/pr2_computer_monitor/CMakeLists.txt index e1d4269..8f98997 100644 --- a/pr2_computer_monitor/CMakeLists.txt +++ b/pr2_computer_monitor/CMakeLists.txt @@ -1,8 +1,10 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_computer_monitor) + # Load catkin and all dependencies required for this package -# TODO: remove all from COMPONENTS that are not catkin packages. find_package(catkin REQUIRED COMPONENTS roscpp std_msgs) if(CATKIN_ENABLE_TESTING) diff --git a/pr2_controller_configuration/CMakeLists.txt b/pr2_controller_configuration/CMakeLists.txt index a870041..2bd77bc 100644 --- a/pr2_controller_configuration/CMakeLists.txt +++ b/pr2_controller_configuration/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_controller_configuration) # Load catkin and all dependencies required for this package diff --git a/pr2_ethercat/CMakeLists.txt b/pr2_ethercat/CMakeLists.txt index e226c36..0bc101b 100644 --- a/pr2_ethercat/CMakeLists.txt +++ b/pr2_ethercat/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_ethercat) # Load catkin and all dependencies required for this package diff --git a/pr2_robot/CMakeLists.txt b/pr2_robot/CMakeLists.txt index f4a5b2a..41ea0f5 100644 --- a/pr2_robot/CMakeLists.txt +++ b/pr2_robot/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_robot) find_package(catkin REQUIRED) catkin_metapackage() diff --git a/pr2_run_stop_auto_restart/CMakeLists.txt b/pr2_run_stop_auto_restart/CMakeLists.txt index b449b0a..d8a56c6 100644 --- a/pr2_run_stop_auto_restart/CMakeLists.txt +++ b/pr2_run_stop_auto_restart/CMakeLists.txt @@ -1,5 +1,7 @@ -# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 2.8.12) +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() project(pr2_run_stop_auto_restart) # Load catkin and all dependencies required for this package