From 940d918df7cec89d3ac6844d510a4ef95fc3ae74 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Wed, 20 Mar 2024 16:42:23 +0100 Subject: [PATCH] remove cob_phidget_em_state --- cob_phidget_em_state/CHANGELOG.rst | 137 ------------------ cob_phidget_em_state/CMakeLists.txt | 10 -- cob_phidget_em_state/package.xml | 17 --- .../scripts/em_state_phidget.py | 108 -------------- 4 files changed, 272 deletions(-) delete mode 100644 cob_phidget_em_state/CHANGELOG.rst delete mode 100644 cob_phidget_em_state/CMakeLists.txt delete mode 100644 cob_phidget_em_state/package.xml delete mode 100755 cob_phidget_em_state/scripts/em_state_phidget.py diff --git a/cob_phidget_em_state/CHANGELOG.rst b/cob_phidget_em_state/CHANGELOG.rst deleted file mode 100644 index 8c9909742..000000000 --- a/cob_phidget_em_state/CHANGELOG.rst +++ /dev/null @@ -1,137 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package cob_phidget_em_state -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.7.16 (2024-02-20) -------------------- - -0.7.15 (2023-11-06) -------------------- - -0.7.14 (2022-11-17) -------------------- - -0.7.13 (2022-07-29) -------------------- - -0.7.12 (2022-03-15) -------------------- - -0.7.11 (2022-01-12) -------------------- - -0.7.10 (2021-12-23) -------------------- - -0.7.9 (2021-11-26) ------------------- - -0.7.8 (2021-10-19) ------------------- - -0.7.7 (2021-08-02) ------------------- - -0.7.6 (2021-05-10) ------------------- - -0.7.5 (2021-04-06) ------------------- - -0.7.4 (2020-10-14) ------------------- -* Merge pull request `#417 `_ from fmessmer/test_noetic - test noetic -* Bump CMake version to avoid CMP0048 warning -* Contributors: Felix Messmer, fmessmer - -0.7.3 (2020-03-18) ------------------- - -0.7.2 (2020-03-18) ------------------- -* Merge pull request `#408 `_ from fmessmer/ci_updates - [travis] ci updates -* catkin_lint fixes -* Contributors: Felix Messmer, fmessmer - -0.7.1 (2019-11-07) ------------------- - -0.7.0 (2019-08-06) ------------------- -* Merge pull request `#396 `_ from HannesBachter/indigo_dev - 0.6.15 -* Contributors: Felix Messmer - -0.6.15 (2019-07-17) -------------------- - -0.6.14 (2019-06-07) -------------------- - -0.6.13 (2019-03-14) -------------------- - -0.6.12 (2018-07-21) -------------------- -* update maintainer -* Contributors: fmessmer - -0.6.11 (2018-01-07) -------------------- -* Merge remote-tracking branch 'origin/indigo_release_candidate' into indigo_dev -* Merge pull request `#341 `_ from ipa-fxm/APACHE_license - use license apache 2.0 -* use license apache 2.0 -* Contributors: Felix Messmer, ipa-fxm, ipa-uhr-mk - -0.6.10 (2017-07-24) -------------------- - -0.6.9 (2017-07-18) ------------------- -* send em_state only if data from phidget received -* Contributors: Benjamin Maidel - -0.6.8 (2016-10-10) ------------------- -* fix -* use values from message -* fixed syntax error -* fixed conditions -* new package to calculate em state from phidgets digital input -* Contributors: Benjamin Maidel - -0.6.3 (2015-06-17) ------------------- - -0.6.2 (2014-12-15) ------------------- - -0.6.1 (2014-09-17) ------------------- - -0.6.0 (2014-09-09) ------------------- - -0.5.7 (2014-08-26 09:47) ------------------------- - -0.5.6 (2014-08-26 09:42) ------------------------- - -0.5.5 (2014-08-26 08:33) ------------------------- - -0.5.4 (2014-08-25) ------------------- - -0.5.3 (2014-03-31) ------------------- - -0.5.2 (2014-03-21) ------------------- - -0.5.1 (2014-03-20 10:54) ------------------------- diff --git a/cob_phidget_em_state/CMakeLists.txt b/cob_phidget_em_state/CMakeLists.txt deleted file mode 100644 index 620ba5735..000000000 --- a/cob_phidget_em_state/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2) -project(cob_phidget_em_state) - -find_package(catkin REQUIRED COMPONENTS) - -catkin_package() - -catkin_install_python(PROGRAMS scripts/em_state_phidget.py - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}/src -) diff --git a/cob_phidget_em_state/package.xml b/cob_phidget_em_state/package.xml deleted file mode 100644 index b0a257352..000000000 --- a/cob_phidget_em_state/package.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - cob_phidget_em_state - 0.7.16 - The cob_phidget_em_state package publishes emergency state based on phidgets signals. - - Benjamin Maidel - Benjamin Maidel - - Apache 2.0 - - catkin - cob_msgs - cob_phidgets - rospy - - diff --git a/cob_phidget_em_state/scripts/em_state_phidget.py b/cob_phidget_em_state/scripts/em_state_phidget.py deleted file mode 100755 index 1028b26d9..000000000 --- a/cob_phidget_em_state/scripts/em_state_phidget.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import rospy -from cob_phidgets.msg import AnalogSensor -from cob_phidgets.msg import DigitalSensor -from cob_msgs.msg import PowerState -from cob_msgs.msg import EmergencyStopState - -class EmState(): - ST_EM_FREE = 0 - ST_EM_ACTIVE = 1 - ST_EM_CONFIRMED = 2 - -class EMStatePhidget(): - def __init__(self): - self.last_update = None - self.em_caused_by_button = False - - self.last_rear_em_state = False - self.last_front_em_state = False - - self.em_stop_status = EmState.ST_EM_ACTIVE - self.em_msg = EmergencyStopState() - - self.sub_digital_sensors = rospy.Subscriber("digital_sensors", DigitalSensor, self.phidget_cb) - self.pub_em_state = rospy.Publisher('em_stop_state', EmergencyStopState, queue_size=1) - - def phidget_cb(self, msg): - front_em_active = False - rear_em_active = False - got_message = False - - for i in range(0, len(msg.uri)): - if msg.uri[i] == "em_stop_laser_rear": - rear_em_active = not msg.state[i] - got_message = True - if msg.uri[i] == "em_stop_laser_front": - front_em_active = not msg.state[i] - got_message = True - - if got_message: - self.last_update = rospy.Time.now() - - if (front_em_active and rear_em_active) and (not self.last_front_em_state and not self.last_rear_em_state): - self.em_msg.emergency_button_stop = True - self.em_caused_by_button = True - elif (not front_em_active and not rear_em_active) and (self.last_front_em_state and self.last_rear_em_state): - self.em_msg.emergency_button_stop = False - self.em_caused_by_button = False - elif (front_em_active is not rear_em_active) and self.em_caused_by_button : - self.em_msg.emergency_button_stop = False - self.em_caused_by_button = False - self.em_msg.scanner_stop = (front_em_active or rear_em_active) - else: - self.em_msg.scanner_stop = (front_em_active or rear_em_active); - - em_signal = self.em_msg.scanner_stop or self.em_msg.emergency_button_stop - - if self.em_stop_status == EmState.ST_EM_FREE: - if em_signal: - rospy.logdebug("Emergency stop was issued") - self.em_stop_status = EmergencyStopState.EMSTOP - - elif self.em_stop_status == EmState.ST_EM_ACTIVE: - if not em_signal: - rospy.logdebug("Emergency stop was confirmed") - self.em_stop_status = EmergencyStopState.EMCONFIRMED - elif self.em_stop_status == EmState.ST_EM_CONFIRMED: - if em_signal: - rospy.logdebug("Emergency stop issued") - self.em_stop_status = EmergencyStopState.EMSTOP - else: - rospy.logdebug("Emergency stop released") - self.em_stop_status = EmergencyStopState.EMFREE - - self.em_msg.emergency_state = self.em_stop_status - - self.last_rear_em_state = rear_em_active - self.last_front_em_state = front_em_active - - def publish(self): - if self.last_update is not None: - self.pub_em_state.publish(self.em_msg) - - -if __name__ == "__main__": - rospy.init_node("em_state_phidget") - emsp = EMStatePhidget() - rospy.loginfo("em_state_phidget running") - rate = rospy.Rate(10) - while not rospy.is_shutdown(): - emsp.publish() - rate.sleep()