ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Convert ros odometery orientation to pcl?

asked 2020-04-22 05:15:11 -0500

What i am doing is that i am trying to convert the odometry messages to pcl but i am unable to find a solution for conversion of orientation

void odomCallback (const nav_msgs::OdometryConstPtr& odomMsg) {

        double odomX = odomMsg->pose.pose.position.x;
        double odomY = odomMsg->pose.pose.position.y;
        double odomZ = odomMsg->pose.pose.position.z;

////////// double odomangle = tf::getYaw(odomMsg->pose.pose.orientation); covert this to pcl

        tf::TransformListener listener;
        tf::Stamped<tf::Point> mapPoint;
        listener.waitForTransform (MAP_FRAME, WORLD_FRAME, ros::Time (0), ros::Duration (0.5));
        tf::Stamped<tf::Point> odomPoint (tf::Point (odomX, odomY, odomZ), ros::Time (0), WORLD_FRAME);
        listener.transformPoint (MAP_FRAME, ros::Time (0), odomPoint, WORLD_FRAME, mapPoint);

    }

What i was able to do was converting the position of robot but i want the orientation as well.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-22 13:33:46 -0500

Use a tf::transform type instead, it has an orientation quaternion and the listener has a method for working with it

edit flag offensive delete link more

Comments

I was trying what you asked but there are compilation errors, Can you please describe it in detail.

Darthdevil gravatar image Darthdevil  ( 2020-06-20 05:46:34 -0500 )edit

Question Tools

Stats

Asked: 2020-04-22 05:15:11 -0500

Seen: 107 times

Last updated: Apr 22 '20