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

KeyError: 'AJ9cQA' #33

Open
ML-S opened this issue Sep 11, 2020 · 3 comments
Open

KeyError: 'AJ9cQA' #33

ML-S opened this issue Sep 11, 2020 · 3 comments

Comments

@ML-S
Copy link

ML-S commented Sep 11, 2020

I've tried to implement a simple SMACH state-machine and visualize it with smach_viewer. According to the terminal output, the state machine itself runs perfectly fine.
When I start smach_viewer, it throws the following error:

[ERROR] [1599821587.164191]: bad callback: <bound method SmachViewerFrame._status_msg_update of <__main__.SmachViewerFrame; proxy of <Swig Object of type 'wxFrame *' at 0x55616f7eb050> >> Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback cb(msg) File "/home/faps/catkin_ws/src/executive_smach_visualization/smach_viewer/scripts/smach_viewer.py", line 844, in _status_msg_update if container.update_status(msg): File "/home/faps/catkin_ws/src/executive_smach_visualization/smach_viewer/scripts/smach_viewer.py", line 185, in update_status self._local_data._data = pickle.loads(msg.local_data) File "/usr/lib/python2.7/pickle.py", line 1388, in loads return Unpickler(file).load() File "/usr/lib/python2.7/pickle.py", line 864, in load dispatch[key](self) File "/usr/lib/python2.7/pickle.py", line 1157, in load_get self.append(self.memo[self.readline()[:-1]]) KeyError: 'AJ9cQA'

I'm using:

  • Ubuntu 18.04
  • ROS Melodic (catkin_ws configured with Python3!)

My state-machine is implemented as follows:

 #!/usr/bin/env python3

 import smach
 import smach_ros
 import rospy

 class t1(smach.State):
  def __init__(self, outcomes=['successful', 'failed']):
      smach.State.__init__(self, outcomes)

  def execute(self, userdata):
      return 'successful'

class t2(smach.State):
  def __init__(self, outcomes=['successful']):
      smach.State.__init__(self, outcomes)

  def execute(self, userdata):
      return 'successful'

class t3(smach.State):
  def __init__(self, outcomes=['successful']):
      smach.State.__init__(self, outcomes)

  def execute(self, userdata):
      return 'successful'


if __name__=="__main__":
  rospy.init_node('test_state_machine')
  sm_top = smach.StateMachine(outcomes=['success'])
  with sm_top:
      smach.StateMachine.add('T1', t1(),
                                 transitions={'successful': 'T2', 'failed': 'T3'})
      smach.StateMachine.add('T2', t2(),
                                 transitions={'successful': 'T1'})
      smach.StateMachine.add('T3', t3(),
                                 transitions={'successful': 'success'})

  # Create and start the introspection server
  sis = smach_ros.IntrospectionServer('introspection_server', sm_top, '/SM_ROOT')
  sis.start()
  # Execute SMACH plan
  outcome = sm_top.execute()
  # Wait for ctrl-c to stop the application
  rospy.spin()
  sis.stop()

Did I miss something or do you have any ideas what could cause the problem?

@amx-piap
Copy link

amx-piap commented Nov 6, 2020

Hi,
I just had the same issue, the base64 decoding was not done.

The PR might solve your issue

@kousuke-takeuchi
Copy link

@jbohren hi, I fixed this decoding error as melodic and noetic.

@k-okada
Copy link
Contributor

k-okada commented Jul 20, 2022

Closed via #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants