ros-navigation / navigation2

ROS 2 Navigation Framework and System
https://nav2.org/
Other
2.52k stars 1.28k forks source link

BT_Navigator failing to load Libary when changing Namespace #2919

Closed isiko closed 2 years ago

isiko commented 2 years ago

Bug report

Required Info:

Steps to reproduce issue

Launch file (adjust package names, etc.): This is mostly copied from the nav2_bringup package, I just added an XML_File for the BT_Navigator and the namespace

# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PythonExpression
from launch_ros.actions import Node
from launch_ros.actions import LoadComposableNodes
from launch_ros.descriptions import ComposableNode
from nav2_common.launch import RewrittenYaml

def generate_launch_description():
    # Get the launch directory
    pkg_nav = get_package_share_directory('field_robot_nav')
    pkg_share = get_package_share_directory('field_robot')

    namespace_str = "robot"

    namespace = LaunchConfiguration('namespace')
    use_sim_time = LaunchConfiguration('use_sim_time')
    autostart = LaunchConfiguration('autostart')
    bt_params_xml = LaunchConfiguration('bt_params')
    params_file = LaunchConfiguration('params_file')
    use_composition = LaunchConfiguration('use_composition')
    container_name = LaunchConfiguration('container_name')

    lifecycle_nodes = ['controller_server',
                       # 'smoother_server',
                       'planner_server',
                       # 'behavior_server',
                           'bt_navigator',
                       'waypoint_follower']

    # Map fully qualified names to relative ones so the node's namespace can be prepended.
    # In case of the transforms (tf), currently, there doesn't seem to be a better alternative
    # https://github.com/ros/geometry2/issues/32
    # https://github.com/ros/robot_state_publisher/pull/30
    # TODO(orduno) Substitute with `PushNodeRemapping`
    #              https://github.com/ros2/launch_ros/issues/56
    remappings = [('/tf', 'tf'),
                  ('/tf_static', 'tf_static')]

    # Create our own temporary YAML files that include substitutions
    param_substitutions = {
        'use_sim_time': use_sim_time,
        'autostart': autostart,
        'default_bt_xml_filename': bt_params_xml,
        'default_nav_to_pose_bt_xml': bt_params_xml,
        'default_nav_through_poses_bt_xml': bt_params_xml,
    }

    configured_params = RewrittenYaml(
            source_file=params_file,
            root_key=namespace,
            param_rewrites=param_substitutions,
            convert_types=True)

    stdout_linebuf_envvar = SetEnvironmentVariable(
        'RCUTILS_LOGGING_BUFFERED_STREAM', '1')

    declare_namespace_cmd = DeclareLaunchArgument(
        'namespace',
        default_value=namespace_str,
        description='Top-level namespace')

    declare_use_sim_time_cmd = DeclareLaunchArgument(
        'use_sim_time',
        default_value='false',
        description='Use simulation (Gazebo) clock if true')

    declare_params_file_cmd = DeclareLaunchArgument(
        'params_file',
        default_value=os.path.join(pkg_nav, 'params', 'nav2_params.yaml'),
        description='Full path to the ROS2 parameters file to use for all launched nodes')

    declare_bt_params_file_cmd = DeclareLaunchArgument(
        'bt_params',
        default_value=os.path.join(pkg_nav, 'params', 'nav2_bt_config.xml'),
        description='Full path to the ROS2 parameters file to use for all launched nodes')

    declare_autostart_cmd = DeclareLaunchArgument(
        'autostart', default_value='true',
        description='Automatically startup the nav2 stack')

    declare_use_composition_cmd = DeclareLaunchArgument(
        'use_composition', default_value='False',
        description='Use composed bringup if True')

    declare_container_name_cmd = DeclareLaunchArgument(
        'container_name', default_value='nav2_container',
        description='the name of conatiner that nodes will load in if use composition')

    load_nodes = GroupAction(
        condition=IfCondition(PythonExpression(['not ', use_composition])),
        actions=[
            Node(
                package='nav2_controller',
                executable='controller_server',
                output='screen',
                parameters=[configured_params],
                remappings=remappings),
            # Node(
            #     package='nav2_smoother',
            #     executable='smoother_server',
            #     name='smoother_server',
            #     output='screen',
            #     parameters=[configured_params],
            #     remappings=remappings),
            Node(
                package='nav2_planner',
                executable='planner_server',
                name='planner_server',
                output='screen',
                parameters=[configured_params],
                remappings=remappings),
            # Node(
            #     package='nav2_behaviors',
            #     executable='behavior_server',
            #     name='behavior_server',
            #     output='screen',
            #     parameters=[configured_params],
            #     remappings=remappings),
            Node(
                package='nav2_bt_navigator',
                executable='bt_navigator',
                name='bt_navigator',
                output='screen',
                parameters=[configured_params],
                remappings=remappings),
            Node(
                package='nav2_waypoint_follower',
                executable='waypoint_follower',
                name='waypoint_follower',
                output='screen',
                parameters=[configured_params],
                remappings=remappings),
            Node(
                package='nav2_lifecycle_manager',
                executable='lifecycle_manager',
                name='lifecycle_manager_navigation',
                output='screen',
                parameters=[{'use_sim_time': use_sim_time},
                            {'autostart': autostart},
                            {'node_names': lifecycle_nodes}]),
        ]
    )

    load_composable_nodes = LoadComposableNodes(
        condition=IfCondition(use_composition),
        target_container=container_name,
        composable_node_descriptions=[
            ComposableNode(
                package='nav2_controller',
                plugin='nav2_controller::ControllerServer',
                name='controller_server',
                parameters=[configured_params],
                remappings=remappings),
            # ComposableNode(
            #     package='nav2_smoother',
            #     plugin='nav2_smoother::SmootherServer',
            #     name='smoother_server',
            #     parameters=[configured_params],
            #     remappings=remappings),
            ComposableNode(
                package='nav2_planner',
                plugin='nav2_planner::PlannerServer',
                name='planner_server',
                parameters=[configured_params],
                remappings=remappings),
            # ComposableNode(
            #     package='nav2_behaviors',
            #     plugin='behavior_server::BehaviorServer',
            #     name='behavior_server',
            #     parameters=[configured_params],
            #     remappings=remappings),
            ComposableNode(
                package='nav2_bt_navigator',
                plugin='nav2_bt_navigator::BtNavigator',
                name='bt_navigator',
                parameters=[configured_params],
                remappings=remappings),
            ComposableNode(
                package='nav2_waypoint_follower',
                plugin='nav2_waypoint_follower::WaypointFollower',
                name='waypoint_follower',
                parameters=[configured_params],
                remappings=remappings),
            ComposableNode(
                package='nav2_lifecycle_manager',
                plugin='nav2_lifecycle_manager::LifecycleManager',
                name='lifecycle_manager_navigation',
                parameters=[{'use_sim_time': use_sim_time,
                             'autostart': autostart,
                             'node_names': lifecycle_nodes}]),
        ],
    )

    # Create the launch description and populate
    ld = LaunchDescription()

    # Set environment variables
    ld.add_action(stdout_linebuf_envvar)

    # Declare the launch options
    ld.add_action(declare_namespace_cmd)
    ld.add_action(declare_use_sim_time_cmd)
    ld.add_action(declare_bt_params_file_cmd)
    ld.add_action(declare_params_file_cmd)
    ld.add_action(declare_autostart_cmd)
    ld.add_action(declare_use_composition_cmd)
    ld.add_action(declare_container_name_cmd)

    # Add the actions to launch all of the navigation nodes
    ld.add_action(load_nodes)
    ld.add_action(load_composable_nodes)

    return ld

Params File:

amcl:
  ros__parameters:
    use_sim_time: True
    alpha1: 0.2
    alpha2: 0.2
    alpha3: 0.2
    alpha4: 0.2
    alpha5: 0.2
    base_frame_id: "base_footprint"
    beam_skip_distance: 0.5
    beam_skip_error_threshold: 0.9
    beam_skip_threshold: 0.3
    do_beamskip: false
    global_frame_id: "map"
    lambda_short: 0.1
    laser_likelihood_max_dist: 2.0
    laser_max_range: 100.0
    laser_min_range: -1.0
    laser_model_type: "likelihood_field"
    max_beams: 60
    max_particles: 2000
    min_particles: 500
    odom_frame_id: "odom"
    pf_err: 0.05
    pf_z: 0.99
    recovery_alpha_fast: 0.0
    recovery_alpha_slow: 0.0
    resample_interval: 1
    robot_model_type: "nav2_amcl::DifferentialMotionModel"
    save_pose_rate: 0.5
    sigma_hit: 0.2
    tf_broadcast: true
    transform_tolerance: 1.0
    update_min_a: 0.2
    update_min_d: 0.25
    z_hit: 0.5
    z_max: 0.05
    z_rand: 0.5
    z_short: 0.05
    scan_topic: scan

amcl_map_client:
  ros__parameters:
    use_sim_time: True

amcl_rclcpp_node:
  ros__parameters:
    use_sim_time: True

bt_navigator:
  ros__parameters:
    use_sim_time: True
    global_frame: map
    robot_base_frame: base_link
    odom_topic: /odometry/filtered
    bt_loop_duration: 10
    default_server_timeout: 20
    enable_groot_monitoring: True
    groot_zmq_publisher_port: 1666
    groot_zmq_server_port: 1667
    # The following Values should be overwritten by the Launchfile.
    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_smooth_path_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_globally_updated_goal_condition_bt_node
    # - nav2_is_path_valid_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_path_expiring_timer_condition
    - 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
    # - nav2_controller_cancel_bt_node
    # - nav2_path_longer_on_approach_bt_node
    # - nav2_wait_cancel_bt_node
    # - nav2_spin_cancel_bt_node
    # - nav2_back_up_cancel_bt_node

bt_navigator_rclcpp_node:
  ros__parameters:
    use_sim_time: True

controller_server:
  ros__parameters:
    use_sim_time: True
    controller_frequency: 20.0
    min_x_velocity_threshold: 0.001
    min_y_velocity_threshold: 0.5
    min_theta_velocity_threshold: 0.001
    failure_tolerance: 0.3
    progress_checker_plugin: "progress_checker"
    goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
    controller_plugins: ["FollowPath"]

    # Progress checker parameters
    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.5
      movement_time_allowance: 10.0
    # Goal checker parameters
    #precise_goal_checker:
    #  plugin: "nav2_controller::SimpleGoalChecker"
    #  xy_goal_tolerance: 0.25
    #  yaw_goal_tolerance: 0.25
    #  stateful: True
    general_goal_checker:
      stateful: True
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.25
      yaw_goal_tolerance: 0.25
    # DWB parameters
    FollowPath:
      plugin: "dwb_core::DWBLocalPlanner"
      debug_trajectory_details: True
      min_vel_x: 0.0
      min_vel_y: 0.0
      max_vel_x: 0.26
      max_vel_y: 0.0
      max_vel_theta: 1.0
      min_speed_xy: 0.0
      max_speed_xy: 0.26
      min_speed_theta: 0.0
      # Add high threshold velocity for turtlebot 3 issue.
      # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
      acc_lim_x: 2.5
      acc_lim_y: 0.0
      acc_lim_theta: 3.2
      decel_lim_x: -2.5
      decel_lim_y: 0.0
      decel_lim_theta: -3.2
      vx_samples: 20
      vy_samples: 5
      vtheta_samples: 20
      sim_time: 1.7
      linear_granularity: 0.05
      angular_granularity: 0.025
      transform_tolerance: 0.2
      xy_goal_tolerance: 0.25
      trans_stopped_velocity: 0.25
      short_circuit_trajectory_evaluation: True
      stateful: True
      critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
      BaseObstacle.scale: 0.02
      PathAlign.scale: 32.0
      PathAlign.forward_point_distance: 0.1
      GoalAlign.scale: 24.0
      GoalAlign.forward_point_distance: 0.1
      PathDist.scale: 32.0
      GoalDist.scale: 24.0
      RotateToGoal.scale: 32.0
      RotateToGoal.slowing_factor: 5.0
      RotateToGoal.lookahead_time: -1.0

controller_server_rclcpp_node:
  ros__parameters:
    use_sim_time: True

local_costmap:
  local_costmap:
    ros__parameters:
      update_frequency: 5.0
      publish_frequency: 2.0
      global_frame: odom
      robot_base_frame: base_link
      use_sim_time: True
      rolling_window: true
      width: 3
      height: 3
      resolution: 0.05
      robot_radius: 0.2
      plugins: ["voxel_layer", "inflation_layer"]
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        cost_scaling_factor: 3.0
        inflation_radius: 0.55
      voxel_layer:
        plugin: "nav2_costmap_2d::VoxelLayer"
        enabled: True
        publish_voxel_map: True
        origin_z: 0.0
        z_resolution: 0.05
        z_voxels: 16
        max_obstacle_height: 2.0
        mark_threshold: 0
        observation_sources: scan
        scan:
          topic: /scan
          max_obstacle_height: 2.0
          clearing: True
          marking: True
          data_type: "LaserScan"
          raytrace_max_range: 3.0
          raytrace_min_range: 0.0
          obstacle_max_range: 2.5
          obstacle_min_range: 0.0
      static_layer:
        map_subscribe_transient_local: True
      always_send_full_costmap: True
  local_costmap_client:
    ros__parameters:
      use_sim_time: True
  local_costmap_rclcpp_node:
    ros__parameters:
      use_sim_time: True

global_costmap:
  global_costmap:
    ros__parameters:
      update_frequency: 1.0
      publish_frequency: 1.0
      global_frame: map
      robot_base_frame: base_link
      use_sim_time: True
      robot_radius: 0.2
      resolution: 0.05
      track_unknown_space: true
      plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
      obstacle_layer:
        plugin: "nav2_costmap_2d::ObstacleLayer"
        enabled: True
        observation_sources: scan
        scan:
          topic: /scan
          max_obstacle_height: 2.0
          clearing: True
          marking: True
          data_type: "LaserScan"
          raytrace_max_range: 3.0
          raytrace_min_range: 0.0
          obstacle_max_range: 2.5
          obstacle_min_range: 0.0
      static_layer:
        plugin: "nav2_costmap_2d::StaticLayer"
        map_subscribe_transient_local: True
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        cost_scaling_factor: 3.0
        inflation_radius: 0.55
      always_send_full_costmap: True
  global_costmap_client:
    ros__parameters:
      use_sim_time: True
  global_costmap_rclcpp_node:
    ros__parameters:
      use_sim_time: True

map_server:
  ros__parameters:
    use_sim_time: True
    yaml_filename: "turtlebot3_world.yaml"

map_saver:
  ros__parameters:
    use_sim_time: True
    save_map_timeout: 5.0
    free_thresh_default: 0.25
    occupied_thresh_default: 0.65
    map_subscribe_transient_local: True

planner_server:
  ros__parameters:
    expected_planner_frequency: 20.0
    use_sim_time: True
    planner_plugins: ["GridBased"]
    GridBased:
      plugin: "nav2_navfn_planner/NavfnPlanner"
      tolerance: 0.5
      use_astar: false
      allow_unknown: true

planner_server_rclcpp_node:
  ros__parameters:
    use_sim_time: True

smoother_server:
  ros__parameters:
    use_sim_time: True
    smoother_plugins: ["simple_smoother"]
    simple_smoother:
      plugin: "nav2_smoother::SimpleSmoother"
      tolerance: 1.0e-10
      max_its: 1000
      do_refinement: True

behavior_server:
  ros__parameters:
    costmap_topic: local_costmap/costmap_raw
    footprint_topic: local_costmap/published_footprint
    cycle_frequency: 10.0
    behavior_plugins: ["spin", "backup", "wait"]
    spin:
      plugin: "nav2_behaviors/Spin"
    backup:
      plugin: "nav2_behaviors/BackUp"
    wait:
      plugin: "nav2_behaviors/Wait"
    global_frame: odom
    robot_base_frame: base_link
    transform_tolerance: 0.1
    use_sim_time: true
    simulate_ahead_time: 2.0
    max_rotational_vel: 1.0
    min_rotational_vel: 0.4
    rotational_acc_lim: 3.2

robot_state_publisher:
  ros__parameters:
    use_sim_time: True

waypoint_follower:
  ros__parameters:
    loop_rate: 20
    stop_on_failure: false
    waypoint_task_executor_plugin: "wait_at_waypoint"
    wait_at_waypoint:
      plugin: "nav2_waypoint_follower::WaitAtWaypoint"
      enabled: True
      waypoint_pause_duration: 200

Behavior Tree

<root main_tree_to_execute="MainTree">
  <BehaviorTree ID="MainTree">
    <PipelineSequence name="NavigateWithReplanning">
      <DistanceController distance="1.0">
        <ComputePathToPose goal="{goal}" path="{path}"/>
      </DistanceController>
      <FollowPath path="{path}"/>
    </PipelineSequence>
  </BehaviorTree>
</root>

Expected behavior

Nav2 Stack running in the /robot namespace

Actual behavior

Nav2 Crashing with the following Error:

[bt_navigator-3] [INFO] [1650307748.833286215] [bt_navigator]: Configuring
[bt_navigator-3] [ERROR] [1650307749.025385302] []: Caught exception in callback for transition 10
[bt_navigator-3] [ERROR] [1650307749.025654106] []: 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-3] [WARN] [1650307749.025741322] []: Error occurred while doing error handling.
[bt_navigator-3] [FATAL] [1650307749.025977693] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-5] [ERROR] [1650307749.032132248] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-5] [ERROR] [1650307749.032331849] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.

Additional information

I tried asking on answers.ros.org, but my question is pending moderation for some time now without anything happening... Also, this might be related to #2143

SteveMacenski commented 2 years ago

Please ask on ROS Answers, that is the correct place.

SteveMacenski commented 2 years ago

But definitely remove libnav2_change_goal_node_bt_node from your param file, the BT nav is stopping because that doesn't exist in Foxy. You must use the appropriate parameter files / libraries for your distribution.

isiko commented 2 years ago

But definitely remove libnav2_change_goal_node_bt_node from your param file, the BT nav is stopping because that doesn't exist in Foxy. You must use the appropriate parameter files / libraries for your distribution.

That's why I also posted here: That library is no where in my params, the file doesn't even contain the string 'change'

xinxing-max commented 2 years ago

@SteveMacenski same problem for me. I didn't add this parameter libnav2_change_goal_node_bt_node in the param file at all, but still the error was displayed. And it only appeared when I added the namespace. Since this problem is not accidental, and it is not like you said, just remove libnav2_change_goal_node_bt_node. But the problem is, there is no such parameter in the param file, why does this error occur?

@isiko Have you made any progress? I'm working on a multi-robot project recently and I'm also having the same problem.

BATAxjh commented 2 years ago

[lifecycle_manager-13] [INFO] [1662003008.932584225] [lifecycle_manager_navigation]: Configuring bt_navigator

[bt_navigator-11] [ERROR] [1662003009.187668684] []: Caught exception in callback for transition 10 [bt_navigator-11] [ERROR] [1662003009.190816521] []: Original error: Could not load library: libnav2_transform_availablemap_condition_bt_node.so: cannot open shared object file: No such file or directory [bt_navigator-11] [WARN] [1662003009.194177208] []: Error occurred while doing error handling. [bt_navigator-11] [FATAL] [1662003009.197183521] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented [lifecycle_manager-13] [ERROR] [1662003009.202547305] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator [lifecycle_manager-13] [ERROR] [1662003009.202713494] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.

BATAxjh commented 2 years ago

in params_file “nav2_transform_availablemap_condition_bt_node” change “ nav2_transform_available_condition_bt_node” ok!!

nav2_change_goal_node_bt_node change to "nav2_goal_updater_node_bt_node"

maybe The versions are different

JACOBIN-SCTCS commented 1 year ago

@SteveMacenski I am facing the same error which @isiko has pointed out. I am using Ubuntu 20.04 and ros2 foxy. Is there any workaround, it would be helpful. Else if you give a big picture idea of how this happened would also be helpful.

JACOBIN-SCTCS commented 1 year ago

@SteveMacenski same problem for me. I didn't add this parameter libnav2_change_goal_node_bt_node in the param file at all, but still the error was displayed. And it only appeared when I added the namespace. Since this problem is not accidental, and it is not like you said, just remove libnav2_change_goal_node_bt_node. But the problem is, there is no such parameter in the param file, why does this error occur?

@isiko Have you made any progress? I'm working on a multi-robot project recently and I'm also having the same problem.

@xinxing-max could you solve this issue?

xinxing-max commented 1 year ago

@JACOBIN-SCTCS yes, I have solved this issue. I did not use the package navigation2 from deb source any more. I have downloaded the package in my workspace and changed the source code (just check the lib list in the source code). I found the source code of Nav2 between deb source and official code in github were different. You can compare them by yourself. But I use Nav2 galactic now, not foxy anymore. The issues occurred using the global path planner with Nav2 foxy, e.g. global path through the wall :).

JACOBIN-SCTCS commented 1 year ago

@JACOBIN-SCTCS yes, I have solved this issue. I did not use the package navigation2 from deb source any more. I have downloaded the package in my workspace and changed the source code (just check the lib list in the source code). I found the source code of Nav2 between deb source and official code in github were different. You can compare them by yourself. But I use Nav2 galactic now, not foxy anymore. The issues occurred using the global path planner with Nav2 foxy, e.g. global path through the wall :).

I will try the suggestions you made. Thank you once again.

Cristian-wp commented 10 months ago

Hi, I am using the Humble branch and I have the same problem...

[lifecycle_manager-14] [INFO] [1700832618.874720224] [lifecycle_manager_navigation]: Configuring bt_navigator
[bt_navigator-11] [INFO] [1700832618.874903793] [bt_navigator]: Configuring
[bt_navigator-11] [ERROR] [1700832618.913140548] [bt_navigator]: Caught exception in callback for transition 10
[bt_navigator-11] [ERROR] [1700832618.913171216] [bt_navigator]: Original error: Could not load library: libnav2_are_error_codes_active_condition_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-11] [WARN] [1700832618.913190111] [bt_navigator]: Error occurred while doing error handling.
[bt_navigator-11] [FATAL] [1700832618.913198917] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-14] [ERROR] [1700832618.913455290] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-14] [ERROR] [1700832618.913479267] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
…
…
…

lifecycle_manager-14] [INFO] [1700820547.300933970] [lifecycle_manager_navigation]: Starting managed nodes bringup...
[lifecycle_manager-14] [INFO] [1700820547.301005364] [lifecycle_manager_navigation]: Configuring controller_server
[controller_server-7] [WARN] [1700820547.301310911] [rcl_lifecycle]: No transition matching 1 found for current state inactive
[controller_server-7] [ERROR] [1700820547.301329534] [controller_server]: Unable to start transition 1 from current state inactive: Transition is not registered., at ./src/rcl_lifecycle.c:355
[lifecycle_manager-14] [INFO] [1700820547.301832985] [lifecycle_manager_navigation]: Configuring smoother_server
[smoother_server-8] [WARN] [1700820547.302026701] [rcl_lifecycle]: No transition matching 1 found for current state inactive
[smoother_server-8] [ERROR] [1700820547.302045041] [smoother_server]: Unable to start transition 1 from current state inactive: Transition is not registered., at ./src/rcl_lifecycle.c:355
[lifecycle_manager-14] [INFO] [1700820547.302364218] [lifecycle_manager_navigation]: Configuring planner_server
[planner_server-9] [WARN] [1700820547.302519899] [rcl_lifecycle]: No transition matching 1 found for current state inactive
[planner_server-9] [ERROR] [1700820547.302537385] [planner_server]: Unable to start transition 1 from current state inactive: Transition is not registered., at ./src/rcl_lifecycle.c:355
[lifecycle_manager-14] [INFO] [1700820547.302776746] [lifecycle_manager_navigation]: Configuring behavior_server
[behavior_server-10] [WARN] [1700820547.302911425] [rcl_lifecycle]: No transition matching 1 found for current state inactive
[behavior_server-10] [ERROR] [1700820547.302927600] [behavior_server]: Unable to start transition 1 from current state inactive: Transition is not registered., at ./src/rcl_lifecycle.c:355
[lifecycle_manager-14] [INFO] [1700820547.303191023] [lifecycle_manager_navigation]: Configuring bt_navigator
[bt_navigator-11] [INFO] [1700820547.303381089] [bt_navigator]: Configuring
[bt_navigator-11] [ERROR] [1700820547.337725521] [bt_navigator]: Caught exception in callback for transition 10
[bt_navigator-11] [ERROR] [1700820547.337762428] [bt_navigator]: Original error: Could not load library: libnav2_are_error_codes_active_condition_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-11] [WARN] [1700820547.337784641] [bt_navigator]: Error occurred while doing error handling.
[bt_navigator-11] [ERROR] [1700820547.337798562] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-14] [ERROR] [1700820547.338181273] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-14] [ERROR] [1700820547.338208415] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
[lifecycle_manager-14] [INFO] [1700820593.618853682] [lifecycle_manager_navigation]: Resetting managed nodes...
[lifecycle_manager-14] [INFO] [1700820593.618894026] [lifecycle_manager_navigation]: Deactivating velocity_smoother
[velocity_smoother-13] [WARN] [1700820593.619228674] [rcl_lifecycle]: No transition matching 4 found for current state unconfigured

I have got this error following the Navigating Using GPS Localization tutorial... @xinxing-max can you explain better what have you done please? At the moment I have install the navigation2 package and all nav2 package as well, plus in my workspace I have the humble branch of the package.

xinxing-max commented 10 months ago

@Cristian-wp did you build nav2 package in your workspace or just installed in /opt. Now I don't remember it very clearly. I probably know that I compiled the nav2 package in my own workspace and deleted the so shared files that could not be found from the corresponding files in nav2. In your case, you should delete libnav2_are_error_codes_active_condition_bt_node.so in the bt_navigator node file or configuration file or any file like this in bt_navigator of nav2 package.

Cristian-wp commented 10 months ago

hi @xinxing-max thank you for the fast reply. I have do both, first I clone the humble branch from repository: git clone --recursive https://github.com/ros-planning/navigation2.git -b humble Then I install the binary indicated on Getting Started[¶](https://navigation.ros.org/getting_started/index.html#getting-started). Doing that I had found that not all required package where installed, so I insall all with: sudo apt-get install ros-humble-nav2-* But I do not understand where I have do delete that libnav2_are_error_codes_active_condition_bt_node.so, plus is used as config param only in this files nav2_multirobot_params_all.yam.

Whit I compiled the nav2 package in my own workspace and deleted the so shared files do you mean I have to delete them in the install and build share directory?

xinxing-max commented 10 months ago

@Cristian-wp I was referring to bt_navigator.cpp before. But I just took a look at humble's version. I found that the code in github should be correct. So I think the problem should be with the params yaml file you are referring to. Just make sure that the lib file name in the yaml file is consistent with the name in bt_navigator.cpp, and there should be no errors.

Of course, if you install two nav2 packages, make sure that the package you use is the one you want to use.

Cristian-wp commented 10 months ago

@xinxing-max this is the nav2_params.yaml that I am using. I have not modify it, at the moment I am only trying to follow the tutorials. Ok, so I have to check that all le plugin name here are equal to these ones right?

Cristian-wp commented 10 months ago

@xinxing-max I have check the cpp and yaml file and there are some difference...I copy and paste the plugin list in two txt file and use diff command, this is the result:

diff -c bt_navigator.txt nav2_params.txt 
*** bt_navigator.txt    2023-11-27 15:02:39.882398665 +0100
--- nav2_params.txt 2023-11-27 15:03:11.982362655 +0100
***************
*** 10,19 ****
      nav2_clear_costmap_service_bt_node
      nav2_is_stuck_condition_bt_node
      nav2_goal_reached_condition_bt_node
-     nav2_initial_pose_received_condition_bt_node
      nav2_goal_updated_condition_bt_node
      nav2_globally_updated_goal_condition_bt_node
      nav2_is_path_valid_condition_bt_node
      nav2_reinitialize_global_localization_service_bt_node
      nav2_rate_controller_bt_node
      nav2_distance_controller_bt_node
--- 10,19 ----
      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_globally_updated_goal_condition_bt_node
      nav2_is_path_valid_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
***************
*** 41,47 ****
      nav2_path_longer_on_approach_bt_node
      nav2_wait_cancel_bt_node
      nav2_spin_cancel_bt_node
-     nav2_assisted_teleop_cancel_bt_node
      nav2_back_up_cancel_bt_node
      nav2_drive_on_heading_cancel_bt_node
      nav2_is_battery_charging_condition_bt_node
--- 41,48 ----
      nav2_path_longer_on_approach_bt_node
      nav2_wait_cancel_bt_node
      nav2_spin_cancel_bt_node
      nav2_back_up_cancel_bt_node
+     nav2_assisted_teleop_cancel_bt_node
      nav2_drive_on_heading_cancel_bt_node
      nav2_is_battery_charging_condition_bt_node
+ 

Now I am recreating the workspace, after the compilation I try to _take as good the nav2param.yaml and make the bt_navigator.cpp equal to it.

xinxing-max commented 10 months ago

@Cristian-wp the wired thing was that there was no lib named nav2_are_error_codes_active_condition_bt_node in your yaml file. But wait and see your subsequent results.

Cristian-wp commented 10 months ago

@xinxing-max I know, but I suspect there is a problem on this branch because @SteveMacenski reply me that: You’re pulling params from the wrong branch.

But as I say, I get my package with: git clone --recursive https://github.com/ros-planning/navigation2.git -b humble

So I really do not know how to do...

Cristian-wp commented 10 months ago

@xinxing-max Nothing has change...This is the output of my shell:

source install/setup.bash
source /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=waffle

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models

