You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be recent API changes in PyYAML (either starting at 5.3.1 or 5.4) which will cause dynamic_reconfigure_load to crash on Ubuntu 20.04 with ROS noetic.
Given this example dynamic_reconfigure setup:
#!/usr/bin/env python
# set ROS package name
PACKAGE = "my_package"
from dynamic_reconfigure.parameter_generator_catkin import *
gen = ParameterGenerator()
# define parameters
gen.add("parameter_float", double_t, 0, "floating point number parameter", 0.5, 0.0, 1.0)
gen.add("parameter_bool", bool_t, 0, "boolean parameter", True)
gen.add("parameter_string", str_t, 0, "string parameter", "Hello World!")
nodeNameForDocumentation = "my_node"
thisConfigFile = os.path.splitext(os.path.basename(__file__))[0] # the generated header will be prefixed by this file's name (<thisConfigFile>Config.h)
exit(gen.generate(PACKAGE, nodeNameForDocumentation, thisConfigFile))
and an input config.yaml file exported by rqt_reconfigure:
Traceback (most recent call last):
File "/opt/ros/noetic/lib/dynamic_reconfigure/dynparam", line 240, in <module>
elif cmd == 'load': do_load()
File "/opt/ros/noetic/lib/dynamic_reconfigure/dynparam", line 162, in do_load
for doc in yaml.load_all(f.read()):
File "/home/rosuser/.local/lib/python3.8/site-packages/yaml/__init__.py", line 130, in load_all
yield loader.get_data()
File "/home/rosuser/.local/lib/python3.8/site-packages/yaml/constructor.py", line 45, in get_data
return self.construct_document(self.get_node())
File "/home/rosuser/.local/lib/python3.8/site-packages/yaml/constructor.py", line 55, in construct_document
data = self.construct_object(node)
File "/home/rosuser/.local/lib/python3.8/site-packages/yaml/constructor.py", line 100, in construct_object
data = constructor(self, node)
File "/home/rosuser/.local/lib/python3.8/site-packages/yaml/constructor.py", line 427, in construct_undefined
raise ConstructorError(None, None,
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/new:dynamic_reconfigure.encoding.Config'
in "<unicode string>", line 1, column 1:
!!python/object/new:dynamic_reco ...
^
[my_package/dynamic_reconfigure_load-2] process has died [pid 1185, exit code 1, cmd /opt/ros/noetic/lib/dynamic_reconfigure/dynparam load /my_package/my_node /home/rosuser/my_package/config.yaml __name:=dynamic_reconfigure_load __log:=/home/rosuser/.ros/log/12a48208-d583-11eb-a63e-0242d5aa77ae/my_package-dynamic_reconfigure_load-2.log].
log file: /home/rosuser/.ros/log/12a48208-d583-11eb-a63e-0242d5aa77ae/my_package-dynamic_reconfigure_load-2*.log
pip list outputs:
PyYAML 5.3.1
Updating to 5.4 shows the same behaviour.
Downgrading to 5.3 however using
pip install PyYAML==5.3
fixes the crash and the parameters are loaded in correctly. Interestingly, upgrading from 5.3 to 5.3.1 appears to be safe (i.e. no crash) - so I'm not entirely sure if its 5.3.1 or 5.4 which introduces the incompatibility.
The text was updated successfully, but these errors were encountered:
There seems to be recent API changes in PyYAML (either starting at 5.3.1 or 5.4) which will cause
dynamic_reconfigure_load
to crash on Ubuntu 20.04 with ROS noetic.Given this example
dynamic_reconfigure
setup:and an input
config.yaml
file exported byrqt_reconfigure
:Loading in this file from a
.launch
file:Results in the following crash:
pip list
outputs:Updating to 5.4 shows the same behaviour.
Downgrading to 5.3 however using
fixes the crash and the parameters are loaded in correctly. Interestingly, upgrading from 5.3 to 5.3.1 appears to be safe (i.e. no crash) - so I'm not entirely sure if its 5.3.1 or 5.4 which introduces the incompatibility.
The text was updated successfully, but these errors were encountered: