Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive Euler angle instead of quaternion angle from Vicon bridge package #15

Open
zer1988 opened this issue Apr 24, 2017 · 8 comments
Open

Comments

@zer1988
Copy link

zer1988 commented Apr 24, 2017

Hi every body,
I would like to know that what i have to edit inside vicon bridge packet so that I receive the Euler angles ( roll, pitch and yaw) instead of quaternion angles ( x, y,z, w).
Thanks

@marco-tranzatto
Copy link

Why would you do that? Why can't you directly convert a quaternion to euler angles directly in your application, for example by using Eigen?

@zer1988
Copy link
Author

zer1988 commented Apr 24, 2017

Hi friend,
In my case I would like to control my drone with Euler angles that may be received using GlobalEurlerRoatation from ViconDataStreamSDK. Therefore, I prefer to use euler angles instead of quaternion angles. I can use Eigen to convert (TF or TF2 library) but it is not good for the asynchronous problem between different machines.
Thanks

@marco-tranzatto
Copy link

I still don't see why you want to implement the conversion between quaternion and euler angles directly in this repo. You can use the same timestamp and convert the quaternion to euler angles in the callback function of your drone, when you receive ad odometry message from vicon for example ... or am I missing something else?

@zer1988
Copy link
Author

zer1988 commented Apr 24, 2017

Hi Marco,
I used to use TF library (Eigen and getrpy) in order to convert quaternion angles into Eurler angles for a IMU sensor and I read successfully roll pitch and yaw angles. However, when I used roslaunch for remote machines, a message relative to TF function (Error: TF_OLD_DATA) appeared every 0.1 seconds and made my network overload. Here are some references (http://wiki.ros.org/tf/Errors%20explained). Therefore, I had to convert directly quaternion angles into eurler angles and it worked quite well for IMU sensor. However, I would like to receive Euler angles directly from Vicon instead of using this code two times (one for imu and one for vicon) while they are subscribed from the topic /vicon/... .

@kdhansen
Copy link
Contributor

Like Marco, I don't really understand why you cannot convert to Euler angles after the vicon_bridge. However, you need to modify the process_frames function in vicon_bridge.cpp. The msvcbridge has a function getSegmentEulerXYZ that you could use instead of getSegmentQuaternion.

Hope it helps.

@zer1988
Copy link
Author

zer1988 commented Apr 24, 2017

Hi kdhansen,
Yes, I saw the functinon getSegmentEulerXYZ in msvcbridge and i can edit it in process_subjects. My version of ros is Indigo. Can you tell me some places more I have to edit also? or if I want to keep tf::transform because the setorientation is used in quaternion and then use my own code to convert quaternion to eurler angles, what should I edit more ? Thanks.

@kdhansen
Copy link
Contributor

Well, just go ahead and advertise another topic with the Euler angles. E.g. use Eigen as Marco pointed out. Here is an example: http://stackoverflow.com/questions/31589901/euler-to-quaternion-quaternion-to-euler-using-eigen

Best of luck

@marco-tranzatto
Copy link

@zer1988 I think the error TF_OLD_DATA can be related to the fact that the two machines are not synchronized in time. Other than the solution pointed out by Karl, I'd suggest you try to use chrony to synchronize your machines ;)

Nevertheless, since converting a quaternion to euler angles is so easy with Eigen, I'd still do it after the vicon_bridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants