Robotics StackExchange | Archived questions

ros navigation stack - tf problems.

Hi all, im trying to implement ros navigation stack on 4 wheel robot

my system built from arduino to control the motors with cmd_vel topic and im running ros noetic on raspberry pi 4(ubiquity version)

the sensor I'm using is rplidar a1 and I'm doing the mapping with hector-slam

when I'm trying to auto-navigate the robot with the served map, I get tf errors that I can't manage to solve,

I'd appreciate some guidance on how to approach the problems

including my tf tree and the navigation launch file

thank's in advance.

tf tree: link text

launch file:

<!-- Run teleop -->
<include file="$(find electrobot)/launch/electrobot_teleop.launch"/>

<!-- Run lidar. -->
<arg name="node_start_delay" default="5.0" />  

<!-- Run the map server --> 
<node name="map_server" pkg="map_server" type="map_server" args="$(find electrobot)/maps/blackroom2.pgm 0.05"/>

<!-- Add transformations. -->

<!-- 
    HECTOR STUFF. 
-->

<!-- Change below!! Used to be true. -->

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<param name="pub_odometry" value="$(arg pub_odometry)"/>

<!-- Frame names -->
<remap from="map" to="mapcurrent" />
<param name="map_frame" value="mapcurrent_frame" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />

<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />

<!-- Map update parameters -->
<param name="update_factor_free" value="0.2"/>
<param name="update_factor_occupied" value="0.9" />    
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />

<!-- Advertising config --> 
<param name="advertise_map_service" value="true"/>

<param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>

<!-- Debug parameters -->
<!--
  <param name="output_timing" value="false"/>
  <param name="pub_drawings" value="true"/>
  <param name="pub_debug_output" value="true"/>
-->
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />

<!-- 
    AMCL stuff.
 -->
<node pkg="amcl" type="amcl" name="amcl">
    <param name="tf_broadcast" value="true" />
    <param name="base_frame_id" value="base_link" />
    <param name="global_frame_id" value="map" />
    <param name="odom_frame_id" value="scanmatch_odom" />
    <param name="use_map_topic" value="false" />

    <remap from="scan" to="scan" />
    <param name="odom_model_type" value="diff" />
    <param name="transform_tolerance" value="0.5" />
    <param name="gui_publish_rate" value="-1.0"/>
    <param name="laser_max_beams" value="30"/>
    <param name="laser_max_range" value="29.5"/>
    <param name="min_particles" value="3"/>
    <param name="max_particles" value="20"/>
    <param name="update_min_d" value="0.01"/>
    <param name="kld_err" value="0.01"/>
    <param name="kld_z" value="0.99"/>
    <param name="odom_alpha1" value="0.2"/>
    <param name="odom_alpha2" value="0.2"/>
    <param name="odom_alpha3" value="0.2"/>
    <param name="odom_alpha4" value="0.2"/>
    <param name="odom_alpha5" value="0.2"/>
    <param name="laser_z_hit" value="0.95"/>
    <param name="laser_z_short" value="0.1"/>
    <param name="laser_z_max" value="0.05"/>
    <param name="laser_z_rand" value="0.05"/>
    <param name="laser_sigma_hit" value="0.2"/>
    <param name="laser_lambda_short" value="0.1"/>
    <param name="laser_model_type" value="likelihood_field"/>
    <param name="laser_likelihood_max_dist" value="2.0"/>
    <param name="update_min_a" value="0.5"/>
    <param name="resample_interval" value="2"/>
    <param name="transform_tolerance" value="0.2"/>
    <param name="recovery_alpha_slow" value="0.0"/>
    <param name="recovery_alpha_fast" value="0.0"/>
  </node> 

<!-- Run odom transformer. Credit goes to https://github.com/ne0h/hmmwv/blob/master/ros_workspace/src/hmmwv/launch/odomtransformer.launch -->
<!-- <include file="$(find electrobot)/launch/odomtransformer.launch"/>
-->

error:

                                         [ WARN] [1684427202.546229540]: Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.2964 seconds
   [ WARN] [1684427202.861793968]: Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.3158 seconds
                                             [ WARN] [1684427203.114603806]: Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.2528 seconds
       [ERROR] [1684427203.116138176]: Extrapolation Error: Lookup would require extrapolation 0.063063934s into the future.  Requested time 1684427203.064594746 but the latest data is at time 1684427203.001530886, when looking up transform from frame [scanmatch_odom] to frame [map]

                                           [ERROR] [1684427203.116340081]: Global Frame: scanmatch_odom Plan Frame size 190: map

                                                [ WARN] [1684427203.116925092]: Could not transform the global plan to the frame of the controller
                                                                  [ WARN] [1684427204.052524066]: Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.2879 seconds
                            [ERROR] [1684427204.053191743]: Extrapolation Error: Lookup would require extrapolation 0.038872486s into the future.  Requested time 1684427204.022427559 but the latest data is at time 1684427203.983555079, when looking up transform from frame [scanmatch_odom] to frame [map]

                                                                [ERROR] [1684427204.053443721]: Global Frame: scanmatch_odom Plan Frame size 184: map

                                                                     [ WARN] [1684427204.053636941]: Could not transform the global plan to the frame of the controller
       [ WARN] [1684427204.352773327]: Transform timeout for global_costmap. Current time: 1684427204.3526, pose stamp: 1684427204.0224, tolerance: 0.3000
                                                                          ^C[ERROR] [1684427204.703257998]: Extrapolation Error: Lookup would require extrapolation 0.007542548s into the future.  Requested time 1684427204.691305637 but the latest data is at time 1684427204.683763027, when looking up transform from frame [scanmatch_odom] to frame [map]

[ERROR] [1684427204.703536957]: Global Frame: scanmatch_odom Plan Frame size 184: map

[ WARN] [1684427204.703680641]: Could not transform the global plan to the frame of the controller

Asked by Amarsahar on 2023-05-18 11:51:32 UTC

Comments

Answers

Your TF tree seems to be broken/not connected properly; try following this thread https://answers.ros.org/question/10099/issues-with-tf-understandingnavigation-stack/

Asked by satvikgupta on 2023-06-08 02:38:12 UTC

Comments