Tf has two or more unconnected trees. Error
Hello
I create the node that gives me the distance between the center of my robot which is my base link and some fixed point in the map. It was running and getting the correct distance but after a while (after playing differnt bag files) i start getting strange disttances I got this error at the begiing of calculation
Could not find a connection between '/base_link' and '/door2' because they are not part of the same tree.Tf has two or more unconnected trees.
This is my node
#include <ros/ros.h>
#include <tf/transform_listener.h>
int main(int argc, char** argv){
ros::init(argc, argv, "my_tf_listener");
ros::NodeHandle node;
tf::TransformListener listener;
ros::Rate rate(10.0);
while (node.ok())
{
tf::StampedTransform transform;
try{
listener.lookupTransform("/base_link", "/door1",
ros::Time(0), transform);
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
double x = transform.getOrigin().x();
double y = transform.getOrigin().y();
double dist1 = sqrt(x*x + y*y);
ROS_INFO("%f", dist1);
rate.sleep();
}
return 0;
};
And this the label in the launch file
<node pkg="tf" type="static_transform_publisher" name="door1" args="-1.25 4.5 0 0 0 0 /world /door1 10"/>
Any help???
This my frames.pdf
I add the pdf. frame. Any help?
You are now having a different problem that has nothing to do with the original question. Please open a new question.