Nav2 missing Libary when changing namespace
I'm trying to use the Nav2 Stack with my robot, and as everything else in my code uses the /robot
namespace, I'd like Nav2 to also do so. I've tried this via two ways: First, I used GroupActions, and now I discovered that they also seem to have a launch parameter for that (here), so I tried that. Both methods gave me the same error:
[bt_navigator-4] [INFO] [1650111718.166634112] [bt_navigator]: Configuring
[bt_navigator-4] [ERROR] [1650111718.419839279] []: Caught exception in callback for transition 10
[bt_navigator-4] [ERROR] [1650111718.420100268] []: Original error: Could not load library: libnav2_change_goal_node_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-4] [WARN] [1650111718.420154572] []: Error occurred while doing error handling.
[bt_navigator-4] [FATAL] [1650111718.420166294] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-6] [ERROR] [1650111718.426122540] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-6] [ERROR] [1650111718.426223914] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
I can't find the library listed under the Plugins section of the BT_Navigator in my config file, also I had to comment some Libarys out, as they also weren't found by the navigator, If you have a tip on that, that would also be helpfull:
bt_navigator:
ros__parameters:
use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
bt_loop_duration: 10
default_server_timeout: 20
enable_groot_monitoring: True
groot_zmq_publisher_port: 1666
groot_zmq_server_port: 1667
default_bt_xml_filename: /field_robot/dev_ws/src/field_robot/config/nav2_bt_config.xml
default_nav_to_pose_bt_xml: /field_robot/dev_ws/src/field_robot/config/nav2_bt_config.xml
default_nav_through_poses_bt_xml: /field_robot/dev_ws/src/field_robot/config/nav2_bt_config.xml
# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
plugin_lib_names:
- nav2_compute_path_to_pose_action_bt_node
# - nav2_compute_path_through_poses_action_bt_node
- nav2_follow_path_action_bt_node
- nav2_back_up_action_bt_node
- nav2_spin_action_bt_node
- nav2_wait_action_bt_node
- nav2_clear_costmap_service_bt_node
- nav2_is_stuck_condition_bt_node
- nav2_goal_reached_condition_bt_node
- nav2_goal_updated_condition_bt_node
- nav2_initial_pose_received_condition_bt_node
- nav2_reinitialize_global_localization_service_bt_node
- nav2_rate_controller_bt_node
- nav2_distance_controller_bt_node
- nav2_speed_controller_bt_node
- nav2_truncate_path_action_bt_node
- nav2_goal_updater_node_bt_node
- nav2_recovery_node_bt_node
- nav2_pipeline_sequence_bt_node
- nav2_round_robin_node_bt_node
- nav2_transform_available_condition_bt_node
- nav2_time_expired_condition_bt_node
- nav2_distance_traveled_condition_bt_node
# - nav2_single_trigger_bt_node
- nav2_is_battery_low_condition_bt_node
# - nav2_navigate_through_poses_action_bt_node
- nav2_navigate_to_pose_action_bt_node
# - nav2_remove_passed_goals_action_bt_node
# - nav2_planner_selector_bt_node
# - nav2_controller_selector_bt_node
# - nav2_goal_checker_selector_bt_node
Asked by isiko on 2022-04-16 07:36:24 UTC
Answers
I had a same problem and solved it by change the bt_navigator:
session inside the .yaml param file.
my old version:
bt_navigator:
ros__parameters:
use_sim_time: False
bt_xml_filename: "navigate_w_replanning_and_recovery.xml"
new version:
bt_navigator:
ros__parameters:
use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
enable_groot_monitoring: True
groot_zmq_publisher_port: 1666
groot_zmq_server_port: 1667
default_bt_xml_filename: "navigate_w_replanning_and_recovery.xml"
plugin_lib_names:
- nav2_compute_path_to_pose_action_bt_node
- nav2_follow_path_action_bt_node
- nav2_back_up_action_bt_node
- nav2_spin_action_bt_node
- nav2_wait_action_bt_node
- nav2_clear_costmap_service_bt_node
- nav2_is_stuck_condition_bt_node
- nav2_goal_reached_condition_bt_node
- nav2_goal_updated_condition_bt_node
- nav2_initial_pose_received_condition_bt_node
- nav2_reinitialize_global_localization_service_bt_node
- nav2_rate_controller_bt_node
- nav2_distance_controller_bt_node
- nav2_speed_controller_bt_node
- nav2_truncate_path_action_bt_node
- nav2_goal_updater_node_bt_node
- nav2_recovery_node_bt_node
- nav2_pipeline_sequence_bt_node
- nav2_round_robin_node_bt_node
- nav2_transform_available_condition_bt_node
- nav2_time_expired_condition_bt_node
- nav2_distance_traveled_condition_bt_node
BTW it's a shame that I solved it but don't konw why. Don't even remember where did I get this list...
Asked by yyf202xz on 2022-07-29 04:24:49 UTC
Comments
I got this exact list from the nav2 apt package, but sadly it still does not work
Asked by Zeckurbo on 2022-08-24 04:51:04 UTC
Same problem for me. Without namespace that worked perfect. But bt_navigator was always looking for libnav2_change_goal_node_bt_node after adding namespace. There is no such library in my param file and in source of bt_navigator. sad :(
Asked by xxing on 2022-08-25 05:02:40 UTC
I tried to put nav2 into a namespace in a launch file
start_nav2 = GroupAction([
PushRosNamespace(
namespace=namespace),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(s_nav2_path, 'launch', 'navigation_launch.py')),
launch_arguments={
'use_sim_time': use_sim_time,
'namespace': namespace,
'params_file': params_file,
'default_bt_xml_filename': default_bt_xml_filename,
}.items()
)
])
and it seemed to do so, but now it does not find any input data nay more and I dont know what I have to remap/change to make it work :/ (I tried to make use of the nav2 bringup_launch.py, because they give the params yaml explicitly, and then the error seems to be gone...) I also searched for a long time, but there seem to be no real tutorials.
Asked by Zeckurbo on 2022-08-30 03:21:56 UTC
I found a solution to this issue. I compiled the workspace after downloading the nav2 package into it. There will be errors that the plugin does not exist during compilation. I removed these plugins from the bt_navigator.cpp code and it worked fine.
Asked by xxing on 2022-08-31 07:14:43 UTC
Comments
I think this is a relevant similar question with comments and an answer: https://answers.ros.org/question/344030/nav2_bt_navigator-exception-in-callback/
Asked by ljaniec on 2022-04-19 08:12:08 UTC
It seems like a similar Problem, but sadly the suggested solution (adding the list of plugins in the parameters) doesn't seem to work :/
Asked by isiko on 2022-04-19 11:05:58 UTC