Skip to content

Add apriltag support to windows #77

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

gftabor
Copy link
Contributor

@gftabor gftabor commented Jun 17, 2025

No description provided.

@gftabor
Copy link
Contributor Author

gftabor commented Jun 17, 2025

Just looks like we need to pull over more windows fixes from the different sub packages

gftabor/apriltag_detector@1e03a6e

I had gotten it locally building before so it should all be doable.

@gftabor
Copy link
Contributor Author

gftabor commented Jun 17, 2025

Okay so this error

│ │ %PREFIX%\Library\include\rclcpp\rclcpp\duration.hpp(109,3): error C2059: syntax error: '(' [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\duration.hpp(109,3): error C2143: syntax error: missing ',' before '?' [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\duration.hpp(109,3): error C2059: syntax error: '?' [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\duration.hpp(159,3): error C2535: 'rclcpp::Duration::Duration(void)': member function already defined or declared [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │       %PREFIX%\Library\include\rclcpp\rclcpp\duration.hpp(107,3):
 │ │       see declaration of 'rclcpp::Duration::Duration'
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\time.hpp(204,3): error C2059: syntax error: '(' [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\time.hpp(204,3): error C2143: syntax error: missing ',' before '?' [%SRC_DIR%\build\apriltag_detector_umich.vcxproj]
 │ │   (compiling source file '../ros-jazzy-apriltag-detector-umich/src/work/src/detector_impl.cpp')
 │ │   
 │ │ %PREFIX%\Library\include\rclcpp\rclcpp\time.hpp(204,3): error C2059: syntax error: '?' 

Locally, I just worked around by removing a logging call so it doesnt need to reference \rclcpp\duration.hpp (see).

Not sure if there is a more appropriate fix.

@traversaro
Copy link
Member

The code around ~109 in Duration is:

   */
  static
  Duration
  max();

  Duration
  operator*(double scale) const;

  /// Get duration in nanosecods

I suspect then the problem is the use of max, and something that is including windows.h without defining NOMINMAX (see for example

+add_definitions(-DNOMINMAX)
). The actual fix is to never use windows.h in public headers, but sometimes doing that is tricky.

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