def getAnglesFromDict(d):# NOTE Fails currently if dict is None
"""
Converts a dictionary to a angles of a JointState()
:param d (dict): The dictionary to be converted
:return (sensor_msgs.msg.JointState): The angles
"""
# print datapath
if d is None:
rospy.logerr("Could not get angles for non existing dictionary")
return None
js=JointState()
for n,v in d.items():
js.name.append(n.encode())
js.position.append(v)
return js
评论列表
文章目录