0
$\begingroup$

Rosanswers logo

Hi,

I am using hokuyo UTM-30lx to do mapping using hector slam and i am facing a problem when running the hector slam. It shows the following message below:

[INFO][1389574162.6000311161]: lookupTransform base_stabilized to laser timed out. Could not transform laser scan into base_frame.

"Trajectory Server: Transform from /map to /base_link failed: Frame id /map does not exist! Frames (4): Frame /base_link exists with parent /base_stabilized. Frame /base_stabilized exists with parent NO_PARENT. Frame /laser exists with parent /base_link."

rostopic: 
/diagnostics 
/hokuyo/parameter_updates 
/hokuyo/parameter_descriptions 
/imu 
/initialpose 
/map 
/map_metadata 
/pose2D 
/poseupdate 
/rosout 
/rosout_agg 
/scan 
/slam_cloud 
/slam_out_pose 
/syscommand 
/tf 
/tf/tfMessage 
/trajectory

edited: laser scan cannot be seen if fixed frame is set to base_stabilized in rviz can be seen if fixed frame is set to base_link. target frame: laser

<launch>
<node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node" respawn="false" output="screen">
  

    <param name="calibrate_time" type="bool" value="true"/> 
    
    <!-- Set the port to connect to here -->
    <param name="port" type="string" value="/dev/ttyACM0"/> 
  
    <param name="intensity" type="bool" value="false"/>
    <param name="min_ang" value="-2.356194437"/>   
    <param name="max_ang" value="2.35619443"/>    
    <param name="cluster" value="1"/>
  </node>

  #### publish an example base_link -> laser transform ###########

  <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser" 
    args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /laser 40" />
  <node pkg="hector_imu_attitude_to_tf" type="imu_attitude_to_tf_node" name="imu_attitude_to_tf_node" output="screen">
    <remap from="imu_topic" to="thumper_imu" />
    <param name="base_stabilized_frame" type="string" value="base_stabilized" />
    <param name="base_frame" type="string" value="base_link" />
  </node>


<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
 <param name="pub_map_odom_transform" value="true"/>
 <param name="map_frame" value="map" />
 <param name="base_frame" value="base_stabilized" />
 <param name="odom_frame" value="base_stabilized" />
 <param name="output_timing" value="false"/>
 <param name="use_tf_scan_transformation" value="true"/>
 <param name="use_tf_pose_start_estimate" value="false"/>
 <param name="scan_topic" value="scan"/>
<!-- Map size / start point -->
<param name="map_resolution" value="0.025"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_update_distance_thresh" value="0.1" />
<param name="map_update_angle_tresh" value="0.3" />
<param name="laser_z_min_value" value="-1.0" />
<param name="laser_z_max_value" value="1.5" />
<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.7" />    
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="pub_map_odom_transform" value="true"/>
<!--
<param name="pub_drawings" value="true"/>
<param name="pub_debug_output" value="true"/>
-->
</node>
<param name="hector_mapping/pub_map_odom_transform" value="true"/>
<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch" />

</launch>

How do i solve this problem? Thanks in advance


Originally posted by saunders on ROS Answers with karma: 3 on 2014-01-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If this is happening only once or twice shortly after startup, this should not be a problem (and I´ll have to look into suppressing the message, as a few people got confused by this already, for example here). If the problem persists and you don´t get a map out of the system, your tf setup most likely is not correct. It seems you try to use the "/thumper_imu" topic to publish the roll and pitch angle of the robot to tf (a setup that I used on one of our robots some time ago). Is that intended? If not, you should have a look at the hector_slam setup tutorial and the links there to see how a proper tf setup can be done.


Originally posted by Stefan Kohlbrecher with karma: 24361 on 2014-01-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by saunders on 2014-01-07:
Hi, i am not sure what does the "" does but whether i include it or not the problem still persist. I understand that the tf relation as (map->odom->base_footprint->base_stabilized->base_link->laser). For my case i am using hector slam for quadrotor which does not have any odometry thus i presume that the tf relation is (map->base_stabilized->base_link->laser).

Comment by Stefan Kohlbrecher on 2014-01-08:
You have to have some way of providing the roll/pitch angles of your platform via tf. I did that in the example launch file by publishing IMU data on the "thumper_imu" topic. This probably is not published on your system.

Comment by saunders on 2014-01-08:
For the imu data, i am using the imu_attitude_to_tf_node. The problem i have is that i my imu data does not contain linear_acceleration_covariance and angular_velocity_covariance as my imu provides the euler angle x,y,z. What i did is i convert it to quaternion in order for me to use the imu_attitude_to_tf_node. So the imu data is a "customized" imu data but i had no idea what do i need to do for the angular_velocity_covariance and linear_acceleration_covariance so i basically set the first index of the two arrays to -1. Could that be the source of the problem?

Comment by Stefan Kohlbrecher on 2014-01-08:
No the imu_attitude_to_tf just uses the quaternion and publishes roll/pitch to tf, see code: http://docs.ros.org/hydro/api/hector_imu_attitude_to_tf/html/imu__attitude__to__tf__node_8cpp_source.html

Comment by saunders on 2014-01-09:
I did manage to get the imu_attitude_to_tf_node working and it successfully publish the base_stabilized. Since i am using hector mapping for odom and mapping itself, according to the setup the base_frame and odom_frame will be base_stabilized right? if it is correct i have no idea why hector mapping itself is not running correctly.

Comment by Stefan Kohlbrecher on 2014-01-09:
Yes, that should be correct. Can you update the original post with more information on what is not working?

Comment by saunders on 2014-01-14:
From tf viewframe it shows "base_stabilized->base_link->laser" It seems that the problem lies between the transform from map to base_stabilized.

Comment by Stefan Kohlbrecher on 2014-01-14:
So you are still getting the original error message posted in the original question, or something else?

Comment by saunders on 2014-01-15:
Yes, i am still getting the same error.

Comment by Stefan Kohlbrecher on 2014-01-16:
Have a look at this Q/A and try the same for your setup: http://answers.ros.org/question/116446/problem-with-tf-no-transform-from-laser_link-to-frame-odom/

Comment by saunders on 2014-01-16:
Thanks alot! Now the hector mapping works and the map seems to be working well. It appears that because my "imu message" is a customized version and does not have the time stamp.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.