KikiHobbyRepair / SpaceRat

387 stars 46 forks source link

suggestion: switch to multi-axis controller USB HID #2

Open zdar opened 2 years ago

zdar commented 2 years ago

Hi, if you use USB HID multi-axis controller for sending events it will prevent troubles interfering with regular mouse. It should also allow to control all axis. I beleive that spacemouse uses same protocol.

It should be quite easy using Joystick library https://github.com/MHeironimus/ArduinoJoystickLibrary (and setting joystik type to multi-axis).

KikiHobbyRepair commented 2 years ago

Hi, thank you for your comment. I will check this out. My only concerns is that if it will work as a mouse or as a keyboard how will I interact with Fusion 360? This is the hard thing to handle.

zdar commented 2 years ago

Fusion360 should have built in "driver" for Spacemouse (which is HID multi axis controller). From that point of view it should work directly (no guarantee as I have no way to test it by myself).

If you need mouse and keyborad control as well you can always register multiple HID devices. E.g. ArduinoProMicro is able to present itself as all those devices at the same time. I have done that in my project where I needed keyboard and multimedia control. If you need a more advanced control https://www.autohotkey.com/ may be help.

KikiHobbyRepair commented 2 years ago

Thanks a lot. I will give it a go. I have just 5 minutes ago started to play with Fusion 360 scripts.

falias4 commented 2 years ago

Fusion360 should have built in "driver" for Spacemouse (which is HID multi axis controller). From that point of view it should work directly (no guarantee as I have no way to test it by myself).

@zdar Do you have concrete information or do you just "expect" that? 😄 3dconnexion has it's very own driver/software 3DxWare so I wouldn't be very confident that other hid-devices work out of the box.

I suppose you really have to write your own Fusion 360 script (python, c++) to read the device data (or even raw hid) and translate them to camera-movements with the Fusion 360 API.

A possible alternative for the ArduinoJoystickLibrary: https://github.com/NicoHood/HID

kamoshika9999 commented 3 months ago

We suggest using serial communication in Fusion to resolve conflicts with the mouse. I actually created the script. https://github.com/kamoshika9999/https---github.com-kamoshika9999-Orbion_3D_Space_Mouse.git The logic to control component rotation is built into FusionAPI_rotate.py in this repository. I hope this helps.

MyBlog https://qiita.com/kamoshika9999/items/3424c062310145d481c8