Navigation 2: The robot has a stuck, not moving and just spin

asked 2021-11-08 03:18:27 -0500

Staredeath gravatar image

I am using Navigation package for my project in school, but I have some errors such as sometime robot has a stuck, not moving and just spin, rarely the robot run smoothly.

Video about the error

I don't know how to fix it. Here is robot in Rviz and terminal's image when the robot stuck or spin:

Image in Rviz

Image terminal

Can anyone help me. Thanks you so much. Here is my config file:

amcl:
  ros__parameters:
    use_sim_time: True
    alpha1: 0.2
    alpha2: 0.15
    alpha3: 0.2
    alpha4: 0.25
    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: 1500
    min_particles: 300
    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: "differential"
    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.6
    z_max: 0.05
    z_rand: 0.3
    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: 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

bt_navigator_rclcpp_node:
  ros__parameters:
    use_sim_time: True

controller_server:
  ros__parameters:
    # controller server parameters (see Controller Server for more info)
    use_sim_time: True
    controller_frequency: 10.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_plugin: "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: 0.25
      yaw_goal_tolerance: 0.25
      stateful: True
    # DWB controller parameters
    FollowPath:
      plugin: "dwb_core::DWBLocalPlanner"
      debug_trajectory_details: True          # Publish debug information (on what topic???).
      prune_distance: 1.0                     # Whether to prune the path of old, passed points.
      min_vel_x: 0.0                         # Minimum velocity X (m/s).
      min_vel_y: 0.0                          #Minimum velocity Y (m/s).
      max_vel_x: 0.4                         #Maximum velocity X (m/s).
      max_vel_y: 0.0                          #Maximum velocity Y (m/s).
      max_vel_theta: 1.0                      #Maximum angular velocity (rad/s).
      min_speed_xy: 0.0                       #Minimum translational speed (m/s).
      max_speed_xy: 0.4                      #Maximum translational speed (m/s).
      min_speed_theta: -0.2                    #Minimum angular speed (rad/s).
      acc_lim_x: 2.5                          #Maximum acceleration X (m/s^2).
      acc_lim_y: 0.0                          #Maximum acceleration Y (m/s^2).
      acc_lim_theta: 3.2                      #Maximum acceleration rotation (rad/s^2).
      decel_lim_x: -2.5                       #Maximum deceleration X (m/s^2).
      decel_lim_y: 0.0                        #Maximum deceleration Y (m/s^2).
      decel_lim_theta: -3.2                   #Maximum deceleration rotation (rad/s^2).
      vx_samples: 20                           #Number of velocity samples in the X velocity direction.
      vy_samples: 5                           #Number of velocity samples in the Y velocity direction.
      vtheta_samples: 20                      #Number of velocity samples in the angular directions.
      sim_time: 2.0                           #Time to simulate ahead by (s).
      publish_evaluation: True                #Whether to publish the local plan evaluation.
      publish_global_plan: true               #Whether to publish the global plan.
      linear_granularity: 0.05                #Linear distance forward to project.
      angular_granularity: 0.02              # Angular distance to project ...
(more)
edit retag flag offensive close merge delete

Comments

Would it be possible to get dimensions of your robot. I’ve seen the video but it will be good to know. What is the robot turning radius?

osilva gravatar image osilva  ( 2021-11-08 20:18:51 -0500 )edit

Have you followed this guide for troubleshooting: http://wiki.ros.org/navigation/Troubl... ?

osilva gravatar image osilva  ( 2021-11-08 20:19:55 -0500 )edit

yes, I am. In my project, I set my robot radius is 0.15.

Staredeath gravatar image Staredeath  ( 2021-11-08 20:38:01 -0500 )edit

Based on what can be seen in the video it looks you are dealing with issue 7, then troubleshoot accordingly but one factor at the time to ensure you get desired result. Do you get this behaviour in simulation?

osilva gravatar image osilva  ( 2021-11-08 21:41:01 -0500 )edit