[osg-users] How to support a new input device?

0 views
Skip to first unread message

Cervantes Pintor Pedro

unread,
Aug 24, 2007, 7:28:00 AM8/24/07
to osg-...@lists.openscenegraph.org
Hi,


I just got one of those SpaceNavigators from Siggraph and I thought it could be so nice to use it as an input device on OSG so... I've been looking for some low level calls in the OSG source code to have a hint where to start but it was useless, so can someone please give me a quick guideline on what should I do to add support for a new device ?

I'm expecting some answers like: "use class osgGA::event as a base for your low level calls and then create a class derived from osgGA::turboMyBestManipulator and then... etc".

Ideally I'd like to add the support for this and possibly other devices in a general purpose way like adding the support directly to osgGA::GUIEventHandler so it can be incorporated someday into the main OSG distribution.

I'm not expecting to know everything in a weekend (nor even in one or two months) I just want a starting point to begin my research.

Thanks in advance

Pedro


Looking for the Hottest New Ringtones?
Find them at Lycos Mobile. Get 10 Bonus Tones today!

Robert Osfield

unread,
Aug 24, 2007, 7:44:53 AM8/24/07
to osg-...@lists.openscenegraph.org
Hi Pedro,

You needn't integrate the new device in an OSG centric way at all, you
can just poll the device yourself in your main loop and then do what
you want with it.

Potentially you could integrate it on an OSG centric way to make use
of the existing manipulators, and I've done this in the past to make a
joystick work with the standard manipulators. The way to do it is to
call one of the osgGA::EventQueue methods to adapt your events. One
can pass in custom event i.e you own subclassed from
osgGA::GUIEventAdapter, but you only need to do this is you want to an
extra variables.

The Viewer and GraphicsWindow both have an EventQueue that you can
insert events in by.

Robert.

> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Mike Weiblen

unread,
Aug 24, 2007, 12:11:40 PM8/24/07
to osg-...@lists.openscenegraph.org
Hi,

What OS are you targeting?

For Linux, I'm in the process of integrating SpacePilot and
SpaceExplorer (I'm told SpaceNavigator uses the same protocol) into
VRPN, then those devices will be accessible as all the other VRPN input
devices using my osgVRPN nodekit. I'm using the Linux "input event
subsystem" (aka evdev). The 3Dx devices enumerate as HID, and linux
will create /dev/input/event* nodes to communicate. In this way I'm
able to avoid the 3Dx driver software entirely.

If on Windows, you should probably use their driver software, or
interact with the devices as USB HID devices.

If you prefer not to use osgVRPN, you can review its code for tips on
device integration.

fwiw there are lots of cheap SpaceBalls (the generation of serial
devices before the current USB devices) on EBay, which work great on
both linux and windows via VRPN & osgVRPN.

Cheers
-- mew


Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/

<http://www.lycos.playp.biz/mobringtones/Default.aspx?StoreFrontID=0006-
> 0006-1005-0125> . Get 10 Bonus Tones today!

Paul Martz

unread,
Aug 24, 2007, 12:19:25 PM8/24/07
to osg-...@lists.openscenegraph.org
Hi Mike -- Have you had any experience with integrating a data glove device
into VRPN?
-Paul

Mike Weiblen

unread,
Aug 24, 2007, 12:26:11 PM8/24/07
to osg-...@lists.openscenegraph.org
Hi Paul,

Not personally, but VRPN already supports several glove devices, and the
trackers associated with them (eg I've successfully used their existing
Polhemus support)

-- mew


Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/

> -----Original Message-----
> From: osg-user...@lists.openscenegraph.org [mailto:osg-users-
> bou...@lists.openscenegraph.org] On Behalf Of Paul Martz
> Sent: Friday, August 24, 2007 11:19 AM
> To: osg-...@lists.openscenegraph.org
> Subject: Re: [osg-users] How to support a new input device?
>
> Hi Mike -- Have you had any experience with integrating a data glove
> device
> into VRPN?
> -Paul

_______________________________________________

Paul Martz

unread,
Aug 24, 2007, 12:35:32 PM8/24/07
to osg-...@lists.openscenegraph.org
(Apologies for hijacking this thread...)

I'm exploring ways to add a 5DT Ultra 14 to an OSG-based app.
http://www.5dt.com/products/pdataglove14.html

Can you provide me a list of supported devices or point me to a Web site
with such info?
-Paul

>
> Hi Paul,
>
> Not personally, but VRPN already supports several glove
> devices, and the trackers associated with them (eg I've
> successfully used their existing Polhemus support)
>
> -- mew
>
>
> Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
> http://www.zebraimaging.com/
>

> >

Mike Weiblen

unread,
Aug 24, 2007, 1:59:05 PM8/24/07
to osg-...@lists.openscenegraph.org
Hi,

The canonical website is http://vrpn.org/ It does mention support for
5DT gloves.

-- mew


Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/

> -----Original Message-----
> From: osg-user...@lists.openscenegraph.org [mailto:osg-users-
> bou...@lists.openscenegraph.org] On Behalf Of Paul Martz
> Sent: Friday, August 24, 2007 11:36 AM
> To: osg-...@lists.openscenegraph.org
> Subject: Re: [osg-users] How to support a new input device?
>

Reply all
Reply to author
Forward
0 new messages