0
$\begingroup$

Rosanswers logo

Hello! I'm trying to use

roslaunch turtlebot_bringup kinect.launch

and then tb_amcl.launch ( it fires map server, move_base and amcl_turtlebot.launch ). I have a problem that AMCL does not produce the transform from /base_link to /map

Waiting on transform from /base_link to /map to become available before running costmap, tf error: 
 

I've seen this problem few times on answers.ros.org, but none of the results helped me. In rxconsole I noticed another problem, namely

Node: /amcl
Time: 1366709506.039584814
Severity: Warn
Location: /tmp/buildd/ros-fuerte-navigation-1.8.3/debian/ros-fuerte-navigation/opt/ros/fuerte/stacks/navigation/amcl/src/amcl_node.cpp:checkLaserReceived:540
Published Topics: /rosout, /tf, /amcl_pose, /particlecloud, /amcl/parameter_descriptions, /amcl/parameter_updates

No laser scan received (and thus no pose updates have been published) for 1366709506.039474 seconds.  Verify that data is being published on the /narrow_scan topic.

But when I run rostopic echo /narrow_scan this is what I get:

header: 
  seq: 1716
  stamp: 
    secs: 1366709470
    nsecs: 793361122
  frame_id: /camera_depth_frame
angle_min: -1.57079637051
angle_max: 1.57079637051
angle_increment: 0.00872664619237
time_increment: 0.0
scan_time: 0.0333333350718
range_min: 0.449999988079
range_max: 10.0
ranges: [11.0, (lots of numbers here...), 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0]
intensities: []
---

What can be wrong here? Is it the time stamp? Or maybe it's because /camera_depth_frame is not connected to /base_link ? But if that's the problem, how can I connect those frames? (I'm newbie when it comes to frames). Highly appreciate your help,

EDIT: It turned out, that I didn't publish any transformations between the robot and Kinect. To check if not publishing tf's is THE problem, I did:

In RVIZ set Fixed Frame to /odom, then in terminal I run:

rosrun tf static_transform_publisher 0 0 0 0 0 0 /base_link /camera_depth_frame 100

And now I'm able to move my robot around with amcl :) (But I'm going to publish transformations in a more elegant way, using URDF model).

Thanks all for help!

da-na


Originally posted by da-na on ROS Answers with karma: 306 on 2013-04-22

Post score: 0


Original comments

Comment by Hansg91 on 2013-04-23:
Is AMCL listening on /narrow_scan? I believe by default it will listen on /scan.

Comment by da-na on 2013-04-23:
Yes, it is, I'm sure. There's a line in launch file, specyfing that amcl listens to /narrow_scan

Comment by Pi Robot on 2013-04-23:
Could it be that /camera_depth_frame is not part of your robot's URDF model? Have a look at the TurtleBot model in /opt/ros/fuerte/stacks/turtlebot/turtlebot_description/urdf.

Comment by da-na on 2013-04-23:
when I looked into turtlebot_kinect.urdf.xacro, like you suggested, I can see there. It seems to be fine

Comment by da-na on 2013-04-24:
!!!! Actualy I haven't used any urdf model . To check if not publishing transforms is THE problem I used 'rosrun tf static_transform_publisher 0 0 0 0 0 0 /base_link /camera_depth_frame 10' and 'rosrun tf static_transform_publisher 0 0 0 0 0 0 /map /odom 100'. And now I can move my robot!

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I am experiencing kind of the same problem. Sometimes my tf transformation /odom published from amcl does not exist. And I say sometimes because this is what is mostly frustrating me that sometimes it works properly and I get the transformation and others don't. This dynamic transformation should be done automatically by the amcl so I do not know what it could be happening or how to fix it. I remap also the topic from scan to kinect_narrow_scan and I do not recive any message in rviz although I see the info when I read it with a rostopic echo /kinect_narrow_scan exactly the same way as you.

When it is working properly and I run a rosrun tf tf_monitor I see the following:

(other frames) Frame: /odom published by /amcl Average Delay: 0.0081728 Max Delay: 0.0597752

But sometimes I don't have this transformation published and rviz has the message that no tf transform exists between /map and /odom. I have been with this for about a month and I am not able to find any solution. ¿How does acml set the transformation between /map and /odom? ¿any ideas?

Thank you all!


Originally posted by agonzamart with karma: 88 on 2013-04-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by da-na on 2013-04-23:
If you're working on few computers, remember to run in every terminal 'export ROS_MASTER_URI=http://10.0.0.10:11311' and 'export ROS_IP=10.0.0.8' - maybe sometimes you forget about it, and that might be your problem?

Comment by agonzamart on 2013-04-23:
Thank you for the answer, but that can't be the problem because I have the variables sourced in the .bashrc from both computers.

Comment by agonzamart on 2013-04-25:
I think I have been able to solve the problem. I am launching different types of configurations for my robot to navigate autonomously, perhaps some parameters in the param server got mixed around, from other tests I perform and that's why sometimes I had the error and others don't. Now I basically check out that I am launching a new roscore in a window of my robot PC's every time I want to run a new check. Secondly I had a problem with the declaration of my tf's I was missing a tf transformation in the test from the kinect a transformation between /base_footprint and /base_link Now I have it working perfectly.

Comment by da-na on 2013-04-26:
so we had a similar problem :) great you could solve your problem

$\endgroup$

Your Answer

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