Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by HiteshSharma · Apr 22, 2014 at 04:48 PM · rotationrotate objectavatartiltmocap

Rotation issue when applying live streaming mocap data from Polhemus G4

I am working on a Virtual Reality project where I am reading the motion data from Polhemus G4 tracker and apply this data to a game object (an Avatar) in Unity. Polhemus send 6 data values(3 for position xyz and 3 for rotation azimuth, elevation & roll)

The Unity (X,Y,Z) co-ordinates corresponds to the (Y, -Z, X) of the Polhemus. I am able to apply the data values correctly but end up with an issue in rotation. When I hold the Polhemus Sensor in vertical position (Attached image), my Avatar appears laid horizontally. I did a work-around for this by applying some boresighting in Polhemus APIs. I am looking for a better way if this is possible through Unity?

Also when I rotate the sensor left/right holding it same in vertical position, my Avatar gives huge tilt and start leaning horizontally. I tried both for Euler & Quaternions. I am using the following code for rotation:

gameObject.transform.localRotation = Quaternion.Euler(new Vector3(0, y, 0))*Quaternion.Euler(new Vector3(x, 0, 0))*Quaternion.Euler(new Vector3(0, 0, -z));

I am sure there are people who have already done these things in Unity. Please help me to get through this one.

Thanks in advance :)

[1]: /storage/temp/25575-attachment.png

attachment.png (366.6 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sidhants1 · Jun 06, 2014 at 09:41 PM 0
Share

Hi Hitesh, I am starting to work with Unity. I have a Polhemus G4 and I want to apply tracking data to a model in my game. I have the G4 hardware and the Polhemus SD$$anonymous$$ installed. How should I go about this integration so that I am able to apply G4 tracking data to any 3d model in my game? I have integrated G4 using their own SD$$anonymous$$ in other C++ projects but I am not sure how to do this in Unity. Any help or advice will be appreciated or if you have a built G4 plugin you can share.

avatar image Studying · May 03, 2016 at 05:41 PM 0
Share

Hi, please, could you tell me how to get data from Pi$$anonymous$$gr to my own project in C++ VS 2008? Thanks!

avatar image Studying · May 03, 2016 at 06:05 PM 0
Share

,Hi, did anyone resolve how to get data from Pi$$anonymous$$gr to your own project, please?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Wotthe Dickins · Apr 26, 2014 at 05:20 PM

hi HiteshSharma, You could be experiencing gimball lock - you mention quaternians, but did you try setting the G4 system to output positions and quaternians rather than positions and eulers? There's a command through the polhemus sdk to switch. I've just spent ages with the 8 sensor Liberty system, but went for a stand alone engine rather than unity3d, did consider though... out of interest, did you use unity3d inverse kinematics? good luck!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HiteshSharma · Apr 28, 2014 at 08:00 AM 0
Share

Hi Wotthe, I set the G4 system to output positions and quaternians and then set these values(w, x, y, z) in Unity as:

quaternion.w = w; quaternion.x = y; quaternion.y = z; quaternion.z = x; gameObject.transform.rotation = quaternion;

But this still gives me that tilt. rotating the sensor same way for Pi$$anonymous$$gr though gives better rotation.

And sorry, I am not much aware about the unity3d inverse kinematics. $$anonymous$$ay you please guide me a little on that?

Regards, Hitesh

avatar image
0

Answer by Marlies123 · May 16, 2014 at 01:42 PM

Hey,

I'm working at the moment with the G4 too. Could you explain me, who you connect the G4 with your own system. As I understood it, the application PiMgr do a further filtering and the floor compensation. I saw in the PiMgr a option to export data. Do you use this option. I never did this before so I'm inexperienced. Poorly I have to work with Windows and found no information to create a pipeline with Windows.

So, no I will answer your question :D I'm not sure, if changing the order of the quaternions is the right way. You have a rotation from the coordinate system of the G4 to your reference system. So I would calculate the quaternion of the rotation q_R. Then the multiplication of the output quaternion and q_R gives you the orientation you wanna have. You have to think about the order of the multiplication.

I hope that helps you. Best Marlies

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HiteshSharma · May 22, 2014 at 07:27 AM 0
Share

Hi $$anonymous$$arlies,

Thank you for your response. Can you please explain me about this quaternion of the rotation q_R? I am newbie for this field. I am a computer programmer and 3D is all new to me.

And I am doing a continuous reading of the P&O data from G4 and applying to the game object in Update method. so I am not looking for an export frm Pi$$anonymous$$gr.

Thanks, Hitesh

avatar image Marlies123 · May 23, 2014 at 09:08 AM 0
Share

Hi,

you have first a rotation, with the quaternion q1, and the a second rotation, with the quaternion q2. The whole rotation will be done with q = q2*q1. I'm new in this field to, but I spent a lot of time to try to understand all the notations for orientation. So I'm not sure about the order of the multiplication, you will have to try. I'm thinking that you get the quaternion q1 from your system and the do a second rotation to come from the coordinates from the G4 to yours. So q2 is the rotation from (Y,-Z,X) to (X,Y,Z).

An other, maybe the simplest idea, would be to rotate the source ;) Just try it.

So you use the P&O directly from the USB connection? Do you use the RF $$anonymous$$odule or a direct connection? Because I noticed that there are a lot of data gaps, if you use the RF $$anonymous$$odule, although you are only 1.5m away from the PC.

Thanks you too $$anonymous$$arlies

avatar image sidhants1 · Jun 06, 2014 at 11:26 PM 0
Share

I am starting to work with Unity. I have a Polhemus G4 and I want to apply tracking data to a model in my game. I have the G4 hardware and the Polhemus SD$$anonymous$$ installed. How should I go about this integration so that I am able to apply G4 tracking data to any 3d model in my game? I have integrated G4 using their own SD$$anonymous$$ in other C++ projects but I am not sure how to do this in Unity. Any help or advice will be appreciated or if you have a built G4 plugin you can share.

avatar image IssamIGE · Jul 01, 2015 at 09:15 AM 0
Share

Hi,

I am working to make a VR arm using Oculus Rift D$$anonymous$$2 and Polhemus Fastrak or Polhemus Liberty for tracking. But unfortunately, I did not find how to extract data from Polhemus to Unity. So I will need some help for getting data from Polhemus to move the arms in Unity.

Thanks,

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Max rotation degrees 1 Answer

Rotation around an axis, how unity handle this? 3 Answers

Build rotation tool for level editor 0 Answers

Anti-Gravity vehicle bounce-back? 1 Answer

Weird Rotation Reset 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges