I figured that I guess you do have to build panda and include vrpn explicitly if you want to use it. So, I built VRPN, then copied the libs and headers over into panda’s thirdparty/ directory. makepanda liked that, and tried to use it, but I’ve run into this odd problem about semaphores:
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/vrpn_composite.o -I"/usr/include/python2.6" -I"thirdparty/linux-libs-x64/vrpn/include" -I"built/tmp" -I"built/include" -Ipanda/src/vrpn -O2 -DBUILDING_PANDA panda/src/vrpn/vrpn_composite.cxx
In file included from thirdparty/linux-libs-x64/vrpn/include/vrpn_Connection.h:7,
from panda/src/vrpn/vrpn_interface.h:31,
from panda/src/vrpn/vrpnClient.h:21,
from panda/src/vrpn/config_vrpn.cxx:18,
from panda/src/vrpn/vrpn_composite1.cxx:2,
from panda/src/vrpn/vrpn_composite.cxx:1:
thirdparty/linux-libs-x64/vrpn/include/vrpn_Shared.h:269: error: ISO C++ forbids declaration of ‘sem_t’ with no type
thirdparty/linux-libs-x64/vrpn/include/vrpn_Shared.h:269: error: expected ‘;’ before ‘*’ token
I wonder if what’s happening is that panda/src/pipeline/semaphore.h is getting included instead of the /usr/include/semaphore.h, so it’s not getting sem_t ?
I think I’ve got everything built and working how it should be, but I’m just getting zeros in Panda for the tracker position. Not sure if I’m using the TrackerNode and Client correctly.
I’m just using a joystick first, before moving on to actual trackers. Here’s the contents of my joystick.cfg:
The TrackerNode does not itself transform to match the tracker, so checking self.tracker0.getPos() will always return 0, regardless of the data coming in.
Instead, a TrackerNode is meant to be attached into the datagraph, similar to the way base.trackball is used. The datagraph is a special graph of nodes that control user-input devices, such as the keyboard and mouse (and any VRPN devices you connect); you can think of the data in the datagraph as flowing from parent to child, along the graph lines. In general, you hook up devices in the datagraph by parenting them.
Use a Transform2SG node as the child of TrackerNode in order to convert its transform data into a scene-graph transform.
Although the numbers seem very strange. I would have thought the joystick tracker would give ranges from -1 to 1 on the different axes; it does do this at the extremes, but in between has this odd non-linear up to around +/- 50. But that’s a VRPN issue, not a panda one.
(EDIT): solved, that’s because I wasn’t using the config file correctly at all. I had
X *Joystick0 0 0.0 0.0 1.0 -1.0
which I thought meant the range would be 1 to -1. Nope, turns out that last -1 is an exponent, hence my weird numbers