0
$\begingroup$

Rosanswers logo

Forgive my naivety but i'm new to ROS so its all a bit strange to me. I followed the method provided in answers.ros.org/question/11363/how-to-generate-map-with-hector_slam-and-kinect/ and after fixing a few problems with deprecated stacks I was able to get the first launch file working. But the second launch file seems to raise the errors shown below.

When rivz is called no data changes on the map..

I can send a copy of the 2 launch files if it helps as I’m unable to paste them into this post

Has any one faced a similar or the same problem?

Any assistance would be much appreciated.

ERROR:-

c

[ERROR] [1353506787.385155113]: Trajectory Server: Transform from /map to /base_link failed: Frame id /base_link does not exist! Frames (11): Frame /camera_depth_frame exists with parent /camera_link.

Frame /camera_link exists with parent NO_PARENT.

Frame /camera_depth_optical_frame exists with parent /camera_depth_frame.

Frame /camera_rgb_optical_frame exists with parent /camera_rgb_frame.

Frame /camera_rgb_frame exists with parent /camera_link.

Frame /base_frame exists with parent /base_stabilized.

Frame /base_stabilized exists with parent /map.

Frame /openni_camera exists with parent /base_frame.

Frame /nav exists with parent /base_frame.

Frame /map exists with parent NO_PARENT.
 

    [ERROR] [1353506787.634790194]: Trajectory Server: Transform from /map to /base_link failed: Frame id /base_link does not exist! Frames (11): Frame /camera_depth_frame exists with parent /camera_link.
    
    Frame /camera_link exists with parent NO_PARENT.
    
    Frame /camera_depth_optical_frame exists with parent /camera_depth_frame.
    
    Frame /camera_rgb_optical_frame exists with parent /camera_rgb_frame.
    
    Frame /camera_rgb_frame exists with parent /camera_link.
    
    Frame /base_frame exists with parent /base_stabilized.
    
    Frame /base_stabilized exists with parent /map.
    
    Frame /openni_camera exists with parent /base_frame.
    
    Frame /nav exists with parent /base_frame.
    
    Frame /map exists with parent NO_PARENT.

Thanks!

Ben, I tried what you suggested and saw the following

$ rosrun tf view_frames
Listening to /tf for 5.000000 seconds
Done Listening
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored 

dot - graphviz version 2.26.3 (20100126.1600)

Detected dot version 2.26.3
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
frames.pdf generated

yes i am using fuerte.. and the pdf file has /map at the top followed by /base stablized, /base_frame then a split into /camera_link and /nav, the camera_link is connected to the Camera rgb and depth frame... Could it be that i have not included the right dependencies?

I looked at the set-up tutorial for hector slam and the launch files send the required parameters correctly..

Files can be found here:- dropbox.com/sh/7i5f3kcygtyud5q/2-w1HGYw6X.

Errors brought up when using Bens suggested code

   [ INFO] [1353684416.257402857]: lookupTransform base_footprint to /openni_depth_frame timed out. Could not transform laser scan into base_frame.
    [ERROR] [1353684416.339196772]: Trajectory Server: Transform from /map to /base_link failed: Frame id /map does not exist! Frames (8): Frame /camera_depth_optical_frame exists with parent /camera_depth_frame.
    Frame /camera_depth_frame exists with parent /camera_link.
    Frame /camera_link exists with parent NO_PARENT.
    Frame /camera_rgb_frame exists with parent /camera_link.
    Frame /camera_rgb_optical_frame exists with parent /camera_rgb_frame.
    Frame /openni_camera exists with parent /base_frame.
    Frame /base_frame exists with parent NO_PARENT.
     
    
    [ERROR] [1353684416.589315153]: Trajectory Server: Transform from /map to /base_link failed: Frame id /map does not exist! Frames (8): Frame /camera_depth_optical_frame exists with parent /camera_depth_frame.
    Frame /camera_depth_frame exists with parent /camera_link.
    Frame /camera_link exists with parent NO_PARENT.
    Frame /camera_rgb_frame exists with parent /camera_link.
    Frame /camera_rgb_optical_frame exists with parent /camera_rgb_frame.
    Frame /openni_camera exists with parent /base_frame.
    Frame /base_frame exists with parent NO_PARENT.

Update!

Good news every one! After reading through the Hector Slam set-up page I realised that the launch file was not defining a 'base_link' TF that Hector mapping needs. hence by adding an additional Tf and rearranging the Tfs to resemble the image in the tutorial i was able to get rid of the errors..

Yet this problem persists.. any ideas ??...

[ INFO] [1353684416.257402857]: lookupTransform base_footprint to /openni_depth_frame timed out. Could not transform laser scan into base_frame.

For those interested the new second launch file looks like this:

<launch>


<param name="pub_map_odom_transform" value="true"/> 
<param name="map_frame" value="map"/> 
<param name="base_frame" value="base_frame"/> 
<param name="odom_frame" value="base_frame"/>

<node pkg="tf" type="static_transform_publisher" name="map_2_base_footprint" args="0 0 0 0 0 0 /map /base_footprint 100"/> 
<node pkg="tf" type="static_transform_publisher" name="base_footprint_base_link" args="0 0 0 0 0 0 /base_footprint /base_link 100"/> 
<node pkg="tf" type="static_transform_publisher" name="base_link_2_base_stabilized_link" args="0 0 0 0 0 0 /base_link /base_stabilized 100"/> 
<node pkg="tf" type="static_transform_publisher" name="base_2_base_stablized_link" args="0 0 0 0 0 0 /base_stabilized /base_frame 100"/> 
<node pkg="tf" type="static_transform_publisher" name="base_2_laser_link" args="0 0 0 0 0 0 /base_frame /openni_camera 100"/> 
<node pkg="tf" type="static_transform_publisher" name="base_2_nav_link" args="0 0 0 0 0 0 /base_frame /nav 100"/>

<node pkg="rviz" type="rviz" name="rviz" args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.vcg"/>

<include file="$(find hector_mapping)/launch/mapping_default.launch"/> <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>

</launch>   

Originally posted by samarth.rajan on ROS Answers with karma: 56 on 2012-11-21

Post score: 1


Original comments

Comment by Ben_S on 2012-11-22:
That looks like a bug in tf. Did it generate a frames.pdf file? And which ROS version are you using? Fuerte?

Comment by samarth.rajan on 2012-11-22:
yes i am using fuerte.. and the pdf file has /map at the top followed by /base stablized, /base_frame then a split into /camera_link and /nav, the camera_link is connected to the Camera rgb and depth frame... Could it be that i have not included the right dependencies?

Comment by Ben_S on 2012-11-23:
Sounds good. As long as everything is connected its fine. You may have to change the base_frame parameter of hector_mapping to base_stabilized to get it working quick and dirty. But you should really consider building a valid tf tree for your robot and adapting the nodes to that one. :)

Comment by samarth.rajan on 2012-11-23:
I might be wrong.. but i was hoping to use hector slam and manually turn the kinect around rather than have a base robot. ill change the base frame parameter and get back to you.. thanks

Comment by Ben_S on 2012-11-23:
Ok, that should work if you make sure, that the only movements happen along the x- and y-axis and the only rotation is yaw (along the z-Axis). The fake-laser should always be parallel to the ground if you dont have an position sensor at hand.

Comment by samarth.rajan on 2012-11-23:
Ya i was planning to keep a constant Z axis but i still have the error? and Rviz still generates nothing.. because of the TF errors. :(

Comment by Ben_S on 2012-11-23:
Could you upload the generated frames.pdf and post your current launch-files? There has to be some error in the tf-configuration. You could also try to replace every apperance of ´base_stabilized´ with ´base_link`.

Comment by samarth.rajan on 2012-11-23:
I don’t have enough karam to upload it :( I could email them if its not too much of a bother! An error im seeing says: Transform from /map to /base_link failed: Frame id /base_link does not exist! ill try what youv said above

Comment by Ben_S on 2012-11-23:
You could use any of the popular 1-click hosters or dropbox and post the link. :)

Comment by samarth.rajan on 2012-11-23:
https://www.dropbox.com/sh/7i5f3kcygtyud5q/2-w1HGYw6X

Thanks a million!

Comment by Ben_S on 2012-11-23:
Please try the following part2.launch file: http://pastebin.com/H7D8iVxq

Comment by samarth.rajan on 2012-11-23:
Tried it but no luck, iv added the errors to the post. By any chance does are the transforms called from another package i may not have?

Comment by Stefan Kohlbrecher on 2012-11-27:
There still has to be an error in your tf tree. I can already warn you that hector_slam will not work well with the Kinect though, so you shouldn't get your hopes too high. The narrow FOV and high noise of the simulated laser scan are problematic.

Comment by samarth.rajan on 2012-11-27:
Stefan any ideas what im doing wrong? + i am aware its not going to work very well but im doing it as a first step in a project to show that it can be done but needs to be improved to work well with the kinect..

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Finaly fixed it :)

My understanding of ROS is still limited yet i was able to get it to work(one issue though). So it turns out that the code provided at the link below is a bit dated:

http://answers.ros.org/question/11363/how-to-generate-map-with-hector_slam-and-kinect

  • The openni_node has been deprecated, so the first line of Launch file 1 has to be changed.
  • The TFs need to be changed as the TFs are not connected in the code provided. I probably have more TFs that i need.

I am using this setup, to perform 2d slam using a hand held systems with no picth and roll along at a fixed height.

Find my launch files at:

I have the following stacks as extra dependencies in my package:

  • openni_launch
  • openni_camera
  • scanpointcloud_to_laserscan
  • hector_mapping
  • hector_geotiff
  • hector_trajectory_server
  • openni_camera_deprecated

Although this generates the first observation and map updates correctly, Ive found that the Kinect fake laser scan moves in the opposite direction to that actual camera motion so the map does not update properly beyond this point. So when rotating the camera clock wise the fake laser scan view moves counter clockwise.

Any ideas how to fix this anyone?

Cheers for your help.


Originally posted by samarth.rajan with karma: 56 on 2013-02-18

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by NAGALLA DEEPAK on 2018-01-24:
could you please send your launch files through google drive? I can not open pastebin

$\endgroup$

Your Answer

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