SpaceNavigator -> Simulink

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
Foeks
Posts: 3
Joined: Sun Nov 25, 2007 9:35 pm

SpaceNavigator -> Simulink

Post by Foeks »

hello,

let me first introduce myself,
i'm a mechanical engineering student doing research at the university of victoria. the research field is 'haptics', where we're trying to create a sense of touch in a virtual environment using so-called 'haptic-devices'. these devices generally have encoders to read positions and actuators to return forces. an example of such a device is shown here: http://www.sensable.com/documents/image ... iImage.jpg

we recently bought a spacenavigator because it has 6 degrees of motion freedom like the haptic device, which would allow us to do simulations and experiments without having to worry about the force-feedback.

all the computation to go from positions to forces, as well as displaying the virtual environment are done in Simulink, a well known tool in the engineering world. at the moment we're doing simulations with pre-defined user trajectories such that we're 'touching' a soft/deformable object in a virtual world. instead of pre-defining the trajectories, we would now like to read the positions from the SpaceNavigator. it is possible to integrate C++ code in our Simulink model so we would like to write a C++ program that reads positions from the SpaceNavigator and feed them in our model.

still following me? :)

once i've written that code, i can post it on the MathWorks website such that any Simulink user would be able to use it. i hope this gives some motivation to help me.

now here comes the problem. i'm an engineer, not a software developer. i've written some for/while loop-basic stuff- C programs and that's it. i've downloaded and read the 3DxInput API, a large part of the windows SDK guide, tried to decipher the AtlCube3D example and searched this forum. i still don't even know where to start, so i am desperate for help.

i don't know if it's possible but what i would like is: one C++ file, for example spacenavigator.cpp that makes connection with the device, does the initialization etc etc, read the input data (3 translations / 3 rotations), put them in an array and make them an output of some function such that i can feed it to simulink. there's no need to draw a window whatsoever.

i'm just going to ask a bunch of questions. i apologize for any dumb ass ones :lol: thanks in advance for your time! it's very much appreciated!

1) what documentation/examples do you recommend me to have a good look at?
2) what is the difference between 3Dxware and 3DxInput?
3) where can i find the 3DxWare SDK? i just have the SDK guide. couldn't find the rest of it, like the programming examples.
4) why can't i find none of the 'five basic functions' (SiInitialize etc) in the cube3D example?
5) which files of the cube3D are really essential for event handling and iinput data reading? so no window drawing, cube rotation calculations etc etc (hope i get a good answer on this one)

okay, i think thats it for now. that wasn't an unreasable amount of informations and questions, was it?! as i said, your help is greatly appreciated and hopefully enables me to ask more direct questions next time.

thanks!
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hello Foeks,

Your project sounds like an ideal opportunity to go grab someone from the Computer Science dept that needs a quick project. To rip apart atlcube3d should be relatively straightforward...and you may need their expertise beyond just that first task to make it work.

We have a managed C++ example and a C# example that does what you want, but would have to put in a bit of work to create an unmanaged C++ sample.
1) what documentation/examples do you recommend me to have a good look at?
AtlCube3D or the polling example are the best for using 3DxInput.
2) what is the difference between 3Dxware and 3DxInput?
3DxWare is the driver that handles the device. 3DxInput is the API that programs use to get data from the driver.
3) where can i find the 3DxWare SDK? i just have the SDK guide. couldn't find the rest of it, like the programming examples
The 3DxWare SDK is a C/C++ SDK that talks directly to the 3DxWare driver. It unfortunately needs a window for communication. It sounds like you don't want that. You could use a hidden window if you want to create one. The 3DxWare SDK is available in the archive section of the download page on our web site (pick an old device to get to the archive option). Do you mind telling me where you got the SDK guide? I didn't think we published that anywhere (except in the SDK). Several people have mentioned lately that they have been reading that, and it has confused them.
4) why can't i find none of the 'five basic functions' (SiInitialize etc) in the cube3D example?
The Si* API functions are in the 3DxWare SDK (old).
5) which files of the cube3D are really essential for event handling and iinput data reading? so no window drawing, cube rotation calculations etc etc (hope i get a good answer on this one)
The functions to watch for are the functions that use _3DxDevice or COM: InitializeCOM, OnSensorInput, ::CoInitializeEx, OnDeviceChange, OnKeyDown/Up, UnInitializeCOM. You don't need any MathFrame* calls, DisplayCube, nor most of OnCreate. You can remove anything to do with pens and drawing. Just change OnSensorInput to publish the information to whatever you need, instead of filling the math data structs and calling DisplayCube. IOW, start removing things until it stops working, then back up one step. <GG>
Foeks
Posts: 3
Joined: Sun Nov 25, 2007 9:35 pm

Post by Foeks »

thanks jwick! your info will help me get started.
Do you mind telling me where you got the SDK guide? I didn't think we published that anywhere (except in the SDK). Several people have mentioned lately that they have been reading that, and it has confused them.
i'm pretty sure i got it from the Support/SDK section on your website. at the same spot where i found the cube examples. i haven't looked in the archive.
(100% sure i got it from your website, didn't look anywhere else)
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Aha! Sure enough. There it is under Support->Manuals & Documentation->SDK Guide Win. We'll have to redirect that link to a more up-to-date document or delete it. The correct 3DxInput SDK documentation is under the Support->SDK page.

Thanks for telling us about it.
Post Reply