Introduction
P5 is a VR glove available at Essential Reality. P5Glove# is a managed library that exposes the features of P5 to .NET applications. The library is a managed C++ wrapper to the C++ SDK available on line (we include the DLL in the distribution for simplifying the build).
Notes
When you build the project the C# project fails. Rebuild again and it will work.
Why is in Robotics4.NET?
Although the P5 glove is an input device designed for humans it can be useful for remote control of robotic devices. In fact in the demo we gave in Cambridge in March 2003 of VisualStorms (that went not exactly well :) we were using the glove as a mean for controlling the Lego robot remotely.
Example
In the following example we simply read the values provided by the Glove and we show them in several Text boxes.
Show
Glove = new P5.P5Glove(0);
Glove.FastStartTracker(this);
//...
private void UpdateGlove() {
while(running) {
if(Glove != null && Glove.Initialized) {
Glove.Process();
Ilbl.Text = Glove.Index.ToString();
Tlbl.Text = Glove.Thumb.ToString();
Mlbl.Text = Glove.Middle.ToString();
Rlbl.Text = Glove.Ring.ToString();
Plbl.Text = Glove.Pinky.ToString();
Xlbl.Text = Glove.X.ToString();
Ylbl.Text = Glove.Y.ToString();
Zlbl.Text = Glove.Z.ToString();
APlbl.Text = Glove.AbsolutePitch.ToString();
ARlbl.Text = Glove.AbsoluteRoll.ToString();
AYlbl.Text = Glove.AbsoluteYaw.ToString();
RPlbl.Text = Glove.RelativePitch.ToString();
RRlbl.Text = Glove.RelativeRoll.ToString();
RYlbl.Text = Glove.RelativeYaw.ToString();
Albl.Enabled = Glove.ButtonA;
Blbl.Enabled = Glove.ButtonB;
Clbl.Enabled = Glove.ButtonC;
}
Thread.Sleep(30);
}
}