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 Port (WIP) #238

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
77bc858
initial commit with visibility added and some functions moved from .h…
lilustga May 3, 2020
adbd24b
Visibiltiy fixes for robot model and robot state
lilustga Jul 8, 2020
bf07c17
Windows bringup work in progress. Working on moveit_core/collision_de…
lilustga Jul 14, 2020
b6004c9
collision_detection_fcl symbol visibility. Moveit_core now builds.
lilustga Jul 14, 2020
0325aed
More symbol visibility fixes and cleanups of earlier commits. Milesto…
lilustga Jul 21, 2020
87d34b9
Disable warnings about stl dll link
ooeygui Jul 21, 2020
246181d
modified .repos file to point to forked dependencies.
lilustga Jul 21, 2020
b11a6db
Symbol visibility for robot state.
lilustga Jul 21, 2020
73c350c
MoveIt2 on Windows fixes
ooeygui Jul 21, 2020
406f106
fix.
seanyen Jul 21, 2020
4e5a474
fix.
seanyen Jul 21, 2020
a9c07ec
fix.
seanyen Jul 21, 2020
858b38e
remove all ASSIMP things.
seanyen Jul 21, 2020
4778da7
Fixing type deduction errors.
seanyen Jul 21, 2020
188ff0a
Fix Boost
ooeygui Jul 21, 2020
d8d9406
moveit_kinematics boost fixes
lilustga Jul 22, 2020
3d81711
More Windows Fixes
ooeygui Jul 22, 2020
1e2c28f
moveit_kinematics and run_moveit_cpp fix
lilustga Jul 22, 2020
d0d4fa5
moveit_ros_visualization symbol visibility.
lilustga Jul 22, 2020
0e52403
Removed unnecessary deps in .repos file. Added compiler flags
lilustga Jul 30, 2020
7188875
Update moveit2.repos
ooeygui Jun 3, 2021
ae0e1d7
Mopve the needle
ooeygui Jun 22, 2021
cfad43a
Added symbol visibility headers and replaced GLEW_LIBRARIES with GLEW…
lilustga Jun 24, 2021
734a8b7
undef near, far and max from windows.h, changed type from uint to uin…
lilustga Jun 24, 2021
d61357f
Fix for planning scene rviz plugin symbol visibility.
lilustga Jun 25, 2021
b56eba1
Added ifndef WIN32 for kill, fork, execv commands in warehouse_connec…
lilustga Jun 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions moveit_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10.2)
project(moveit_core VERSION 2.0.0 LANGUAGES CXX)

set(CMAKE_VERBOSE_MAKEFILE ON)

# Common cmake code applied to all moveit packages
find_package(moveit_common REQUIRED)
moveit_package()
Expand All @@ -13,7 +15,9 @@ find_package(Eigen3 REQUIRED)
# Finds Boost Components
include(ConfigExtras.cmake)

if(NOT MSVC)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
endif()

# TODO: Move collision detection into separate packages
find_package(Bullet 2.87 REQUIRED)
Expand All @@ -25,6 +29,26 @@ pkg_check_modules(LIBFCL REQUIRED "fcl>=0.5.0")
find_library(LIBFCL_LIBRARIES_FULL ${LIBFCL_LIBRARIES} ${LIBFCL_LIBRARY_DIRS})
set(LIBFCL_LIBRARIES "${LIBFCL_LIBRARIES_FULL}")

if(WIN32)
pkg_check_modules(LIBCCD REQUIRED ccd)
find_library(LIBCCD_LIBRARIES_FULL ${LIBCCD_LIBRARIES} ${LIBCCD_LIBRARY_DIRS})
set(LIBCCD_LIBRARIES "${LIBCCD_LIBRARIES_FULL}")
endif()

find_package(ASSIMP QUIET)
if(NOT ASSIMP_FOUND)
find_package(PkgConfig REQUIRED)
# assimp is required, so REQUIRE the second attempt
pkg_check_modules(ASSIMP_PC REQUIRED assimp)
set(ASSIMP_INCLUDE_DIRS ${ASSIMP_PC_INCLUDE_DIRS})
endif()

# find *absolute* paths to ASSIMP_LIBRARIES
# Both, pkg-config and assimp's cmake-config don't provide an absolute library path.
# For, pkg-config the path is in ASSIMP_PC_LIBRARY_DIRS, for cmake in ASSIMP_LIBRARY_DIRS.
find_library(ASSIMP_ABS_LIBRARIES NAMES ${ASSIMP_LIBRARIES} assimp HINTS ${ASSIMP_LIBRARY_DIRS} ${ASSIMP_PC_LIBRARY_DIRS})
set(ASSIMP_LIBRARIES "${ASSIMP_ABS_LIBRARIES}")

find_package(angles REQUIRED)
find_package(OCTOMAP REQUIRED)
find_package(urdfdom REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion moveit_core/ConfigExtras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# boost::iostreams on Windows depends on boost::zlib
if(WIN32)
set(EXTRA_BOOST_COMPONENTS zlib)
# set(EXTRA_BOOST_COMPONENTS zlib)
endif()
find_package(Boost REQUIRED
chrono
Expand Down
1 change: 1 addition & 0 deletions moveit_core/background_processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(MOVEIT_LIB_NAME moveit_background_processing)

add_library(${MOVEIT_LIB_NAME} SHARED src/background_processing.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@henningkayser PR #285 set's this as a global property

ament_target_dependencies(${MOVEIT_LIB_NAME}
Boost
rclcpp
Expand Down
8 changes: 8 additions & 0 deletions moveit_core/collision_detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ add_library(${MOVEIT_LIB_NAME} SHARED
)

set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION})
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${MOVEIT_LIB_NAME}
PRIVATE "COLLISION_DETECTION_BUILDING_LIBRARY")


ament_target_dependencies(${MOVEIT_LIB_NAME}
rclcpp
rmw_implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include <moveit/collision_detection/collision_detector_allocator.h>
#include <moveit/collision_detection/allvalid/collision_env_allvalid.h>
#include <moveit/collision_detection/visibility_control.hpp>

namespace collision_detection
{
Expand All @@ -46,6 +47,6 @@ class CollisionDetectorAllocatorAllValid
: public CollisionDetectorAllocatorTemplate<CollisionEnvAllValid, CollisionDetectorAllocatorAllValid>
{
public:
static const std::string NAME; // defined in collision_env_allvalid.cpp
COLLISION_DETECTION_PUBLIC static const std::string NAME; // defined in collision_env_allvalid.cpp
};
} // namespace collision_detection
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <moveit/macros/class_forward.h>
#include <moveit/collision_detection/collision_env.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/collision_detection/visibility_control.hpp>

namespace collision_detection
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (c) 2019, Open Source Robotics Foundation, Inc.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Copyright (c) 2019, Open Source Robotics Foundation, Inc.
// Copyright (c) 2020, Open Source Robotics Foundation, Inc.

// All rights reserved.
//
// Software License Agreement (BSD License 2.0)
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Open Source Robotics Foundation, Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef COLLISION_DETECTION__VISIBILITY_CONTROL_HPP_
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to simplify the visibility logic even more? It looks like these constants don't have to be defined for each class, so maybe we could use a single header for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@henningkayser We need one macro per shared lib. However, we could put them all in one header if that's preferable. It could be one large file in moveit_common which would be include logic for every shared lib.

Copy link
Contributor Author

@lilustga lilustga Sep 23, 2020

Choose a reason for hiding this comment

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

Could we also maybe leverage rcpputils? https://github.com/ros2/rcpputils/blob/master/include/rcpputils/visibility_control.hpp

@mikeferguson I'm not sure what you mean by leveraging rcpputils. It uses the same logic for symbol visibility but the RCPPUTILS_PUBLIC macro will switch between import and export based on whether rcpputils is the library currently being built.

#define COLLISION_DETECTION__VISIBILITY_CONTROL_HPP_

// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
// https://gcc.gnu.org/wiki/Visibility

#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define COLLISION_DETECTION_EXPORT __attribute__ ((dllexport))
#define COLLISION_DETECTION_IMPORT __attribute__ ((dllimport))
#else
#define COLLISION_DETECTION_EXPORT __declspec(dllexport)
#define COLLISION_DETECTION_IMPORT __declspec(dllimport)
#endif
#ifdef COLLISION_DETECTION_BUILDING_LIBRARY
#define COLLISION_DETECTION_PUBLIC COLLISION_DETECTION_EXPORT
#else
#define COLLISION_DETECTION_PUBLIC COLLISION_DETECTION_IMPORT
#endif
#define COLLISION_DETECTION_PUBLIC_TYPE COLLISION_DETECTION_PUBLIC
#define COLLISION_DETECTION_LOCAL
#else
#define COLLISION_DETECTION_EXPORT __attribute__ ((visibility("default")))
#define COLLISION_DETECTION_IMPORT
#if __GNUC__ >= 4
#define COLLISION_DETECTION_PUBLIC __attribute__ ((visibility("default")))
#define COLLISION_DETECTION_LOCAL __attribute__ ((visibility("hidden")))
#else
#define COLLISION_DETECTION_PUBLIC
#define COLLISION_DETECTION_LOCAL
#endif
#define COLLISION_DETECTION_PUBLIC_TYPE
#endif

#endif // COLLISION_DETECTION__VISIBILITY_CONTROL_HPP_
22 changes: 16 additions & 6 deletions moveit_core/collision_detection_bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_library(${MOVEIT_LIB_NAME}
src/bullet_integration/ros_bullet_utils.cpp
)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

ament_target_dependencies(${MOVEIT_LIB_NAME}
rclcpp
Expand Down Expand Up @@ -58,16 +59,25 @@ if(BUILD_TESTING)

ament_add_gtest(test_bullet_collision_detection test/test_bullet_collision_detection_pr2.cpp)
target_link_libraries(test_bullet_collision_detection moveit_test_utils ${MOVEIT_LIB_NAME})
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_collision_detection PRIVATE -Wno-deprecated-declarations)

if(NOT WIN32)
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_collision_detection PRIVATE -Wno-deprecated-declarations)
endif()

ament_add_gtest(test_bullet_collision_detection_panda test/test_bullet_collision_detection_panda.cpp)
target_link_libraries(test_bullet_collision_detection_panda moveit_test_utils ${MOVEIT_LIB_NAME})
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_collision_detection_panda PRIVATE -Wno-deprecated-declarations)

