Skip to content

Commit

Permalink
Merge branch 'melodic-devel' into image-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 authored Jul 20, 2022
2 parents 4c3e4c3 + 1ec4886 commit 68df466
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 27 deletions.
32 changes: 23 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# this is .traivs.yml written by ./create_travis_settings.py
# this is .traivs.yml written by -

# https://github.com/ros-infrastructure/ros_buildfarm/blob/master/doc/jobs/devel_jobs.rst
# https://github.com/ros-infrastructure/ros_buildfarm/blob/master/doc/jobs/prerelease_jobs.rst
Expand All @@ -8,22 +8,34 @@ sudo: true
dist: bionic
language: python
python:
- "3.7"
- "3.6"
addons:
apt:
packages:
- python2.7
- 2to3
env:
global:
- JOB_PATH=/tmp/devel_job
- ABORT_ON_TEST_FAILURE=1
- INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml
matrix:
- ROS_DISTRO_NAME=kinetic OS_NAME=ubuntu OS_CODE_NAME=xenial ARCH=amd64
- CHECK_PYTHON2_COMPILE=true
- CHECK_PYTHON3_COMPILE=true
- ROS_DISTRO_NAME=indigo OS_NAME=ubuntu OS_CODE_NAME=trusty ARCH=amd64 INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/6a93d17/index.yaml
- ROS_DISTRO_NAME=kinetic OS_NAME=ubuntu OS_CODE_NAME=xenial ARCH=amd64 INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/6a93d17/index.yaml
- ROS_DISTRO_NAME=melodic OS_NAME=ubuntu OS_CODE_NAME=bionic ARCH=amd64
- ROS_DISTRO_NAME=noetic OS_NAME=ubuntu OS_CODE_NAME=focal ARCH=amd64
# matrix:
# allow_failures:
# - env: ROS_DISTRO_NAME=kinetic OS_NAME=ubuntu OS_CODE_NAME=xenial ARCH=amd64
# matrix:
# allow_failures:
# - env: ROS_DISTRO_NAME=melodic OS_NAME=ubuntu OS_CODE_NAME=bionic ARCH=amd64
install:
# check python code code compatibility
- docker run --rm -v$(pwd):/opt/code -ti ${OS_NAME}:${OS_CODE_NAME} bash -c 'set -x; set -e; apt update -qq; apt install -y -qq lsb-release libroslib-dev python 2>&1 >/dev/null; set +x; for file in /etc/catkin/profile.d/*.sh; do echo $file; source $file; done; set -x; apt install -y -qq python${ROS_PYTHON_VERSION} 2>&1 >/dev/null; lsb_release -a; python${ROS_PYTHON_VERSION} --version; set +x; cd /opt/code; EXIT_STATUS=0; for file in $(find -type f); do if [[ $file == *.py || \"$(head -1 $file)\" =~ \"python\" ]]; then echo \"Check if $file is compatible with python${ROS_PYTHON_VERSION}\"; set -x; python${ROS_PYTHON_VERSION} -m py_compile $file || EXIT_STATUS=1; set +x; fi; done; exit $EXIT_STATUS';
# check python2 compatibility
- if [ "${CHECK_PYTHON2_COMPILE}" == "true" ]; then python2 -m compileall .; exit $?; fi
# check python3 compatibility
- if [ "${CHECK_PYTHON3_COMPILE}" == "true" ]; then bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . > /dev/null; echo Exitting with \$ret; exit \$ret"; exit $?; fi
# either install the latest released version of ros_buildfarm
- pip install pyyaml==5.4.1 ## latest pyyaml raises TypeError: load() missing 1 required positional argument: 'Loader'
- pip install ros_buildfarm
# or checkout a specific branch
#- git clone -b master https://github.com/ros-infrastructure/ros_buildfarm /tmp/ros_buildfarm
Expand All @@ -36,7 +48,9 @@ install:
- mkdir -p $JOB_PATH/ws/src
- cp -R $TRAVIS_BUILD_DIR $JOB_PATH/ws/src/
# generate the script to run a pre-release job for that target and repo
- generate_prerelease_script.py https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml $ROS_DISTRO_NAME default $OS_NAME $OS_CODE_NAME $ARCH --output-dir $JOB_PATH
- generate_prerelease_script.py $INDEX_URL $ROS_DISTRO_NAME default $OS_NAME $OS_CODE_NAME $ARCH --output-dir $JOB_PATH
# update keys for trusty/xenial
- set -x; if [ "${OS_CODE_NAME}" = "trusty" ] || [ "${OS_CODE_NAME}" = "xenial" ]; then sed -i /0.key$/a'curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | tee $WORKSPACE/keys/0.key' $JOB_PATH/prerelease_build_*.sh; fi
# run the actual job which involves Docker
- cd $JOB_PATH; sh ./prerelease.sh -y
script:
Expand Down
36 changes: 23 additions & 13 deletions smach_viewer/scripts/smach_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import rospy
import rospkg
import roslib

from smach_msgs.msg import SmachContainerStatus,SmachContainerInitialStatusCmd,SmachContainerStructure
from sensor_msgs.msg import Image
Expand All @@ -47,6 +48,7 @@
import time
import cv_bridge
import numpy as np
import base64

import wxversion
if wxversion.checkInstalled("2.8"):
Expand Down Expand Up @@ -85,12 +87,12 @@ def import_non_local(name, custom_name=None):
### Helper Functions
def graph_attr_string(attrs):
"""Generate an xdot graph attribute string."""
attrs_strs = ['"'+str(k)+'"="'+str(v)+'"' for k,v in attrs.iteritems()]
attrs_strs = ['"'+str(k)+'"="'+str(v)+'"' for k,v in attrs.items()]
return ';\n'.join(attrs_strs)+';\n'

def attr_string(attrs):
"""Generate an xdot node attribute string."""
attrs_strs = ['"'+str(k)+'"="'+str(v)+'"' for k,v in attrs.iteritems()]
attrs_strs = ['"'+str(k)+'"="'+str(v)+'"' for k,v in attrs.items()]
return ' ['+(', '.join(attrs_strs))+']'

def get_parent_path(path):
Expand Down Expand Up @@ -164,6 +166,14 @@ def update_structure(self, msg):

return needs_update

def _load_local_data(self, msg):
"""Unpack the user data"""
try:
local_data = pickle.loads(msg.local_data)
except KeyError:
local_data = pickle.loads(base64.b64decode(msg.local_data.encode('utf-8')))
return local_data

def update_status(self, msg):
"""Update the known userdata and active state set and return True if the graph needs to be redrawn."""

Expand All @@ -185,14 +195,14 @@ def update_status(self, msg):
# Unpack the user data
while not rospy.is_shutdown():
try:
self._local_data._data = pickle.loads(msg.local_data)
self._local_data._data = self._load_local_data(msg)
break
except ImportError as ie:
# This will only happen once for each package
modulename = ie.args[0][16:]
packagename = modulename[0:modulename.find('.')]
roslib.load_manifest(packagename)
self._local_data._data = pickle.loads(msg.local_data)
self._local_data._data = self._load_local_data(msg)

# Store the info string
self._info = msg.info
Expand Down Expand Up @@ -292,10 +302,10 @@ def get_dotcode(self, selected_paths, closed_paths, depth, max_depth, containers
dotstr += '"%s" %s;\n' % (child_path, attr_string(child_attrs))

# Iterate over edges
internal_edges = zip(
internal_edges = list(zip(
self._internal_outcomes,
self._outcomes_from,
self._outcomes_to)
self._outcomes_to))

# Add edge from container label to initial state
internal_edges += [('','__proxy__',initial_child) for initial_child in self._initial_states]
Expand Down Expand Up @@ -766,7 +776,7 @@ def selection_changed(self, event):

# Generate the userdata string
ud_str = ''
for (k,v) in container._local_data._data.iteritems():
for (k,v) in container._local_data._data.items():
ud_str += str(k)+": "
vstr = str(v)
# Add a line break if this is a multiline value
Expand Down Expand Up @@ -798,7 +808,7 @@ def _structure_msg_update(self, msg, server_name):
parent_path = '/'.join(pathsplit[0:-1])

rospy.logdebug("RECEIVED: "+path)
rospy.logdebug("CONTAINERS: "+str(self._containers.keys()))
rospy.logdebug("CONTAINERS: "+str(list(self._containers.keys())))

# Initialize redraw flag
needs_redraw = False
Expand Down Expand Up @@ -911,7 +921,7 @@ def _update_graph(self):

# Generate the rest of the graph
# TODO: Only re-generate dotcode for containers that have changed
for path,tc in containers_to_update.iteritems():
for path,tc in containers_to_update.items():
dotstr += tc.get_dotcode(
self._selected_paths,[],
0,self._max_depth,
Expand All @@ -928,7 +938,7 @@ def _update_graph(self):
self._structure_changed = False

# Update the styles for the graph if there are any updates
for path,tc in containers_to_update.iteritems():
for path,tc in containers_to_update.items():
tc.set_styles(
self._selected_paths,
0,self._max_depth,
Expand Down Expand Up @@ -959,7 +969,7 @@ def _update_tree(self):
self._update_cond.wait()
self.tree.DeleteAllItems()
self._tree_nodes = {}
for path,tc in self._top_containers.iteritems():
for path,tc in self._top_containers.items():
self.add_to_tree(path, None)

def add_to_tree(self, path, parent):
Expand All @@ -972,7 +982,7 @@ def add_to_tree(self, path, parent):
# Add children to tree
for label in self._containers[path]._children:
child_path = '/'.join([path,label])
if child_path in self._containers.keys():
if child_path in list(self._containers.keys()):
self.add_to_tree(child_path, container)
else:
self.tree.AppendItem(container,label)
Expand Down Expand Up @@ -1085,4 +1095,4 @@ def main():
if __name__ == '__main__':
rospy.init_node('smach_viewer',anonymous=False, disable_signals=True,log_level=rospy.INFO)
sys.argv = rospy.myargv()
main()
main()
4 changes: 2 additions & 2 deletions smach_viewer/src/smach_viewer/xdot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import wxxdot
import xdot_qt
from . import wxxdot
from . import xdot_qt

2 changes: 1 addition & 1 deletion smach_viewer/src/smach_viewer/xdot/wxxdot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from xdot import *
from .xdot import *


__all__ = ['WxDotWindow', 'WxDotFrame']
Expand Down
2 changes: 1 addition & 1 deletion smach_viewer/src/smach_viewer/xdot/xdot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ def parse_subgraph(self):
self.parse_stmt()
self.consume()
new_shapes = set(self.shapes) - shapes_before
self.subgraph_shapes[id] = [s for s in new_shapes if not any([s in ss for ss in self.subgraph_shapes.values()])]
self.subgraph_shapes[id] = [s for s in new_shapes if not any([s in ss for ss in list(self.subgraph_shapes.values())])]
return id

def parse_stmt(self):
Expand Down
2 changes: 1 addition & 1 deletion smach_viewer/src/smach_viewer/xdot/xdot_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def parse_subgraph(self):
self.parse_stmt()
self.consume()
new_shapes = set(self.shapes) - shapes_before
self.subgraph_shapes[id] = [s for s in new_shapes if not any([s in ss for ss in self.subgraph_shapes.values()])]
self.subgraph_shapes[id] = [s for s in new_shapes if not any([s in ss for ss in list(self.subgraph_shapes.values())])]
return id

def parse_stmt(self):
Expand Down

0 comments on commit 68df466

Please sign in to comment.