-
Notifications
You must be signed in to change notification settings - Fork 26
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
Support for other 3dconnexion products #1
Comments
Yes, it should be easy enough. I'll make some changes to support multiple device types. I think the data encoding (or at least the channel IDs used) might be different for your device, but it is easy enough to determine this. I'll add a script that dumps the raw HID stream to terminal so you can see what changes are happening when you move the Wireless, and then I can modify the callback code to work with that output. |
OK, the latest version (0.1.5) can support multiple devices. We just need to work out what the format for the Wireless device is. If you run the raw_data.py script from pywinusb you should be able to see the raw data stream from the device. If you can work out what the values are for the 6 axes and buttons on your device, you can add a new entry to device_specs in spacenavigator.py; send a pull request and I'll add it in. (or post them here and I can add them in) |
(i just noticed the above replies hiding in my inbox). thank you, i will take a look as soon as i can and feed back some information to you. |
Hi @johnhw I am trying to get this to work with a wireless SpaceMouse. It connects successfully (once the id's have been changed) but the data once formatted is always 0. Do you have an idea as to what alteration is required to get the data formatted correctly? Regards, |
Can you run the raw_data.py script mentioned above (from the pywinusb package) to dump the HID stream while you adjust the SpaceMouse? If you adjust the mouse on each axis (as best you can) and try each button, you should be able to see which channels are carrying the axis data. I assume a new entry in the device_specs dictionary will be required to support the device. |
Hey there @johnhw, I also tried to use the library with my SpaceMouse but:
So following your suggestion for using raw_hid.py I was able to reverse out the protocol alterations for the 6-axes and the 15 buttons. I've since updated my local
Just let me know how you'd like to collaborate, if at all. |
@PalantirWielder I have just modified the code (1c815eb) to make the button state be a list of (binary) integers, which will make it easier to support 15 buttons. The old code could support multiple buttons by adding new entries into the button_mapping list, but this will end up packed into a single integer as a bit array which is pretty inconvenient. With the tweaked code, just add the buttons into button_mapping, specifying the byte+bit of the HID event to look at, and the button state will be written into that element of the button vector. Note all that you need to is add a new entry to device_specs for the SpaceMouse Pro Wireless. It will then autodetect the right device and use it; you don't need to change or remove the SpaceNavigator. |
@johnhw I have a SpaceNavigator on hand, so I tested that in the meantime. Assuming that I'm correctly understanding the formatting of the ButtonSpec, I believe that there were a few changes that weren't implemented to handle the new format. I updated the SpaceNavigator's device_specs for button_mapping so that it had a ButtonSpec for each of the two buttons. I then propagated that change through the code to restore the testing button_callback functionality. All these changes will be in the PR I'll file after I can confirm the SpaceMouse Pro code works as desired. Thanks for the quick response! |
@johnhw The SpaceMouse Pro appears to work as desired. One thing that popped up was the value scaling of the aforementioned SpaceNavigator. When moving the puck to it's extremes, I noticed that the values were of a greater magnitude than 1.0. I also jumped to a commit prior to your recent changes, and the scaling phenomenon was still present. Is it a problem if the output values are greater than 1.0? Since functionality appears to be working properly, beside the odd scaling quirk, I'll go ahead and file a PR. Then in that thread we can discuss any additional changes you'd like made before the merge. |
Thanks for the PR! I will investigate the SpaceNavigator scaling issue on my device -- perhaps the device axis range is different on different versions or can be user modified? |
Hmm, can't see why the SpaceNavigator would report these values -- mine maxes out at [-350.0, 350.0], and so scales to exactly [-1.0, 1.0] with the default scaling. The latest commit prints out the vendor name, device name and version number as reported by the device itself. I get:
Do you have a different HW version? It could also be that the range is configurable in firmware. |
My pleasure! It nice when my work can be contributed back to the community.
FYI, I changed the serial number to all zeroes when I pasted it here
So yes, it is a different version. Not sure if that's a firmware version or a hardware version, but it is different. |
Oh, and one other thing. I don't believe the SpaceMouse Pro has a controllable LED, unlike the SpaceNavigator. Is there a way to verify that there is no interface to one? |
Hello, I'm trying to modify the code to include the SpaceMouse Enterprise. I have added SpaceMouse Enterprise to the supported devices list and now it recognizes it. But nothing else is happening. I have run the raw_data.py script as suggested and Have the following strings Please let me know where I need to change the code. I'm not really familiar with working with this level of complicated scripting. Thanks |
Hi, |
@aephchw you might want to look at the automatic branch. It will autodetect the device capabilities from the HID usage pages for any detected device. Unfortunately, I can't get buttons to work correctly with this mode on Windows, but it should be enough for you to get the axes specifications to use in the master branch version. |
ok, thank you. Until now I already figured out how to connect with it and read its status which already works fine for me (I don't need the buttons, just x,y,z coordinates). |
Hey,
I was able to get it working, at least the coordinates. I am attaching the
modified script.
I have not been able to spend the time to get the buttons working properly.
If anyone has those working for the SpaceMouse Enterprise please let me
know.
Thanks
…On Fri, Nov 23, 2018 at 8:59 AM aephchw ***@***.***> wrote:
Hi,
thank you johnhw for your work!
I am trying to use it with the SpaceMouse Enterprise but can't succeed.
@giant99 <https://github.com/giant99>: could you figure it out?
Thanks in advance
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Amykypyc365HRR5nwjXV3oaomV0PxzFbks5ux_85gaJpZM4HC5I4>
.
|
My 3dconnexion device (SpaceMouse Wireless) creates six nearly identical devices. vID=0x256f, pID=0xc652, for each one. Only one of them outputs the data. I've created a profile for the device already, but I can't figure out how to select between the device's instances more granularly than vID and pID. Is there one in pyspacenavigator or am I better off custom-writing something based on the raw_data.py example? |
I've noticed the code here on GitHub includes support for the SpaceMouse Compact but this is not the case when installing the library with pip |
Hi, can you add the product "SpaceMouse Module USB" (https://3dconnexion.com/us/product/spacemouse-module/) as well to the list? This version is not supported by 3DConnexion's libraries, so a solution such as pyspacemouse is perfect for those users. |
Anyone figure out how to use Spacemouse Enterprise with Pyspacemouse or add it to this library? |
Hi, would it be hard to implement support for SpaceMouse Enterprise with all its basic keys - the same ones that are with SpaceMouse Pro? Would it be matter of switching parameters defined for SpaceMouse Pro, or it would be harder? |
Hi everyone!
My steps to solve are as follows:
The number 6 is the index number (in
The 5 steps above is how I finally suceeded. And hopefully you will, too! |
erm, On a related note, if you're not aware, you can find all the relevant hid/pid pairs by searching for "3dconnexion" here: http://www.linux-usb.org/usb.ids |
It would seem simple to support other SpaceMouse products by adjusting the vendor and product ids for the HID device. I tried 0x256f,0xc62e and 0x256f,0xc62f for the SpaceMouse Wireless, and was then able to turn on and off the LED with set_led() but never received any data callbacks. Any thoughts? Would love to get this working; pyspacenavigator is exactly what I need.
The text was updated successfully, but these errors were encountered: