[Solved] Timed out waiting for transform from base_link to map during map navigation

Hi,

I am new to rosbot, I tried to navigate a rosbot2.0 pro in a prescanned map as tutorial 9. But after I start the launch file, I always got the following error:

[ WARN] [1597199719.630242210]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.1007 timeout was 0.1.
[ WARN] [1597199724.736318078]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101086 timeout was 0.1.
[ WARN] [1597199729.771186731]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101048 timeout was 0.1.
[ WARN] [1597199734.803355013]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101032 timeout was 0.1.
[ WARN] [1597199736.880434488]: No laser scan received (and thus no pose updates have been published) for 1597199736.880186 seconds.  Verify that data is being published on the /scan topic.

Here is my start .launch file:
`

<arg name="use_rosbot" default="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>

<!-- ROSbot 2.0 -->
<!--<include if="$(arg use_rosbot)" file="$(find rosbot_ekf)/launch/all.launch"/>-->

<!-- ROSbot 2.0 PRO -->
<include file="$(find rosbot_ekf)/launch/all.launch" >
  <arg name="rosbot_pro" value="true" />
</include>

<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0 3.14 0 0 base_link laser 100" />

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

<!--<include file="$(find tutorial_pkg)/launch/map_server.launch"/>-->
<include file="map_server.launch" >
    <arg name="map_file" value="/home/husarion/docs/map/b001/map.yaml" />
</include>

<!--<include file="$(find tutorial_pkg)/launch/amcl_only.launch"/>-->
<include file="amcl_only.launch"/>

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

The other launch files, like ‘map_server.luanch’ nad 'amcl_only.launch are same as the tutorial.

Here is the node graph:

Can anyone help me? Thanks very much!

Hi,

Can you check that according to log message you got no data on /scan topic.

Also, can you provide screenshot of rqt_tf_tree (rosrun rqt_tf_tree rqt_tf_tree)

Best,
Adam Krawczyk

Hi, Adam,

Thanks a lot for your reply!

After reinstall the OS as descriped [ROSbot 2.0 PRO](http://ROSbot 2.0 PRO), I modified the launch file as:

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>

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

    <include file="$(find rplidar_ros)/launch/rplidar_a3.launch"></include>

    <include file="$(find rosbot_ekf)/launch/all.launch">
        <arg name="rosbot_pro" value="true"/>
    </include>

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

    <arg name="map_file" default="$(find tutorial_pkg)/maps/b001/map.yaml"/>       <!-- path of map file -->
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" respawn="true" />

    <node pkg="amcl" type="amcl" name="amcl" output="screen">
        <remap from="scan" to="scan"/>
        <param name="odom_frame_id" value="odom"/>
        <param name="odom_model_type" value="diff-corrected"/>
        <param name="base_frame_id" value="base_link"/>
        <param name="update_min_d" value="0.1"/>
        <param name="update_min_a" value="0.2"/>
        <param name="min_particles" value="500"/>
        <param name="global_frame_id" value="map"/>
        <param name="tf_broadcast" value="true" />
        <param name="initial_pose_x" value="0.0"/>
        <param name="initial_pose_y" value="0.0"/>
        <param name="initial_pose_a" value="0.0"/>
    </node>


    <param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
    <!-- Show in Rviz   -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find rosbot_description)/rviz/rosbot.rviz" required="true" output="screen"/>

</launch>

After roslaunch this file, the previous warning of “Timed out waiting for transform from base_link to map to become available” just promp out at the starting, and I got the robot and map visulized in the RViz, but in the console, other warnings keep prompt out, like:

[ WARN] [1597374571.715845860]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101226 timeout was 0.1.
[ WARN] [1597374572.237790611]: Failed to compute odom pose, skipping scan (Lookup would require extrapolation into the past.  Requested time 1597374564.341051631 but the earliest data is at time 1597374564.515260696, when looking up transform from frame [base_link] to frame [odom])
[ERROR] [1597374572.238138043]: Couldn't determine robot's pose associated with laser scan
[ WARN] [1597374572.238526010]: Failed to compute odom pose, skipping scan (Lookup would require extrapolation into the future.  Requested time 1597374564.416964697 but the latest data is at time 1597374564.360954193, when looking up transform from frame [base_link] to frame [odom])
[ERROR] [1597374572.238699495]: Couldn't determine robot's pose associated with laser scan
[ WARN] [1597374572.239035476]: Failed to compute odom pose, skipping scan (Lookup would require extrapolation into the future.  Requested time 1597374564.498614794 but the latest data is at time 1597374564.360954193, when looking up transform from frame [base_link] to frame [odom])
[ERROR] [1597374572.239220035]: Couldn't determine robot's pose associated with laser scan
[ WARN] [1597374572.294717880]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
[ WARN] [1597374579.620923663]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
[ WARN] [1597374590.344705682]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6070 seconds
[ WARN] [1597374590.778202316]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6406 seconds
[ WARN] [1597374591.170654150]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6330 seconds
[ WARN] [1597374591.585365532]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6477 seconds
[ WARN] [1597374591.971833276]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6342 seconds
[ WARN] [1597374592.377964018]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6403 seconds
[ WARN] [1597374592.769939835]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 0.6323 seconds
[ WARN] [1597374592.829456694]: Costmap2DROS transform timeout. Current time: 1597374592.8292, global_pose stamp: 1597374592.5690, tolerance: 0.2500
[ WARN] [1597374592.841147827]: Could not get robot pose, cancelling reconfiguration

The robot will also failed to navigation in the map even after the “2D Post Estimate” is done in the RViz, and set the “2D Nav Goal”

The tf tree by “rosrun tf view_frames” is as following:

Looking forward for your reply!

Okay,

So from some reason, you don’t have recent static transformations (base_link → imu / base_link → laser and so on)

My guesses are to.

  1. Sync time, try ntpd digitalocean-how-to

  2. Flash new firmware for core2 firmware

  3. Reinstall package static-transform-publisher using apt

  4. Try to use rosrun tf tf_monitor to inspect time delays

  5. You can use tf2_ros instead of tf (try only with laser and check if this helps) http://wiki.ros.org/tf2_ros

If none of steps above helps take a look at tf/Tutorials/Debugging tf problems - ROS Wiki

Best,
Adam

Hi, Adam,

Thanks a lot for your guidance!

for some other detail information, in my previous settings, my roscore is running on another virtual machine with ubuntu 16.04 and ros kinetic, and I set the

#export ROS_MASTER_URI=http://ip_of_master:11311
#export ROS_IP=ip_of_rosbot

With this setting, I always have the above mentioned warnings, and has no way to do the navigation in a map, even after I do the ntpdate to sync the time.

But after I restored ROS_MASTER_URI like:

export ROS_MASTER_URI=http://master:11311
export ROS_IPV6=on

I found I can navigate the robot in the map via RVIZ, but the warning of Control loop and Map update loop keep coming out like:

[ WARN] [1597743093.801539483]: Map update loop missed its desired rate of 5.0000Hz... the loop actually took 0.2397 seconds
[ WARN] [1597743093.901708645]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.1433 seconds
[ WARN] [1597743094.002353760]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.1439 seconds
[ WARN] [1597743094.032305507]: Map update loop missed its desired rate of 2.5000Hz... the loop actually took 1.0526 seconds
[ WARN] [1597743094.035482761]: Map update loop missed its desired rate of 5.0000Hz... the loop actually took 0.2736 seconds

And I also found the demo of

roslaunch route_admin_panel demo_rosbot_pro_mbed_fw.launch
always failed and waings kept coming out like

[ WARN] [1597744215.798315083]: Could not get transform between '/map' and '/base_link', will retry every second
[ WARN] [1597744216.809092375]: Could not get transform between '/map' and '/base_link', will retry every second
[ WARN] [1597744217.645967966]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100324 timeout was 0.1.

I’d like to get your help on two new questions:

  1. how can I eliminate the warning of Control loop and Map update loop?
  2. why didi the demo of route_admin_panel fail and how to bring it back?

Best Regards!

Hi,

Thank you for the details.

  1. Warnings like Map update loop missed its desired rate of *.*Hz ... are because of not enough computing power and are almost unavoidable. You can ignore them because it doesn’t affect system efficiency.

  2. We will investigate why demo_rosbot_pro_mbed_fw.launch is not working as intended.

Best,
Adam

Hi,

Unfortunately, we are not able to reproduce the error, the map always is being created.

To find the way out please do this steps.

  1. You got the ROS melodic installed - currently recommended OS Ubuntu 18.04 + ROS Melodic UpBoard

  2. You have flashed the new firmware you should have a script in the home directory flash_firmware.sh

  3. Attach full log - especially lines before this errors.

  4. Check the ping between all the machines.

Thank you.

Best,
Adam

Hi, Adam,

Please find my update of previous question!

Recently, I installed Ubuntu 16.04 + ROS Kinetic for Upboard on my rosbot 2.0 pro and connected it with roscore running on another ubuntu 16.04 machine (with ros-kinetic-desktop-full and dependencies installed).

Currently, I can control my robot to do map slam and map navigation. But there is a Extrapolation Error always poping up during the map location.

Hope to get your guidence about why this error happens and how to solve it!

The launch file is still like previous:

<launch>

    <arg name="use_rviz" default="true"/>

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>

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

    <include file="$(find rplidar_ros)/launch/rplidar_a3.launch"></include>

    <include file="$(find rosbot_ekf)/launch/all.launch">
        <arg name="rosbot_pro" value="true"/>
    </include>

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

    <arg name="map_file" default="$(find tutorial_pkg)/maps/map01/map.yaml"/>       <!-- path of map file -->
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" respawn="true" />

    <node pkg="amcl" type="amcl" name="amcl" output="screen">
        <remap from="scan" to="scan"/>
        <param name="odom_frame_id" value="odom"/>
        <param name="odom_model_type" value="diff-corrected"/>
        <param name="base_frame_id" value="base_link"/>
        <param name="update_min_d" value="0.1"/>
        <param name="update_min_a" value="0.2"/>
        <param name="min_particles" value="500"/>
        <param name="global_frame_id" value="map"/>
        <param name="tf_broadcast" value="true" />
        <param name="initial_pose_x" value="0.0"/>
        <param name="initial_pose_y" value="0.0"/>
        <param name="initial_pose_a" value="0.0"/>
    </node>


    <param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
    <node if="$(arg use_rviz)" name="rviz" pkg="rviz" type="rviz" output="screen" />

</launch>

Here is the full logs from the start of map navigation:

... logging to /home/husarion/.ros/log/287a565c-e808-11ea-9675-000c290fedfc/roslaunch-husarion-4223.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.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
xacro.py is deprecated; please use xacro instead
started roslaunch server http://192.168.28.77:34835/

SUMMARY
========

CLEAR PARAMETERS
 * /rosbot_ekf/

PARAMETERS
 * /amcl/base_frame_id: base_link
 * /amcl/global_frame_id: map
 * /amcl/initial_pose_a: 0.0
 * /amcl/initial_pose_x: 0.0
 * /amcl/initial_pose_y: 0.0
 * /amcl/min_particles: 500
 * /amcl/odom_frame_id: odom
 * /amcl/odom_model_type: diff-corrected
 * /amcl/tf_broadcast: True
 * /amcl/update_min_a: 0.2
 * /amcl/update_min_d: 0.1
 * /move_base/TrajectoryPlannerROS/acc_lim_Y: 1.5
 * /move_base/TrajectoryPlannerROS/acc_lim_theta: 5.0
 * /move_base/TrajectoryPlannerROS/acc_lim_x: 1.5
 * /move_base/TrajectoryPlannerROS/holonomic_robot: False
 * /move_base/TrajectoryPlannerROS/max_vel_theta: 2.5
 * /move_base/TrajectoryPlannerROS/max_vel_x: 0.1
 * /move_base/TrajectoryPlannerROS/meter_scoring: True
 * /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.25
 * /move_base/TrajectoryPlannerROS/min_vel_theta: -2.5
 * /move_base/TrajectoryPlannerROS/min_vel_x: 0.01
 * /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.1
 * /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.05
 * /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
 * /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.01
 * /move_base/global_costmap/robot_base_frame: base_link
 * /move_base/global_costmap/rolling_window: True
 * /move_base/global_costmap/static_map: False
 * /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: 1.0
 * /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
 * /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.01
 * /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
 * /robot_description: <?xml version="1....
 * /rosbot_ekf/acceleration_gains: [0.8, 0.0, 0.0, 0...
 * /rosbot_ekf/acceleration_limits: [1.3, 0.0, 0.0, 0...
 * /rosbot_ekf/base_link_frame: base_link
 * /rosbot_ekf/control_config: [True, False, Fal...
 * /rosbot_ekf/control_timeout: 0.2
 * /rosbot_ekf/debug: False
 * /rosbot_ekf/debug_out_file: /path/to/debug/fi...
 * /rosbot_ekf/deceleration_gains: [1.0, 0.0, 0.0, 0...
 * /rosbot_ekf/deceleration_limits: [1.3, 0.0, 0.0, 0...
 * /rosbot_ekf/frequency: 20
 * /rosbot_ekf/imu0: imu
 * /rosbot_ekf/imu0_config: [False, False, Fa...
 * /rosbot_ekf/imu0_differential: True
 * /rosbot_ekf/imu0_linear_acceleration_rejection_threshold: 0.8
 * /rosbot_ekf/imu0_nodelay: False
 * /rosbot_ekf/imu0_pose_rejection_threshold: 0.8
 * /rosbot_ekf/imu0_queue_size: 4
 * /rosbot_ekf/imu0_relative: True
 * /rosbot_ekf/imu0_remove_gravitational_acceleration: True
 * /rosbot_ekf/imu0_twist_rejection_threshold: 0.8
 * /rosbot_ekf/initial_estimate_covariance: ['1e-9', 0, 0, 0,...
 * /rosbot_ekf/map_frame: map
 * /rosbot_ekf/odom0: odom/wheel
 * /rosbot_ekf/odom0_config: [True, True, True...
 * /rosbot_ekf/odom0_differential: False
 * /rosbot_ekf/odom0_nodelay: False
 * /rosbot_ekf/odom0_queue_size: 6
 * /rosbot_ekf/odom0_relative: True
 * /rosbot_ekf/odom_frame: odom
 * /rosbot_ekf/print_diagnostics: True
 * /rosbot_ekf/process_noise_covariance: [0.05, 0, 0, 0, 0...
 * /rosbot_ekf/publish_acceleration: False
 * /rosbot_ekf/publish_tf: True
 * /rosbot_ekf/sensor_timeout: 0.2
 * /rosbot_ekf/stamped_control: False
 * /rosbot_ekf/transform_time_offset: 0.0
 * /rosbot_ekf/transform_timeout: 0.0
 * /rosbot_ekf/two_d_mode: False
 * /rosbot_ekf/use_control: True
 * /rosbot_ekf/world_frame: odom
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /rplidarNode/angle_compensate: True
 * /rplidarNode/frame_id: laser
 * /rplidarNode/inverted: False
 * /rplidarNode/scan_mode: Sensitivity
 * /rplidarNode/serial_baudrate: 256000
 * /rplidarNode/serial_port: /dev/ttyUSB0
 * /serial_node/baud: 460800
 * /serial_node/port: /dev/ttyS4

NODES
  /
    ROSbot_laser (tf/static_transform_publisher)
    amcl (amcl/amcl)
    imu_publisher (tf/static_transform_publisher)
    map_server (map_server/map_server)
    move_base (move_base/move_base)
    msgs_conversion (rosbot_ekf/msgs_conversion)
    robot_state_publisher (robot_state_publisher/state_publisher)
    rosbot_ekf (robot_localization/ekf_localization_node)
    rplidarNode (rplidar_ros/rplidarNode)
    serial_node (rosserial_python/serial_node.py)

ROS_MASTER_URI=http://192.168.28.11:11311

process[robot_state_publisher-1]: started with pid [4235]
process[ROSbot_laser-2]: started with pid [4236]
process[rplidarNode-3]: started with pid [4238]
process[serial_node-4]: started with pid [4244]
process[msgs_conversion-5]: started with pid [4246]
process[rosbot_ekf-6]: started with pid [4249]
process[imu_publisher-7]: started with pid [4255]
process[move_base-8]: started with pid [4257]
process[map_server-9]: started with pid [4261]
process[amcl-10]: started with pid [4265]
[ INFO] [1598494210.944708866]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
[INFO] [1598494211.390438]: ROS Serial Python Node
RPLIDAR S/N: AFED9A87C5E392D2A5E492F83F38316C
[ INFO] [1598494211.449502870]: Firmware Ver: 1.27
[ INFO] [1598494211.449684786]: Hardware Rev: 6
[ INFO] [1598494211.450895987]: RPLidar health status : 0
[INFO] [1598494211.543528]: Connecting to /dev/ttyS4 at 460800 baud
[ INFO] [1598494212.113273543]: current scan mode: Sensitivity, max_distance: 25.0 m, Point number: 15.9K , angle_compensate: 4
[INFO] [1598494213.693532]: Note: publish buffer size is 768 bytes
[INFO] [1598494213.765040]: Setup service server on config [rosbot_ekf/Configuration]
[ INFO] [1598494213.778840642]: Requesting the map...
[INFO] [1598494213.855754]: Setup publisher on battery [sensor_msgs/BatteryState]
[INFO] [1598494213.897259]: Setup publisher on pose [geometry_msgs/PoseStamped]
[ INFO] [1598494213.897598936]: Received a 2016 X 3136 map @ 0.010 m/pix

[INFO] [1598494213.918378]: Setup publisher on velocity [geometry_msgs/Twist]
[INFO] [1598494213.950998]: Setup publisher on range/fr [sensor_msgs/Range]
[INFO] [1598494213.984342]: Setup publisher on range/fl [sensor_msgs/Range]
[INFO] [1598494214.008144]: Setup publisher on range/rr [sensor_msgs/Range]
[INFO] [1598494214.026590]: Setup publisher on range/rl [sensor_msgs/Range]
[INFO] [1598494214.059805]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1598494214.097131]: Setup publisher on mpu9250 [rosbot_ekf/Imu]
[INFO] [1598494214.116677]: Setup publisher on buttons [std_msgs/UInt8]
[INFO] [1598494214.121338]: Note: subscribe buffer size is 768 bytes
[INFO] [1598494214.171134]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1598494214.183112]: 

 ______  _____  _____  _             _           __
 | ___ \|  _  |/  ___|| |           | |         / _|
 | |_/ /| | | |\ `--. | |__    ___  | |_       | |_ __      __
 |    / | | | | `--. \| '_ \  / _ \ | __|      |  _|\ \ /\ / /
 | |\ \ \ \_/ //\__/ /| |_) || (_) || |_       | |   \ V  V / 
 \_| \_| \___/ \____/ |_.__/  \___/  \__|      |_|    \_/\_/ 

 Firmware version: 0.10.1


[ INFO] [1598494214.919235643]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1598494217.802027151]: Done initializing likelihood field model.
[ERROR] [1598494435.694541676]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494425.659580946, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494436.714969160]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494426.679581165, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494437.715043870]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494427.639765024, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494438.715461080]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494428.659765005, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494439.794365650]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494429.744091034, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494440.795205963]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494430.764091015, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494441.814515703]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494431.724091053, when looking up transform from frame [base_link] to frame [map]

[ERROR] [1598494442.815033431]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past.  Requested time 1598494425.615524550 but the earliest data is at time 1598494432.740044117, when looking up transform from frame [base_link] to frame [map]

......

the output of rosrun tf view_frames is like:

In the map location, I used MoveBaseGoal to set the target location and tf.TransformListener to get the robot location in the map like:

##set the target location
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = 'map'
goal.target_pose.header.stamp = rospy.Time.now()
goal.target_pose.pose = Pose(Point(pos['x'], pos['y'], 0.000),
                                 Quaternion(quat['r1'], quat['r2'], quat['r3'], quat['r4']))
self.move_base.send_goal(goal)


##get the location
istener.waitForTransform("/map", "/base_link", rospy.Time(0), rospy.Duration(10.0))
trans, rot = listener.lookupTransform("/map", "/base_link", rospy.Time(0))

The map navigation and location can succeed even if when Extrapolation Error happens, here is a log of the robot naviagtion and location:

INFO - Wait for the action server to come up
[INFO] [1598494719.996265]: Go to (0, 0) pose
INFO - target_pose: 
  header: 
    seq: 0
    stamp: 
      secs: 1598494719
      nsecs: 998287916
    frame_id: "map"
  pose: 
    position: 
      x: 0
      y: 0
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
INFO - arrived!!!
[INFO] [1598494744.724462]: Hooray, reached the desired pose
Warning: TF_OLD_DATA ignoring data from the past for frame laser at time 1.59849e+09 according to authority /robot_state_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 277 in /tmp/binarydeb/ros-kinetic-tf2-0.5.20/src/buffer_core.cpp
INFO - current position -- x:0.0474696515822, y:0.0722862027887

Thanks!

Hi,

Good to hear that it’s working now.

As far I know rosdep update can’t cause that kind of error. Try run rosdep update and see whether problem occurs.

Sometimes working kinetic <=> melodic can generate some strange errors but generally it works. From my experience this kind of error usually is linked to CPU load or network latency.

Best,
Adam

Hi, Adam,

I just update my quetion in last post! Please kindly find it! And Hope to get your guidance!

BTW, besides of the ROS version changed to Kinetic, I also changed the firmware to v0.10.1.

Thanks!

Hi,

I found the reason why code it wasn’t working, the problem was with rplidar launch. To be exact we got missing param frame_id in the provided launch. This should be done as follows.

<node if="$(arg use_rosbot)" pkg="rplidar_ros" type="rplidarNode" name="rplidar">
       <param name="angle_compensate" type="bool" value="true"/>
	<param name="frame_id" type="string" value="laser"/>
        <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>

AMCL checks whether frame_id matches but we got default frame_id which was laser_frame.

The patch is already on tutorial_pkg and soon documentation will be updated.

[Explanation] It started working for you because you have changed rplidar launch to

<include file="$(find rplidar_ros)/launch/rplidar_a3.launch"></include>

which got this param.

Hope now everything will works as expected.

Thank you for your time.

Best,
Adam

Hi, Adam,

Thanks very much for your help!

for the error I mentioned in

I tried to solved it by rospy.Time.now() to rospy.Time(0), but I wondering if it is right?

BTW, I am now trying to do the multirobot navigation by namespace, but encountered some errors, I post another article Multirobots navigation with namespace failed to seek help. Would you please have a check and give me some guidance!

Thanks very much!

Hi,

  1. I think the problem is connected to multiple tf publishers. Rosbot model got transform form base_link to laser. I suspect that this is the problem. To solve simply remove/comment static transform publisher base_link -> laser from launch file.

  2. I will publish a reply here.

Best,
Adam