Vicon Motion capture stream.

Hi,I was wondering whether anybody has used the Vicon optical trackers for motion capture with Panda3D. I am sure it is supported since it says so on the Vicon official site http://www.vicon.com/products/vicontracker.html.

Not sure how to make it work though. Any tips or general steps for such things would be helpful. I have the libraries that work with the system which is said to support the following compilers.

The libraries support the following compilers:
· Microsoft Visual Studio .NET 2003
· Microsoft Visual C++ 6.0
· Borland C++ Builder 5.0

Though i am writing the program in python, c++ libraries are good to go, right?

Btw there are 3 libs
· TrackLib - Tracking system library
· MathsVM - Vector / Matrix maths library
· VFC - Foundation classes

whose dll’s are also provided.

The webpage suggests that you can integrate easily with Panda3D via the VRPN library, which Panda already integrates with. If that’s the case, then you won’t need to link with any of their provided libraries; you’ll just contact their server using the VRPN interface.

There’s no documentation in the manual for Panda’s use of VRPN, but the relevant classes are described in the API reference, and there are plenty of examples in the forum.

David

@ David thanks a lot for the quick reply. Takes a load off my mind. :slight_smile:

I have an emulator to work with offline which streams any mocap file in a loop and basically acts as the server. I tried using code from some of the previous replies that you posted but i cant seem to establish a connection between the panda3d program and the server/emulator.

import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.task import Task
from direct.showbase import *
#from direct.directdevices.DirectDeviceManager import *
import random

class World(DirectObject.DirectObject):
  def __init__(self):
    client = VrpnClient('vrpn.server.com')
    tracker = TrackerNode(client, 'tracker_name')
    print tracker.getTransform()
    
w=World()
run() 

If it helps i can send you the emulator. It together with test data is only 90 kb. Moreover i was wondering how do you mention what port to use since i didn’t find anybody else specify it in the other posts.For me it is port 800.

Btw what is import random needed for?

Panda takes the name you give it for the server name and passes it directly to vrpn_get_connection_by_name(), as described here: cs.unc.edu/Research/vrpn/Con … _make.html . Beyond that, establishing the connection is outside of Panda’s control (and that function doesn’t appear to provide a way to specify the port, so I don’t know if there’s a way to use a nonstandard port). In any case, if there is any doubt, you might want to make sure you can use other VRPN tools to contact your server.

Also, the standard disclaimers apply: are you sure there is no Windows firewall issue (the Windows firewall is stubbornly difficult to disable in Windows 7, even when it says you have disabled it, it is still somewhat in effect). And, I assume you have inserted your actual server name or IP address in the place of ‘vrpn.server.com’ in the above.

Edit: oh, and the random module is clearly unused and unneeded in the above snippet. It must have been left over from something else.

David

what other tools are there?
I doubt the firewall is the problem in my case as I wrote a wrote server client program using win sock on the same machine and it worked.

As it is a local sever i used 127.0.0.1 for the server name.

I beginning to think that there is a mismatch of vrpn versions. Would you happen to know what version vrpn panda3d has?

I’m not sure. I have little direct experience with VRPN. You might start looking at the page I linked above. Perhaps there’s a VRPN forum where people can be more able to assist with questions in connecting to the VRPN server.

I don’t know offhand, but you can check it for yourself by downloading the third-party tools from the SDK download page.

David

Hi, David’s previous posts regarding Vicon Tracker were indeed correct. Tracker includes an integrated VRPN server rather than having a separate one.

Just a quick note, that Vicon VRPN data is always Z Up. If this is not as required, the data will have to be permuted or otherwise transformed in the client script.

To debug any issues with VRPN connection, the VRPN libraries include a tool called vrpn_print_devices (you can find binaries on the web). Using this you can check a connection can be made to the server and you can also check the data itself on the console output.

I hope this helps.
Good luck!

Warren Lester

Thanks Warren for your reply. I did realize that vrpn server comes integrated with vicon tracker.

Do you know whether Vicon tracker always supported vrpn(older versions like version 1.0.1 or version 1.1)?

I will keep that in mind but first i need to establish some sort of connection atleast.

Panda3d uses z up also. So that is not an issue.

Found a helpful link for anybody else with a similar problem.
http://www.vrgeeks.org/vrpn/tutorial—use-vrpn

Vicon Tracker has always incorporated a VRPN server. Although early versions <1.2 did not stream translations in the correct units. Tracker streamed mm, VRPN requires m.

This was corrected in 1.2.

It’s not a big issue - just something to be aware of as Scale factors can usually be applied in the client to make the conversion.

Warren