Closed justin-kel closed 1 year ago
[component_container_isolated-9] [ERROR] [1687432498.084000262] []: Original error: parameter 'yaml_filename' is not initialized
I see not only this behavior but other servers complaining too like the DWB controller having no critics. I think that means that potentially the configuration file isn't making it to the servers? I'm not sure why that would be. I checked against main
with rolling
binaries and that works fine, so something is fishy that I couldn't find from a 10 minute first look. It also works fine with iron
and iron
binaries. So either something was backported that shouldn't have been, or something was fixed more recently that should have been backported that wasn't.
I won't have time to look into this anytime in the immediate future, so I'd recommend you take the initiative to start looking into it and let me know if you make progress or find something! Happy to review a patch or help answer questions! I'm pretty confident that the issue isn't with map server as much as it is with the launch / param system -- but it would be good to run an experiment to validate that :smile:
I believe this is related to #3182. I face the same issue when using ROS2 Humble, nav2 (Version: 1.1.8-2jammy.20230624.064440
) installed from binaries.
As noted in #3606 in my comment, when I append the 'use_composition': 'False'
all seem to work fine.
ie.
IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(bringup_dir,
'launch',
'tb3_simulation_launch.py')),
launch_arguments={'namespace': robot['name'],
...
'use_composition': 'False',
...
'robot_name':TextSubstitution(text=robot['name']), }.items()),
You noted that this should be solved by #3383, but it's for humble at least that it does not.
After editing localization_launch.py
change the composable map server from
ComposableNode(
package='nav2_map_server',
plugin='nav2_map_server::MapServer',
name='map_server',
parameters=[configured_params],
remappings=remappings),
to
ComposableNode(
package='nav2_map_server',
plugin='nav2_map_server::MapServer',
name='map_server',
parameters=[configured_params,
{'yaml_filename': map_yaml_file}], # Added this to parameters
remappings=remappings),
map_server is able to load the maps and these errors disappear.
[component_container_isolated-9] [ERROR] [1688131650.010146598] []: Caught exception in callback for transition 10
[component_container_isolated-9] [ERROR] [1688131650.010154559] []: Original error: parameter 'yaml_filename' is not initialized
[component_container_isolated-9] [WARN] [1688131650.010171663] []: Error occurred while doing error handling.
Unfortunately, I couldn't find what caused the critics
error.
Is RewrittenYaml reliable? Shouldn't yaml_filename
already be changed according to param_substitutions
?
@AlexeyMerzlyakov this seems related to some of your work, can you take the lead on it?
The problem does not appear on Rolling. Need some time to check it for Humble.
The problem was reproduced on Humble (using ROS2 & Nav2 in binaries). The root cause why the Map Server can not load the map - is that ROS-parameters won't read from configuration YAML where the composable nodes operating with non-empty root namespace; which was reported in #3182 (Problem No.2), and fixed in launch_ros
by https://github.com/ros2/launch_ros/commit/954a2110ec271b606f6acaf6d1d72cd2e2ae05ff. This also causes, Couldn't load critics!
issue, mentioned above by Steve. The root cause is the same - absence of correctly loaded configuraiton.yaml
for multi-robot case.
Unfortunately, the latest launch_ros
in Humble does not contain this patch:
$ sudo apt install ros-humble-launch-ros
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ros-humble-launch-ros is already the newest version (0.19.4-1jammy.20230623.052147).
0 upgraded, 0 newly installed, 0 to remove and 327 not upgraded.
So, I might suggest to patch the to_parameters_list.py
file manually, like this:
$ cat ~/launch_ros_fix.patch
diff --git a/launch_ros/launch_ros/utilities/to_parameters_list.py b/launch_ros/launch_ros/utilities/to_parameters_list.py
index 534ec7e..6aad203 100644
--- a/launch_ros/launch_ros/utilities/to_parameters_list.py
+++ b/launch_ros/launch_ros/utilities/to_parameters_list.py
@@ -48,8 +48,8 @@ def __normalize_parameters_dict(dictionary):
if isinstance(value, dict):
keys.append(key.lstrip('/'))
result_dict = normalize_parameters_dict(value, keys, result_dict)
- # Reset keys in case there are multiple ros__parameter entries
- keys = []
+ # Clean-up keys for the case of multiple nodes/ros__parameter entries
+ keys.pop()
return result_dict
$ cd /opt/ros/humble/lib/python3.10/site-packages
$ sudo patch -p2 < ~/launch_ros_fix.patch
Another workaround (if you do not want to make changes in your system launch_ros
package) - is to do not use composition mode:
ros2 launch nav2_bringup multi_tb3_simulation_launch.py autostart:=True use_composition:=False
This is also the case where this issue won't appear.
@AlexeyMerzlyakov thanks for the debugging! Please do submit that patch (or cherry pick the commit to backport from Rolling) and link back here / ping me so we can make sure to track progress!
The fix was already back-ported to "humble" branch by following commit. However, it is not in the Humble binaries yet, that was already asked in https://github.com/ros2/launch_ros/pull/347 and https://github.com/ros2/launch_ros/pull/350 by the Community.
@justin-kel please follow up in those places!
Bug report
Required Info:
Operating System:
ROS2 Version:
Version or commit hash:
DDS implementation:
Steps to reproduce issue
Expected behavior
Map is loaded and displayed in RVIZ upon clicking startup and an initial position can be provided.
Actual behavior
Upon clicking startup, the following errors occur:
The full output from the terminal is as follows:
Additional information
The single turtlebot3 example works fine:
my nav2_multirobot_params_1.yaml file is as follows:
my nav2_multirobot_params_1.yaml file is as follows: