鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    不明原因的tf时间同步错误

    已定时 已固定 已锁定 已移动
    Nav2
    tf 时间戳 tf2 nav2导航出错
    1
    1
    36
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • E
      esasgizio
      最后由 编辑

      我尝试在Nav2官方的示例上修改,但是今天启动的时候我却遇到了莫名奇妙的tf帧时间同步错误。下面是我的配置文件,同样的配置文件在昨天还是工作正常的。

      bt_navigator:
        ros__parameters:
          use_sim_time: True
          global_frame: map
          robot_base_frame: base_link
          odom_topic: /demo/odom
          bt_loop_duration: 10
          default_server_timeout: 20
          wait_for_service_timeout: 1000
          action_server_result_timeout: 900.0
          #default_nav_to_pose_bt_xml: $(find-pkg-share sam_bot_description)/src/control/navigate_w_replanning_only_if_goal_is_updated.xml
          #default_nav_through_poses_bt_xml: $(find-pkg-share sam_bot_description)/src/control/no_global_map.bt.xml
          #default_nav_to_pose_bt_xml: "nav2_bt_navigator/navigate_w_replanning_only_if_goal_is_updated.xml"
          navigators: ["navigate_to_pose", "navigate_through_poses"]
          navigate_to_pose:
            plugin: "nav2_bt_navigator::NavigateToPoseNavigator"
          navigate_through_poses:
            plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
          # '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 is used to add custom BT plugins to the executor (vector of strings).
          # Built-in plugins are added automatically
          # plugin_lib_names: []
      
          error_code_name_prefixes:
            - assisted_teleop
            - backup
            - compute_path
            - dock_robot
            - drive_on_heading
            - follow_path
            - nav_thru_poses
            - nav_to_pose
            - route
            - spin
            - undock_robot
            - wait
      
      controller_server:
        ros__parameters:
          use_sim_time: True
          controller_frequency: 20.0
          costmap_update_timeout: 0.30
          min_x_velocity_threshold: 0.4
          min_y_velocity_threshold: 0.0
          min_theta_velocity_threshold: 0.001
          failure_tolerance: 0.3
          transform_tolerance: 0.5
          progress_checker_plugins: ["progress_checker"]
          goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
          controller_plugins: ["FollowPath"]
          odom_topic: /demo/odom
          use_realtime_priority: false
          enable_stamped_cmd_vel: true
      
          # Progress checker parameters
          progress_checker:
            plugin: "nav2_controller::SimpleProgressChecker"
            required_movement_radius: 0.5
            movement_time_allowance: 10.0
          # Goal checker parameters
          general_goal_checker:
            stateful: True
            plugin: "nav2_controller::SimpleGoalChecker"
            xy_goal_tolerance: 0.25
            yaw_goal_tolerance: 0.25
          # RPP controller parameters
          FollowPath_RPP:
            plugin: "nav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController"
            use_sim_time: True
            desired_linear_vel: 0.5
            lookahead_dist: 3.0
            min_lookahead_dist: 0.3
            max_lookahead_dist: 6.0
            lookahead_time: 1.5
            rotate_to_heading_angular_vel: 1.8
            transform_tolerance: 0.1
            use_velocity_scaled_lookahead_dist: false
            min_approach_linear_velocity: 0.05
            approach_velocity_scaling_dist: 1.0
            use_collision_detection: true
            max_allowed_time_to_collision_up_to_carrot: 1.0
            use_regulated_linear_velocity_scaling: true
            use_cost_regulated_linear_velocity_scaling: false
            regulated_linear_scaling_min_radius: 0.9
            regulated_linear_scaling_min_speed: 0.25
            use_fixed_curvature_lookahead: false
            curvature_lookahead_dist: 1.0
            use_rotate_to_heading: true
            rotate_to_heading_min_angle: 0.785
            max_angular_accel: 3.2
            max_robot_pose_search_dist: 10.0
            interpolate_curvature_after_goal: false
            cost_scaling_dist: 0.3
            cost_scaling_gain: 1.0
            inflation_cost_scaling_factor: 3.0
          # 时间弹性带
          FollowPath:
            #加载旋转控制器插件
            plugin: "nav2_rotation_shim_controller::RotationShimController"
            primary_controller: "teb_local_planner::TebLocalPlannerROS"
            angular_dist_threshold: 0.785
            forward_sampling_distance: 2.0
            rotate_to_heading_angular_vel: 3.14
            max_angular_accel: 1.57
            simulate_ahead_time: 10.0
            rotate_to_goal_heading: true
            use_path_orientations: true
            # 加载 TEB 控制器插件
            footprint_model:
              type: "circular"
              radius: 0.5
            use_sim_time: True
            max_vel_x: 2.0
            max_vel_y: 0.0
            max_vel_theta: 1.0
            min_vel_x: 0.5
            min_vel_y: 0.0
            min_vel_theta: 0.4
            acc_lim_x: 1.0
            acc_lim_y: 1.0
            acc_lim_theta: 0.5
            # 时间弹性带参数
            dt_ref: 0.3
            dt_hysteresis: 0.1
            global_plan_overwrite_orientation: True
            max_global_plan_lookahead_dist: 20.0
          # MPC controller parameters
          FollowPath_MPPI:
            # 加载旋转控制器插件
            plugin: "nav2_rotation_shim_controller::RotationShimController"
            primary_controller: "nav2_mppi_controller::MPPIController"
            angular_dist_threshold: 0.785
            forward_sampling_distance: 2.0
            rotate_to_heading_angular_vel: 3.14
            max_angular_accel: 0.6
            simulate_ahead_time: 10.0
            rotate_to_goal_heading: true
            use_path_orientations: false
            # 加载 MPPI 控制器插件
            # plugin: "nav2_mppi_controller::MPPIController"
            # MPPI 控制器参数
            # 采样时间步长
            time_steps: 200
            # 采样时间间隔(秒)
            model_dt: 0.05
            # 一次采样的轨迹数量
            batch_size: 1000
            # 加速度控制
            ax_max: 3.0
            ax_min: -3.0
            ay_max: 3.0
            az_max: 3.5
            # 输入标准差
            vx_std: 1.2
            vy_std: 1.2
            wz_std: 1.57
            # 速度限制
            vx_max: 10.0
            vx_min: -0.35
            vy_max: 10.0
            wz_max: 1.9
            # 每次规划迭代次数
            iteration_count: 1
            # 路径裁剪距离
            prune_distance: 10.0
            # 坐标变化容忍时间
            transform_tolerance: 0.1
            temperature: 0.3
            gamma: 0.015
            motion_model: "DiffDrive"
            visualize: true
            regenerate_noises: true
            TrajectoryVisualizer:
              trajectory_step: 30
              time_step: 2
            AckermannConstraints:
              min_turning_r: 0.01
            critics: [
              "ConstraintCritic", "CostCritic", "GoalCritic",
              "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic",
              "PathAngleCritic", "PreferForwardCritic", "TwirlingCritic"]
            ConstraintCritic:
              enabled: true
              cost_power: 1
              cost_weight: 4.0
            GoalCritic:
              enabled: true
              cost_power: 1
              cost_weight: 5.0
              threshold_to_consider: 1.4
            GoalAngleCritic:
              enabled: true
              cost_power: 1
              cost_weight: 5.0
              threshold_to_consider: 0.3
            PreferForwardCritic:
              enabled: true
              cost_power: 1
              cost_weight: 3.0
              threshold_to_consider: 0.5
            CostCritic:
              enabled: true
              cost_power: 1
              cost_weight: 5.0
              critical_cost: 30.0
              consider_footprint: true
              collision_cost: 1000000.0
              near_goal_distance: 1.0
              trajectory_point_step: 2
            PathAlignCritic:
              enabled: true
              cost_power: 1
              cost_weight: 5.0
              max_path_occupancy_ratio: 0.05
              trajectory_point_step: 4
              threshold_to_consider: 5.0
              offset_from_furthest: 20
              use_path_orientations: false
            PathFollowCritic:
              enabled: true
              cost_power: 1
              cost_weight: 4.0
              offset_from_furthest: 5
              threshold_to_consider: 3.0
            PathAngleCritic:
              enabled: true
              cost_power: 1
              cost_weight: 3.0
              offset_from_furthest: 4
              threshold_to_consider: 0.5
              max_angle_to_furthest: 1.0
              mode: 0
            TwirlingCritic:
               enabled: true
               twirling_cost_power: 1
               twirling_cost_weight: 1.0
      
      local_costmap:
        local_costmap:
          ros__parameters:
            use_sim_time: True
            update_frequency: 24.0
            publish_frequency: 24.0
            global_frame: odom
            robot_base_frame: base_link
            rolling_window: true
            width: 30
            height: 30
            resolution: 0.05
            footprint: "[ [0.8, 0.6], [0.8, -0.6], [-0.8, -0.6], [-0.8, 0.6] ]"
            plugins: ["voxel_layer", "static_layer", "inflation_layer"]
            inflation_layer:
              plugin: "nav2_costmap_2d::InflationLayer"
              cost_scaling_factor: 10.0
              inflation_radius: 0.2
            # 目前voxel_layer已经开启
            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: pointcloud_front pointcloud_back
              pointcloud_front:
                topic: /scan_front/points
                data_type: "PointCloud2"
                clearing: True
                marking: True
                inf_is_valid: True
                max_obstacle_height: 3.0
                min_obstacle_height: 0.0
                obstacle_max_range: 6.0
                obstacle_min_range: 0.0
                raytrace_max_range: 5.0
                raytrace_min_range: 0.0
              pointcloud_back:
                topic: /scan_back/points
                data_type: "PointCloud2"
                clearing: True
                marking: True
                inf_is_valid: True
                max_obstacle_height: 3.0
                min_obstacle_height: 0.0
                obstacle_max_range: 6.0
                obstacle_min_range: 0.0
                raytrace_max_range: 5.0
                raytrace_min_range: 0.0
            static_layer:
              plugin: "nav2_costmap_2d::StaticLayer"
              map_subscribe_transient_local: True
              footprint_clearing_enabled: True
              subscribe_to_updates: True
            always_send_full_costmap: True
      
      global_costmap:
        global_costmap:
          ros__parameters:
            update_frequency: 1.0
            publish_frequency: 1.0
            global_frame: map
            robot_base_frame: base_link
            robot_radius: 0.3
            resolution: 0.05
            track_unknown_space: false
            plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
            obstacle_layer:
              plugin: "nav2_costmap_2d::ObstacleLayer"
              enabled: True
              combination_method: 0
              observation_sources: pointcloud_front pointcloud_back
              pointcloud_front:
                topic: /scan_front/points
                data_type: "PointCloud2"
                clearing: True
                marking: True
                max_obstacle_height: 10.0
                min_obstacle_height: 0.0
                obstacle_max_range: 30.0
                obstacle_min_range: -1.0
                raytrace_max_range: 3.0
                raytrace_min_range: -3.0
              pointcloud_back:
                topic: /scan_back/points
                data_type: "PointCloud2"
                clearing: True
                marking: True
                max_obstacle_height: 10.0
                min_obstacle_height: 0.0
                obstacle_max_range: 30.0
                obstacle_min_range: -1.0
                raytrace_max_range: 3.0
                raytrace_min_range: -3.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.7
            always_send_full_costmap: True
      
      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
      
      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:
          use_sim_time: True
          local_costmap_topic: local_costmap/costmap_raw
          global_costmap_topic: global_costmap/costmap_raw
          local_footprint_topic: local_costmap/published_footprint
          global_footprint_topic: global_costmap/published_footprint
          cycle_frequency: 20.0
          behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
          spin:
            plugin: "nav2_behaviors::Spin"
          backup:
            plugin: "nav2_behaviors::BackUp"
          drive_on_heading:
            plugin: "nav2_behaviors::DriveOnHeading"
          wait:
            plugin: "nav2_behaviors::Wait"
          assisted_teleop:
            plugin: "nav2_behaviors::AssistedTeleop"
          local_frame: odom
          global_frame: map
          robot_base_frame: base_link
          transform_tolerance: 2.0
          simulate_ahead_time: 2.0
          max_rotational_vel: 1.0
          min_rotational_vel: 0.4
          rotational_acc_lim: 3.2
          enable_stamped_cmd_vel: true
      
      waypoint_follower:
        ros__parameters:
          use_sim_time: True
          loop_rate: 20
          stop_on_failure: false
          action_server_result_timeout: 900.0
          waypoint_task_executor_plugin: "wait_at_waypoint"
          wait_at_waypoint:
            plugin: "nav2_waypoint_follower::WaitAtWaypoint"
            enabled: True
            waypoint_pause_duration: 200
      
      planner_server:
        ros__parameters:
          plugins: ["GridBased"]
          use_sim_time: True
          GridBased:
            plugin: "nav2_straightline_planner::StraightLine"
            interpolation_resolution: 0.1
      
      velocity_smoother:
        ros__parameters:
          use_sim_time: True
          smoothing_frequency: 20.0
          scale_velocities: False
          feedback: "OPEN_LOOP"
          max_velocity: [1.0, 0.0, 2.0]
          min_velocity: [-1.0, 0.0, -2.0]
          max_accel: [2.5, 0.0, 3.2]
          max_decel: [-2.5, 0.0, -3.2]
          odom_topic: "/demo/odom"
          odom_duration: 0.1
          deadband_velocity: [0.0, 0.0, 0.0]
          velocity_timeout: 1.0
          enable_stamped_cmd_vel: true
      
      collision_monitor:
        ros__parameters:
          use_sim_time: True
          base_frame_id: "base_footprint"
          odom_frame_id: "odom"
          cmd_vel_in_topic: "cmd_vel_smoothed"
          cmd_vel_out_topic: "/demo/cmd_vel"
          enable_stamped_cmd_vel: true
          state_topic: "collision_monitor_state"
          transform_tolerance: 0.2
          source_timeout: 1.0
          base_shift_correction: True
          stop_pub_timeout: 2.0
          # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types,
          # and robot footprint for "approach" action type.
          polygons: ["FootprintApproach"]
          FootprintApproach:
            type: "polygon"
            action_type: "approach"
            footprint_topic: "local_costmap/published_footprint"
            time_before_collision: 1.2
            simulation_time_step: 0.1
            min_points: 6
            visualize: False
            enabled: True
          observation_sources: ["scan"]
          scan:
            type: "scan"
            topic: "scan"
            min_height: 0.15
            max_height: 2.0
            enabled: True
      
      docking_server:
        ros__parameters:
          use_sim_time: True
          controller_frequency: 50.0
          initial_perception_timeout: 5.0
          wait_charge_timeout: 5.0
          dock_approach_timeout: 30.0
          undock_linear_tolerance: 0.05
          undock_angular_tolerance: 0.1
          max_retries: 3
          base_frame: "base_link"
          fixed_frame: "odom"
          dock_backwards: false
          dock_prestaging_tolerance: 0.5
      
          # Types of docks
          dock_plugins: ['simple_charging_dock']
          simple_charging_dock:
            plugin: 'opennav_docking::SimpleChargingDock'
            docking_threshold: 0.05
            staging_x_offset: -0.7
            use_external_detection_pose: true
            use_battery_status: false # true
            use_stall_detection: false # true
      
            external_detection_timeout: 1.0
            external_detection_translation_x: -0.18
            external_detection_translation_y: 0.0
            external_detection_rotation_roll: -1.57
            external_detection_rotation_pitch: -1.57
            external_detection_rotation_yaw: 0.0
            filter_coef: 0.1
      
          # Dock instances
          # The following example illustrates configuring dock instances.
          # docks: ['home_dock']  # Input your docks here
          # home_dock:
          #   type: 'simple_charging_dock'
          #   frame: map
          #   pose: [0.0, 0.0, 0.0]
      
          controller:
            k_phi: 3.0
            k_delta: 2.0
            v_linear_min: 0.15
            v_linear_max: 0.15
            use_collision_detection: true
            costmap_topic: "/local_costmap/costmap_raw"
            footprint_topic: "/local_costmap/published_footprint"
            transform_tolerance: 0.1
            projection_time: 5.0
            simulation_step: 0.1
            dock_collision_threshold: 0.3
      
      loopback_simulator:
        ros__parameters:
          use_sim_time: True
          base_frame_id: "base_footprint"
          odom_frame_id: "odom"
          map_frame_id: "map"
          scan_frame_id: "base_scan"  # tb4_loopback_simulator.launch.py remaps to 'rplidar_link'
          update_duration: 0.02
          enable_stamped_cmd_vel: true
      
      

      我遇到的错误是这个

      [controller_server-8] [ERROR] [1753155010.957683345] [controller_server]: Extrapolation Error: Lookup would require extrapolation into the future.  Requested time 80.830000 but the latest data is at time 80.600000, when looking up transform from frame [odom] to frame [map]
      [controller_server-8] 
      [controller_server-8] [ERROR] [1753155010.957710639] [controller_server]: Global Frame: odom Plan Frame size 63: map
      [controller_server-8] 
      [controller_server-8] [ERROR] [1753155010.957740037] [controller_server]: Could not transform the global plan to the frame of the controller
      [controller_server-8] [WARN] [1753155010.957826901] [controller_server]: [follow_path] [ActionServer] Aborting handle.
      [behavior_server-11] [INFO] [1753155010.972874419] [behavior_server]: Running backup
      [planner_server-10] [INFO] [1753155011.310881979] [global_costmap.global_costmap]: Message Filter dropping message: frame 'back_lidar_link' at time 80.850 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
      [rviz2-3] [INFO] [1753155011.502784946] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.645 for reason 'discarding message because the queue is full'
      [planner_server-10] [INFO] [1753155011.563139438] [global_costmap.global_costmap]: Message Filter dropping message: frame 'front_lidar_link' at time 80.950 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
      [planner_server-10] [INFO] [1753155011.600570306] [global_costmap.global_costmap]: Message Filter dropping message: frame 'back_lidar_link' at time 80.950 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
      [rviz2-3] [INFO] [1753155011.664746872] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.704 for reason 'discarding message because the queue is full'
      [rviz2-3] [INFO] [1753155011.820135330] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.754 for reason 'discarding message because the queue is full'
      [rviz2-3] [INFO] [1753155011.947982501] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.803 for reason 'discarding message because the queue is full'
      

      我检查了我的其他配置文件,确定这些配置在之前都从未修改,工作正常。
      请大佬看看我是不是错漏了什么?

      1 条回复 最后回复 回复 引用 0
      • 第一个帖子
        最后一个帖子
      皖ICP备16016415号-7
      Powered by NodeBB | 鱼香ROS