Recent (2022) improvements to the PS Move API library

131 views
Skip to first unread message

Thomas Perl

unread,
Jan 13, 2023, 3:14:48 AM1/13/23
to psm...@googlegroups.com
Hi,

I spent some of my free time over the holidays to fix up some
long-standing annoyances with the PS Move API. As part of that, I also
ripped out many things (e.g. most language bindings) that weren't used
but also modernised the codebase and added a few new features.

All the changes are listed in the ChangeLog[1], but here are some highlights:

- Support for PS4 and PS5 cameras (including firmware upload) on
Linux, macOS and (partially) Windows -- they act as UVC devices once
the firmware is loaded
- New fast hue-based color calibration as alternative to blinking
calibration[2]
- Many internal fixes to the tracker, including per-controller
dimming and less mis-detections
- Move from Travis CI and AppVeyor to Github Actions (and removed
MinGW in favor of MSVC, to simplify the build matrix and reduce
"#ifdef"s)
- Migrate to OpenCV 4, glm 0.9.9.8, C++14 and C99 stdbool.h
- Improved camera control on Linux using V4L2 APIs (PS3, PS4, PS5 cameras)
- Fancy logging macros

Some of the original design decisions and code style decisions were
quite bad in retrospect, but a few things got cleaned up, and the
whole project started around a time where C++11 wasn't all that well
supported or even a thing yet, and I didn't have as many years of
professional C/C++ development experience as I have today ;) Not
everything has been touched, and there's always room for improvement,
but at least the newly added code (e.g. camera support and camera
control driver) should be reasonably easy-to-read-and-maintain,
although we still haven't fully removed the OpenCV C API usage, so
there's that.

One thing that would have been a fun project but that I haven't gotten
around to do would be to do the CV parts in a custom GPU (compute)
shader, as it would not be too complicated and could reduce the binary
size which right now drags in lots of OpenCV things that we don't use
(alternatively, looking at which parts of OpenCV need building could
of course also help).

There are still some things that would be nice-to-have, but have not
been implemented yet:

- More robust 3D sphere tracking[3]
- macOS Ventura Bluetooth pairing[4]

Obviously the changes will affect the API and ABI of the library, so
the next release would definitely be a new major version. As I don't
know of any active API users that would benefit from a new release
with stable API/ABI, it's very likely that there just won't (ever?) be
a new official major release, and things will just move on in the
development branch without any API/ABI stability guarantees (which
makes it easier to clean things up and improve things, no need to
pretend the API needs to be stable). For stability, version 4.0.12
from December 2020 ist still available and not going away, although
practically speaking I'd recommend upgrading to the latest development
version, as it has seen many improvements, and porting should be
relatively straightforward.

There probably won't be much more work on this in the near future, but
it was a fun exercise while I happened to have all the devices (PS3
camera, PS4 camera with adapter, PS5 camera and lots of controllers)
in one place over the holidays. If you do want to sponsor development
of additional features in PS Move API or have related projects where
you could need consultant help, feel free to get in touch.

Just a quick update on the developments, in case someone wants to use
this opportunity to take the new tracker improvements (or new camera
support) out for a spin.


Thanks,
Thomas

[1] https://github.com/thp/psmoveapi/blob/master/CHANGELOG.md
[2] https://www.youtube.com/watch?v=ptP_zkRvAlE
[3] https://github.com/thp/psmoveapi/issues/465
[4] https://github.com/thp/psmoveapi/issues/457

Justin Schmid

unread,
Jan 13, 2023, 9:15:30 AM1/13/23
to psm...@googlegroups.com
Thanks for doing this.
I ended up having to switch to Vive trackers but I prefer the PS move controllers.  If I get the time I may switch over again and see if these new updates will enable me to use the PS move controllers again in my project.

Justin

--
You received this message because you are subscribed to the Google Groups "psmove" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psmove+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psmove/CA%2BuOhx5M3RLyaxzSzH-xWxnTjNHSKbh8YecVA9oX%2BcfnTRzdpw%40mail.gmail.com.

Confidentiality Statement: This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify the sender immediately. Thank you.

Kieran Coulter

unread,
Jan 26, 2023, 6:56:11 PM1/26/23
to psm...@googlegroups.com
Hi Thomas,

Thanks for these updates. I noticed that the OpenGL examples are no longer built:
test_opengl
test_opengl2
test_opengl3

Was there a reason for their removal? Is the code still around in case we want to build these targets manually?

Kieran Coulter

unread,
Jan 26, 2023, 7:07:25 PM1/26/23
to psm...@googlegroups.com
Ah I discovered this line in the CHANGELOG:

  • Removed legacy OpenGL examples and glfw3 (only used for the OpenGL examples)
I suppose the feeling is that OpenGL is a bit too old at this point to be a useful example. It might be nice however to replace the old examples with a modern equivalent rather than having no graphical examples.

I'd be happy to contribute some Vulkan replacement examples that reproduce the OpenGL examples.. I'll try to revert https://github.com/thp/psmoveapi/commit/3f9ae0e41b0081e1b8e32d90f62d245241d18851 onto my fork of the current tip to get started

th.perl

unread,
Feb 11, 2023, 5:20:01 AM2/11/23
to psmove
OpenGL is still totally fine, and Vulkan is probably overkill for those examples.

So just using modern OpenGL would be fine, just haven't gotten around to port it.


HTH,
Thomas

Kieran Coulter

unread,
Feb 18, 2023, 4:58:55 PM2/18/23
to psm...@googlegroups.com
I’m happy to help modernize the OpenGL examples in that case, as one thing that bugs me is the lack of a horizontal flip so that you see the Move wand moving as though it was in the mirror. 

Just hoping to find a good chunk of time to dig into this!

--
You received this message because you are subscribed to the Google Groups "psmove" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psmove+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages