local costmap not showing in rviz2

asked 2023-08-01 16:09:25 -0500

sdu568 gravatar image

Background info:

ROS 2 info:

ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=galactic

Problem:

Hello all,

I am encountering a very strange issue in rviz2.
I have recorded a ros2 bag that contains tf transform from map->odom->base_link by using the robot_localization package, as shown below.

image description

After I launch my Nav2, I was able to see both map information on both /global_costmap/costmap and /map topics. However, I was not able to see the local_costmap on /local_costmap/costmap.

Moreover, when I tried to echo to the local_costmap/costmap topic, I was able to see information published on the local_costmap, as shown below. image description

Error Code:

The only that I have gotten a "Message Filter dropping message: frame 'odom' at time 1690921914.628 for reason 'discarding message because the queue is full' message in the rviz2 terminal, as shown below. According to a similar ros answer, the issue is caused by a missing transform. However, I don't think to be the case in this situation, because I do have a complete TF transform from map -> base_link as shown in the first picture. image description

Things I have tried:

  1. Change the QOS setting in rviz2 from Reliable to Best Effort, as shown below. However, I am still not getting any update in Rviz2 for local costmap. Note: the moving of the robot (red and green arrow) is just a replay of history from the bag, I have not yet set a goal to Nav2 to tell it where to move the robot. image description
  2. According to This ros answer, I have double-check that my RMW_IMPLEMENTATION ins cyclonedds, which is the default of Galactic.

configure file

bt_navigator:
  ros__parameters:
    use_sim_time: False
    global_frame: map
    robot_base_frame: base_link
    odom_topic: /odometry/global
    bt_loop_duration: 10
    default_server_timeout: 20
    enable_groot_monitoring: True
    groot_zmq_publisher_port: 1666
    groot_zmq_server_port: 1667
    # '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

controller_server:
  ros__parameters:
    # controller server parameters (see Controller Server for more info)
    controller_frequency: 20.0
    min_x_velocity_threshold: 0.001
    min_y_velocity_threshold: 0.5
    min_theta_velocity_threshold: 0.001
    progress_checker_plugin: "progress_checker"
    goal_checker_plugins: ["goal_checker"]
    controller_plugins: ["FollowPath"]
    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.5
      movement_time_allowance: 10.0
    goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 1.0
      yaw_goal_tolerance: 6.29
      stateful: True
    # DWB controller parameters
    FollowPath:
      transform_tolerance: 5.0
      plugin: "dwb_core::DWBLocalPlanner"
      debug_trajectory_details: False
      forward_prune_distance: 0.2
      min_vel_x: 0.0
      min_vel_y: 0.0
      max_vel_x: 0.0
      max_vel_y: 1.0 # 1.0 # was 2.23
      max_vel_theta: 0.5 # 0.5 # was 1.0
      min_speed_xy: 0.0
      max_speed_xy: 1.0 # 0.5 # was 2.23
      min_speed_theta: 0.0
      acc_lim_x: 0.0
      acc_lim_y: 1.25
      acc_lim_theta: 3.2
      decel_lim_x: 0.0
      decel_lim_y: -2.5
      decel_lim_theta: -3.2
      vx_samples: 1
      vy_samples: 20
      vtheta_samples: 20
      sim_time: 1.7
      linear_granularity: 0.05
      angular_granularity: 0.025
      xy_goal_tolerance: 1.0
      trans_stopped_velocity: 0.25
      short_circuit_trajectory_evaluation: True
      stateful: True
      critics ...
(more)
edit retag flag offensive close merge delete