Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

uncorrect 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.pdfimage description

uncorrect 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.pdfimage description

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.pdfimage description

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

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.pdfimage description

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]

-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

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.pdfimage description

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

//

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.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.536815193, 1301628270.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.673510162, 1301628270.947420969]:  Dist to Door1 =6.513787

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.pdfimage description

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.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.536815193, 1301628270.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.673510162, 1301628270.947420969]:  Dist to Door1 =6.513787

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.pdfimage description

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.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.536815193, 1301628270.778485784]:  Dist to Door1 =6.513787
[ INFO] [1345721049.673510162, 1301628270.947420969]:  Dist to Door1 =6.513787

And from the rosrun tf tf_echo /world /base_link

At time 1301628270.947
- Translation: [4.850, 2.665, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.811, 0.586]
            in RPY [0.000, -0.000, 1.890]
At time 1301628270.947
- Translation: [4.850, 2.665, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.811, 0.586]
            in RPY [0.000, -0.000, 1.890]
At time 1301628270.947
- Translation: [4.850, 2.665, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.811, 0.586]
            in RPY [0.000, -0.000, 1.890]
^CAt time 1301628270.947
- Translation: [4.850, 2.665, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.811, 0.586]
            in RPY [0.000, -0.000, 1.890]

[ INFO] [1345721361.623291271, 1301628270.605040589]:  Dist to Door1 =1.868834
[ INFO] [1345721361.767260212, 1301628270.773273617]:  Dist to Door1 =1.869268
[ INFO] [1345721361.918387565, 1301628270.910657656]:  Dist to Door1 =1.868726
[ INFO] [1345721361.918494447, 1301628270.910657656]:  Dist to Door1 =1.868726