Ask Your Question
0

extracting orientation from Stage odometry using quaternions

asked 2012-11-16 04:39:51 -0500

ubisum gravatar image

hello everyone.

i'm writing a subscriber of a nav_msgs/Odometry topic where Stages writes its own messages. I can easily get x,y position of robot, while for its orientation i should elaborate quaternion included in each message. I know, from other tutorials, that i could solve problem by using

tf::getYaw(robot_pose.orientation)

where robot_pose.orientation is the quaternion contained in every generic message received. To make this work, i should add at the beginning of file

#include "tf/transform_listener"

but no header and no file is found with such name at compiling time. By using command

rospack find tf

i realized that i have tf package installed. I even built it through command rosmake. can you help me?

thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-11-16 07:12:47 -0500

Make sure your manifest.xml has the dependency to the tf package:

<depend package="tf"/>

Also, you might be missing the .h in your include:

#include "tf/transform_listener.h"

The getYaw method however is defined somewhere else, so I would use

#include "tf/transform_datatypes.h"

See tf API

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-11-16 04:39:51 -0500

Seen: 238 times

Last updated: Nov 16 '12