[Solved] Service call failed: service [/explore_server/explore_costmap/explore_boundary/update_boundary_polygon] responded with an error: Lookup would require extrapolation into the past

I am trying to apply the following tutorial:

But couldn’t make it work. I am getting this error

[ INFO] [1572935729.431625229]: Sending goal
[ERROR] [1572935729.814186148]: Exception thrown while processing service call: Lookup would require extrapolation into the past. Requested time 1572935715.662593779 but the earliest data is at time 1572935719.811961202, when looking up transform from frame [odom] to frame [map]
[ERROR] [1572935729.814847415]: Service call failed: service [/explore_server/explore_costmap/explore_boundary/update_boundary_polygon] responded with an error: Lookup would require extrapolation into the past. Requested time 1572935715.662593779 but the earliest data is at time 1572935719.811961202, when looking up transform from frame [odom] to frame [map]
[ERROR] [1572935729.815326083]: Failed to set region boundary

When i am trying to publish point on 5th time (after making red square in previous points), the rosbot is not moving and also giving the above-mentioned error.

Launch file:

<arg name="use_rosbot" default="true"/>
<arg name="use_gazebo" default="false"/>

<include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/maze_world.launch"/>
<include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/rosbot.launch"/>

<param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>

<node if="$(arg use_rosbot)" pkg="rplidar_ros" type="rplidarNode" name="rplidar">
    <param name="angle_compensate" type="bool" value="true"/>
    <param name="serial_baudrate" type="int" value="115200"/><!--model A2 (ROSbot 2.0) -->
    <!--<param name="serial_baudrate" type="int" value="256000"/>--><!-- model A3 (ROSbot 2.0 PRO) -->
</node>

<node if="$(arg use_rosbot)" pkg="slam_tut" type="slam_tut_node" name="drive_controller"/>

<node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0 3.14 0 0 base_link laser_frame 100" />

<node pkg="rviz" type="rviz" name="rviz"/>

<node pkg="gmapping" type="slam_gmapping" name="gmapping">
    <param name="base_frame" value="base_link"/>
    <param name="odom_frame" value="odom" />
    <param name="delta" value="0.1" />
</node>

<node pkg="move_base" type="move_base" name="move_base" output="screen">
    <param name="controller_frequency" value="10.0"/>
    <rosparam file="$(find slam_tut)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find slam_tut)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find slam_tut)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find slam_tut)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find slam_tut)/config/trajectory_planner.yaml" command="load" />
</node>

<node pkg="frontier_exploration" type="explore_client" name="explore_client" output="screen"/>

<node pkg="frontier_exploration" type="explore_server" name="explore_server" output="screen">
    <param name="frequency" type="double" value="1.0"/>
    <param name="goal_aliasing" type="double" value="0.5"/>
    <rosparam ns="explore_costmap" subst_value="true" file="$(find slam_tut)/config/exploration.yaml" command="load" />
</node>

exploration.yaml

footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
transform_tolerance: 5
update_frequency: 5
publish_frequency: 5
global_frame: map
robot_base_frame: base_link

plugins:
    - {name: static,           type: "costmap_2d::StaticLayer"}
    - {name: explore_boundary, type: "frontier_exploration::BoundedExploreLayer"}
    - {name: inflation,        type: "costmap_2d::InflationLayer"}

static:
    map_topic: /map
    subscribe_to_updates: true
explore_boundary:
    resize_to_boundary: false
    frontier_travel_point: "middle"
    explore_clear_space: false
inflation:
    inflation_radius: 0.5

driver_controller.cpp:

#include <ros/ros.h>
#include <geometry_msgs/PoseStamped.h>
#include <tf/transform_broadcaster.h>

tf::Transform transform;
tf::Quaternion q;

void pose_callback(const geometry_msgs::PoseStampedPtr &pose)
{
   ROS_INFO("position");
   static tf::TransformBroadcaster br;
   q.setX(pose->pose.orientation.x);
   q.setY(pose->pose.orientation.y);
   q.setZ(pose->pose.orientation.z);
   q.setW(pose->pose.orientation.w);

   transform.setOrigin(tf::Vector3(pose->pose.position.x, pose->pose.position.y, 0.0));
   transform.setRotation(q);

   br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "odom", "base_link"));
}

int main(int argc, char **argv)
{
   ros::init(argc, argv, "drive_controller");
   ros::NodeHandle n("~");
   ros::Subscriber pose_sub = n.subscribe("/pose", 1, pose_callback);
   ros::Rate loop_rate(100);
   while (ros::ok())
   {
      ros::spinOnce();
      loop_rate.sleep();
   }
}

Any help?

Thanks in advance.

Hello aiubian,

The error Lookup would require extrapolation into the past. usually occurs when clocks on different machines are mismatched or there is a significant delay in message transfer.
In your case, there is roughly 14 seconds of difference between current time and message timestamp.

What configuration are you using for Rviz, is it SSH or remote desktop?

Regards,
Łukasz

Hi Łukasz,

Thanks for your reply. I am using Remote Desktop to access rviz.

Could you provide full terminal output prior to error?

Here is the terminal output

... logging to /home/husarion/.ros/log/bfc97058-00f8-11ea-8244-80c5f2fe52a3/roslaunch-husarion-5132.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://husarion:42807/

SUMMARY
========

PARAMETERS
 * /explore_server/explore_costmap/explore_boundary/explore_clear_space: False
 * /explore_server/explore_costmap/explore_boundary/frontier_travel_point: middle
 * /explore_server/explore_costmap/explore_boundary/resize_to_boundary: False
 * /explore_server/explore_costmap/footprint: [[0.12, 0.14], [0...
 * /explore_server/explore_costmap/global_frame: map
 * /explore_server/explore_costmap/inflation/inflation_radius: 0.5
 * /explore_server/explore_costmap/plugins: [{'type': 'costma...
 * /explore_server/explore_costmap/publish_frequency: 5
 * /explore_server/explore_costmap/robot_base_frame: base_link
 * /explore_server/explore_costmap/static/map_topic: /map
 * /explore_server/explore_costmap/static/subscribe_to_updates: True
 * /explore_server/explore_costmap/transform_tolerance: 5
 * /explore_server/explore_costmap/update_frequency: 5
 * /explore_server/frequency: 1.0
 * /explore_server/goal_aliasing: 0.5
 * /gmapping/base_frame: base_link
 * /gmapping/delta: 0.1
 * /gmapping/odom_frame: odom
 * /move_base/TrajectoryPlannerROS/acc_lim_Y: 4.5
 * /move_base/TrajectoryPlannerROS/acc_lim_theta: 0.25
 * /move_base/TrajectoryPlannerROS/acc_lim_x: 4.5
 * /move_base/TrajectoryPlannerROS/holonomic_robot: False
 * /move_base/TrajectoryPlannerROS/max_vel_theta: 0.35
 * /move_base/TrajectoryPlannerROS/max_vel_x: 0.5
 * /move_base/TrajectoryPlannerROS/meter_scoring: True
 * /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.25
 * /move_base/TrajectoryPlannerROS/min_vel_theta: -0.35
 * /move_base/TrajectoryPlannerROS/min_vel_x: 0.1
 * /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.15
 * /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.25
 * /move_base/controller_frequency: 10.0
 * /move_base/global_costmap/always_send_full_costmap: True
 * /move_base/global_costmap/footprint: [[0.12, 0.14], [0...
 * /move_base/global_costmap/global_frame: map
 * /move_base/global_costmap/height: 15
 * /move_base/global_costmap/inflation_radius: 2.5
 * /move_base/global_costmap/laser_scan_sensor/clearing: True
 * /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan
 * /move_base/global_costmap/laser_scan_sensor/marking: True
 * /move_base/global_costmap/laser_scan_sensor/sensor_frame: laser_frame
 * /move_base/global_costmap/laser_scan_sensor/topic: scan
 * /move_base/global_costmap/map_topic: /map
 * /move_base/global_costmap/observation_sources: laser_scan_sensor
 * /move_base/global_costmap/obstacle_range: 6.0
 * /move_base/global_costmap/origin_x: -7.5
 * /move_base/global_costmap/origin_y: -7.5
 * /move_base/global_costmap/publish_frequency: 2.5
 * /move_base/global_costmap/raytrace_range: 8.5
 * /move_base/global_costmap/resolution: 0.1
 * /move_base/global_costmap/robot_base_frame: base_link
 * /move_base/global_costmap/rolling_window: True
 * /move_base/global_costmap/static_map: True
 * /move_base/global_costmap/subscribe_to_updates: True
 * /move_base/global_costmap/transform_tolerance: 0.5
 * /move_base/global_costmap/update_frequency: 2.5
 * /move_base/global_costmap/width: 15
 * /move_base/local_costmap/always_send_full_costmap: True
 * /move_base/local_costmap/footprint: [[0.12, 0.14], [0...
 * /move_base/local_costmap/global_frame: map
 * /move_base/local_costmap/height: 3
 * /move_base/local_costmap/inflation_radius: 0.6
 * /move_base/local_costmap/laser_scan_sensor/clearing: True
 * /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan
 * /move_base/local_costmap/laser_scan_sensor/marking: True
 * /move_base/local_costmap/laser_scan_sensor/sensor_frame: laser_frame
 * /move_base/local_costmap/laser_scan_sensor/topic: scan
 * /move_base/local_costmap/map_topic: /map
 * /move_base/local_costmap/observation_sources: laser_scan_sensor
 * /move_base/local_costmap/obstacle_range: 6.0
 * /move_base/local_costmap/origin_x: -1.5
 * /move_base/local_costmap/origin_y: -1.5
 * /move_base/local_costmap/publish_frequency: 5
 * /move_base/local_costmap/raytrace_range: 8.5
 * /move_base/local_costmap/resolution: 0.1
 * /move_base/local_costmap/robot_base_frame: base_link
 * /move_base/local_costmap/rolling_window: True
 * /move_base/local_costmap/static_map: False
 * /move_base/local_costmap/subscribe_to_updates: True
 * /move_base/local_costmap/transform_tolerance: 0.25
 * /move_base/local_costmap/update_frequency: 5
 * /move_base/local_costmap/width: 3
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /rplidar/angle_compensate: True
 * /rplidar/serial_baudrate: 115200

NODES
  /
    drive_controller (slam_tut/slam_tut_node)
    explore_client (frontier_exploration/explore_client)
    explore_server (frontier_exploration/explore_server)
    gmapping (gmapping/slam_gmapping)
    laser_broadcaster (tf/static_transform_publisher)
    move_base (move_base/move_base)
    rplidar (rplidar_ros/rplidarNode)
    rviz (rviz/rviz)

ROS_MASTER_URI=http://master:11311

process[rplidar-1]: started with pid [5229]
process[drive_controller-2]: started with pid [5232]
process[laser_broadcaster-3]: started with pid [5240]
process[rviz-4]: started with pid [5266]
process[gmapping-5]: started with pid [5276]
process[move_base-6]: started with pid [5286]
process[explore_client-7]: started with pid [5289]
process[explore_server-8]: started with pid [5290]
[ INFO] [1573087944.315094477]: Please use the 'Point' tool in Rviz to select an exporation boundary.
[ INFO] [1573087944.782472867]: Loading from pre-hydro parameter style
[ INFO] [1573087944.791127040]: Using plugin "static"
[ INFO] [1573087944.896080171]: Requesting the map...
libEGL warning: DRI2: failed to authenticate
[ INFO] [1573087944.965674043]: Using plugin "static_layer"
[ INFO] [1573087945.027715668]: Requesting the map...
Laser Pose= 0 0 -3.13446
[ INFO] [1573087946.157148473]: Resizing static layer to 1984 X 1984 at 0.100000 m/pix
[ INFO] [1573087946.231487258]: Resizing costmap to 1984 X 1984 at 0.100000 m/pix
[ INFO] [1573087946.250434781]: Received a 1984 X 1984 map at 0.100000 m/pix
[ INFO] [1573087946.298347248]: Using plugin "obstacle_layer"
[ INFO] [1573087946.317179274]:     Subscribed to Topics: laser_scan_sensor
[ INFO] [1573087946.323891581]: Received a 1984 X 1984 map at 0.100000 m/pix
[ INFO] [1573087946.324003579]: Subscribing to updates
[ INFO] [1573087946.410290293]: Using plugin "explore_boundary"
[ INFO] [1573087946.620791727]: Using plugin "inflation_layer"
[ INFO] [1573087946.653130907]: Using plugin "inflation"
[ INFO] [1573087947.178700578]: Loading from pre-hydro parameter style
[ INFO] [1573087947.316662922]: Using plugin "obstacle_layer"
[ INFO] [1573087947.326947223]:     Subscribed to Topics: laser_scan_sensor
[ INFO] [1573087947.468756883]: Using plugin "inflation_layer"
[ INFO] [1573087947.700238669]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1573087947.763312661]: Sim period is set to 0.10
[ INFO] [1573087948.274035887]: Recovery behavior will clear layer obstacles
[ INFO] [1573087948.303863625]: Recovery behavior will clear layer obstacles
[ WARN] [1573087949.335088818]: Costmap2DROS transform timeout. Current time: 1573087949.3350, global_pose stamp: 1573087949.0834, tolerance: 0.2500
[ WARN] [1573087949.335235524]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087953.434619240]: Costmap2DROS transform timeout. Current time: 1573087953.4345, global_pose stamp: 1573087953.1831, tolerance: 0.2500
[ WARN] [1573087953.434737364]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087955.734798046]: Costmap2DROS transform timeout. Current time: 1573087955.7347, global_pose stamp: 1573087955.4833, tolerance: 0.2500
[ WARN] [1573087955.734975961]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087957.534812912]: Costmap2DROS transform timeout. Current time: 1573087957.5347, global_pose stamp: 1573087957.2832, tolerance: 0.2500
[ WARN] [1573087957.534987036]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087959.335271312]: Costmap2DROS transform timeout. Current time: 1573087959.3352, global_pose stamp: 1573087959.0830, tolerance: 0.2500
[ WARN] [1573087959.335383894]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087961.634437849]: Costmap2DROS transform timeout. Current time: 1573087961.6342, global_pose stamp: 1573087961.3830, tolerance: 0.2500
[ WARN] [1573087961.634587765]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087965.234703561]: Costmap2DROS transform timeout. Current time: 1573087965.2346, global_pose stamp: 1573087964.9830, tolerance: 0.2500
[ WARN] [1573087965.235687639]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087968.034693084]: Costmap2DROS transform timeout. Current time: 1573087968.0346, global_pose stamp: 1573087967.7830, tolerance: 0.2500
[ WARN] [1573087968.034813542]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087970.834876917]: Costmap2DROS transform timeout. Current time: 1573087970.8348, global_pose stamp: 1573087970.5830, tolerance: 0.2500
[ WARN] [1573087970.834979875]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087972.634555402]: Costmap2DROS transform timeout. Current time: 1573087972.6344, global_pose stamp: 1573087972.3830, tolerance: 0.2500
[ WARN] [1573087972.634692193]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087974.934144877]: Costmap2DROS transform timeout. Current time: 1573087974.9340, global_pose stamp: 1573087974.6830, tolerance: 0.2500
[ WARN] [1573087974.934268543]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087979.534668572]: Costmap2DROS transform timeout. Current time: 1573087979.5346, global_pose stamp: 1573087979.2830, tolerance: 0.2500
[ WARN] [1573087979.534819071]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087984.634461127]: Costmap2DROS transform timeout. Current time: 1573087984.6344, global_pose stamp: 1573087984.3830, tolerance: 0.2500
[ WARN] [1573087984.634564377]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087990.535022928]: Costmap2DROS transform timeout. Current time: 1573087990.5349, global_pose stamp: 1573087990.2752, tolerance: 0.2500
[ WARN] [1573087990.535157094]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087992.834766552]: Costmap2DROS transform timeout. Current time: 1573087992.8347, global_pose stamp: 1573087992.5752, tolerance: 0.2500
[ WARN] [1573087992.834898968]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087995.134185300]: Costmap2DROS transform timeout. Current time: 1573087995.1341, global_pose stamp: 1573087994.8752, tolerance: 0.2500
[ WARN] [1573087995.134283883]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573087997.434719665]: Costmap2DROS transform timeout. Current time: 1573087997.4346, global_pose stamp: 1573087997.1752, tolerance: 0.2500
[ WARN] [1573087997.434881248]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088003.335060473]: Costmap2DROS transform timeout. Current time: 1573088003.3350, global_pose stamp: 1573088003.0752, tolerance: 0.2500
[ WARN] [1573088003.335173931]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088005.639755425]: Costmap2DROS transform timeout. Current time: 1573088005.6397, global_pose stamp: 1573088005.3853, tolerance: 0.2500
[ WARN] [1573088011.040013350]: Costmap2DROS transform timeout. Current time: 1573088011.0398, global_pose stamp: 1573088010.7852, tolerance: 0.2500
[ WARN] [1573088015.635209861]: Costmap2DROS transform timeout. Current time: 1573088015.6351, global_pose stamp: 1573088015.3752, tolerance: 0.2500
[ WARN] [1573088015.635349569]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088017.439798439]: Costmap2DROS transform timeout. Current time: 1573088017.4397, global_pose stamp: 1573088017.1852, tolerance: 0.2500
[ WARN] [1573088021.538458480]: Costmap2DROS transform timeout. Current time: 1573088021.5383, global_pose stamp: 1573088021.2854, tolerance: 0.2500
[ WARN] [1573088021.538640188]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088025.634804063]: Costmap2DROS transform timeout. Current time: 1573088025.6346, global_pose stamp: 1573088025.3753, tolerance: 0.2500
[ WARN] [1573088025.635062770]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088027.439774111]: Costmap2DROS transform timeout. Current time: 1573088027.4397, global_pose stamp: 1573088027.1852, tolerance: 0.2500
[ WARN] [1573088028.734371457]: Costmap2DROS transform timeout. Current time: 1573088028.7341, global_pose stamp: 1573088028.4752, tolerance: 0.2500
[ WARN] [1573088028.734737790]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1573088028.935257075]: Please select an initial point for exploration inside the polygon
[ WARN] [1573088032.840004848]: Costmap2DROS transform timeout. Current time: 1573088032.8398, global_pose stamp: 1573088032.5852, tolerance: 0.2500
[ WARN] [1573088036.434240337]: Costmap2DROS transform timeout. Current time: 1573088036.4341, global_pose stamp: 1573088036.1654, tolerance: 0.2500
[ WARN] [1573088036.434371587]: Could not get robot pose, cancelling reconfiguration
[ INFO] [1573088037.392138028]: Sending goal
[ERROR] [1573088037.645868953]: Exception thrown while processing service call: Lookup would require extrapolation into the past.  Requested time 1573088024.536661179 but the earliest data is at time 1573088027.711413806, when looking up transform from frame [odom] to frame [map]
[ERROR] [1573088037.647243867]: Service call failed: service [/explore_server/explore_costmap/explore_boundary/update_boundary_polygon] responded with an error: Lookup would require extrapolation into the past.  Requested time 1573088024.536661179 but the earliest data is at time 1573088027.711413806, when looking up transform from frame [odom] to frame [map]
[ERROR] [1573088037.647459117]: Failed to set region boundary

Hi Łukasz,

Any help? :no_mouth:

Hi Łukasz,

Any update? :sob:

Hello aiubian,

Could you try to increase transform tolerance for costmap? It is in file local_costmap_params.yaml, change it from value 0.25 to 0.5. This should solve Costmap2DROS warning and subsequent error.

Regards,
Łukasz

1 Like

Hi Łukasz,

After changing the value 0.25 to 0.5, the system works perfectly.

Thanks a lot for your support.