-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open cv and Python Scripting with Razer Hydra #237
Comments
Hi, no Python is only used as a scripting language. The plugins uses c# and currently only run under Windows |
Thank you for the explanation. I noticed that if i try to acces the hydra update event in FreePie it doesnt do anything. for example Hydra-Setup und Key-Handlingdef bla(): if starting: #It should press key.D but it doesnt. #when i put wiimote[0].acceleration.update += bla #now it works. I dont undertand it. There for iam forced to use a wiimote for using the hydra. Thats weird |
hydra and wii are two different plugins with no shared dependencies |
Ah ok good to know. Sadly it doesn't work for me. Is there anything missing in my script? Here is the Script that only works if I uncomment the Wiimote line:
|
What's wrong with this line? hydra[0].update += walk |
I am not (yet) familiar with the intricacies of update procedure, but I have noticed that the Hydra plugin source is missing the line: However, the good news is that the plugin does not require it, as you can just read the data directly. The minimal script might be:
Try if it works (as separate script, not IN your script) - the watch tab should show pressing of the trigger of one of the controllers (try both, as Hydra sometimes gets confused which is which). |
Since the Python script is supposed to re-run at a regular interval, that's where you can read values (directly outside of the proposed |
If I understand it correctly, the reason for the use of 'update' is that the scripts, especially involving complex calculations, might be somewhat resource intensive, so it might be better to wait for new data and not perform every operation on old data in every cycle. |
It depends; if a certain API doesn't have any sort of update "callback" but only polling methods, the FreePIE engine would have had to compare if anything changed to decide if the |
This script works, if I access the hydra directly. For more complex scripts, the update callback is necessaty i think. So I delete the walk function. It worked
I put this to a walk funtion to it, then it worked properly, too!
As soon i add
instead of walk() |
Yeah, its a convenient helper for users of freepie. So they dont need to track when updates occour themself. |
Hydra uses polling, but still tracks a sequence number to see if the data has changed: FreePIE/FreePIE.Core.Plugins/HydraPlugin.cs Lines 143 to 150 in 5f948af
It does raise an FreePIE/FreePIE.Core.Plugins/HydraPlugin.cs Line 175 in 5f948af
@yabix007 perhaps you can replace |
This is the error i get when add this: hydra.update += walk to the script 'Array[HydraPluginGlobal]' object has no attribute 'update' |
Is it possible to get the hydra data through python. Iam using opencv with an iPhone. Iam trying to implement the razer hydra in python to use it with open cv. How to import pysixense in my OpenCv Scripts? I already installed the hydra sdk. But got no plan how to install the pysixense library? Can I import the freePie hydra plugin in my Phyton Scripts? Thanks in advance.
The text was updated successfully, but these errors were encountered: