Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Conversation

@ruevs
Copy link

@ruevs ruevs commented Jan 24, 2024

Implement support for pretty much all 3Dconnexion 6DOF controllers - USB and serial.

Win32: Add Windows example.

CMake build system.

ruevs and others added 20 commits February 14, 2021 06:18
by using ANSI C functions instead of obsolete POSIX ones.
Works with SpaceExplorer and should mostly work with all USB devices if the
usbdev.c implementation is merged.
Using `hidapi` as a HID access library.

Tested on Windows with SpaceExplorer. Should work on Linux.
Needs hid.c and hidapi.h from here: https://github.com/libusb/hidapi
Format VID and PID properly in debug messages.
Print more information on unknown 3Dconnexion devices.
Dump unknown HID reports.
The SpacePilot should be correct taken from Base.xml of the official driver
(v. 10.4.10). The others just seem right from pictures and user manuals.
Added RS-232 serial port HAL (Hardware Abstraction Layer) for Win32 and
POSIX (Linux, UNIX).

Implemented rough first serial device support by heavily borrowing code from
spacenavd. Tested working on Win32 with a SpaceBall 3003 FLX (apart from a
timing problem when opening).

The POSIX HAL tested on Windows but is far from ready.
Currently tested USB devices:
	"SpaceTraveler"
	"SpacePilot"
	"SpaceExplorer"

- 6DOF hat working.
- All button press and release events detected.
- Buttons correctly identified.
- LED On/Off working.
Tested working on Win32 with a SpaceTec IMC "SpaceBall 3003 FLX" and a
3Dconnexion "Magellan / SpaceMouse" (apart from a checksum error when
receiving button and 6DOF data simultaneously).
Writing to the screen and controlling the backlight works.
The API for writing to the screen is not finalized.

Also mark the tested and fully working USB devices as such:
  Spaceball 5000 USB
  SpaceTraveler
  SpacePilot SP1 USB
  SpaceExplorer
@jtsiomb
Copy link
Contributor

jtsiomb commented Jan 24, 2024

Thank you for your contribution, but I can't merge this as it stands for a number of reasons:

  1. libspnavdev, as you can probably tell by the fact that pretty much nothing was implemented before your pull request, is not active at this stage. The idea was to move all the device handling code from spacenavd to libspnavdev, to make it usable without spacenavd by standalone applications, and then change spacenavd to use libspnavdev for device handling. This was never done. The device handling code is still in spacenavd.
  2. As a result of 1, this pull request duplicates much of the work spacenavd already does.
  3. None of the decisions were discussed with me, leading to changes I cannot accept, like using cmake.

There are three ways forward that I can see:

  1. Make any applicable additions (like adding an alternative USB backend using hidapi, and adding windows serial support, or whatever else is relevant) to spacenavd instead. This should be done as a series of narrow pull requests, one feature at a time, and after discussing integration with me first, through an issue, or through email.
  2. If you're not interested in spacenavd but rather only on 6dof device handling as a standalone library: I could prioritize moving the spacenavd device handling core into this library, and then get back to you when that's done, so you can again submit a series of narrow pull requests merging relevant parts of your code into it.
  3. If you don't want to get involved with either 1 or 2, I could just cherry-pick changes from this pull request and merge to spacenavd at my leisure.

Let me know which way you prefer.

Edit: if you want to discuss any of this in real-time, I'm always idling in #spacenav on libera.chat (IRC) as "nuclear".

@jtsiomb jtsiomb closed this Jan 24, 2024
@ruevs
Copy link
Author

ruevs commented Jan 24, 2024

It would have surprised me, if you had just merged this pull request. I created it only to replace my original three, since they are now obsolete - essentially to "let you know" of the current state of the code.

The work I did was out of curiosity how to communicate with space mice and your nascent libspnavdev looked as a perfect starting point.

As for the ways to continue:

  1. I've not looked deeply into spacenavd - perhaps I should. Porting it to Windows could be interesting but I can not commit to this - too little time :-)
  2. I would definitely participate in this. But I am in no hurry at all. Nothing critical depends on my code. As far as I am aware the only place it is (potentially) used is here Libspnavdev solvespace/solvespace#968 .
  3. You are of course welcome to cherry pick any of the code I've written (and/or copy pasted from spacenavd) at any time. Both in libspnavdev and in spacenavd.

P.S. It has turned into a hobby of sniping cheap space mice just to test if they work correctly or to implement the support (I do realize I'm duplicating code from spacenavd but I thought this was the idea).
268ee34a-b045-403f-bef9-04ead242aed2
ea52c691-fdc9-43c5-9c7a-f24da8ed1a0a

P.P.S. CMake is non-itrusive and is not necessary. You can completely ignore the commit adding it if you want.

@ruevs
Copy link
Author

ruevs commented Jan 24, 2024

And of course I would be very glad if you give me specific comments and suggestions of what could/should be done differently or improved.

@jtsiomb
Copy link
Contributor

jtsiomb commented Jan 24, 2024

Nice collection :)

Ok, in that case no worries, but it would be helpful if you have said what the pull request was about, because usually it's meant for contributions intended to be merged, so that's what I thought this is.

If you don't have the time to work on spacenavd, I think the best approach would be #2. I'll try to get it done soon and then I will be in a better position to discuss what to merge and how.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants