smach_viewer does not work in indigo
Hi:
smach_viewer.py does not seem to work in ROS Indigo. It looks like there are a couple of bugs related to the changed Publisher interface and maybe something else. I'm unable to upload this file (no karma) so I'm providing the file at the bottom of this question.
When I run an example state_machine2.py with an introspection server, it runs fine except for a warning about the Publisher not specifying queue_size=1.
[aravind@jeeves src]$ ./state_machine2.py
/opt/ros/indigo/lib/python2.7/dist-packages/smach_ros/introspection.py:132: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'.
data_class=SmachContainerStructure)
/opt/ros/indigo/lib/python2.7/dist-packages/smach_ros/introspection.py:137: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'.
data_class=SmachContainerStatus)
[INFO] [WallTime: 1405615980.267506] State machine starting in initial state 'FOO' with userdata:
[]
[INFO] [WallTime: 1405615980.268563] Executing state FOO
[INFO] [WallTime: 1405615981.270877] State machine transitioning 'FOO':'outcome1'-->'BAR'
[INFO] [WallTime: 1405615981.271551] Executing state BAR
[INFO] [WallTime: 1405615982.273528] State machine transitioning 'BAR':'outcome1'-->'FOO'
Now when I run the introspection server, it does not work.
[aravind@jeeves simple_smach]$ rosrun smach_viewer smach_viewer.py
Exception in thread Thread-6:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/ros/indigo/lib/smach_viewer/smach_viewer.py", line 848, in _update_graph
self.set_dotcode(dotstr,zoom=False)
File "/opt/ros/indigo/lib/smach_viewer/smach_viewer.py", line 866, in set_dotcode
if self.widget.set_dotcode(dotcode, None):
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/wxxdot.py", line 455, in set_dotcode
self.set_xdotcode(xdotcode)
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/wxxdot.py", line 483, in set_xdotcode
self.graph = parser.parse()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 1146, in parse
DotParser.parse(self)
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 951, in parse
self.parse_graph()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 960, in parse_graph
self.parse_stmt()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 993, in parse_stmt
self.parse_subgraph()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 974, in parse_subgraph
self.parse_stmt()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 993, in parse_stmt
self.parse_subgraph()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 974, in parse_subgraph
self.parse_stmt()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 1009, in parse_stmt
self.handle_node(id, attrs)
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 1120, in handle_node
shapes.extend(parser.parse())
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 608, in parse
points = self.read_polygon()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py", line 503, in read_polygon
x, y ...
There's a couple of things here. The queue_size warning should be fixed, but doesn't actually break anything yet. The real problem looks like xdot now returns floating point numbers instead of ints. I can confirm that I see the same problem on my computer. Can you create an issue here: https://github.com/ros-visualization/executive_smach_visualization/issues
Thanks! I have done so. It is strange that when I checked my post, it says "Seen: 0 times". Still does. I saw your post almost by accident. Also, on a related basis, it was pretty hard for me to post as I could not attach files and I wasn't allowed to post because my post contained a link from an error message.