ros2 launch nav2_gps_waypoint_follower_demo gps_waypoint_follower.launch.py use_rviz:=True
[INFO] [launch]: All log files can be found below /home/ctrazzi/.ros/log/2023-11-27-15-57-39-564424-jelly-219358
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [219408]
[INFO] [gzclient-2]: process started with pid [219410]
[INFO] [robot_state_publisher-3]: process started with pid [219412]
[INFO] [ekf_node-4]: process started with pid [219414]
[INFO] [ekf_node-5]: process started with pid [219416]
[INFO] [navsat_transform_node-6]: process started with pid [219418]
[INFO] [controller_server-7]: process started with pid [219420]
[INFO] [smoother_server-8]: process started with pid [219422]
[INFO] [planner_server-9]: process started with pid [219426]
[INFO] [behavior_server-10]: process started with pid [219444]
[INFO] [bt_navigator-11]: process started with pid [219476]
[INFO] [waypoint_follower-12]: process started with pid [219490]
[INFO] [velocity_smoother-13]: process started with pid [219505]
[INFO] [lifecycle_manager-14]: process started with pid [219516]
[INFO] [rviz2-15]: process started with pid [219538]
[navsat_transform_node-6] [WARN] [1701097060.493877224] [navsat_transform]: Parameter 'broadcast_utm_transform' has been deprecated. Please use 'broadcast_cartesian_transform' instead.
[controller_server-7] [INFO] [1701097060.497587628] [controller_server]: 
[controller_server-7]   controller_server lifecycle node launched. 
[controller_server-7]   Waiting on external lifecycle transitions to activate
[controller_server-7]   See https://design.ros2.org/articles/node_lifecycle.html for more information.
[controller_server-7] [INFO] [1701097060.518111920] [controller_server]: Creating controller server
[controller_server-7] [INFO] [1701097060.564526297] [local_costmap.local_costmap]: 
[controller_server-7]   local_costmap lifecycle node launched. 
[controller_server-7]   Waiting on external lifecycle transitions to activate
[controller_server-7]   See https://design.ros2.org/articles/node_lifecycle.html for more information.
[controller_server-7] [INFO] [1701097060.566956807] [local_costmap.local_costmap]: Creating Costmap
[smoother_server-8] [INFO] [1701097060.552074882] [smoother_server]: 
[smoother_server-8]     smoother_server lifecycle node launched. 
[smoother_server-8]     Waiting on external lifecycle transitions to activate
[smoother_server-8]     See https://design.ros2.org/articles/node_lifecycle.html for more information.
[smoother_server-8] [INFO] [1701097060.558256223] [smoother_server]: Creating smoother server
[planner_server-9] [INFO] [1701097060.568756460] [planner_server]: 
[planner_server-9]  planner_server lifecycle node launched. 
[planner_server-9]  Waiting on external lifecycle transitions to activate
[planner_server-9]  See https://design.ros2.org/articles/node_lifecycle.html for more information.
[planner_server-9] [INFO] [1701097060.574828414] [planner_server]: Creating
[behavior_server-10] [INFO] [1701097060.550331429] [behavior_server]: 
[behavior_server-10]    behavior_server lifecycle node launched. 
[behavior_server-10]    Waiting on external lifecycle transitions to activate
[behavior_server-10]    See https://design.ros2.org/articles/node_lifecycle.html for more information.
[bt_navigator-11] [INFO] [1701097060.595717398] [bt_navigator]: 
[bt_navigator-11]   bt_navigator lifecycle node launched. 
[bt_navigator-11]   Waiting on external lifecycle transitions to activate
[bt_navigator-11]   See https://design.ros2.org/articles/node_lifecycle.html for more information.
[bt_navigator-11] [INFO] [1701097060.595871296] [bt_navigator]: Creating
[lifecycle_manager-14] [INFO] [1701097060.619628406] [lifecycle_manager_navigation]: Creating
[lifecycle_manager-14] [INFO] [1701097060.621920946] [lifecycle_manager_navigation]: Creating and initializing lifecycle service clients
[waypoint_follower-12] [INFO] [1701097060.677355281] [waypoint_follower]: 
[waypoint_follower-12]  waypoint_follower lifecycle node launched. 
[waypoint_follower-12]  Waiting on external lifecycle transitions to activate
[waypoint_follower-12]  See https://design.ros2.org/articles/node_lifecycle.html for more information.
[waypoint_follower-12] [INFO] [1701097060.679034074] [waypoint_follower]: Creating
[planner_server-9] [INFO] [1701097060.693163328] [global_costmap.global_costmap]: 
[planner_server-9]  global_costmap lifecycle node launched. 
[planner_server-9]  Waiting on external lifecycle transitions to activate
[planner_server-9]  See https://design.ros2.org/articles/node_lifecycle.html for more information.
[planner_server-9] [INFO] [1701097060.695207111] [global_costmap.global_costmap]: Creating Costmap
[velocity_smoother-13] [INFO] [1701097060.724416770] [velocity_smoother]: 
[velocity_smoother-13]  velocity_smoother lifecycle node launched. 
[velocity_smoother-13]  Waiting on external lifecycle transitions to activate
[velocity_smoother-13]  See https://design.ros2.org/articles/node_lifecycle.html for more information.
[robot_state_publisher-3] [INFO] [1701097060.735904530] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-3] [INFO] [1701097060.736020684] [robot_state_publisher]: got segment base_link
[robot_state_publisher-3] [INFO] [1701097060.738022586] [robot_state_publisher]: got segment base_scan
[robot_state_publisher-3] [INFO] [1701097060.738046132] [robot_state_publisher]: got segment camera_depth_frame
[robot_state_publisher-3] [INFO] [1701097060.738058263] [robot_state_publisher]: got segment camera_depth_optical_frame
[robot_state_publisher-3] [INFO] [1701097060.738070624] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-3] [INFO] [1701097060.738085421] [robot_state_publisher]: got segment camera_rgb_frame
[robot_state_publisher-3] [INFO] [1701097060.738100554] [robot_state_publisher]: got segment camera_rgb_optical_frame
[robot_state_publisher-3] [INFO] [1701097060.738115032] [robot_state_publisher]: got segment caster_back_left_link
[robot_state_publisher-3] [INFO] [1701097060.738127262] [robot_state_publisher]: got segment caster_back_right_link
[robot_state_publisher-3] [INFO] [1701097060.738137854] [robot_state_publisher]: got segment gps_link
[robot_state_publisher-3] [INFO] [1701097060.738150917] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-3] [INFO] [1701097060.738164960] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-3] [INFO] [1701097060.738179066] [robot_state_publisher]: got segment wheel_right_link
[rviz2-15] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[lifecycle_manager-14] [INFO] [1701097060.896229941] [lifecycle_manager_navigation]: Starting managed nodes bringup...
[lifecycle_manager-14] [INFO] [1701097060.896283811] [lifecycle_manager_navigation]: Configuring controller_server
[controller_server-7] [INFO] [1701097060.896548056] [controller_server]: Configuring controller interface
[controller_server-7] [INFO] [1701097060.896754181] [controller_server]: getting goal checker plugins..
[controller_server-7] [INFO] [1701097060.896830962] [controller_server]: Controller frequency set to 20.0000Hz
[controller_server-7] [INFO] [1701097060.896860943] [local_costmap.local_costmap]: Configuring
[controller_server-7] [INFO] [1701097060.910725650] [local_costmap.local_costmap]: Using plugin "voxel_layer"
[controller_server-7] [INFO] [1701097060.924182379] [local_costmap.local_costmap]: Subscribed to Topics: scan
[controller_server-7] [INFO] [1701097060.961422909] [local_costmap.local_costmap]: Initialized plugin "voxel_layer"
[controller_server-7] [INFO] [1701097060.961465553] [local_costmap.local_costmap]: Using plugin "inflation_layer"
[controller_server-7] [INFO] [1701097060.967920663] [local_costmap.local_costmap]: Initialized plugin "inflation_layer"
[controller_server-7] [INFO] [1701097060.992314084] [controller_server]: Created progress_checker : progress_checker of type nav2_controller::SimpleProgressChecker
[controller_server-7] [INFO] [1701097060.993194083] [controller_server]: Created goal checker : general_goal_checker of type nav2_controller::SimpleGoalChecker
[controller_server-7] [INFO] [1701097060.993426944] [controller_server]: Controller Server has general_goal_checker  goal checkers available.
[controller_server-7] [INFO] [1701097060.997732429] [controller_server]: Created controller : FollowPath of type dwb_core::DWBLocalPlanner
[controller_server-7] [INFO] [1701097061.003382325] [controller_server]: Setting transform_tolerance to 0.200000
[controller_server-7] [INFO] [1701097061.022927278] [controller_server]: Using critic "RotateToGoal" (dwb_critics::RotateToGoalCritic)
[controller_server-7] [INFO] [1701097061.023295110] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.023393694] [controller_server]: Using critic "Oscillation" (dwb_critics::OscillationCritic)
[controller_server-7] [INFO] [1701097061.023663041] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.023754706] [controller_server]: Using critic "BaseObstacle" (dwb_critics::BaseObstacleCritic)
[controller_server-7] [INFO] [1701097061.023886172] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.023964171] [controller_server]: Using critic "GoalAlign" (dwb_critics::GoalAlignCritic)
[controller_server-7] [INFO] [1701097061.024372774] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.024459150] [controller_server]: Using critic "PathAlign" (dwb_critics::PathAlignCritic)
[controller_server-7] [INFO] [1701097061.024692055] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.024795847] [controller_server]: Using critic "PathDist" (dwb_critics::PathDistCritic)
[controller_server-7] [INFO] [1701097061.024976732] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.025081216] [controller_server]: Using critic "GoalDist" (dwb_critics::GoalDistCritic)
[controller_server-7] [INFO] [1701097061.025247117] [controller_server]: Critic plugin initialized
[controller_server-7] [INFO] [1701097061.025271684] [controller_server]: Controller Server has FollowPath  controllers available.
[lifecycle_manager-14] [INFO] [1701097061.052114540] [lifecycle_manager_navigation]: Configuring smoother_server
[smoother_server-8] [INFO] [1701097061.052447980] [smoother_server]: Configuring smoother server
[smoother_server-8] [INFO] [1701097061.083299548] [smoother_server]: Created smoother : simple_smoother of type nav2_smoother::SimpleSmoother
[smoother_server-8] [INFO] [1701097061.086205803] [smoother_server]: Smoother Server has simple_smoother  smoothers available.
[lifecycle_manager-14] [INFO] [1701097061.126985467] [lifecycle_manager_navigation]: Configuring planner_server
[planner_server-9] [INFO] [1701097061.127256401] [planner_server]: Configuring
[planner_server-9] [INFO] [1701097061.127289277] [global_costmap.global_costmap]: Configuring
[planner_server-9] [INFO] [1701097061.146563172] [global_costmap.global_costmap]: Using plugin "obstacle_layer"
[planner_server-9] [INFO] [1701097061.174989856] [global_costmap.global_costmap]: Subscribed to Topics: scan
[planner_server-9] [INFO] [1701097061.187856693] [global_costmap.global_costmap]: Initialized plugin "obstacle_layer"
[planner_server-9] [INFO] [1701097061.187912019] [global_costmap.global_costmap]: Using plugin "inflation_layer"
[planner_server-9] [INFO] [1701097061.192665038] [global_costmap.global_costmap]: Initialized plugin "inflation_layer"
[planner_server-9] [INFO] [1701097061.211690647] [planner_server]: Created global planner plugin GridBased of type nav2_navfn_planner/NavfnPlanner
[planner_server-9] [INFO] [1701097061.211737816] [planner_server]: Configuring plugin GridBased of type NavfnPlanner
[planner_server-9] [INFO] [1701097061.213426118] [planner_server]: Planner Server has GridBased  planners available.
[lifecycle_manager-14] [INFO] [1701097061.235734391] [lifecycle_manager_navigation]: Configuring behavior_server
[behavior_server-10] [INFO] [1701097061.235952228] [behavior_server]: Configuring
[behavior_server-10] [INFO] [1701097061.249417727] [behavior_server]: Creating behavior plugin spin of type nav2_behaviors/Spin
[behavior_server-10] [INFO] [1701097061.252230081] [behavior_server]: Configuring spin
[behavior_server-10] [INFO] [1701097061.261994911] [behavior_server]: Creating behavior plugin backup of type nav2_behaviors/BackUp
[behavior_server-10] [INFO] [1701097061.263393118] [behavior_server]: Configuring backup
[behavior_server-10] [INFO] [1701097061.269999315] [behavior_server]: Creating behavior plugin drive_on_heading of type nav2_behaviors/DriveOnHeading
[behavior_server-10] [INFO] [1701097061.271712032] [behavior_server]: Configuring drive_on_heading
[behavior_server-10] [INFO] [1701097061.279928449] [behavior_server]: Creating behavior plugin assisted_teleop of type nav2_behaviors/AssistedTeleop
[behavior_server-10] [INFO] [1701097061.284116045] [behavior_server]: Configuring assisted_teleop
[behavior_server-10] [INFO] [1701097061.294046775] [behavior_server]: Creating behavior plugin wait of type nav2_behaviors/Wait
[behavior_server-10] [INFO] [1701097061.295285751] [behavior_server]: Configuring wait
[lifecycle_manager-14] [INFO] [1701097061.301712762] [lifecycle_manager_navigation]: Configuring bt_navigator
[bt_navigator-11] [INFO] [1701097061.301928073] [bt_navigator]: Configuring
[rviz2-15] [INFO] [1701097061.318854360] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-15] [INFO] [1701097061.318963053] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-15] [INFO] [1701097061.339832408] [rviz2]: Stereo is NOT SUPPORTED
[bt_navigator-11] [ERROR] [1701097061.359194733] [bt_navigator]: Caught exception in callback for transition 10
[bt_navigator-11] [ERROR] [1701097061.359256195] [bt_navigator]: Original error: Could not load library: libnav2_are_error_codes_active_condition_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-11] [WARN] [1701097061.359283068] [bt_navigator]: Error occurred while doing error handling.
[bt_navigator-11] [FATAL] [1701097061.359296575] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-14] [ERROR] [1701097061.359722852] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-14] [ERROR] [1701097061.359750923] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
[gzserver-1] [INFO] [1701097063.243823231] [intel_realsense_r200_depth_driver]: Publishing camera info to [/intel_realsense_r200_depth/camera_info]
[gzserver-1] [INFO] [1701097063.247060061] [intel_realsense_r200_depth_driver]: Publishing depth camera info to [/intel_realsense_r200_depth/depth/camera_info]
[gzserver-1] [INFO] [1701097063.248137365] [intel_realsense_r200_depth_driver]: Publishing pointcloud to [/intel_realsense_r200_depth/points]
[gzserver-1] [INFO] [1701097063.283764177] [turtlebot3_diff_drive]: Wheel pair 1 separation set to [0.287000m]
[gzserver-1] [INFO] [1701097063.283827317] [turtlebot3_diff_drive]: Wheel pair 1 diameter set to [0.066000m]
[gzserver-1] [INFO] [1701097063.285316316] [turtlebot3_diff_drive]: Subscribed to [/cmd_vel]
[gzserver-1] [INFO] [1701097063.288534686] [turtlebot3_diff_drive]: Advertise odometry on [/odom]
[gzserver-1] [INFO] [1701097063.304135841] [turtlebot3_joint_state]: Going to publish joint [wheel_left_joint]
[gzserver-1] [INFO] [1701097063.304196396] [turtlebot3_joint_state]: Going to publish joint [wheel_right_joint]
[navsat_transform_node-6] [INFO] [1701097064.316246955] [navsat_transform]: Datum (latitude, longitude, altitude) is (38.16, -122.45, 488.33)
[navsat_transform_node-6] [INFO] [1701097064.316294483] [navsat_transform]: Datum UTM coordinate is (10S, 547779.04, 4223869.70)
[navsat_transform_node-6] [INFO] [1701097064.341780971] [navsat_transform]: Corrected for magnetic declination of 0, user-specified offset of 0 and meridian convergence of 0.00588165. Transform heading factor is now 0.00434459
[rviz2-15] [INFO] [1701097192.181738623] [rviz2]: Setting estimate pose: Frame:map, Position(1.96488, -2.25424, 0), Orientation(0, 0, -0.347845, 0.937552) = Angle: -0.710542
xinxing-max commented 10 months ago

