[ros-users] smach_viewer in electric

Michael Karg kargm at in.tum.de
Sun Nov 6 19:58:08 UTC 2011


Hi guys,

sorry for my  late reply... this is indeed cause by one of my patches 
when trying to introduce partial Python3 compatibility...

I answered on answers.ros.org:

http://answers.ros.org/question/2032/smach-introspection-server-fails-in-electric?answer=4499#4499

Maybe you can check my idea out and see if it helps...

Cheers

Michi



On 10/28/2011 08:04 PM, Ken Conley wrote:
> On Fri, Oct 28, 2011 at 10:55 AM, Jonathan Bohren
> <jonathan.bohren at gmail.com>  wrote:
>> 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
>> (https://kforge.ros.org/smach/executive_smach/file/d79964e4c22f/smach_msgs/msg/SmachContainerStatus.msg)
>> from:
>> 12 # A pickled user data structure
>> 13 string local_data
>> to:
>> 12 # A pickled user data structure
>> 13 byte[] local_data
>> I don't currently have the time to test this, but I'm pretty sure this is
>> the problem.
>> -j
> I answered this on Answers as well, but for completeness here, I think
> this is a regression caused by attempting to have Py3k compatibility.
> I have backed this change out on the ROS 1.6 branch (r15301) for now
> while we can attempt to figure out a different approach to this
> compatibility.  Py3k separates the notion of strings and bytes; this
> distinction has ripple effects when attempting to serialize 'strings'
> and the like in Python 2, which treats such data identically.   The
> priority is to maintain Python 2 compatibility; I'm guessing a more
> significant rewrite of the serializer is necessary to be compatible
> with the Py3k distinctions.
>
>   - Ken
>
>> On Fri, Oct 28, 2011 at 1:40 PM, Tully Foote<tfoote at willowgarage.com>
>> wrote:
>>> Hi Manuel,
>>>
>>> There's already an open thread on this at
>>>
>>> http://answers.ros.org/question/2032/smach-introspection-server-fails-in-electric
>>>
>>> Tully
>>>
>>> 2011/10/28 Manuel Rodríguez<mrodriguez at robotnik.es>:
>>>> Hi all,
>>>>
>>>> I'm using smach with the introspection server and the smach_viewer.py
>>>> but does not work fine (it just shows the machine but does not update in
>>>> which state the machine is), moreover the script running the
>>>> introspection
>>>> server periodically shows the following exception:
>>>>> Traceback (most recent call last):
>>>>>    File "/usr/lib/python2.6/threading.py", line 532, in
>>>>> __bootstrap_inner
>>>>>      self.run()
>>>>>    File "/usr/lib/python2.6/threading.py", line 484, in run
>>>>>      self.__target(*self.__args, **self.__kwargs)
>>>>>    File
>>>>>
>>>>> "/opt/ros/electric/stacks/executive_smach/smach_ros/src/smach_ros/introspection.py",
>>>>> line 160, in _status_pub_loop
>>>>>      self._publish_status('HEARTBEAT')
>>>>>    File
>>>>>
>>>>> "/opt/ros/electric/stacks/executive_smach/smach_ros/src/smach_ros/introspection.py",
>>>>> line 225, in _publish_status
>>>>>      self._status_pub.publish(state_msg)
>>>>>    File
>>>>> "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py",
>>>>> line
>>>>> 695, in publish
>>>>>      self.impl.publish(data)
>>>>>    File
>>>>> "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py",
>>>>> line
>>>>> 872, in publish
>>>>>      serialize_message(b, self.seq, message)
>>>>>    File
>>>>> "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/msg.py",
>>>>> line 151, in serialize_message
>>>>>      msg.serialize(b)
>>>>>    File
>>>>>
>>>>> "/opt/ros/electric/stacks/executive_smach/smach_msgs/src/smach_msgs/msg/_SmachContainerStatus.py",
>>>>> line 120, in serialize
>>>>>      buff.write(struct.pack('<I%ss'%length, length, _x.encode()))
>>>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0:
>>>>> ordinal not in range(128)
>>>> Has anyone knows how to solve this trouble?
>>>> Best regards,
>>>> Manuel
>>>>
>>>> _______________________________________________
>>>> ros-users mailing list
>>>> ros-users at code.ros.org
>>>> https://code.ros.org/mailman/listinfo/ros-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Tully Foote
>>> Systems Engineer
>>> Willow Garage, Inc.
>>> tfoote at willowgarage.com
>>> (650) 475-2827
>>> _______________________________________________
>>> ros-users mailing list
>>> ros-users at code.ros.org
>>> https://code.ros.org/mailman/listinfo/ros-users
>>


-- 
Dipl.-Ing. Michael Karg             | kargm at in.tum.de
Technische Universität München      | Boltzmannstrasse 3
http://hcai.in.tum.de/members/kargm | 85748 Garching bei München
Tel: +49-89-289-17790               | Germany




More information about the ros-users mailing list