ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

smach_viewer does not work in indigo

asked 2014-07-17 12:10:13 -0500

Aravind gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

Comments

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

jbinney gravatar image jbinney  ( 2014-07-17 20:22:35 -0500 )edit

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.

Aravind gravatar image Aravind  ( 2014-07-18 16:22:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-08-31 13:00:23 -0500

shiva gravatar image

updated 2015-12-23 13:06:16 -0500

To save others some time, this answer worked for me:

when I rewrote the 480th row of the /opt/ros/indigo/lib/python2.7/dist-packages/xdot/xdot.py

return int(self.read_code()) -> return int(float(self.read_code()))

Source: http://answers.ros.org/question/17268...

I got to the solution following the thread above. From what I gather, the problem is that read_code returns a float instead of an int.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-07-17 12:10:13 -0500

Seen: 1,376 times

Last updated: Dec 23 '15