Open reinzor opened 2 years ago
I'm running in the same issue. This is a regression caused by #1881.
@paulbovbel Are you aware?
Same issue here. I'm using noetic.
My current workaround:
def ros_get_params():
"""
This is a workaround since rospy.get_param('/') is currently broken.
See https://github.com/ros/ros_comm/issues/2216
"""
def build_nested(name, val, d):
if name.startswith('/'):
name = name[1:]
if '/' not in name:
d[name] = val
else:
head, rest = name.split('/', 1)
if head not in d:
d[head] = {}
build_nested(rest, val, d[head])
ros_params = {}
for param in rospy.get_param_names():
pval = rospy.get_param_cached(param)
build_nested(param, pval, ros_params)
return ros_params
The
rospy.get_param('')
behavior is affected by arospy.loginfo
. This is not expected:Related to this line. When the
get_param_cached
call is removed, the result of both print statements is the same.