Programatically load yaml config file to the Parameter Server in Python
How should I do that? I've looked up along the roslaunch and dynamic reconfigure code but I don't find it. Do you know any standard function to do it?
By the momment I've done this (but I understand that should exist another way):
config = yaml.load(open(custom_configuration_file)) rospy.loginfo(config) self.recursive_set_param(config) ... def recursive_set_param(self, config, key_path=""): for k in config.keys(): data = config[k] full_qualified_key = key_path + "/" + k if data.__class__ == dict: self.recursive_set_param(data, full_qualified_key) else: rospy.set_param(full_qualified_key, config[k]) rospy.loginfo("SETTING PARAM %s -> %s", full_qualified_key, data)
Any reason why you want to do that? There might be simpler ways to achieve your goal.
For sure! and that is what I was looking for!