Robotics StackExchange | Archived questions

Costmap2DROS transform timeout. Current time: 1.0210, global_pose stamp: 0.0000, tolerance: 0.5000

Hello, first let me say, that this error is of course not unique and i tried nearly all of the numerous hints i found here and in other forums.

I am trying to use the teblocalplanner with a carlike-robot, but I need to use gazebo with GPS simulation instead of the ros-stage simulation with AMCL.

So in RVIZ i get the message, that global and local costmap are not receiving a map, which fits to the error.

 [INFO] [1615145474.783383, 0.594000]: Loading controller: swerve_controller
        [WARN] [1615145474.787266, 0.596000]: heading not yet received
                                                                      [WARN] [1615145474.796941, 0.599000]: heading not yet received
                                                    [ WARN] [1615145474.843092297, 0.613000000]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
                    [ WARN] [1615145474.853544668, 0.617000000]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided
                                                                  [ INFO] [1615145474.860873448, 0.620000000]: global_costmap: Using plugin "static_layer"
                                                                          [ INFO] [1615145474.905840959, 0.644000000]: Requesting the map...
                                                            [ INFO] [1615145474.923638758, 0.656000000]: Controller state will be published at 50Hz.
                                                                    [ INFO] [1615145474.927562794, 0.657000000]: Velocity commands will be considered old if they are older than 5s.
                    [ INFO] [1615145474.938281821, 0.662000000]: Base frame_id set to body
          [ INFO] [1615145474.941507534, 0.664000000]: Publishing to tf is disabled
   [ INFO] [1615145474.988495704, 0.686000000]: Some geometric parameters are not provided in the config file.Parsing from URDF!
                                                [ INFO] [1615145475.014001171, 0.700000000]: Odometry params : track 0.992, wheel radius 0.24, wheel base 0.8, wheel steering offset 0.191
                          [ INFO] [1615145475.047899247, 0.713000000]: Adding LF wheel with joint name: wheel_lf_joint, RF wheel with joint name: wheel_rf_joint, LH wheel with joint name: wheel_lh_joint, RH wheel with joint name: wheel_rh_joint
    [ INFO] [1615145475.049228544, 0.714000000]: Adding LF steering with joint name: leg_lf_joint, RF steering with joint name: leg_rf_joint, LH steering with joint name: leg_lh_joint, RH steering with joint name: leg_rh_joint
                                                                  [INFO] [1615145475.070940, 0.721000]: Controller Spawner: Loaded controllers: joint_state_controller, swerve_controller
                         [INFO] [1615145475.114928, 0.734000]: Started controllers: joint_state_controller, swerve_controller
                                             [ INFO] [1615145475.154315546, 0.756000000]: Resizing costmap to 788 X 321 at 0.200000 m/pix
                                                         [ INFO] [1615145475.362198142, 0.853000000]: Received a 788 X 321 map at 0.200000 m/pix
                                                                [ INFO] [1615145475.371455674, 0.859000000]: global_costmap: Using plugin "obstacle_layer"
                                                                          [ INFO] [1615145475.381234107, 0.866000000]:     Subscribed to Topics: laser_scan_sensor
  [ INFO] [1615145475.480182212, 0.922000000]: global_costmap: Using plugin "inflation_layer"
             [ WARN] [1615145475.705353722, 1.021000000]: Costmap2DROS transform timeout. Current time: 1.0210, global_pose stamp: 0.0000, tolerance: 0.5000
                                                                           [ WARN] [1615145475.762495939, 1.054000000]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
                                          [ WARN] [1615145475.764276518, 1.054000000]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided
       [ INFO] [1615145475.771441181, 1.056000000]: local_costmap: Using plugin "static_layer"
              [ INFO] [1615145475.788734963, 1.069000000]: Requesting the map...
[ WARN] [1615145475.799362653, 1.073000000]: Could not get robot pose, cancelling reconfiguration
                 [ INFO] [1615145475.799826190, 1.073000000]: Resizing static layer to 788 X 321 at 0.200000 m/pix
                                  [ INFO] [1615145476.018285015, 1.176000000]: Received a 788 X 321 map at 0.200000 m/pix
                                         [ INFO] [1615145476.066187020, 1.196000000]: local_costmap: Using plugin "obstacle_layer"
                                                  [ INFO] [1615145476.089338139, 1.205000000]:     Subscribed to Topics: laser_scan_sensor
                                                          [ INFO] [1615145476.326130798, 1.323000000]: Created local_planner teb_local_planner/TebLocalPlannerROS
 [ INFO] [1615145476.729292864, 1.516000000]: Footprint model 'line' (line_start: [0,0]m, line_end: [0.4,0]m) loaded for trajectory optimization.
                                                                 [ INFO] [1615145476.729630387, 1.516000000]: Parallel planning in distinctive topologies enabled.
  [ INFO] [1615145476.729713814, 1.517000000]: No costmap conversion plugin specified. All occupied costmap cells are treaten as point obstacles.
                                                                 [ WARN] [1615145477.801064802, 2.021000000]: Costmap2DROS transform timeout. Current time: 2.0210, global_pose stamp: 0.0000, tolerance: 0.5000

What I have already checked, based on other entries, is the synchronisation of time-use. /usesimtime is set to true in the initial launch file and /clock is subcribed.

    <!--  Simulate a carlike robot with the teb_local_planner in stage: - stage  - map_server  - move_base  - static map  - amcl  - rviz view -->

<launch>


        <!--  ************** Global Parameters ***************  -->
      <param name="/use_sim_time" value="true"/>

        <arg name="target_x_vel" default="2.3"/>
        <arg name="target_yaw_vel" default="0.8"/>
        <arg name="robot_radius" default="0.1"/>
        <arg name="tool_radius" default="0.1"/>


  <include file="$(find swerve_controller)/test/launch/swervebot.launch"/>
  <include file="$(find innok_gps_localization)/launch/sim_gps_localization.launch" />

        <!--  ************** Navigation ***************  -->
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

      <rosparam file="$(find teb_local_planner_tutorials)/cfg/carlike/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find teb_local_planner_tutorials)/cfg/carlike/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find teb_local_planner_tutorials)/cfg/carlike/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find teb_local_planner_tutorials)/cfg/carlike/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find teb_local_planner_tutorials)/cfg/carlike/teb_local_planner_params.yaml" command="load" />


          <param name="tf_timeout" value="10.0"/>
        <rosparam file="$(find full_coverage_path_planner)/test/full_coverage_path_planner/param/planners.yaml" command="load" />
        <param name="SpiralSTC/robot_radius" value="$(arg robot_radius)"/>
        <param name="SpiralSTC/tool_radius" value="$(arg tool_radius)"/>


        <param name="base_global_planner" value="full_coverage_path_planner/SpiralSTC" />       
        <param name="planner_frequency" value="0.0" />  
        <param name="planner_patience" value="0.50" />
            <remap from="/move_base_flex/SpiralSTC/plan" to="/move_base/SpiralSTC/plan"/>

        <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
        <param name="controller_frequency" value="5.0" />
        <param name="controller_patience" value="15.0" />

       <param name="clearing_rotation_allowed" value="false" /> <!-- Our carlike robot is not able to rotate in place -->
    </node>

<!--  ****** Maps *****  -->
    <node name="map_server" pkg="map_server" type="map_server" args="$(find teb_local_planner_tutorials)/maps/occupancy_map.yaml" output="screen">
                <param name="frame_id" value="map"/>
    </node>


<!-- Trigger planner by publishing a move_base goal -->
    <node name="publish_simple_goal" pkg="rostopic" type="rostopic"  launch-prefix="bash -c 'sleep 1.0; $0 $@' "
        args="pub --latch /move_base/goal move_base_msgs/MoveBaseActionGoal --file=$(find full_coverage_path_planner)/test/simple_goal.yaml"/>

      <!--  **************** Visualisation ****************  -->
      <node name="rviz" pkg="rviz" type="rviz" args="-d $(find teb_local_planner_tutorials)/cfg/rviz_navigation.rviz"/>

</launch>

I also read about a possible influence of the hz-rate of the publisher. Here is a pic from viewframes, which shows some problems in transform from map to baselink and further. Maybe the reason for this is the same, but also on this side, i didn't know how to proceed.

Here is also the costmap_params.yaml:

  global_costmap:
  global_frame: map
  robot_base_frame: base_link
  update_frequency: 1.0
  publish_frequency: 0.5
  static_map: true

  transform_tolerance: 0.5
  plugins:
    - {name: static_layer,            type: "costmap_2d::StaticLayer"}
    - {name: obstacle_layer,          type: "costmap_2d::VoxelLayer"}
    - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}

Maybe someone of you has a hint for me, which helps me with these issues. Let me know, what information is missing to analyse the situation, it's my first question here. Thanks in advance!

Asked by offtaste on 2021-03-08 09:10:23 UTC

Comments

Did you solve it ?

Asked by tomkimsour on 2021-05-10 07:33:43 UTC

Yes I did. It was an absolutely dumb thing. As you see, the global frame of my costmap was map and it must be odom, because reference point in my workplace here is odom. That‘s why the costmap couldn’t be loaded...

Asked by offtaste on 2021-05-10 08:35:20 UTC

Nice, it removed my warnings ! Do you have any explanation on why it should be odom instead of map ? I had the same problem but one thing that on Rviz, now odom frame is moving relatively to map frame and thus my robot is not on the place it needs to be. Did you encounter this problem ? Maybe i should open a new topic

Asked by tomkimsour on 2021-05-11 03:45:01 UTC

Answers

I'm also getting this error, and tried changing the global frame from map to odom, but the error still remains. How to fix this issue

Asked by Akshaiathiban on 2023-07-19 02:05:00 UTC

Comments