incorrect tf results
Hello
I tried to make a node that gives me the distance between the fixed point and the baselink over the time. But I get wrong distances. hould be in the range of 0 to some like 10 meters. But I got totaly uncenece datas.. like start from 5 and than go till 15 . So no cence results
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
Yes Sure
The output of
rosrun tf tf_echo /base_link /door1 is
At time 1301628270.947
- Translation: [4.651, 10.067, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.532, 0.847]
in RPY [0.000, 0.000, -1.122]
At time 1301628270.947
- Translation: [4.651, 10.067, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.532, 0.847]
in RPY [0.000, 0.000, -1.122]
At time 1301628270.947
- Translation: [4.651, 10.067, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.532, 0.847]
in RPY [0.000, 0.000, -1.122]
^CAt time 1301628270.947
- Translation: [4.651, 10.067, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.532, 0.847]
in RPY [0.000, 0.000, -1.122]
and the distance is
[ INFO] [1345720655.721469719, 1301628270.653578061]: Dist to Door1 =11.086891
[ INFO] [1345720655.868379126, 1301628270.793675137]: Dist to Door1 =11.087869
[ INFO] [1345720656.020382546, 1301628270.803828608]: Dist to Door1 =11.090092
[ INFO] [1345720656.039301088, 1301628270.950554490]: Dist to Door1 =11.090092
And the output of rosrun tf tf_echo /world /door1
At time 1301628270.978
- Translation: [4.500, 4.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
in RPY [0.000, -0.000, 0.000]
At time 1301628270.978
- Translation: [4.500, 4.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
in RPY [0.000, -0.000, 0.000]
At time 1301628270.978
- Translation: [4.500, 4.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
in RPY [0.000, -0.000, 0.000]
^CAt time 1301628270.978
- Translation: [4.500, 4.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
in RPY [0.000, -0.000, 0.000]
[ INFO] [1345721049.231849091, 1301628270.478065900]: Dist to Door1 =6.513392
[ INFO] [1345721049.371391812, 1301628270.634387495]: Dist to Door1 =6.513717
[ INFO] [1345721049.535096985, 1301628270 ...
What is the comment or answer of the question? I can not see it
Can you post the output of these commands?
... along with the distances you get (i.e., the output of your program)?
i just post it
Please always set the tags correctly to maximize the chance that the right people who can answer your question get notified.
Ok, How to set this tag???
You can retag your question by clicking the "retag" button.