Packages for common geometric calculations including the ROS transform library, "tf". Also includes ROS bindings for "bullet" physics engine and "kdl" kinematics/dynamics package.
173
stars
275
forks
source link
`getFrameStrings()` fails if it called just after `rospy.init_node()` from tf 1.11.9 #152
I have travous on tf 1.11.9, where getFrameStrings() fails if it called just after rospy.init_node()
$ ./hoge.py
Traceback (most recent call last):
File "./hoge.py", line 8, in <module>
print tflistener.getFrameStrings()
File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/listener.py", line 98, in getFrameStrings
return [p for p, _ in data.items()]
and if we comment in time.sleep() then it works ok.This does not happens on 1.11.8, so maybe because of #149.
I do not well understand how tflistener.getFrameStrings called on 1.11.8, but for example, we can avoid this problem by.
def getFrameStrings(self):
""" Not a recommended API, only here for backwards compatibility """
data = yaml.load(self._buffer.all_frames_as_yaml())
return data and [p for p, _ in data.items()]
Ahh, if there's no data, by default the yaml parser creates a list but if there's data it's a dict. PS As that's a deprecated API please switch to one of the supported ones like: allFramesAsString()
I have travous on tf 1.11.9, where
getFrameStrings()
fails if it called just afterrospy.init_node()
the code is
and if we comment in
time.sleep()
then it works ok.This does not happens on 1.11.8, so maybe because of #149. I do not well understand howtflistener.getFrameStrings
called on 1.11.8, but for example, we can avoid this problem by.