if(NOT WIN32)
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_collision_detection_panda PRIVATE -Wno-deprecated-declarations)
endif()

ament_add_gtest(test_bullet_continuous_collision_checking test/test_bullet_continuous_collision_checking.cpp)
target_link_libraries(test_bullet_continuous_collision_checking moveit_test_utils ${MOVEIT_LIB_NAME})
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_continuous_collision_checking PRIVATE -Wno-deprecated-declarations)

if(NOT WIN32)
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_bullet_continuous_collision_checking PRIVATE -Wno-deprecated-declarations)
endif()
endif()
27 changes: 23 additions & 4 deletions moveit_core/collision_detection_fcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,36 @@ add_library(${MOVEIT_LIB_NAME} SHARED
src/collision_env_fcl.cpp
)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
ament_target_dependencies(${MOVEIT_LIB_NAME}
rclcpp
rmw_implementation
urdf
urdfdom
urdfdom_headers
LIBFCL
LIBCCD
Boost
visualization_msgs
)
target_link_libraries(${MOVEIT_LIB_NAME}
moveit_collision_detection
)

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${MOVEIT_LIB_NAME}
PRIVATE "COLLISION_DETECTION_FCL_BUILDING_LIBRARY")

add_library(collision_detector_fcl_plugin SHARED src/collision_detector_fcl_plugin_loader.cpp)
set_target_properties(collision_detector_fcl_plugin PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(collision_detector_fcl_plugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(collision_detector_fcl_plugin
PRIVATE "COLLISION_DETECTION_FCL_PLUGIN_BUILDING_LIBRARY")


ament_target_dependencies(collision_detector_fcl_plugin
rclcpp
urdf
Expand All @@ -47,11 +61,16 @@ if(BUILD_TESTING)

ament_add_gtest(test_fcl_collision_detection test/test_fcl_collision_detection_pr2.cpp)
target_link_libraries(test_fcl_collision_detection moveit_test_utils ${MOVEIT_LIB_NAME})
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_fcl_collision_detection PRIVATE -Wno-deprecated-declarations)
if (NOT WIN32)
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_fcl_collision_detection PRIVATE -Wno-deprecated-declarations)
endif()

ament_add_gtest(test_fcl_collision_detection_panda test/test_fcl_collision_detection_panda.cpp)
target_link_libraries(test_fcl_collision_detection_panda moveit_test_utils ${MOVEIT_LIB_NAME})
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_fcl_collision_detection_panda PRIVATE -Wno-deprecated-declarations)

if (NOT WIN32)
# TODO: remove if transition to gtest's new API TYPED_TEST_SUITE_P is finished
target_compile_options(test_fcl_collision_detection PRIVATE -Wno-deprecated-declarations)
endif()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <moveit/macros/class_forward.h>
#include <moveit/collision_detection_fcl/fcl_compat.h>
#include <geometric_shapes/check_isometry.h>
#include <moveit/collision_detection_fcl/visibility_control.hpp>

#if (MOVEIT_FCL_VERSION >= FCL_VERSION_CHECK(0, 6, 0))
#include <fcl/broadphase/broadphase_collision_manager.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@

#include <moveit/collision_detection/collision_detector_allocator.h>
#include <moveit/collision_detection_fcl/collision_env_fcl.h>
#include <moveit/collision_detection_fcl/visibility_control.hpp>

namespace collision_detection
{
/** \brief An allocator for FCL collision detectors */
class CollisionDetectorAllocatorFCL
class COLLISION_DETECTION_FCL_PUBLIC CollisionDetectorAllocatorFCL
: public CollisionDetectorAllocatorTemplate<CollisionEnvFCL, CollisionDetectorAllocatorFCL>
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@

#include <moveit/collision_detection/collision_plugin.h>
#include <moveit/collision_detection_fcl/collision_detector_allocator_fcl.h>
#include <moveit/collision_detection_fcl/visibility_control.hpp>

namespace collision_detection
{
class CollisionDetectorFCLPluginLoader : public CollisionPlugin
class COLLISION_DETECTION_FCL_PLUGIN_PUBLIC CollisionDetectorFCLPluginLoader : public CollisionPlugin
{
public:
bool initialize(const planning_scene::PlanningScenePtr& scene) const override;
Expand Down
Loading