Skip to content
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

Windows support #16

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Windows support #16

wants to merge 8 commits into from

Conversation

ptrsr
Copy link

@ptrsr ptrsr commented May 20, 2018

Purpose

The current version of apriltags-cpp has UNIX only functions and variables. By upgrading to a newer C++ and OpenCV version it's now possible to compile the library on Windows.

Changes

A quick overview of the changes made:

  • Changed the UNIX only variable M_PI to CV_PI.
  • Changed the UNIX only function gettimeofday to cross platform std::chrono.
  • Changed CMake file to work with CMake GUI on Windows.
  • Added example PDF of Tags (family 36h11)

Reasoning for pull request

When I initially found this library and wanted to play around with it, I immediately stumbled on the fact that this library isn't compatible with Windows. Because of my lack of experience with CMake back then, porting it seemed too far out of my reach. Having become more familiar with the Library, it seems like a good idea to make this library more accessible.

Caveats

  • Since the examples use the UNIX only getopt function, I excluded the examples from compiling. However the library is compiled and adding an example PDF file should help people get something working.
  • This pull request will make apriltags-cpp incompatible with older (non c++ 11) compilers.
  • This pull request also depends on the newer OpenCV 3.x version. I am not completely sure which versions are compatible, which is why I made the CMake check for my current OpenCV version or newer (3.4.0).
  • Minimum CMake version also updated to my current CMake version. It might work with older versions, but I cannot guarantee.

Possible improvements

  • Include a cross platform getopt to enable compiling the examples on Windows.
  • Put this pull under a different branch to keep compatibility with older CMake and OpenCV versions?

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.

1 participant