-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathros-noetic-moveit-ros-perception.osx.patch
85 lines (79 loc) · 2.58 KB
/
ros-noetic-moveit-ros-perception.osx.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2e3dc26e..735d225f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 3.1.3)
project(moveit_ros_perception)
-option(WITH_OPENGL "Build the parts that depend on OpenGL" ON)
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
+ option(WITH_OPENGL "Build the parts that depend on OpenGL" OFF)
+else()
+ option(WITH_OPENGL "Build the parts that depend on OpenGL" ON)
+endif()
find_package(Boost REQUIRED thread)
@@ -12,6 +16,7 @@ if(WITH_OPENGL)
endif()
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
+ list(INSERT CMAKE_FRAMEWORK_PATH 0 /System/Library/Frameworks)
find_package(GLUT REQUIRED)
set(gl_LIBS ${gl_LIBS} ${OPENGL_LIBRARIES})
set(perception_GL_INCLUDE_DIRS "mesh_filter/include" "depth_image_octomap_updater/include")
@@ -45,6 +50,25 @@ find_package(catkin REQUIRED COMPONENTS
moveit_build_options()
find_package(Eigen3 REQUIRED)
+
+
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(OpenMP_C "${CMAKE_C_COMPILER}")
+ set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+ set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
+ set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+ set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+ set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
+ endif()
+ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
+ set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+ set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
+ set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+ set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+ set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+ endif()
+
find_package(OpenMP REQUIRED)
find_package(OpenCV)
diff --git a/mesh_filter/src/gl_renderer.cpp b/mesh_filter/src/gl_renderer.cpp
index 834d2b4ed..8ba0300b2 100644
--- a/mesh_filter/src/gl_renderer.cpp
+++ b/mesh_filter/src/gl_renderer.cpp
@@ -37,11 +37,13 @@
#include <GL/glew.h>
#ifdef __APPLE__
#include <OpenGL/glu.h>
+#include <OpenGL/gl.h>
+#include <GLUT/glut.h>
#else
#include <GL/glu.h>
-#endif
#include <GL/glut.h>
#include <GL/freeglut.h>
+#endif
#include <moveit/mesh_filter/gl_renderer.h>
#include <sstream>
#include <fstream>
@@ -399,8 +401,13 @@ void mesh_filter::GLRenderer::createGLContext()
glutHideWindow();
for (int i = 0; i < 10; ++i)
+ {
+#ifdef __APPLE__
+ glutCheckLoop();
+#else
glutMainLoopEvent();
-
+#endif
+ }
context_[thread_id] = std::pair<unsigned, GLuint>(1, window_id);
}
else