AlexanderKoch-Koch / low_cost_robot

MIT License
2.68k stars 207 forks source link

Add vr controller #22

Open LouisFoucard opened 2 months ago

LouisFoucard commented 2 months ago

Adds a VR controller. Works with any OpenVR compatible controller, tested with Valve Index knuckles. Quite low latency, I estimate it at under <50ms. This is possible in particular thanks to OpenVR's future position estimation, which here is set to 50ms. The 6d pose of the controller is obtained through OpenVR API, and the roll angle is used to control the wrist angle. The 3 joint angles of the base, shoulder and elbow are calculated through inverse kinematics. The main trigger of the Index controller is mapped to the gripper opening.

Pretty flexible, and cheaper than building the leader arm if you already own such controller. Right now I set it up as separate scripts, but we could make the main script take in a flag for leader arm or vr control. Really awesome project btw :)

https://github.com/AlexanderKoch-Koch/low_cost_robot/assets/8585249/8ca7edc4-c284-4c62-847d-efb2cf45e9cd

MichaelRazum commented 1 month ago

The video looks great. Would be interesting to know, which controller this is! Would try to test it as well :+1:

LouisFoucard commented 1 month ago

It's the valve index controller https://a.co/d/48Ga91D + valve lighthouse stations https://a.co/d/d3rA14l

LouisFoucard commented 1 month ago

But should work with any OpenVR compatible controller