Skip to content

Fixes for MSVC 2013#163

Closed
cboulay wants to merge 1 commit into
thp:masterfrom
psmoveservice:msvc2013
Closed

Fixes for MSVC 2013#163
cboulay wants to merge 1 commit into
thp:masterfrom
psmoveservice:msvc2013

Conversation

@cboulay
Copy link
Copy Markdown
Contributor

@cboulay cboulay commented Mar 13, 2015

Here is a cleaner version of my changes to support MSVC 2013.
While everything builds fine, not of the programs really work without merging the changes from #149 and #162 If those are merged then all programs work, including utilities and examples.

I made a lot of changes to CMakeLists.txt
IMO, it's more organized now. It's probably (almost) possible to separate the tracker portions into a separate file, if that's desirable.

Added external/msvc-support for lack of C99-compliance workarounds.

Changes to test_tracker to support MSVC because it cannot create dynamically-sized arrays.

Defined _USE_MATH_DEFINES in CMakeLists for MSVC. Fixes lack of math constants when importing math.h in MSVC.

Add gettimeofday for MSVC. Taken from http://stackoverflow.com/a/26085827/1256069 , implied no license.

Further small changes to support MSVC.

Added instructions for MSVC.

Moved MSVC implementation of usleep into unistd for easier use in other targets.

Replaced __func__ with __FUNCTION__ for universal platform support.

Replaced sleep with usleep for cross-platform support in psmovepair.

Clarified some instructions in README.msvc. Also fixed MSVC building of OpenCV.

Huge change to CMakeLists. More logical sectioning. Support for MSVC, and using PS3EYEDriver in Windows.

Moved sprintf fix to msvc-support/unistd.h. Made small tweaks to example programs to make them MSVC-compatible. Now everything builds successfully in MSVC.

Changed OSX's libusb path back. I tried but failed to build more recent versions.

Added registry file necessary for Windows PS3EYEDriver support. Added README for MinGW 64.

Renamed README files to make their use-cases more obvious.

Fixed regression in CMakeLists regarding libusb's include directory. Only applied to MinGW builds.
@cboulay
Copy link
Copy Markdown
Contributor Author

cboulay commented Apr 7, 2015

Squashed and rebased to fix conflicts.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line instead of commenting it out.

@thp
Copy link
Copy Markdown
Owner

thp commented Apr 20, 2015

Additional comments:

  • Please don't check in binaries (DLLs)
  • Put ps3eye_settings.reg somwhere below contrib/, not in the root directory

I'm still not sure whether we really need the whole pthreads-win32 library, just #ifdef'ing the relevant parts and calling the appropriate Win32 threading functions should do the trick; there's a slideshare that has a table with mappings:

http://www.slideshare.net/abufayez/pthreads-vs-win32-threads

@cboulay
Copy link
Copy Markdown
Contributor Author

cboulay commented Apr 20, 2015

Thanks for the link about win32 threads. I'll look into it to see if it's an easy replacement and if so then I can get rid of pthreads-win32.

Some changes I've made in one of my own branches have eliminated the need for ps3eye_settings.reg entirely. The PS3EYE settings are saved to a file in the home directory then restored from there, just like in Linux.

I wonder though if this mechanism is even necessary (note OSX does not do it at all). From what I can tell, all that's being done is the original settings are being queried from the camera as soon as the camera is opened, the camera settings are manipulated by the API, then the original settings are restored to the camera before it is closed. In Windows, using the PS3EYEDriver, the 'original' settings are just the PS3EYEDriver defaults. There's no need to store these to a file. I propose we change these Win functions to no-ops, just like the Mac functions.

Does it happen in Linux that if you change the camera settings with application A then those changed settings will be preserved when opening the camera with application B? If not, then these functions don't need to exist at all.

@thp
Copy link
Copy Markdown
Owner

thp commented May 25, 2015

Any news on this front?

@cboulay
Copy link
Copy Markdown
Contributor Author

cboulay commented May 25, 2015

Sorry, I've had a backlog of other things. I can get back to this by the end of the week. Let me know if there's anything urgent and I can do a separate smaller pull request.

@cboulay
Copy link
Copy Markdown
Contributor Author

cboulay commented Aug 7, 2015

I started over again in #182 .

@thp
Copy link
Copy Markdown
Owner

thp commented Jan 8, 2016

Closing in favor or #182 and consequently #190.

@thp thp closed this Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants