Head Tracking

73 views
Skip to first unread message

Henan Zhao

unread,
Oct 7, 2016, 9:06:23 PM10/7/16
to omegalib
Hi,

We have one hand tracker and one head tracker, and both of them are connected by VRPN. Is it any possible that I can differentiate them? Also can I ask if there is one demo for testing the tracking please? For example, one program to display some spheres representing the trackable markers.

Also are there any examples for the head tracking?

Based on my understanding, the wand service consists of two services: xinput and vrpn. I guess the vrpn is for the trackable markers and the xinput is for the controller. Can I ask how can I connect the controller to the PC please? I think there is a software named MotioninJoy, so are there any other softwares or libraries I should install? Any examples for the use of wand please?

Thanks a lot!

Henan Zhao

unread,
Oct 10, 2016, 2:02:17 PM10/10/16
to omegalib
Hi,

Just a little update, I added "setTrackerSourceId(1)" and "setTrackingEnabled(true)" in my application. I think I built the commutation between the tracking system and my application, but the result is not correct: the object was following my head. For example, when I walked left, the object was moved to left, which is not the correct head tracking I think.

Any suggestion about that please?

Thanks a lot.

Henan Zhao

unread,
Oct 12, 2016, 4:29:00 PM10/12/16
to omegalib
Just to provide more details, I think the reason might be that both the rendered objects and the camera are in the camera coordinate, so when I moved the trackable glasses, the objects would move with me.

Is possible that I can fix the objects in the world coordinates and only move the position of "observers" (the view) in the process of head tracking?

The configuration file is attached, and also here is a picture of our system: around one quarter of one cylinder.  Could you please help me take a look at my config file? Can you please tell me if my config file is correct?

henan.cfg
Auto Generated Inline Image 1

Alessandro Febretti

unread,
Oct 12, 2016, 5:07:32 PM10/12/16
to omegalib
Hi Henan,
can you post a basic python script drawing a cube that reproduces the problem you mention? I'm assuming you are not attaching the trackable also to the cube but just using it for the camera.

Also, to clarify: note that enabling tracking on a camera (as you did in the config) does not move the camera itself (that is navigation), but it changes the camera head offset. So even if the object is in camera coordinates (ie it is a child of the camera), you should still be able to move around it and see it from different angles.

Henan Zhao

unread,
Oct 12, 2016, 6:30:53 PM10/12/16
to omegalib
Hi Alessandro,

Thank you so much!

I tested it using spincube.py and ohello, and I think the head tracking works for both.

However, when the cube is far away from the world coordinates (such as move it to (0,2,-10) ), I will have the result "I move to left, then the cube moves to left".
I recorded a short video about the condition. http://csee.umbc.edu/~henan1/VID_20161012_181639.mp4
Thus, can I ask if the head tracking in OmegaLib is affected by the distance please? 

Also is it possible that I can define the scale of movement? For example, if a user moves 1 m, the object will move 1 cm. The reason I ask that is that sometimes I found the object moved too much even though I moved a short distance when I tested the head tracking.

Sorry for my stupid questions.

Thank you again.

Alessandro Febretti

unread,
Oct 12, 2016, 10:03:31 PM10/12/16
to omegalib
What you are seeing is exactly what you would expect if head tracking  is configured correctly :) Objects father from you 'follow you' due  to parallax. It would probably make more sense if you added another object  closer to the camera in that same app. I added a sketch to illustrate parallax.

as for the scale of movement, if you mean the head tracked movement, I would strongly discourage you from scaling it to anything different than real world coordinates, since  things will start  looking incorrect for various reasons. Your best solution would be to rescale the entire scene(ie by doing getScene().setScale(scalex,scaley,scalez))


Henan Zhao

unread,
Oct 13, 2016, 9:18:46 AM10/13/16
to omegalib
Hi Alessandro,

Thank you very very much!

I think I can draw the objects close to me. :-) 

Thank you again! 

Henan Zhao

unread,
Oct 14, 2016, 12:01:33 AM10/14/16
to omegalib
Hi Alessandro,

Can I ask how different rigid bodies are differentiated by OmegaLib? The reason I ask that is that it seems that hand and head tracking share the same name but different sensor ids in vrpn so in the configuration file in OmegaLib I have to give them the same name. Thus I have some troubles to detect them individually. For example, when I move the wand, the system consider that as "my head" and starts the head tracking. Could you please give some suggestion about that?

Henan Zhao

unread,
Oct 14, 2016, 12:15:08 PM10/14/16
to omegalib
Just to explain my question, the head and wands are differentiated by sensor ids (body ids) but share the same name. Is it possible that I can add sensor ids in the configuration file and the input server of omegalib can detect those?
For example, if the sensor id for head is 0 and the id for wand is 1, can I do something like that?
" VRPNService:
{
    serverIP = "localhost"; // This is the IP of all trackable objects below, unless marked otherwise
    trackedObjects:
    {
        Head_Tracker: 
        {
            name = "DTrack"; 
            trackableID = 1; 
            sensorID = 0;
            serverIP = "localhost"; 
        };
Wand_Tracker: { name = "DTrack"; trackableID = 1; sensorID = 1; serverIP = "localhost"; }; }; };"

Alessandro Febretti

unread,
Oct 17, 2016, 5:47:50 PM10/17/16
to omegalib
In the configuration, the name should be the VRPN name of the trackable object, while Trackable ID is the id used by omegalib for that object.

You are using both the same VRPN name and the same trackable ID in your config. Your rigid bodies should have two different names, and you should use two different trackable IDs in the omegalib conf.

Henan Zhao

unread,
Oct 18, 2016, 11:17:34 AM10/18/16
to omegalib
Hi Alessandro,

Thanks for your reply.

Does it mean that you can have different names of rigid bodies in VRPN setting before OmegaLib is used?

My condition is that I cannot give different names to different rigid bodies in the VRPN config file. I only have one VRPN name for all rigid bodies. Maybe the reason is that I used different tracking systems (A.R.T.) from yours (I think it is VICON). When I write a VRPN client program, I can differentiate all rigid bodies by different sensor ids instead of names.

So I am just wondering if OmegaLib can handle our condition: one VRPN name for all rigid bodies, but different sensor Ids for different rigid bodies.

Thanks,
Henan

Alessandro Febretti

unread,
Oct 21, 2016, 12:10:23 AM10/21/16
to omegalib
I think you  can do that, but Arthur know a lot more about this, I referred him  to this thread.

Arthur Nishimoto

unread,
Oct 21, 2016, 3:28:15 PM10/21/16
to omegalib
Hi,

Have you tried to use different trackableID numbers in the config? That is the id that is used to differentiate objects in Omegalib as well as compare against incoming VRPN sensor IDs.

- Arthur

Henan Zhao

unread,
Oct 21, 2016, 11:18:46 PM10/21/16
to omegalib
Hi Arthur,

Thanks for your reply. It is great that the trackableID is also used for VRPN sensor IDs.
I haven't tried that before, but when I set the trackableID as 1, I could still get positions of head. (In my condition, the sensor ID of head is 0 instead of 1).
I will try different trackableIDs tomorrow. 


Henan Zhao

unread,
Oct 28, 2016, 2:26:40 PM10/28/16
to omegalib
Hi Arthur,

Sorry for my late reply. I was in the vis conference in the last week.

I tried to use different trackable IDs for head and wand, but unfortunately when I moved the wand, it was still considered as the head. In other words, we could observe the effect of head tracking even though we moved the wand.

Could you please help me take a look at the config? Thanks a lot!

Here is my current config file for omicron server.

config:
{
  vrpnTrackerName = "DTrack";
  services:
  {
   MouseServices: {};
   KeyboardServices: {};
   XInputService:
   {
       updateInterval = 0.05;
       checkControllerInterval = 2.0;
       debug = false;
   };
   VRPNService:
   {
       updateInterval = 0.01;
       serverIP = "130.85.94.8";
       objects:
       {
             Head_Tracker:
             {
              name = "DTrack";
              trackableID  =0;
              jointId = "head";

             };
            Wand_Tracker:
            {
                name = "DTrack";
                trackableID = 1;
            };
       };
   };
   WandService:
  {
      controllerService = "XInputService";
      controllerSourceId = 0;
      raySourceId = 1;
     debug = false;
     pointer:
    {
      type = "cylindrical";
      radius = 3.238;
      doorWidth = 36;
      xBias = 0.0278;
      minY = 0.305;
      maxY = 2.625;
    };
  };
  };
};

Arthur Nishimoto

unread,
Nov 14, 2016, 2:21:00 PM11/14/16
to omegalib
Hi,

Sorry for the delayed response. I think I know what's going on. Currently working out some possibly related issues with VRPN during runtime. Will let you know as soon as I can.

- Arthur

Arthur Nishimoto

unread,
Nov 15, 2016, 6:52:04 PM11/15/16
to omegalib
Hi,

Try replacing trackableID with objectID. There was a change in the parameter names (in bold) at some point. So the ID's might not actually be assigned properly. I'm guessing you're using the newer version as your're getting tracking data for the head. Although l just fixed a bug where not specifying objectID just like in your config would cause an error.

The older version:

trackedObjects:
{
Head_Tracker:
{
name = "Head_Tracker";
trackableID = 0;
}
};

The current version:
objects:
{
Head_Tracker:
{
name = "Head_Tracker";
objectID = 0;
}
};

Let me know if that helps.
- Arthur

Henan Zhao

unread,
Feb 3, 2017, 10:57:51 AM2/3/17
to omegalib
Hi Arthur, 

Thanks for your kind reply. 

Can I ask if you have some solutions please? Maybe I need to add a variable named "sensorID" in VRPNservice.h in my case (please feel free to correct me if I am wrong), but I am afraid that I may break the whole program if I do that. If you plan to solve the similar issues, please feel free let me know if there is any work I can do. I know that you may not have the same problem because of the different tracker systems, so I am happy to help test any intermediate versions in our environment. It will be extremely helpful if we can make the trackers work soon and work on our research with the help of OmegaLib.

Thank you again.

Best,
Henan

Henan Zhao

unread,
Feb 11, 2017, 7:32:58 PM2/11/17
to omegalib
Hi Alessandro and Arthur,

Sorry for my late update.

What Arthur suggested before did help us. We can make omicron and vrpn talk successfully. 

But we still have the problem to get data from wand and head separately. The wand and head in the tracking system we used are assigned with the same name (like "Tracker") but different sensor ID. But based on my understanding, the head and wand should be given different names (like "Head_Tracker" and "Wand_Tracker") before we use omicron and omegalib.

In other words, if what I understand is correct, the first config file is acceptable in omicron but is not applicable in our case because both Head_Tracker and Wand_Tracker are named as "Tracker" in our system. So I am wondering if the second config can be acceptable which will solve our problem.
Config 1:  
objects:
{
Head_Tracker:
{
name = "Head_Tracker";
objectID = 0;
}
       Wand_Tracker:
       {
name = "Wand_Tracker";
objectID = 1;
       }
};
Config 2: 
objects:
{
Head_Tracker:
{
name = "Tracker";
                sensorID = 0;
objectID = 0;
}
       Wand_Tracker:
       {
name = "Tracker";
                sensorID = 1
objectID = 1;
       }
};

Thank you very much.

Best Wishes,
Henan

Arthur Nishimoto

unread,
Feb 16, 2017, 12:43:17 AM2/16/17
to omegalib
I've re-examined the VRPN code and I think I have a solution. I'll have it up in the next day or so. I'll use the format you have in config2.
- Arthur

Henan Zhao

unread,
Feb 17, 2017, 10:48:37 AM2/17/17
to omegalib
Hi Arthur,

Thank you so much!

Thanks,
Henan

Arthur Nishimoto

unread,
Feb 17, 2017, 3:23:34 PM2/17/17
to omegalib
Henan,

I've pushed the sensorID fix to the master branch (commit: d83a4764e674c34cc23f42f71c09972fb6ebce79). You should be able to use the config you specified above. Also if you have the debug flag set for VRPNService, that should also show the object and sensor IDs.

Let me know how that works.

- Arthur

Henan Zhao

unread,
Feb 21, 2017, 3:02:48 PM2/21/17
to omegalib
Hi Arthur,


Thank you very very much!
I haven't done a complete testing, but the head tracker is not affected by wand now. Thus I think we can separate head and wand successfully.

Thank you again.
Reply all
Reply to author
Forward
0 new messages