#1
|
|||
|
|||
Creating a Vizard Sensor Plugin
If you want to connect to a hardware device within your Vizard script you need to use a Sensor Plugin. Vizard already comes with Sensor Plugins for popular hardware devices, but you can easily make one for your own hardware device. You must know C/C++ programming in order to create one. Here are the basic steps:
Step 1: Download sensor.zip to your computer and unzip it. Step 2: Open the project files. If you don't have Visual Studio then create a Win32 DLL project and add the files main.cxx and sensors.h to it. Fill in the functions outlined in main.cxx. When you compile your program make sure the extension for your dll is .dls. Put your new plugin in the [VIZARD_PATH]/plug-ins directory, where [VIZARD_PATH] is the location of your Vizard installation. Step 3: To use the plugin within you Vizard script it would look something like this, assuming the name of your plugin is mysensor.dls: Code:
import viz viz.go() mysensor = viz.add('mysensor.dls') Code:
mysensor.reset() Code:
data = mysensor.get() Code:
mysensor.command(1,'some string',1.2,3.4,5.6) That's it, you should now have your own working Sensor Plugin for Vizard. If you would like to share your plugin with other users then read the post Sharing Files on SourceForge. Have fun! |
#2
|
|||
|
|||
Hi, I cannot use your flockofbird plug-in since my flock of bird has a Extended Range Controller/Transmitter. could you give me some examples, and I cannot open the stickydot.dlr file in the souceForge.
thanks. |
#4
|
|||
|
|||
thanks, it's great.
|
#5
|
|||
|
|||
Would you be able to post the device code you have made for the Intersense tracking systems?
|
#7
|
|||
|
|||
IS-900 wand
Hi, we have an intersense IS-900 tracker system with a head tracker and a wand. We would like to add the wand to the intersense plug in, so we can use it as another tracker and also to add functionality to the buttons.
Does anyone have a sample code for this? thank you!
__________________
Dioselin.- |
#9
|
|||
|
|||
adding more stations
Hi, this is a newbie question:
Is there any more documentation on how to modify the sensors plugin to add more stations (e.g. a wand)? I want to read and send the data from a head tracker as well as the wand (IS-900 system). I tried modifying MAX_SENSOR_DATA in sensors.h and copying the additional wand data in the array, but when I execute data = mysensor.get(), it won't read the wand info. Should I create two different plugins 'headtracker .dls' and 'wand.dls' instead? Thanks,
__________________
Dioselin.- |
#10
|
|||
|
|||
Hi,
There is actually a new undocumented feature of the plug-in API that allows you to specify the size of the data field. First download the newer version of sensors.h Then in your InitializeSensor function you can set the size of the data field by doing the following: Code:
((VRUTSensorObj *)sensor)->dataSize = 20; Another way is to do as you suggested and create a separate plug-in for the wand. Hope this helps. |
#11
|
|||
|
|||
Another newbie question:
I am trying to make a generic wand device which has an LED light on either end, and one or two buttons for basic input/resetting the user when the lights become switched. Does such a device already exist, in some form? If not, then I would be interested in buying several more LEDs either from WorldViz or some online retailer. Also, if anyone could suggest a simple way of getting button input, that would be very helpful. I saw that someone has posted an example using serial input, but I wonder if this would be reinventing the wheel for my simple application. Thanks. |
#12
|
|||
|
|||
Hi,
Your best bet is to use some wireless joystick or mouse. Check out the following site, http://ilab.cs.ucsb.edu/projects/ismo/fogscreen.html They created a wireless joystick with a ppt light embedded in it (scroll half way down the page). You can also purchase special remote controls for computers that can map a button to a specific key press. This might be overkill in your case. Contact support@worldviz.com for information about acquiring extra LEDs for the PPT. |
#13
|
|||
|
|||
Quote:
Best regards, Ron |
#14
|
|||
|
|||
Hi,
I've never been able to use an IS-900, this is the main reason the plugin doesn't support buttons. I went ahead and implemented it, if you don't mind testing it out I will provide you with the new version of it. Email me at lashkari@worldviz.com if you are interested. |
#15
|
|||
|
|||
Hi!
Does the current intersense plugin support ethernet? We would like vizard to read data from our intersense processor connected through a router on port 5005. The plugin does seem to detect the is900 on port 5001, but then crashes. Also, using intersense software, we can only make a succesful connection on port 5005. I have tried setting the port with PORT_INTERSENSE = 5005. It seems to be able to connect to the IS900, but it doesn't find a tracker. Regards, Ron |
#16
|
|||
|
|||
Hi,
The Intersense API we are currently using only supports connecting through a serial or USB port. There is also no mention of an Intersense Processor either. Are you using a new version of the Intersense driver? |
#17
|
|||
|
|||
Hi,
With Intersense Processor, I just meant the IS900 unit. Right now I'm not using any driver at all. Are there any plans to update the intersense plugin for vizard with a newer API in the near future? |
#18
|
|||
|
|||
Hi,
I just checked the intersense site, and we are using the latest version of their SDK. I found the following information in their manual. Quote:
|
#19
|
|||
|
|||
Hi!
I tried all your suggestions, but they didn't make it work. Then, I replaced isense.dll (version 3.0.5.8) with an older one (version 3.0.4.5). And with the older one it works perfectly! It autodetects the IS900 on the correct network address and port, even without isports.ini. What happened between the two DLL versions? Ron |
#20
|
|||
|
|||
Hi,
That's strange. You might have to contact Intersense about this. There might be a problem with their new driver or something different must be done to get it working. Thanks for letting us know about this. |
#21
|
|||
|
|||
Hi.
This is my first post in this forum. I`m new to Vizard so i hope you all can help me. I`m now try to make treadmile as my plugin for my Vizard project. I only want to take the data for z+ axis to make pedestrian move forward. I already tried severel times but failed. I dont really understand the details about step 2. Can someone teach me the details about step 2? Step 2: Open the project files. If you don't have Visual Studio then create a Win32 DLL project and add the files main.cxx and sensors.h to it. Fill in the functions outlined in main.cxx. When you compile your program make sure the extension for your dll is .dls. Put your new plugin in the [VIZARD_PATH]/plug-ins directory, where [VIZARD_PATH] is the location of your Vizard installation. I dont have much experience about Visual Studio or compile. So it`ll be great if someone can send me pm about this details. And screen saver can make me more understand. Thanks. |
#22
|
|||
|
|||
LOL.
Sorry for my mistake. I mean print screen not screen saver. Print screen for the details step will be great. Thanks. |
#23
|
|||
|
|||
Hi Mr.farshizzo,
i tried the sensor.zip, and i got a error message at step 2. here is the error message my environment is: Windows 7 Enterprise 64 bit Visual Studio 2010 is it the version problem ? thank you. |
#24
|
|||
|
|||
how about plug in for flex sensor??
|
#25
|
|||
|
|||
Can you please post the source of the XSens plugin? I wan't to make it work with the newer MTi-300 devices.
|
#26
|
|||
|
|||
Hi Farshizzo,
I unable to download sensor.zip file, please can you help me |
Thread Tools | |
Display Modes | Rate This Thread |
|
|