Ask Your Question
1

Hector Slam with Kinect - Error could not transform laser scan into base frame

asked 2012-11-21 02:50:11 -0600

samarth.rajan gravatar image

updated 2016-10-24 09:00:19 -0600

ngrennan gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

Comments

That looks like a bug in tf. Did it generate a frames.pdf file? And which ROS version are you using? Fuerte?

Ben_S gravatar imageBen_S ( 2012-11-22 22:26:36 -0600 )edit

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?

samarth.rajan gravatar imagesamarth.rajan ( 2012-11-22 22:30:31 -0600 )edit

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. :)

Ben_S gravatar imageBen_S ( 2012-11-22 23:19:42 -0600 )edit

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

samarth.rajan gravatar imagesamarth.rajan ( 2012-11-22 23:48:09 -0600 )edit

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.

Ben_S gravatar imageBen_S ( 2012-11-23 01:28:02 -0600 )edit

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. :(

samarth.rajan gravatar imagesamarth.rajan ( 2012-11-23 01:45:19 -0600 )edit

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`.

Ben_S gravatar imageBen_S ( 2012-11-23 01:52:12 -0600 )edit

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

samarth.rajan gravatar imagesamarth.rajan ( 2012-11-23 02:16:30 -0600 )edit

3 Answers

Sort by » oldest newest most voted
2

answered 2013-02-18 11:04:47 -0600

samarth.rajan gravatar image

updated 2013-02-18 11:06:51 -0600

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:

  • Launch File 1 - http://pastebin.com/VesCy68T
  • Launch File 2 - http://pastebin.com/gGHvRUTT

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.

edit flag offensive delete link more

Comments

could you please send your launch files through google drive? I can not open pastebin

NAGALLA DEEPAK gravatar imageNAGALLA DEEPAK ( 2018-01-24 09:53:55 -0600 )edit
0

answered 2013-02-20 19:00:54 -0600

As also talked about here (and another Q/A referenced there), hector_mapping currently does not work well with the Kinect. Due to time constraints, I also cannot look into improving things currently.

edit flag offensive delete link more

Comments

Ok thanks, Just wanted to know if anyone else faced this problem. Cheers though!

samarth.rajan gravatar imagesamarth.rajan ( 2013-02-21 10:46:54 -0600 )edit
0

answered 2012-11-21 03:10:27 -0600

Ben_S gravatar image

The transform from base to kinect is wrong. There should be only one frame without a parent (the root of the tree).

Change this in the second launch file: <node pkg="tf" type="static_transform_publisher" name="base_2_laser_link" args="0 0 0 0 0 0 /base_frame /openni_camera 100"/> to: <node pkg="tf" type="static_transform_publisher" name="base_2_laser_link" args="0 0 0 0 0 0 /base_frame /camera_link 100"/>

edit flag offensive delete link more

Comments

Hey cheers for your help, just a heads up, i got it working finally! any idea why my laser scan is moving in the wrong direction? Cheers!

samarth.rajan gravatar imagesamarth.rajan ( 2013-02-18 11:09:16 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-11-21 02:50:11 -0600

Seen: 4,179 times

Last updated: Feb 20 '13