@Cristian-wp so now you used the nav2 in your own workspace? How did you write your source environment in the .bashrc file? I just saw that in your log, the order of the two source environments was wrong.

Cristian-wp commented 10 months ago

@xinxing-max now I have modify the plugin listed in nav2_params.yaml as bt_navigator.cpp. But in all my previous tests I have navigation2 in my workspace src.

Is that important? Now I have try to switch the two source as you can see from this shell, but the results are the same:

source /opt/ros/humble/setup.bash
source install/setup.bash

export TURTLEBOT3_MODEL=waffle

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models

ros2 launch nav2_gps_waypoint_follower_demo gps_waypoint_follower.launch.py use_rviz:=True
[INFO] [launch]: All log files can be found below /home/ctrazzi/.ros/log/2023-11-27-16-09-08-531863-jelly-233507
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [233508]
[INFO] [gzclient-2]: process started with pid [233510]
[INFO] [robot_state_publisher-3]: process started with pid [233512]
[INFO] [ekf_node-4]: process started with pid [233514]
[INFO] [ekf_node-5]: process started with pid [233516]
[INFO] [navsat_transform_node-6]: process started with pid [233518]
[INFO] [controller_server-7]: process started with pid [233520]
[INFO] [smoother_server-8]: process started with pid [233524]
[INFO] [planner_server-9]: process started with pid [233555]
[INFO] [behavior_server-10]: process started with pid [233571]
[INFO] [bt_navigator-11]: process started with pid [233579]
[INFO] [waypoint_follower-12]: process started with pid [233600]
[INFO] [velocity_smoother-13]: process started with pid [233604]
[INFO] [lifecycle_manager-14]: process started with pid [233606]
[INFO] [rviz2-15]: process started with pid [233622]
...
...
...
[behavior_server-10] [INFO] [1701097750.131341106] [behavior_server]: Configuring assisted_teleop
[behavior_server-10] [INFO] [1701097750.139542467] [behavior_server]: Creating behavior plugin wait of type nav2_behaviors/Wait
[behavior_server-10] [INFO] [1701097750.140919960] [behavior_server]: Configuring wait
[lifecycle_manager-14] [INFO] [1701097750.146429136] [lifecycle_manager_navigation]: Configuring bt_navigator
[bt_navigator-11] [INFO] [1701097750.146631656] [bt_navigator]: Configuring
[bt_navigator-11] [ERROR] [1701097750.190907109] [bt_navigator]: Caught exception in callback for transition 10
[bt_navigator-11] [ERROR] [1701097750.190966882] [bt_navigator]: Original error: Could not load library: libnav2_are_error_codes_active_condition_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-11] [WARN] [1701097750.190992894] [bt_navigator]: Error occurred while doing error handling.
[bt_navigator-11] [FATAL] [1701097750.191005233] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-14] [ERROR] [1701097750.191474380] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-14] [ERROR] [1701097750.191498721] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
[gzserver-1] [INFO] [1701097751.816048886] [intel_realsense_r200_depth_driver]: Publishing camera info to [/intel_realsense_r200_depth/camera_info]
[gzserver-1] [INFO] [1701097751.820643280] [intel_realsense_r200_depth_driver]: Publishing depth camera info to [/intel_realsense_r200_depth/depth/camera_info]
[gzserver-1] [INFO] [1701097751.821682951] [intel_realsense_r200_depth_driver]: Publishing pointcloud to [/intel_realsense_r200_depth/points]
[gzserver-1] [INFO] [1701097751.862002856] [turtlebot3_diff_drive]: Wheel pair 1 separation set to [0.287000m]
[gzserver-1] [INFO] [1701097751.862061659] [turtlebot3_diff_drive]: Wheel pair 1 diameter set to [0.066000m]
[gzserver-1] [INFO] [1701097751.863759335] [turtlebot3_diff_drive]: Subscribed to [/cmd_vel]
[gzserver-1] [INFO] [1701097751.867113172] [turtlebot3_diff_drive]: Advertise odometry on [/odom]
[gzserver-1] [INFO] [1701097751.889171940] [turtlebot3_joint_state]: Going to publish joint [wheel_left_joint]
[gzserver-1] [INFO] [1701097751.889219017] [turtlebot3_joint_state]: Going to publish joint [wheel_right_joint]
[navsat_transform_node-6] [INFO] [1701097752.886761487] [navsat_transform]: Datum (latitude, longitude, altitude) is (38.16, -122.45, 488.33)
[navsat_transform_node-6] [INFO] [1701097752.886811978] [navsat_transform]: Datum UTM coordinate is (10S, 547779.03, 4223869.69)
[navsat_transform_node-6] [INFO] [1701097752.905701416] [navsat_transform]: Corrected for magnetic declination of 0, user-specified offset of 0 and meridian convergence of 0.00588164. Transform heading factor is now 0.00438591
Cristian-wp commented 10 months ago

@xinxing-max maybe I have found a clue... The tutorial says to use navigation2_tutorials](https://github.com/ros-planning/navigation2_tutorials) package and in nav2_no_map_params.yaml, there is _nav2_are_error_codes_active_condition_btnode

Now I will try to remove it and I let you know

xinxing-max commented 10 months ago

@Cristian-wp This problem must lie in the source code of your nav2 or the input problem of your param yaml file. If the param file you use was right without that lib plugin. One of my suggestions is that you should completely remove the binary installation of nav2. Another thing you can try is to copy the param yaml file to another file, rename it, and then load it through the launch file.

Now you have to make sure that the param file used in the launch file you launch is the one you want to load. It is possible that you have been using the default param file in opt, but the file you modified in your workspace has not even been loaded.

Cristian-wp commented 10 months ago

@xinxing-max It works, my guess was right. All the error were related to nav2_no_map_params.yaml in navigation2_tutorials](https://github.com/ros-planning/navigation2_tutorials) package. I just replace all the plugin in this file with the ones in nav2_params.yaml.

Thank you a lot for your help :)