Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noetic devel #268

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .Dockerfile
Original file line number Diff line number Diff line change
@@ -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-catkin-tools python3-osrf-pycommon git vim bash-completion -y -qq

# Create WS
RUN source /opt/ros/$ROS_DISTRO/setup.bash &&\
Expand Down Expand Up @@ -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
sed -i s/^#force_color_prompt/force_color_prompt/g ~/.bashrc
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ 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: |
# Install newer git from ppa to prevent https://github.com/actions/checkout/issues/126
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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ 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: |
# Install newer git from ppa to prevent https://github.com/actions/checkout/issues/126
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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ 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
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
```

Select or create a [catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace):
Expand Down
4 changes: 2 additions & 2 deletions rosplan_dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -281,4 +281,4 @@ install(DIRECTORY ippc_server/include/ ippc_server/cpp-base64/


########################################################################################################################
########################################################################################################################
########################################################################################################################
30 changes: 15 additions & 15 deletions rosplan_rqt/package.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0"?>
<package>
<name>rosplan_rqt</name>
<version>0.0.0</version>
<description>The rosplan_rqt package</description>
<maintainer email="[email protected]">michael</maintainer>
<license>BSD</license>
<url type="website">https://github.com/KCL-Planning/ROSPlan</url>
<name>rosplan_rqt</name>
<version>0.0.0</version>
<description>The rosplan_rqt package</description>
<maintainer email="[email protected]">michael</maintainer>
<license>BSD</license>
<url type="website">https://github.com/KCL-Planning/ROSPlan</url>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>catkin</buildtool_depend>

<run_depend>python-rospkg</run_depend>
<run_depend>rqt_gui</run_depend>
<run_depend>rqt_gui_py</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>rqt_graph</run_depend>
<run_depend>python3-rospkg</run_depend>
<run_depend>rqt_gui</run_depend>
<run_depend>rqt_gui_py</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>rqt_graph</run_depend>

<export>
<rqt_gui plugin="${prefix}/plugin.xml"/>
</export>
<export>
<rqt_gui plugin="${prefix}/plugin.xml"/>
</export>
</package>
2 changes: 1 addition & 1 deletion rosplan_rqt/scripts/esterel_plan_viewer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys

Expand Down
6 changes: 3 additions & 3 deletions rosplan_rqt/src/rosplan_rqt/ROSPlanActionDispatcher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import rospy
Expand Down Expand Up @@ -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
Expand Down
43 changes: 22 additions & 21 deletions rosplan_rqt/src/rosplan_rqt/ROSPlanDispatcher.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import rospy
import rospkg
import sys

from itertools import product
from string import join, split

from std_msgs.msg import *
from diagnostic_msgs.msg import KeyValue
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 = []
Expand All @@ -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()
Expand Down Expand Up @@ -276,11 +275,13 @@ 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)
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)
Expand All @@ -299,15 +300,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)
Expand All @@ -326,8 +327,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):
Expand All @@ -352,8 +353,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()

"""
Expand Down
2 changes: 1 addition & 1 deletion rosplan_rqt/src/rosplan_rqt/ROSPlanEsterelPlanViewer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import rospy
Expand Down
3 changes: 1 addition & 2 deletions rosplan_rqt/src/rosplan_rqt/ROSPlanProblemViewer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import rospy
import rospkg
import sys

from itertools import product
from string import join, split

from std_msgs.msg import *
from diagnostic_msgs.msg import KeyValue
Expand Down
2 changes: 1 addition & 1 deletion rosplan_rqt/src/rosplan_rqt/graphUpdater.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import rospy
Expand Down
17 changes: 9 additions & 8 deletions rosplan_rqt/src/rosplan_rqt/xdot_qt.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -6,7 +8,6 @@
# or
# from xdot.xdot_qt import DotWidget

#!/usr/bin/env python
#
# Copyright 2008 Jose Fonseca
#
Expand Down Expand Up @@ -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]),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1405,8 +1408,6 @@ def set_filter(self, filter):
self.filter = filter

def set_dotcode(self, dotcode, filename='<stdin>',center=True):
if isinstance(dotcode, unicode):
dotcode = dotcode.encode('utf8')
p = subprocess.Popen(
[self.filter, '-Txdot'],
stdin=subprocess.PIPE,
Expand All @@ -1417,7 +1418,7 @@ def set_dotcode(self, dotcode, filename='<stdin>',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)
Expand All @@ -1437,7 +1438,7 @@ def set_dotcode(self, dotcode, filename='<stdin>',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)
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions rosplan_sensing_interface/example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from geometry_msgs.msg import PoseStamped
from math import sqrt

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion rosplan_sensing_interface/icaps2019_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from geometry_msgs.msg import PoseStamped
from math import sqrt

Expand Down
Loading