From c4d37b501517064670232d35ee98aef11303efac Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Thu, 5 Nov 2020 11:54:44 +0100 Subject: [PATCH 01/14] update instruction in README about how to install python3 catkin tools (catkin build) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bdad74dac..0b24e3fc5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ROSPlan supports kinetic and melodic ROS distributions and is developed under Ub Install dependencies: ```sh -sudo apt install flex bison freeglut3-dev libbdd-dev python-catkin-tools ros-$ROS_DISTRO-tf2-bullet +sudo apt install flex bison freeglut3-dev libbdd-dev python3-osrf-pycommon python3-catkin-tools ros-$ROS_DISTRO-tf2-bullet ``` Select or create a [catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace): From 2b08e9a47ee7e63639d18212e8a319ea18b95c74 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Thu, 5 Nov 2020 11:56:11 +0100 Subject: [PATCH 02/14] do not treat deprecated copy as error but as warning (workaround, this should be solved properly later on) --- rosplan_dependencies/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rosplan_dependencies/CMakeLists.txt b/rosplan_dependencies/CMakeLists.txt index 40271cdb6..c2a7e0aca 100644 --- a/rosplan_dependencies/CMakeLists.txt +++ b/rosplan_dependencies/CMakeLists.txt @@ -50,7 +50,7 @@ if (LBITS EQUAL 64) else() SET (RDDL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") endif(LBITS EQUAL 64) -SET (RDDL_CMAKE_CXX_FLAGS "${RDDL_CMAKE_CXX_FLAGS} -g -Wall -W -Wno-sign-compare -Wno-deprecated -ansi -pedantic -Werror -std=c++11 -O3 -DNDEBUG -fomit-frame-pointer") +SET (RDDL_CMAKE_CXX_FLAGS "${RDDL_CMAKE_CXX_FLAGS} -g -Wall -W -Wno-sign-compare -Wno-deprecated -ansi -pedantic -Werror -std=c++11 -O3 -DNDEBUG -fomit-frame-pointer -Wno-error=deprecated-copy") # Lexer and parser find_package(BISON 3.0.4 REQUIRED) @@ -281,4 +281,4 @@ install(DIRECTORY ippc_server/include/ ippc_server/cpp-base64/ ######################################################################################################################## -######################################################################################################################## \ No newline at end of file +######################################################################################################################## From ae35f656029a95f29ef39a3ffaac46e268389963 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 9 Nov 2020 12:24:25 +0100 Subject: [PATCH 03/14] move dependency to rosplan demos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b24e3fc5..a0d7c0dc8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ROSPlan supports kinetic and melodic ROS distributions and is developed under Ub Install dependencies: ```sh -sudo apt install flex bison freeglut3-dev libbdd-dev python3-osrf-pycommon python3-catkin-tools ros-$ROS_DISTRO-tf2-bullet +sudo apt install flex bison freeglut3-dev libbdd-dev python3-osrf-pycommon python3-catkin-tools ``` Select or create a [catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace): From d6ff2c92ade285a32a3593a1e45bae13f5156a02 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 26 Apr 2021 23:31:17 +0200 Subject: [PATCH 04/14] migrate python2 to python3 --- rosplan_rqt/scripts/esterel_plan_viewer.py | 2 +- .../rosplan_rqt/ROSPlanActionDispatcher.py | 6 +-- .../src/rosplan_rqt/ROSPlanDispatcher.py | 44 ++++++++++--------- .../rosplan_rqt/ROSPlanEsterelPlanViewer.py | 2 +- .../src/rosplan_rqt/ROSPlanProblemViewer.py | 2 +- rosplan_rqt/src/rosplan_rqt/graphUpdater.py | 2 +- rosplan_rqt/src/rosplan_rqt/xdot_qt.py | 17 +++---- rosplan_sensing_interface/example.py | 4 +- .../icaps2019_tutorial.py | 2 +- .../scripts/sensing_interface.py | 2 +- 10 files changed, 43 insertions(+), 40 deletions(-) diff --git a/rosplan_rqt/scripts/esterel_plan_viewer.py b/rosplan_rqt/scripts/esterel_plan_viewer.py index 00daa0901..314405df3 100755 --- a/rosplan_rqt/scripts/esterel_plan_viewer.py +++ b/rosplan_rqt/scripts/esterel_plan_viewer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanActionDispatcher.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanActionDispatcher.py index 21e8dfa64..12c05ca61 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanActionDispatcher.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanActionDispatcher.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import rospy @@ -51,8 +51,8 @@ def __init__(self, plugin=None): label_list.append(param.key) self._parameter_type_list[op.name] = param_list self._parameter_label_list[op.name] = label_list - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') self._handle_operator_name_changed(0) # connect components diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py index 497e4f362..56e5f8494 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import rospy @@ -6,7 +6,6 @@ import sys from itertools import product -from string import join, split from std_msgs.msg import * from diagnostic_msgs.msg import KeyValue @@ -61,8 +60,8 @@ def __init__(self, plugin=None): label_list.append(param.key) self._predicate_param_type_list[pred.name] = param_list self._predicate_param_label_list[pred.name] = label_list - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') self._handle_goal_name_changed(0) self._handle_fact_name_changed(0) @@ -75,8 +74,8 @@ def __init__(self, plugin=None): for typename in resp.types: self.typeComboBox.addItem(typename) self._type_list.append(typename) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') # connect components self.planButton.clicked[bool].connect(self._handle_plan_clicked) @@ -144,8 +143,8 @@ def refresh_model(self): self._goal_list[goalText] = goal if goalText in selected_list: item.setSelected(True) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') # facts and functions rospy.wait_for_service('rosplan_knowledge_base/state/propositions') selected_list = [] @@ -171,8 +170,8 @@ def refresh_model(self): self._fact_list[attributeText] = attribute if attributeText in selected_list: item.setSelected(True) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') # instances expanded_list = [] root = self.instanceView.invisibleRootItem() @@ -276,11 +275,14 @@ def _handle_predicate_name_change(self, predName, combo): predicates_client = rospy.ServiceProxy('rosplan_knowledge_base/state/instances', GetInstanceService) resp = predicates_client(param_type) parameters.append(resp.instances) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') for element in product(*parameters): - pred = join(element, ' ') - combo.addItem(pred) + print(element) + pred = '' + for single_element in element: + pred += f'{single_element} ' + combo.addItem(pred[:-1]) def _handle_goal_name_changed(self, index): self._handle_predicate_name_change(self.goalNameComboBox.itemText(index), self.goalComboBox) @@ -299,15 +301,15 @@ def _handle_add_button_clicked(self, updateType, predName, combo): knowledge.knowledge_type = KnowledgeItem.FACT knowledge.attribute_name = predName index = 0 - for param in split(combo.currentText()): + for param in str.split(combo.currentText()): pair = KeyValue() pair.key = (self._predicate_param_label_list[knowledge.attribute_name])[index] index = index + 1 pair.value = param knowledge.values.append(pair) resp = update_client(updateType, knowledge) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') def _handle_add_goal_clicked(self, data): self._handle_add_button_clicked(KnowledgeUpdateServiceRequest.ADD_GOAL, self.goalNameComboBox.currentText(), self.goalComboBox) @@ -326,8 +328,8 @@ def _handle_remove_button_clicked(self, updateType, removeNameList, removeMsgLis try: update_client = rospy.ServiceProxy('rosplan_knowledge_base/update', KnowledgeUpdateService) resp = update_client(updateType, removeMsgList[item.text()]) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') self.refresh_model() def _handle_remove_goal_clicked(self, checked): @@ -352,8 +354,8 @@ def _handle_add_instance_clicked(self, checked): knowledge.instance_type = self.typeComboBox.currentText() knowledge.instance_name = self.instanceNameEdit.text() resp = update_client(KnowledgeUpdateServiceRequest.ADD_KNOWLEDGE, knowledge) - except rospy.ServiceException, e: - print "Service call failed: %s"%e + except rospy.ServiceException as e: + rospy.logerr(f'Service call failed: {e}') self.refresh_model() """ diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanEsterelPlanViewer.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanEsterelPlanViewer.py index 3bbcbb112..f1d049e11 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanEsterelPlanViewer.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanEsterelPlanViewer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import rospy diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py index b5ff884e2..7c9adbe58 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import rospy diff --git a/rosplan_rqt/src/rosplan_rqt/graphUpdater.py b/rosplan_rqt/src/rosplan_rqt/graphUpdater.py index 04b4aa779..2551b12c1 100644 --- a/rosplan_rqt/src/rosplan_rqt/graphUpdater.py +++ b/rosplan_rqt/src/rosplan_rqt/graphUpdater.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import rospy diff --git a/rosplan_rqt/src/rosplan_rqt/xdot_qt.py b/rosplan_rqt/src/rosplan_rqt/xdot_qt.py index 5336e87f7..e3727c015 100644 --- a/rosplan_rqt/src/rosplan_rqt/xdot_qt.py +++ b/rosplan_rqt/src/rosplan_rqt/xdot_qt.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # NOTE: Important, this file can be safely removed once one of this PR gets accepted: # https://github.com/ros-visualization/executive_smach_visualization/pull/22 # https://github.com/jbohren/xdot/pull/18 @@ -6,7 +8,6 @@ # or # from xdot.xdot_qt import DotWidget -#!/usr/bin/env python # # Copyright 2008 Jose Fonseca # @@ -218,7 +219,7 @@ def __init__(self, pen, points, filled=False): def draw(self, painter, highlight=False): painter_path = QPainterPath() painter_path.moveTo(QPointF(*self.points[0])) - for i in xrange(1, len(self.points), 3): + for i in range(1, len(self.points), 3): painter_path.cubicTo( QPointF(*self.points[i]), QPointF(*self.points[i + 1]), @@ -571,6 +572,8 @@ def parse(self): elif op == "p": points = self.read_polygon() self.handle_polygon(points, filled=False) + elif op == "": + break else: sys.stderr.write("unknown xdot opcode '%s'\n" % op) break @@ -1324,7 +1327,7 @@ def drag(self, deltax, deltay): def draw(self, painter): #TODO: implement this for qt - print "ERROR: UNIMPLEMENTED ZoomAreaAction.draw" + print('ERROR: UNIMPLEMENTED ZoomAreaAction.draw') return painter.save() painter.set_source_rgba(.5, .5, 1.0, 0.25) @@ -1405,8 +1408,6 @@ def set_filter(self, filter): self.filter = filter def set_dotcode(self, dotcode, filename='',center=True): - if isinstance(dotcode, unicode): - dotcode = dotcode.encode('utf8') p = subprocess.Popen( [self.filter, '-Txdot'], stdin=subprocess.PIPE, @@ -1417,7 +1418,7 @@ def set_dotcode(self, dotcode, filename='',center=True): ) xdotcode, error = p.communicate(dotcode) if p.returncode != 0: - print "UNABLE TO SHELL TO DOT", error + print(f'UNABLE TO SHELL TO DOT, error ; {error}') # dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, # message_format=error, # buttons=gtk.BUTTONS_OK) @@ -1437,7 +1438,7 @@ def set_dotcode(self, dotcode, filename='',center=True): # Store references to subgraph states self.subgraph_shapes = self.graph.subgraph_shapes - except ParseError, ex: + except ParseError as ex: # dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, # message_format=str(ex), # buttons=gtk.BUTTONS_OK) @@ -1846,7 +1847,7 @@ def open_file(self, filename=None): self.set_dotcode(fp.read(), filename) fp.close() self.add_recent_file(filename) - except IOError, ex: + except IOError as ex: pass def on_open(self): diff --git a/rosplan_sensing_interface/example.py b/rosplan_sensing_interface/example.py index ca9c93bb7..0d7143b62 100644 --- a/rosplan_sensing_interface/example.py +++ b/rosplan_sensing_interface/example.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from geometry_msgs.msg import PoseStamped from math import sqrt @@ -59,5 +59,5 @@ def req_docked(): return SetBoolRequest(data=False) def docked(res, params): # params is a list with all the parameters - fully instantiated for services! - print params + print(params) return int(res.message.split(' ')[3])%2 == 0 diff --git a/rosplan_sensing_interface/icaps2019_tutorial.py b/rosplan_sensing_interface/icaps2019_tutorial.py index e9755db4c..90f48b8c1 100644 --- a/rosplan_sensing_interface/icaps2019_tutorial.py +++ b/rosplan_sensing_interface/icaps2019_tutorial.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from geometry_msgs.msg import PoseStamped from math import sqrt diff --git a/rosplan_sensing_interface/scripts/sensing_interface.py b/rosplan_sensing_interface/scripts/sensing_interface.py index 201c65f13..f1b43b66f 100755 --- a/rosplan_sensing_interface/scripts/sensing_interface.py +++ b/rosplan_sensing_interface/scripts/sensing_interface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy import rospkg From c1ea6af1b7ed2a4c430e1e7111c19b1b699db6cc Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 26 Apr 2021 23:39:09 +0200 Subject: [PATCH 05/14] update CI to noetic --- .Dockerfile | 6 +++--- .github/workflows/build.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.Dockerfile b/.Dockerfile index b91b1b2bf..acf733f4c 100644 --- a/.Dockerfile +++ b/.Dockerfile @@ -1,12 +1,12 @@ # ROSPlan docker image -FROM ros:melodic +FROM ros:noetic SHELL ["/bin/bash", "-c"] WORKDIR /root/ws # install dependencies -RUN apt update -qq && apt install python-catkin-tools git vim bash-completion -y -qq +RUN apt update -qq && apt install python3-osrf-pycommon python3-catkin-tools git vim bash-completion -y -qq # Create WS RUN source /opt/ros/$ROS_DISTRO/setup.bash &&\ @@ -35,4 +35,4 @@ RUN catkin build --summarize --no-status # Prepare workspace for runtime. Set the prompt to be colored RUN echo -e "source /opt/ros/$ROS_DISTRO/setup.bash\nsource devel/setup.bash" >> ~/.bashrc &&\ - sed -i s/^#force_color_prompt/force_color_prompt/g ~/.bashrc \ No newline at end of file + sed -i s/^#force_color_prompt/force_color_prompt/g ~/.bashrc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5929a092d..c45b30e0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,12 +7,12 @@ on: branches-ignore: gh-pages env: - ROS_VERSION: melodic + ROS_VERSION: noetic jobs: build: runs-on: ubuntu-latest container: - image: ros:melodic + image: ros:noetic steps: - name: Prepare docker run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1065b573a..925b4f4fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,11 +3,11 @@ name: test on: [push, pull_request] env: - ROS_VERSION: melodic + ROS_VERSION: noetic jobs: build-and-test: runs-on: ubuntu-latest - container: ros:melodic + container: ros:noetic steps: - name: Prepare docker run: | From 4ddf045ecd6e6a7811b1e580182b07116775db45 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 26 Apr 2021 23:39:17 +0200 Subject: [PATCH 06/14] update documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0d7c0dc8..4ea937a9a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Several demos are available in the [rosplan_demos repository](https://github.com ## Installation -ROSPlan supports kinetic and melodic ROS distributions and is developed under Ubuntu 16.04 / 18.04, being linux Ubuntu 18.04 + melodic the recommended setup. +ROSPlan supports by default noetic ROS1 distribution and is developed under Ubuntu 20.04. Install dependencies: ```sh From 757c2bf1567e97448c9e758f1fe4d7005298b253 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 26 Apr 2021 23:45:34 +0200 Subject: [PATCH 07/14] CI: replace python-catkin-tools with python3-catkin-tools, add python3-osrf-pycommon pkg --- .Dockerfile | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.Dockerfile b/.Dockerfile index acf733f4c..e1f76e6c4 100644 --- a/.Dockerfile +++ b/.Dockerfile @@ -6,7 +6,7 @@ WORKDIR /root/ws # install dependencies -RUN apt update -qq && apt install python3-osrf-pycommon python3-catkin-tools git vim bash-completion -y -qq +RUN apt update -qq && apt install python3-catkin-tools python3-osrf-pycommon git vim bash-completion -y -qq # Create WS RUN source /opt/ros/$ROS_DISTRO/setup.bash &&\ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c45b30e0b..9c8d64da7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true apt-key adv --keyserver keyserver.ubuntu.com --recv-key E1DD270288B4E6030699E45FA1715D88E1DF1F24 2>&1 echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu bionic main" | tee /etc/apt/sources.list.d/git.list sudo apt update -qq - sudo apt install python-catkin-tools git -y -qq + sudo apt install python3-catkin-tools python3-osrf-pycommon git -y -qq - name: Create ROS workspace run: | source /opt/ros/$ROS_VERSION/setup.bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 925b4f4fc..68b9d8100 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true apt-key adv --keyserver keyserver.ubuntu.com --recv-key E1DD270288B4E6030699E45FA1715D88E1DF1F24 2>&1 echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu bionic main" | tee /etc/apt/sources.list.d/git.list sudo apt update -qq - sudo apt install python-catkin-tools git -y -qq + sudo apt install python3-catkin-tools python3-osrf-pycommon git -y -qq - name: Create ROS workspace run: | source /opt/ros/$ROS_VERSION/setup.bash From 79888fc60b5cce78ad8ef3437ded24e89b3025b5 Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Mon, 26 Apr 2021 23:48:34 +0200 Subject: [PATCH 08/14] replace python-rospkg with python3-rospkg in package.xml --- rosplan_rqt/package.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rosplan_rqt/package.xml b/rosplan_rqt/package.xml index 5973c034c..6f9629e8e 100644 --- a/rosplan_rqt/package.xml +++ b/rosplan_rqt/package.xml @@ -1,21 +1,21 @@ - rosplan_rqt - 0.0.0 - The rosplan_rqt package - michael - BSD - https://github.com/KCL-Planning/ROSPlan + rosplan_rqt + 0.0.0 + The rosplan_rqt package + michael + BSD + https://github.com/KCL-Planning/ROSPlan - catkin + catkin - python-rospkg - rqt_gui - rqt_gui_py - std_msgs - rqt_graph + python3-rospkg + rqt_gui + rqt_gui_py + std_msgs + rqt_graph - - - + + + From 3231820fcce26f089665210877d428195b49a55c Mon Sep 17 00:00:00 2001 From: Oscar Lima Date: Tue, 27 Apr 2021 10:15:10 +0200 Subject: [PATCH 09/14] remove debug print pushed by mistake --- rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py index 56e5f8494..fcbf3b145 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py @@ -278,7 +278,6 @@ def _handle_predicate_name_change(self, predName, combo): except rospy.ServiceException as e: rospy.logerr(f'Service call failed: {e}') for element in product(*parameters): - print(element) pred = '' for single_element in element: pred += f'{single_element} ' From d7013521bc62a08ede3d3f859f0eb862f2a146df Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 29 Apr 2021 17:08:00 +0200 Subject: [PATCH 10/14] Update ROSPlanProblemViewer.py remove unused import that does not work with python3 --- rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py index 7c9adbe58..b2f79e5fe 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py @@ -6,7 +6,6 @@ import sys from itertools import product -from string import join, split from std_msgs.msg import * from diagnostic_msgs.msg import KeyValue From 3e44d84317778b2397a649ef16e57b319d05620d Mon Sep 17 00:00:00 2001 From: Gerard Canal Date: Mon, 9 May 2022 16:32:56 +0200 Subject: [PATCH 11/14] Python3 for noetic. Fixes in sensing interface --- rosplan_action_interface/setup.py | 2 +- .../src/ActionInterfaceManager.py | 2 +- .../src/ActionlibActionInterface.py | 2 +- .../src/BaseActionInterface.py | 2 +- rosplan_action_interface/src/FSMActionInterface.py | 2 +- .../src/RPKnowledgeBaseLink.py | 2 +- .../src/ServiceActionInterface.py | 2 +- .../scripts/direct_esterel_parser.py | 2 +- .../scripts/sensing_interface.py | 14 +++++++------- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rosplan_action_interface/setup.py b/rosplan_action_interface/setup.py index 004d01b3c..39deeef6a 100644 --- a/rosplan_action_interface/setup.py +++ b/rosplan_action_interface/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup diff --git a/rosplan_action_interface/src/ActionInterfaceManager.py b/rosplan_action_interface/src/ActionInterfaceManager.py index 917954200..63ab47abe 100755 --- a/rosplan_action_interface/src/ActionInterfaceManager.py +++ b/rosplan_action_interface/src/ActionInterfaceManager.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy from rosplan_dispatch_msgs.msg import ActionDispatch, ActionFeedback diff --git a/rosplan_action_interface/src/ActionlibActionInterface.py b/rosplan_action_interface/src/ActionlibActionInterface.py index ac74a3869..4bbc1a0d7 100644 --- a/rosplan_action_interface/src/ActionlibActionInterface.py +++ b/rosplan_action_interface/src/ActionlibActionInterface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy import importlib diff --git a/rosplan_action_interface/src/BaseActionInterface.py b/rosplan_action_interface/src/BaseActionInterface.py index dcbadb26b..c73ff4a19 100644 --- a/rosplan_action_interface/src/BaseActionInterface.py +++ b/rosplan_action_interface/src/BaseActionInterface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy import actionlib diff --git a/rosplan_action_interface/src/FSMActionInterface.py b/rosplan_action_interface/src/FSMActionInterface.py index 48f3a788c..5fee80e90 100644 --- a/rosplan_action_interface/src/FSMActionInterface.py +++ b/rosplan_action_interface/src/FSMActionInterface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy, copy import actionlib diff --git a/rosplan_action_interface/src/RPKnowledgeBaseLink.py b/rosplan_action_interface/src/RPKnowledgeBaseLink.py index 9230f0e2d..6a55ce381 100644 --- a/rosplan_action_interface/src/RPKnowledgeBaseLink.py +++ b/rosplan_action_interface/src/RPKnowledgeBaseLink.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from collections import defaultdict diff --git a/rosplan_action_interface/src/ServiceActionInterface.py b/rosplan_action_interface/src/ServiceActionInterface.py index 6540f62a9..b6b23c469 100644 --- a/rosplan_action_interface/src/ServiceActionInterface.py +++ b/rosplan_action_interface/src/ServiceActionInterface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy import importlib diff --git a/rosplan_planning_system/scripts/direct_esterel_parser.py b/rosplan_planning_system/scripts/direct_esterel_parser.py index 13aec1153..cb1d256a0 100755 --- a/rosplan_planning_system/scripts/direct_esterel_parser.py +++ b/rosplan_planning_system/scripts/direct_esterel_parser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import rospy import genpy diff --git a/rosplan_sensing_interface/scripts/sensing_interface.py b/rosplan_sensing_interface/scripts/sensing_interface.py index 1e038d2b0..8ad8f39af 100755 --- a/rosplan_sensing_interface/scripts/sensing_interface.py +++ b/rosplan_sensing_interface/scripts/sensing_interface.py @@ -6,7 +6,7 @@ import threading import numpy as np from threading import Lock -import imp +import importlib from rosplan_knowledge_msgs.srv import KnowledgeUpdateServiceArray, KnowledgeUpdateServiceArrayRequest from rosplan_knowledge_msgs.srv import GetDomainPredicateDetailsService, GetDomainPredicateDetailsServiceRequest from rosplan_knowledge_msgs.srv import GetDomainAttributeService @@ -79,7 +79,7 @@ def __init__(self): # Load scripts self.scripts = None if self.functions_path: - self.scripts = imp.load_source('sensing_scripts', self.functions_path) + self.scripts = importlib.machinery.SourceFileLoader('sensing_scripts', self.functions_path).load_module() # Declare tools in the scripts module: self.scripts.get_kb_attribute = self.get_kb_attribute self.scripts.rospy = rospy @@ -93,7 +93,7 @@ def __init__(self): ###### # Subscribe to all the topics self.offset = {} # Offset for reading cfg - for predicate_name, predicate_info in self.cfg_topics.iteritems(): + for predicate_name, predicate_info in self.cfg_topics.items(): if type(predicate_info) is list: # We have nested elements in the predicate for i, pi in enumerate(predicate_info): pi['sub_idx'] = i @@ -118,7 +118,7 @@ def __init__(self): self.request_src = [] self.response_process_src = [] self.clients_sub_idx = [] - for predicate_name, predicate_info in self.cfg_service.iteritems(): + for predicate_name, predicate_info in self.cfg_service.items(): if type(predicate_info) is list: for i, pi in enumerate(predicate_info): pi['sub_idx'] = i @@ -152,7 +152,7 @@ def load_params(self, predicate_name, predicate_info): kb_params = [] for p in kb_info.typed_parameters: - instances = self.get_instances_srv.call(GetInstanceServiceRequest(p.value, True)).instances + instances = self.get_instances_srv.call(GetInstanceServiceRequest(p.value, True, True)).instances kb_params.append(instances) if 'params' in predicate_info: @@ -457,7 +457,7 @@ def update_kb(self): sensed_predicates.update(self.sensed_services.copy()) self.srv_mutex.release() - for predicate, (val, changed, updated) in sensed_predicates.iteritems(): + for predicate, (val, changed, updated) in sensed_predicates.items(): if updated: continue @@ -518,7 +518,7 @@ def kb_update_status(self, msg): self.srv_mutex.acquire(True) # Dump cache, it will be reloaded in the next update - for predicate, (val, changed, updated) in self.sensed_topics.iteritems(): + for predicate, (val, changed, updated) in self.sensed_topics.items(): self.sensed_topics[predicate] = (val, changed, False) self.sensed_services.clear() From 78e45c7c6ae2a13c84156c830bb3a3d1331eba7a Mon Sep 17 00:00:00 2001 From: Gerard Canal Date: Mon, 9 May 2022 16:41:31 +0200 Subject: [PATCH 12/14] Fix sensing interface reduce moved in Python3 --- rosplan_sensing_interface/scripts/sensing_interface.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rosplan_sensing_interface/scripts/sensing_interface.py b/rosplan_sensing_interface/scripts/sensing_interface.py index 8ad8f39af..1ebf7ff40 100755 --- a/rosplan_sensing_interface/scripts/sensing_interface.py +++ b/rosplan_sensing_interface/scripts/sensing_interface.py @@ -7,6 +7,7 @@ import numpy as np from threading import Lock import importlib +from functools import reduce from rosplan_knowledge_msgs.srv import KnowledgeUpdateServiceArray, KnowledgeUpdateServiceArrayRequest from rosplan_knowledge_msgs.srv import GetDomainPredicateDetailsService, GetDomainPredicateDetailsServiceRequest from rosplan_knowledge_msgs.srv import GetDomainAttributeService From 2d68f19c3d74426e69dd677b9bf0ebd92fe0ecf1 Mon Sep 17 00:00:00 2001 From: mvinci Date: Mon, 27 Mar 2023 15:35:45 +0200 Subject: [PATCH 13/14] fixed startup error of plan dispatcher GUI --- rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py index fcbf3b145..befed68c9 100644 --- a/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py +++ b/rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py @@ -183,7 +183,7 @@ def refresh_model(self): self.instanceView.clear() for typename in self._type_list: instance_client = rospy.ServiceProxy('rosplan_knowledge_base/state/instances', GetInstanceService) - resp = instance_client(typename) + resp = instance_client(type_name=typename) item = QTreeWidgetItem(self.instanceView) item.setText(0, typename) for instancename in resp.instances: @@ -273,7 +273,7 @@ def _handle_predicate_name_change(self, predName, combo): for param_type in self._predicate_param_type_list[predName]: try: predicates_client = rospy.ServiceProxy('rosplan_knowledge_base/state/instances', GetInstanceService) - resp = predicates_client(param_type) + resp = predicates_client(type_name=param_type) parameters.append(resp.instances) except rospy.ServiceException as e: rospy.logerr(f'Service call failed: {e}') From d86189e64708193e552fd97dbf2138f37671c33d Mon Sep 17 00:00:00 2001 From: mvinci Date: Mon, 27 Mar 2023 15:43:04 +0200 Subject: [PATCH 14/14] updated chimp submodule to newest commit --- rosplan_dependencies/chimp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rosplan_dependencies/chimp b/rosplan_dependencies/chimp index ce7ad7926..af1fbfeff 160000 --- a/rosplan_dependencies/chimp +++ b/rosplan_dependencies/chimp @@ -1 +1 @@ -Subproject commit ce7ad7926c0a1b8dd7790763bb8e7b85dbe768a1 +Subproject commit af1fbfeffb3dde515cda24c25495fb5413593e23