Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion smach_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ project(smach_viewer)

find_package(catkin REQUIRED COMPONENTS rostest)

catkin_python_setup()

catkin_package(
CATKIN_DEPENDS smach_ros xdot smach_msgs
CATKIN_DEPENDS smach_ros smach_msgs
)

# Install targets
Expand Down
4 changes: 3 additions & 1 deletion smach_viewer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

<!-- Dependencies needed after this package is compiled. -->
<run_depend>smach_ros</run_depend>
<run_depend>xdot</run_depend>
<run_depend>smach_msgs</run_depend>
<!-- originally depends on xdot : https://github.com/jbohren/xdot/blob/2.0.1/package.xml#L25-L26 -->
<run_depend>wxpython</run_depend>
<run_depend>graphviz</run_depend>

<export>

Expand Down
28 changes: 25 additions & 3 deletions smach_viewer/scripts/smach_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#
# Author: Jonathan Bohren

import roslib; roslib.load_manifest('smach_viewer')
import rospy

from smach_msgs.msg import SmachContainerStatus,SmachContainerInitialStatusCmd,SmachContainerStructure
Expand All @@ -45,13 +44,36 @@
import colorsys

import wxversion
wxversion.select("2.8")
if wxversion.checkInstalled("2.8"):
wxversion.select("2.8")
else:
print("wxversion 2.8 is not installed, installed versions are {}".format(wxversion.getInstalled()))
import wx
import wx.richtext

import textwrap

import xdot
## this import system (or ros-released) xdot
# import xdot
## need to import currnt package, but not to load this file
# http://stackoverflow.com/questions/6031584/importing-from-builtin-library-when-module-with-same-name-exists
def import_non_local(name, custom_name=None):
import imp, sys

custom_name = custom_name or name

path = filter(lambda x: x != os.path.dirname(os.path.abspath(__file__)), sys.path)
f, pathname, desc = imp.find_module(name, path)

module = imp.load_module(custom_name, f, pathname, desc)
if f:
f.close()

return module

smach_viewer = import_non_local('smach_viewer')
from smach_viewer import xdot
##
import smach
import smach_ros

Expand Down
11 changes: 11 additions & 0 deletions smach_viewer/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(
packages=['smach_viewer', 'smach_viewer.xdot'],
package_dir={'': 'src'}
)

setup(**d)
3 changes: 3 additions & 0 deletions smach_viewer/src/smach_viewer/xdot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import wxxdot
import xdot_qt

Loading