tf error: could not find connection between world and odom...

asked 2015-06-28 23:51:21 -0500

creative_cimmons gravatar image

updated 2015-06-29 02:00:58 -0500

Miquel Massot gravatar image

Hello,

I am trying to make hector quadrotor use viso2_ros ,, after having configured correctly ( mono_odometer of viso2_ros takes in image from front_cam of hector) , I got warning that viso2_ros couldn't find the mapping base_link to front_cam_optical_frame and in the rviz of hector simulation, when I tried to add show pose parameter , it outputted 'couldn't find connection between world and odom...'

ok now I checked using tf view_frames

and this is what I got

image description

ok maybe it was because of the lack of link between base_link and fornt_cam_optical_frame,,

I linked both using some code

#include <ros/ros.h>
  #include <tf/transform_broadcaster.h>

  int main(int argc, char** argv){
 ros::init(argc, argv, "hector_remapping_tf");
 ros::NodeHandle n;

ros::Rate r(100);

 tf::TransformBroadcaster broadcaster;

 while(n.ok()){
   broadcaster.sendTransform(
     tf::StampedTransform(
       tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.0, 0.0, -0.2)),
       ros::Time::now(),"base_link", "front_cam_optical_frame"));
   r.sleep();
 }
}

now the warning of lack of base_link to front_cam_optical_frame was gone but still the world and odom frame are not linked (checked using tf view_frames and rviz)

edit retag flag offensive close merge delete

Comments

2

Do you have a localization node running (e.g. amcl)? viso2_ros does, as far as I realize, only provide visual odometry, i.e. the /odom -> /base_link transform. Thus you need a node which provides the /world or /map (whatever it's called in your case) -> /odom transform.

mgruhler gravatar imagemgruhler ( 2015-06-29 00:52:26 -0500 )edit

mig, as i wont't have any drift errors ( UAV ) i thought of mapping map frame to odom frame instead of localization. ( unfortunately amcl only supports if its sensor is LIDAR based). Is there any easy route or do I have to write a listener-publisher of frames.

creative_cimmons gravatar imagecreative_cimmons ( 2015-07-08 18:26:45 -0500 )edit

ok i guess I found it, it was simple assignment of param values. param name="odom_frame" value="odom"/ param name="world_frame" value="odom"/

creative_cimmons gravatar imagecreative_cimmons ( 2015-07-08 18:52:46 -0500 )edit

jep, this would work.

mgruhler gravatar imagemgruhler ( 2015-07-10 00:56:43 -0500 )edit