-
-
Notifications
You must be signed in to change notification settings - Fork 609
Add and switch controllers with different EVRSkeletalTrackingLevel for gesture control in VRChat #2290
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
Add and switch controllers with different EVRSkeletalTrackingLevel for gesture control in VRChat #2290
Conversation
|
I was messing with this to see how it worked, and I was able to get automatic switching working, and also fixed linux compilation |
|
Wow! That looks really good! Now that I think about it, there's a part where I think I implemented it a little wrong. ALVR/alvr/server_openvr/cpp/alvr_server/alvr_server.cpp Lines 509 to 514 in b993aa6
In this part, I implemented it to pass the button state to the Skeletal_Full controller, but the VRChat documentation says that it's better not to do that if you're using SkeletalInput to the fullest. As far as I've tried, the button state of the Skeletal_Full controller didn't move in SteamVR's "Controller Test" and it didn't work, so please delete it from that branch! Japanese original textおお!めっちゃ良さそうですね! そういえばなのですが、私が少し誤った実装をしたと思う部分があります。 ALVR/alvr/server_openvr/cpp/alvr_server/alvr_server.cpp Lines 509 to 514 in b993aa6
この部分で、Skeletal_Full のコントローラーにもボタンの状態を渡すように実装しましたが、VRChat のドキュメントには SkeletalInput をフルで使う場合それらはしないほうが良いというよう記述があります。 その...私が試した範囲で、Skeletal_Full のコントローラーはSteamVRの「コントローラーのテスト」ではボタンの状態が動かず、動作してなかったのでそちらのブランチの方で消すのをお願いします! |
|
@ReinaS-64892 why did you change the code for setting device properties and define buttons? what was wrong with the original code? the code in this PR looks very wrong, you should avoid casting rust memory to a raw pointer and forget |
|
I was only thinking about creating a controller with a different skeletal tracking level, so it was difficult to assign buttons and properties to the duplicated controller using the existing code, so I managed to implement it by getting a list of buttons. I did. Indeed, I also think that passing this array to the C++ code is very dangerous, but the main reason was that I didn't know any other good way to do it. Looking back, I think it would have been better to define an entirely separate controller for hand tracking with a full skeletal tracking level rather than simply duplicating it, and leave the original controller's code alone. Japanese original textスケルタルトラッキングレベルだけが違うコントローラー生成することだけをとりあえずで考えていたので、ボタンやプロパティを複製したコントローラーに割り当てるのが既存のコードでは難しく、ボタンの一覧を取得する形にして何とか実装していました。 確かに、この配列を C++ コードに渡す形は非常に危険であるとは私も思っていますが、それ以外のいいやり方がわからなかったのが主な理由です。 今思うと、ただ単純に複製するのではなくスケルタルトラッキングレベルがフルの、ハンドトラッキング用の全く別のコントローラーを定義し、元のコントローラーのコードには手を触れないほうがよかったと思っています。 |
|
For now...I need to do something like this! TODO
|
|
I tried to define a different controller for the virtual hand, but an access violation exception occurred on the C++ side, and I couldn't figure out the cause at all... it's down to my lack of technical ability. I went back on track and was able to duplicate the controller without making major changes to the button implementation! By incorporating the contents of #2291, it is now possible to automatically switch controllers! Thanks @AdalynBlack ! Japanese original text仮想ハンド用の別のコントローラーを定義しようと試してみましたが...アクセス違反の例外が C++ 側で発生し、原因の解明も全くできませんでした...私の技術力不足です。 方針を戻し、ボタン周りの実装を大きく変えずにコントローラーを複製させることができました! #2291 の内容を取り込み、コントローラーの自動切換えもできるようになっていますね! ありがとう @AdalynBlack ! |
Please forgive me for using a translation from Japanese.
If you don't change EVRSkeletalTrackingLevel from Partial to Full, you won't be able to use the special gesture operations for hand tracking in VRChat.
However, simply changing it to Full will cause other problems, so I rewrote it to provide the driver with two pairs of controllers that can be used by turning the tracking status on and off.
In the current implementation, you can switch between them with a toggle, but I think it would be better to switch when hand tracking is changed to Quest, so this pull request is a draft.
In order to handle multiple pairs of controllers, I am modifying the part that performs FFI mutually in Rust and C++. Would it be better to create a pull request just for that part?
By the way...I prioritized the implementation and getting it to work, so I forgot to read the contributing guide...I will fix it as appropriate, so please forgive me.
Finally...I am mainly a programmer in C#, so I am not very familiar with Rust, especially C++. If there are any bad implementations, I would appreciate it if you could point them out as appropriate!
Japanese original text
日本語からの翻訳を使用することをご容赦ください。
EVRSkeletalTrackingLevel を Partial から Full にしないと VRChat では ハンドトラッキング用の特別なジェスチャー操作が使用できません。
ただ単純に Full に変えてしまうとまた別の弊害が発生するので、トラッキング状況などを相互にオンオフしながら使う二つのペアのコントローラーをドライバーに提供するように書き換えてみました。
現状の実装ではトグルから切り替えれるようになっていますが、Quest などの方でハンドトラッキングに変わったらスイッチするほうが正しいと思うので、このプルリクエストはドラフトです。
複数ペアのコントローラを取り扱うために、Rust と C++ で相互に FFI を行っている部分を改造しています。その部分だけのプルリクエストを作ったほうがいいでしょうか?
そういえば...実装や動くことを最優先してしまって、コントリビューティングガイドを読むのを忘れています...適宜これから直すのでお許しください。
最後に...私は C# などがメインのプログラマーなので、あまり Rust ,特に C++ に詳しくありません。何か良くない実装などがあったら適宜指摘してくれるとありがたいです!
TODO- [ ] VRSkeletalTrackingLevel Auto Switch