- This topic has 6 replies, 3 voices, and was last updated 5 years, 10 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] How do i a map an omni button to a python function
Tagged: 64_bits, SOFA_1806, Windows_10
I have the omni phantom, and I want to use the buttons on it to run a function I have in a python script.
Best,
Fayad
Dear @fayad,
The GeomagicDriver defines several data. Among them the data “button_1” and “button_2” are boolean specifying the state (pressed = 1) of each button.
Best
Hugo
Thanks Hugo, but these are not accessible form python, right?
Best,
Fayad
They should be, as any data.
Using something like:
state_button1 = your_GeomagicDriver.findData('button_1').value
Hugo
Oh I see, I got a bit confused about what you meant. My bad :).
Thank you so much Hugo,
Fayad
If you think that shorter is better you can also write:
state_button1 = your_GeomagicDriver.button_1
This works because the python binding search for each “MyComponent.xxxx” if there is a data with the xxxx name.
Thanks, I managed to get the button, but using “button1” instead of “button_1”.
Best,
Fayad
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.