position and orientation of the robot
Hello
I went through tf tutorial and some questions here (http://answers.ros.org/question/39250/getting-the-position-and-the-pose-of-robot-using-tf_listener/) . I assume that my robot is an rectangle so want to know the position of each corner point of my rectangle. So as I understand to get the position and orientation I need these two tf transforms. I wont the have the position and orientation of all four corner point of the rectangle . My rectangle have dimension 60x90cm . The center of the base_link frame is the center of the rectangle. So I know how the get the position of the center of my robot( rectangle)
double x = transform.getOrigin().x();
double y = transform.getOrigin().y();
Ao for the corner I need the rotation the yaw. tf::getYaw(transform.getRotation()); But how to get the conrner points , let we say A;B;C D of the robot(rectangle)
Any help?
Just like a comment. In my code to get the distance between the fixed point in the map and the center of the robot, center of the base link ( which is the centar of that rectangle I did not used a pose. I used this code. And think is ok. Schould I use pose or ok is with this?
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 dist = sqrt(x*x + y*y);
And in launch file i labeled the door like this
<node pkg="tf" type="static_transform_publisher" name="door1" args="1 0 0 0 0 0 /odom/door1 10"/>
That should be fine. But please open a new question for things that are not related to your original question.
ok. thanks