It appears that in Electric, rospy enforces that strings in ROS messages be ASCII strings, so the output of the python pickle module can't be encoded.  to fix this we should be able to just change SmachContainerStatus (<a href="https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg">https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg</a>) from:<div>

<br></div><div><div class="parity1 source" style="background-color: rgb(255, 255, 255); font-family: monospace; white-space: pre; padding-top: 1px; padding-right: 4px; padding-bottom: 1px; padding-left: 4px; font-size: 12px; ">

<a href="https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg#l12" id="l12" style="text-decoration: none; color: rgb(153, 153, 153); font-size: smaller; ">    12</a> # A pickled user data structure
</div><div class="parity0 source" style="background-color: rgb(255, 255, 255); font-family: monospace; white-space: pre; padding-top: 1px; padding-right: 4px; padding-bottom: 1px; padding-left: 4px; font-size: 12px; "><a href="https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg#l13" id="l13" style="text-decoration: none; color: rgb(153, 153, 153); font-size: smaller; ">    13</a> string local_data
</div><div><br></div><div>to:</div><div><br></div><div><div class="parity1 source" style="background-color: rgb(255, 255, 255); font-family: monospace; white-space: pre; padding-top: 1px; padding-right: 4px; padding-bottom: 1px; padding-left: 4px; font-size: 12px; ">

<a href="https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg#l12" id="l12" style="text-decoration: none; color: rgb(153, 153, 153); font-size: smaller; ">    12</a> # A pickled user data structure
</div><div class="parity0 source" style="background-color: rgb(255, 255, 255); font-family: monospace; white-space: pre; padding-top: 1px; padding-right: 4px; padding-bottom: 1px; padding-left: 4px; font-size: 12px; "><a href="https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg#l13" id="l13" style="text-decoration: none; color: rgb(153, 153, 153); font-size: smaller; ">    13</a> byte[] local_data</div>

</div><div><div><div><br></div><div>I don't currently have the time to test this, but I'm pretty sure this is the problem.</div><div><br></div><div>-j<br><br><div class="gmail_quote">On Fri, Oct 28, 2011 at 1:40 PM, Tully Foote <span dir="ltr"><<a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Manuel,<br>
<br>
There's already an open thread on this at<br>
<a href="http://answers.ros.org/question/2032/smach-introspection-server-fails-in-electric" target="_blank">http://answers.ros.org/question/2032/smach-introspection-server-fails-in-electric</a><br>
<br>
Tully<br>
<br>
2011/10/28 Manuel Rodríguez <<a href="mailto:mrodriguez@robotnik.es">mrodriguez@robotnik.es</a>>:<br>
<div><div></div><div class="h5">> Hi all,<br>
><br>
> I'm using smach with the introspection server and the smach_viewer.py<br>
> but does not work fine (it just shows the machine but does not update in<br>
> which state the machine is), moreover the script running the introspection<br>
> server periodically shows the following exception:<br>
>><br>
>> Traceback (most recent call last):<br>
>>   File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner<br>
>>     self.run()<br>
>>   File "/usr/lib/python2.6/threading.py", line 484, in run<br>
>>     self.__target(*self.__args, **self.__kwargs)<br>
>>   File<br>
>> "/opt/ros/electric/stacks/executive_smach/smach_ros/src/smach_ros/introspection.py",<br>
>> line 160, in _status_pub_loop<br>
>>     self._publish_status('HEARTBEAT')<br>
>>   File<br>
>> "/opt/ros/electric/stacks/executive_smach/smach_ros/src/smach_ros/introspection.py",<br>
>> line 225, in _publish_status<br>
>>     self._status_pub.publish(state_msg)<br>
>>   File<br>
>> "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line<br>
>> 695, in publish<br>
>>     self.impl.publish(data)<br>
>>   File<br>
>> "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line<br>
>> 872, in publish<br>
>>     serialize_message(b, self.seq, message)<br>
>>   File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/msg.py",<br>
>> line 151, in serialize_message<br>
>>     msg.serialize(b)<br>
>>   File<br>
>> "/opt/ros/electric/stacks/executive_smach/smach_msgs/src/smach_msgs/msg/_SmachContainerStatus.py",<br>
>> line 120, in serialize<br>
>>     buff.write(struct.pack('<I%ss'%length, length, _x.encode()))<br>
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0:<br>
>> ordinal not in range(128)<br>
><br>
> Has anyone knows how to solve this trouble?<br>
> Best regards,<br>
> Manuel<br>
><br>
</div></div>> _______________________________________________<br>
> ros-users mailing list<br>
> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Tully Foote<br>
Systems Engineer<br>
Willow Garage, Inc.<br>
<a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>
<a href="tel:%28650%29%20475-2827" value="+16504752827">(650) 475-2827</a><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br></div></div></div></div>