Problem using several transformation
Hi,
I want to do 3D textured reconstruction. To this I did a small state of the art and now want to do this using ros. I want to use ORBSLAM2 for the localisation and I found the package chisel_ros to do the rest of the work (https://github.com/personalrobotics/OpenChisel). I changed a bit orbslam to publish the transformation cam to world (in fact the tf depth -> map and the tf wolor->map which are the same) through a tf broadcaster as following :
tf::TransformBroadcaster br;
tf::Transform transform;
...
geometrymsgs::Quaternion q = cvRot2Quat(camtoworld); transform.setOrigin(tf::Vector3(camtoworld.at
(0,3), cam toworld.at(1,3), cam to_world.at(2,3)) ); transform.setRotation( tf::Quaternion(q.x, q.y, q.z, q.w) ); br.sendTransform(tf::StampedTransform(transform, cvptrD->header.stamp, "/cameradepth_ref", "map"));
br.sendTransform(tf::StampedTransform(transform, cvptrRGB->header.stamp, "/camerabrg_ref", "map"));
On the chiesel side a ros server is emplemented and received tf message like this (same way to do for color and depth transform) :
transformListener.waitForTransform(colorCamera.transform, baseTransform, colorImage.header.stamp, ros::Duration(0.5));
transformListener.lookupTransform(colorCamera.transform, baseTransform, colorImage.header.stamp, tf);
std::cout << "COLOR -- transform read" << std::endl;
But when I'm running all of this chiesel (the ros server part) display "[ WARN] [1501769809.122784924]: Could not find a connection between 'camerabrgref' and 'map' because they are not part of the same tree.Tf has two or more unconnected trees." or for the depth"[ WARN] [1501769803.905113498]: Could not find a connection between 'cameradepthref' and 'map' because they are not part of the same tree.Tf has two or more unconnected trees."
I tried to use rosrun tf view_frames when I publish only the depth tf, only the color tf ad finally the both color and depth tf (as they are screenshot there are my two screen, the figure is on the right side).
Could you say me where does it come from ?
---- EDIT ---
As the figure with both depth and color shows only 1 arrow I was looking for a problem in the tree tf. The error was just that I invert the /name in the " br.sendTransform". So I replaced
br.sendTransform(tf::StampedTransform(transform,cvptrRGB->header.stamp, "/camerabrg_ref", "map"));
by
br.sendTransform(tf::StampedTransform(transform, cvptrRGB->header.stamp, "map", "camerabrg_ref"));
to make it work.
Asked by Bastienm on 2017-08-03 09:58:26 UTC
Comments
Please attach the screenshots directly to this post. I've given you enough karma to do so.
Asked by gvdhoorn on 2017-08-03 10:14:00 UTC