From 16aece19e93dcbeff95798944b472bb338dc4e40 Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Thu, 8 Oct 2020 11:05:43 -0500 Subject: [PATCH] Add visibility control to all packages --- tesseract/tesseract/CMakeLists.txt | 10 +- .../tesseract/cmake/tesseract-config.cmake.in | 1 + .../include/tesseract/manipulator_manager.h | 4 +- .../tesseract/include/tesseract/tesseract.h | 3 +- .../include/tesseract/tesseract_init_info.h | 3 +- .../include/tesseract/visibility_control.h | 61 +++++++ tesseract/tesseract/package.xml | 2 + tesseract/tesseract_collision/CMakeLists.txt | 16 +- .../bullet/bullet_cast_bvh_manager.h | 3 +- .../bullet/bullet_cast_simple_manager.h | 3 +- .../bullet/bullet_discrete_bvh_manager.h | 3 +- .../bullet/bullet_discrete_simple_manager.h | 3 +- .../tesseract_collision/bullet/bullet_utils.h | 29 ++-- .../tesseract_collision_configuration.h | 4 +- .../tesseract_compound_collision_algorithm.h | 9 +- ...ct_compound_compound_collision_algorithm.h | 8 +- .../tesseract_convex_convex_algorithm.h | 3 +- .../bullet/tesseract_gjk_pair_detector.h | 3 +- .../bullet/visibility_control.h | 61 +++++++ .../core/continuous_contact_manager.h | 3 +- .../core/continuous_contact_manager_factory.h | 3 +- .../core/discrete_contact_manager.h | 3 +- .../core/discrete_contact_manager_factory.h | 3 +- .../include/tesseract_collision/core/types.h | 8 +- .../core/visibility_control.h | 61 +++++++ .../fcl/fcl_collision_object_wrapper.h | 4 +- .../fcl/fcl_discrete_managers.h | 3 +- .../tesseract_collision/fcl/fcl_utils.h | 9 +- .../fcl/visibility_control.h | 61 +++++++ .../tesseract_collision/test/CMakeLists.txt | 1 + .../test/benchmarks/CMakeLists.txt | 1 + tesseract/tesseract_common/CMakeLists.txt | 7 +- .../cmake/tesseract_macros.cmake | 47 +++++- .../include/tesseract_common/resource.h | 8 +- .../include/tesseract_common/status_code.h | 8 +- .../include/tesseract_common/types.h | 6 +- .../tesseract_common/visibility_control.h | 61 +++++++ .../tesseract_common/test/CMakeLists.txt | 1 + .../tesseract_environment/CMakeLists.txt | 15 +- .../tesseract_environment/core/commands.h | 35 ++-- .../tesseract_environment/core/environment.h | 3 +- .../tesseract_environment/core/state_solver.h | 3 +- .../tesseract_environment/core/types.h | 8 +- .../core/visibility_control.h | 61 +++++++ .../kdl/kdl_state_solver.h | 3 +- .../tesseract_environment/kdl/kdl_utils.h | 56 ------- .../kdl/visibility_control.h | 61 +++++++ .../tesseract_environment/ofkt/ofkt_node.h | 3 +- .../tesseract_environment/ofkt/ofkt_nodes.h | 13 +- .../ofkt/ofkt_state_solver.h | 3 +- .../ofkt/visibility_control.h | 61 +++++++ .../tesseract_environment/test/CMakeLists.txt | 1 + tesseract/tesseract_geometry/CMakeLists.txt | 24 +-- .../include/tesseract_geometry/geometry.h | 4 +- .../tesseract_geometry/geometry_loaders.h | 6 +- .../include/tesseract_geometry/impl/box.h | 2 +- .../include/tesseract_geometry/impl/capsule.h | 2 +- .../include/tesseract_geometry/impl/cone.h | 2 +- .../tesseract_geometry/impl/convex_mesh.h | 2 +- .../tesseract_geometry/impl/cylinder.h | 2 +- .../include/tesseract_geometry/impl/mesh.h | 2 +- .../include/tesseract_geometry/impl/octree.h | 2 +- .../include/tesseract_geometry/impl/plane.h | 2 +- .../tesseract_geometry/impl/sdf_mesh.h | 2 +- .../include/tesseract_geometry/impl/sphere.h | 2 +- .../include/tesseract_geometry/mesh_parser.h | 32 ++-- .../tesseract_geometry/visibility_control.h | 61 +++++++ .../tesseract_geometry/test/CMakeLists.txt | 1 + tesseract/tesseract_kinematics/CMakeLists.txt | 17 +- .../core/forward_kinematics.h | 3 +- .../core/forward_kinematics_factory.h | 3 +- .../core/inverse_kinematics.h | 3 +- .../core/inverse_kinematics_factory.h | 3 +- .../core/rep_inverse_kinematics.h | 3 +- .../core/rop_inverse_kinematics.h | 3 +- .../core/visibility_control.h | 61 +++++++ .../ikfast/ikfast_inv_kin.h | 3 +- .../ikfast/visibility_control.h | 61 +++++++ .../kdl/kdl_fwd_kin_chain.h | 3 +- .../kdl/kdl_fwd_kin_chain_factory.h | 3 +- .../kdl/kdl_fwd_kin_tree.h | 5 +- .../kdl/kdl_fwd_kin_tree_factory.h | 4 +- .../kdl/kdl_inv_kin_chain_lma.h | 3 +- .../kdl/kdl_inv_kin_chain_lma_factory.h | 4 +- .../kdl/kdl_inv_kin_chain_nr.h | 3 +- .../kdl/kdl_inv_kin_chain_nr_factory.h | 4 +- .../tesseract_kinematics/kdl/kdl_utils.h | 3 +- .../kdl/visibility_control.h | 61 +++++++ .../tesseract_kinematics/opw/opw_inv_kin.h | 3 +- .../opw/visibility_control.h | 61 +++++++ .../tesseract_kinematics/test/CMakeLists.txt | 3 + .../tesseract_command_language/CMakeLists.txt | 7 +- .../cartesian_waypoint.h | 3 +- .../composite_instruction.h | 3 +- .../core/instruction.h | 5 +- .../core/waypoint.h | 6 +- .../tesseract_command_language/deserialize.h | 30 ++-- .../instruction_type.h | 18 +- .../joint_waypoint.h | 3 +- .../manipulator_info.h | 5 +- .../move_instruction.h | 3 +- .../null_instruction.h | 3 +- .../null_waypoint.h | 4 +- .../plan_instruction.h | 3 +- .../tesseract_command_language/serialize.h | 7 +- .../state_waypoint.h | 3 +- .../utils/flatten_utils.h | 18 +- .../utils/get_instruction_utils.h | 33 ++-- .../tesseract_command_language/utils/utils.h | 33 ++-- .../visibility_control.h | 61 +++++++ .../waypoint_type.h | 10 +- .../tesseract_motion_planners/CMakeLists.txt | 26 ++- .../examples/CMakeLists.txt | 3 + .../tesseract_motion_planners/core/planner.h | 3 +- .../core/trajectory_validator.h | 3 +- .../tesseract_motion_planners/core/types.h | 5 +- .../core/visibility_control.h | 61 +++++++ ...descartes_motion_planner_status_category.h | 4 +- .../descartes/deserialize.h | 16 +- .../descartes/serialize.h | 9 +- .../descartes/visibility_control.h | 61 +++++++ .../ompl/compound_state_validator.h | 4 +- .../ompl/continuous_motion_validator.h | 3 +- .../ompl/deserialize.h | 13 +- .../ompl/discrete_motion_validator.h | 9 +- .../ompl/ompl_motion_planner.h | 3 +- .../ompl_motion_planner_status_category.h | 3 +- .../ompl/ompl_planner_configurator.h | 32 ++-- .../ompl/ompl_problem.h | 3 +- .../default_problem_generator.h | 8 +- .../ompl/profile/ompl_default_plan_profile.h | 3 +- .../ompl/profile/ompl_profile.h | 3 +- .../ompl/serialize.h | 8 +- .../ompl/state_collision_validator.h | 3 +- .../tesseract_motion_planners/ompl/utils.h | 24 +-- .../ompl/visibility_control.h | 61 +++++++ .../ompl/weighted_real_vector_state_sampler.h | 4 +- .../tesseract_motion_planners/planner_utils.h | 5 + .../tesseract_motion_planners/robot_config.h | 7 + .../simple_planner_default_lvs_plan_profile.h | 3 +- .../simple_planner_default_plan_profile.h | 5 +- ...imple_planner_interpolation_plan_profile.h | 3 +- .../simple/profile/simple_planner_profile.h | 5 +- .../simple/simple_motion_planner.h | 6 +- .../fixed_size_assign_position.h | 51 +++--- .../fixed_size_interpolation.h | 105 ++++++------ .../step_generators/lvs_interpolation.h | 153 +++++++++-------- .../simple/visibility_control.h | 61 +++++++ .../trajopt/deserialize.h | 30 ++-- .../default_problem_generator.h | 10 +- .../trajopt_default_composite_profile.h | 3 +- .../profile/trajopt_default_plan_profile.h | 3 +- .../trajopt/profile/trajopt_profile.h | 5 +- .../trajopt/serialize.h | 17 +- .../trajopt/trajopt_collision_config.h | 5 +- .../trajopt/trajopt_motion_planner.h | 6 +- .../trajopt/trajopt_utils.h | 157 ++++++++++-------- .../trajopt/visibility_control.h | 61 +++++++ .../src/descartes/descartes_collision.cpp | 5 +- .../descartes_collision_edge_evaluator.cpp | 5 +- .../descartes/descartes_motion_planner.cpp | 5 +- .../src/descartes/descartes_robot_sampler.cpp | 5 +- .../descartes_default_plan_profile.cpp | 5 +- .../step_generators/lvs_interpolation.cpp | 5 - .../test/CMakeLists.txt | 9 + .../tesseract_process_managers/CMakeLists.txt | 9 +- .../examples/CMakeLists.txt | 2 + .../debug_observer.h | 4 +- .../process_generator.h | 3 +- ...ntinuous_contact_check_process_generator.h | 3 +- ...discrete_contact_check_process_generator.h | 3 +- .../fix_state_bounds_process_generator.h | 5 +- .../fix_state_collision_process_generator.h | 5 +- ...pline_parameterization_process_generator.h | 5 +- .../motion_planner_process_generator.h | 3 +- .../process_input.h | 3 +- .../process_manager.h | 3 +- .../raster_dt_process_manager.h | 3 +- .../process_managers/raster_process_manager.h | 3 +- .../raster_waad_dt_process_manager.h | 3 +- .../raster_waad_process_manager.h | 3 +- .../process_managers/simple_process_manager.h | 3 +- .../taskflow_generator.h | 3 +- .../taskflow_generators/graph_taskflow.h | 3 +- .../taskflow_generators/sequential_taskflow.h | 3 +- .../taskflows/cartesian_taskflow.h | 3 +- .../taskflows/descartes_taskflow.h | 5 +- .../taskflows/freespace_taskflow.h | 5 +- .../taskflows/ompl_taskflow.h | 3 +- .../taskflows/trajopt_taskflow.h | 3 +- .../visibility_control.h | 61 +++++++ .../src/taskflows/cartesian_taskflow.cpp | 2 +- .../src/taskflows/descartes_taskflow.cpp | 6 +- .../src/taskflows/freespace_taskflow.cpp | 8 +- .../src/taskflows/ompl_taskflow.cpp | 2 +- .../src/taskflows/trajopt_taskflow.cpp | 2 +- .../tesseract_process_planners/CMakeLists.txt | 2 +- .../CMakeLists.txt | 7 +- .../iterative_spline_parameterization.h | 3 +- .../visibility_control.h | 61 +++++++ .../tesseract_scene_graph/CMakeLists.txt | 10 +- .../allowed_collision_matrix.h | 4 +- .../include/tesseract_scene_graph/graph.h | 3 +- .../include/tesseract_scene_graph/joint.h | 14 +- .../include/tesseract_scene_graph/link.h | 11 +- .../tesseract_scene_graph/resource_locator.h | 8 +- .../tesseract_scene_graph/srdf/types.h | 8 +- .../tesseract_scene_graph/srdf_model.h | 3 +- .../visibility_control.h | 61 +++++++ .../tesseract_scene_graph/test/CMakeLists.txt | 1 + tesseract/tesseract_urdf/CMakeLists.txt | 10 +- .../include/tesseract_urdf/box.h | 3 +- .../include/tesseract_urdf/calibration.h | 3 +- .../include/tesseract_urdf/capsule.h | 3 +- .../include/tesseract_urdf/collision.h | 3 +- .../include/tesseract_urdf/cone.h | 3 +- .../include/tesseract_urdf/convex_mesh.h | 3 +- .../include/tesseract_urdf/cylinder.h | 3 +- .../include/tesseract_urdf/dynamics.h | 3 +- .../include/tesseract_urdf/geometry.h | 3 +- .../include/tesseract_urdf/inertial.h | 3 +- .../include/tesseract_urdf/joint.h | 3 +- .../include/tesseract_urdf/limits.h | 3 +- .../include/tesseract_urdf/link.h | 3 +- .../include/tesseract_urdf/material.h | 3 +- .../include/tesseract_urdf/mesh.h | 3 +- .../include/tesseract_urdf/mimic.h | 3 +- .../include/tesseract_urdf/octomap.h | 3 +- .../include/tesseract_urdf/octree.h | 3 +- .../include/tesseract_urdf/origin.h | 4 +- .../include/tesseract_urdf/point_cloud.h | 3 +- .../tesseract_urdf/safety_controller.h | 3 +- .../include/tesseract_urdf/sdf_mesh.h | 3 +- .../include/tesseract_urdf/sphere.h | 3 +- .../include/tesseract_urdf/urdf_parser.h | 25 +-- .../tesseract_urdf/visibility_control.h | 61 +++++++ .../include/tesseract_urdf/visual.h | 3 +- tesseract/tesseract_urdf/test/CMakeLists.txt | 1 + .../tesseract_visualization/CMakeLists.txt | 18 +- .../ignition/conversions.h | 11 +- .../ignition/entity_manager.h | 4 +- .../tesseract_ignition_visualization.h | 4 +- .../ignition/visibility_control.h | 61 +++++++ .../trajectory_interpolator.h | 3 +- .../trajectory_player.h | 3 +- .../visibility_control.h | 61 +++++++ .../tesseract_visualization/visualization.h | 3 +- .../visualization_loader.h | 3 +- .../test/CMakeLists.txt | 1 + 249 files changed, 2668 insertions(+), 736 deletions(-) create mode 100644 tesseract/tesseract/include/tesseract/visibility_control.h create mode 100644 tesseract/tesseract_collision/include/tesseract_collision/bullet/visibility_control.h create mode 100644 tesseract/tesseract_collision/include/tesseract_collision/core/visibility_control.h create mode 100644 tesseract/tesseract_collision/include/tesseract_collision/fcl/visibility_control.h create mode 100644 tesseract/tesseract_common/include/tesseract_common/visibility_control.h create mode 100644 tesseract/tesseract_environment/include/tesseract_environment/core/visibility_control.h create mode 100644 tesseract/tesseract_environment/include/tesseract_environment/kdl/visibility_control.h create mode 100644 tesseract/tesseract_environment/include/tesseract_environment/ofkt/visibility_control.h create mode 100644 tesseract/tesseract_geometry/include/tesseract_geometry/visibility_control.h create mode 100644 tesseract/tesseract_kinematics/include/tesseract_kinematics/core/visibility_control.h create mode 100644 tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/visibility_control.h create mode 100644 tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/visibility_control.h create mode 100644 tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/visibility_control.h create mode 100644 tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/visibility_control.h create mode 100644 tesseract/tesseract_scene_graph/include/tesseract_scene_graph/visibility_control.h create mode 100644 tesseract/tesseract_urdf/include/tesseract_urdf/visibility_control.h create mode 100644 tesseract/tesseract_visualization/include/tesseract_visualization/ignition/visibility_control.h create mode 100644 tesseract/tesseract_visualization/include/tesseract_visualization/visibility_control.h diff --git a/tesseract/tesseract/CMakeLists.txt b/tesseract/tesseract/CMakeLists.txt index d14a03a13f2..4efffe0bf01 100644 --- a/tesseract/tesseract/CMakeLists.txt +++ b/tesseract/tesseract/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +find_package(Eigen3 REQUIRED) find_package(Boost COMPONENTS system REQUIRED) find_package(console_bridge REQUIRED) find_package(tesseract_scene_graph REQUIRED) @@ -20,7 +24,8 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) tesseract_variables() # Create target -add_library(${PROJECT_NAME} SHARED src/tesseract.cpp src/manipulator_manager.cpp) +add_library(${PROJECT_NAME} src/tesseract.cpp src/manipulator_manager.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_urdf tesseract::tesseract_scene_graph @@ -32,6 +37,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_command_language console_bridge) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -40,7 +46,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC "$") target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} - $) #tesseract::tesseract_common Due to bug in catkin, there is an open PR + ${EIGEN3_INCLUDE_DIRS}) configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME}) diff --git a/tesseract/tesseract/cmake/tesseract-config.cmake.in b/tesseract/tesseract/cmake/tesseract-config.cmake.in index 8dfd322c2e7..2dd48221dae 100644 --- a/tesseract/tesseract/cmake/tesseract-config.cmake.in +++ b/tesseract/tesseract/cmake/tesseract-config.cmake.in @@ -11,6 +11,7 @@ if(${CMAKE_VERSION} VERSION_LESS "3.10.0") else() find_dependency(Boost COMPONENTS system) endif() +find_dependency(Eigen3) find_dependency(tesseract_scene_graph) find_dependency(tesseract_collision) find_dependency(tesseract_environment) diff --git a/tesseract/tesseract/include/tesseract/manipulator_manager.h b/tesseract/tesseract/include/tesseract/manipulator_manager.h index c0e56531ab8..f46f1ef8d0f 100644 --- a/tesseract/tesseract/include/tesseract/manipulator_manager.h +++ b/tesseract/tesseract/include/tesseract/manipulator_manager.h @@ -29,6 +29,7 @@ #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include +#include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include @@ -36,10 +37,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract { -class ManipulatorManager +class TESSERACT_PUBLIC ManipulatorManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract/include/tesseract/tesseract.h b/tesseract/tesseract/include/tesseract/tesseract.h index 4ece8dd0a10..49e70a1ba5a 100644 --- a/tesseract/tesseract/include/tesseract/tesseract.h +++ b/tesseract/tesseract/include/tesseract/tesseract.h @@ -42,6 +42,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract { @@ -59,7 +60,7 @@ using FindTCPCallbackFn = std::function; diff --git a/tesseract/tesseract/include/tesseract/tesseract_init_info.h b/tesseract/tesseract/include/tesseract/tesseract_init_info.h index ff985be052b..ce5ea2526a1 100644 --- a/tesseract/tesseract/include/tesseract/tesseract_init_info.h +++ b/tesseract/tesseract/include/tesseract/tesseract_init_info.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract { @@ -56,7 +57,7 @@ enum class TesseractInitType Note: Recreating a Tesseract does not guarantee that it is identical to the Tesseract associate with this construction info since the kinmeatics managers could have changed and it does not include the environment command history. This will simply recreate the Tesseract as it was at construction. */ -struct TesseractInitInfo +struct TESSERACT_PUBLIC TesseractInitInfo { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; diff --git a/tesseract/tesseract/include/tesseract/visibility_control.h b/tesseract/tesseract/include/tesseract/visibility_control.h new file mode 100644 index 00000000000..11de8b2dece --- /dev/null +++ b/tesseract/tesseract/include/tesseract/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_VISIBILITY_CONTROL_H +#define TESSERACT_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_EXPORT __declspec(dllexport) + #define TESSERACT_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_STATIC_LIBRARY + #ifdef TESSERACT_LIBRARY_SHARED + #define TESSERACT_PUBLIC TESSERACT_EXPORT + #else + #define TESSERACT_PUBLIC TESSERACT_IMPORT + #endif + #else + #define TESSERACT_PUBLIC + #endif + #define TESSERACT_PUBLIC_TYPE TESSERACT_PUBLIC + #define TESSERACT_LOCAL +#else + #define TESSERACT_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_PUBLIC + #define TESSERACT_LOCAL + #endif + #define TESSERACT_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract/package.xml b/tesseract/tesseract/package.xml index 8c2d84f4e20..66fcea942b5 100644 --- a/tesseract/tesseract/package.xml +++ b/tesseract/tesseract/package.xml @@ -8,6 +8,8 @@ Levi Armstrong cmake_common_scripts + eigen + eigen boost tesseract_scene_graph tesseract_collision diff --git a/tesseract/tesseract_collision/CMakeLists.txt b/tesseract/tesseract_collision/CMakeLists.txt index dd4d14ba66b..24a06a60ce0 100644 --- a/tesseract/tesseract_collision/CMakeLists.txt +++ b/tesseract/tesseract_collision/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.6.0) project(tesseract_collision VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Eigen3 REQUIRED) find_package(Boost COMPONENTS system thread program_options REQUIRED) find_package(octomap REQUIRED) @@ -39,8 +42,10 @@ tesseract_variables() # Create interface for core add_library(${PROJECT_NAME}_core INTERFACE) +target_process_export(${PROJECT_NAME}_core INTERFACE) target_link_libraries(${PROJECT_NAME}_core INTERFACE tesseract::tesseract_common tesseract::tesseract_geometry PkgConfig::bullet ${Boost_LIBRARIES}) target_compile_options(${PROJECT_NAME}_core INTERFACE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_core INTERFACE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_core ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_core INTERFACE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_core INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -52,7 +57,7 @@ target_include_directories(${PROJECT_NAME}_core SYSTEM INTERFACE ${Boost_INCLUDE_DIRS}) # Create target for Bullet implementation -add_library(${PROJECT_NAME}_bullet SHARED +add_library(${PROJECT_NAME}_bullet src/bullet/bullet_cast_bvh_manager.cpp src/bullet/bullet_cast_simple_manager.cpp src/bullet/bullet_discrete_bvh_manager.cpp @@ -64,8 +69,10 @@ add_library(${PROJECT_NAME}_bullet SHARED src/bullet/tesseract_convex_convex_algorithm.cpp src/bullet/tesseract_gjk_pair_detector.cpp ) +target_process_export(${PROJECT_NAME}_bullet) target_link_libraries(${PROJECT_NAME}_bullet PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_geometry PkgConfig::bullet console_bridge octomap octomath) target_compile_options(${PROJECT_NAME}_bullet PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_bullet PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_bullet ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_bullet PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_bullet ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -77,12 +84,14 @@ target_include_directories(${PROJECT_NAME}_bullet SYSTEM PUBLIC ${Boost_INCLUDE_DIRS}) # Create target for FCL implementation -add_library(${PROJECT_NAME}_fcl SHARED +add_library(${PROJECT_NAME}_fcl src/fcl/fcl_discrete_managers.cpp src/fcl/fcl_utils.cpp src/fcl/fcl_collision_object_wrapper.cpp) +target_process_export(${PROJECT_NAME}_fcl) target_link_libraries(${PROJECT_NAME}_fcl PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_geometry PkgConfig::bullet console_bridge octomap octomath fcl) target_compile_options(${PROJECT_NAME}_fcl PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_fcl PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_fcl ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_fcl PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_fcl ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -97,9 +106,9 @@ target_include_directories(${PROJECT_NAME}_fcl SYSTEM PUBLIC add_executable(create_convex_hull src/create_convex_hull.cpp) target_link_libraries(create_convex_hull PUBLIC tesseract::tesseract_common tesseract::tesseract_geometry console_bridge PkgConfig::bullet ${Boost_LIBRARIES} octomap octomath) target_compile_options(create_convex_hull PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(create_convex_hull PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(create_convex_hull ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(create_convex_hull PRIVATE VERSION ${TESSERACT_CXX_VERSION}) -target_compile_definitions(create_convex_hull PRIVATE "-DBT_USE_DOUBLE_PRECISION") target_include_directories(create_convex_hull PUBLIC "$") target_include_directories(create_convex_hull SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} @@ -110,6 +119,7 @@ target_include_directories(create_convex_hull SYSTEM PUBLIC add_library(${PROJECT_NAME}_test_suite INTERFACE) target_link_libraries(${PROJECT_NAME}_test_suite INTERFACE tesseract::tesseract_support tesseract::tesseract_geometry ${PROJECT_NAME}_core) target_compile_options(${PROJECT_NAME}_test_suite INTERFACE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_test_suite INTERFACE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_test_suite ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_test_suite INTERFACE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_test_suite INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_bvh_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_bvh_manager.h index 1a7f3a4073f..a1458e6cba6 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_bvh_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_bvh_manager.h @@ -44,13 +44,14 @@ #include #include #include +#include namespace tesseract_collision { namespace tesseract_collision_bullet { /** @brief A BVH implementaiton of a tesseract contact manager */ -class BulletCastBVHManager : public ContinuousContactManager +class TESSERACT_COLLISION_BULLET_PUBLIC BulletCastBVHManager : public ContinuousContactManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_simple_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_simple_manager.h index f8d8415e8d1..2c3191f43b1 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_simple_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_cast_simple_manager.h @@ -44,13 +44,14 @@ #include #include #include +#include namespace tesseract_collision { namespace tesseract_collision_bullet { /** @brief A simple implementaiton of a tesseract manager which does not use BHV */ -class BulletCastSimpleManager : public ContinuousContactManager +class TESSERACT_COLLISION_BULLET_PUBLIC BulletCastSimpleManager : public ContinuousContactManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_bvh_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_bvh_manager.h index 9c5996c4688..00f12e95825 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_bvh_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_bvh_manager.h @@ -44,13 +44,14 @@ #include #include #include +#include namespace tesseract_collision { namespace tesseract_collision_bullet { /** @brief A BVH implementaiton of a bullet manager */ -class BulletDiscreteBVHManager : public DiscreteContactManager +class TESSERACT_COLLISION_BULLET_PUBLIC BulletDiscreteBVHManager : public DiscreteContactManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_simple_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_simple_manager.h index 3d475812d5d..7753161ab6e 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_simple_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_discrete_simple_manager.h @@ -44,13 +44,14 @@ #include #include #include +#include namespace tesseract_collision { namespace tesseract_collision_bullet { /** @brief A simple implementaiton of a bullet manager which does not use BHV */ -class BulletDiscreteSimpleManager : public DiscreteContactManager +class TESSERACT_COLLISION_BULLET_PUBLIC BulletDiscreteSimpleManager : public DiscreteContactManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_utils.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_utils.h index ab33ff1f1a5..8a60f642f8b 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_utils.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/bullet_utils.h @@ -51,6 +51,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_collision { @@ -122,7 +123,7 @@ inline Eigen::Isometry3d convertBtToEigen(const btTransform& t) * It is a wrapper around bullet's collision object which * contains specific information related to tesseract */ -class CollisionObjectWrapper : public btCollisionObject +class TESSERACT_COLLISION_BULLET_LOCAL CollisionObjectWrapper : public btCollisionObject { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -222,7 +223,7 @@ using Link2Cow = std::map; using Link2ConstCow = std::map; /** @brief This is a casted collision shape used for checking if an object is collision free between two transforms */ -struct CastHullShape : public btConvexShape +struct TESSERACT_COLLISION_BULLET_LOCAL CastHullShape : public btConvexShape { public: btConvexShape* m_shape; @@ -619,7 +620,7 @@ inline btScalar addCastSingleResult(btManifoldPoint& cp, } /** @brief This is copied directly out of BulletWorld */ -struct TesseractBridgedManifoldResult : public btManifoldResult +struct TESSERACT_COLLISION_BULLET_LOCAL TesseractBridgedManifoldResult : public btManifoldResult { btCollisionWorld::ContactResultCallback& m_resultCallback; @@ -676,7 +677,7 @@ struct TesseractBridgedManifoldResult : public btManifoldResult }; /** @brief The BroadphaseContactResultCallback is used to report contact points */ -struct BroadphaseContactResultCallback +struct TESSERACT_COLLISION_BULLET_LOCAL BroadphaseContactResultCallback { ContactTestData& collisions_; double contact_distance_; @@ -707,7 +708,7 @@ struct BroadphaseContactResultCallback int index1) = 0; }; -struct DiscreteBroadphaseContactResultCallback : public BroadphaseContactResultCallback +struct TESSERACT_COLLISION_BULLET_LOCAL DiscreteBroadphaseContactResultCallback : public BroadphaseContactResultCallback { DiscreteBroadphaseContactResultCallback(ContactTestData& collisions, double contact_distance, bool verbose = false) : BroadphaseContactResultCallback(collisions, contact_distance, verbose) @@ -729,7 +730,7 @@ struct DiscreteBroadphaseContactResultCallback : public BroadphaseContactResultC } }; -struct CastBroadphaseContactResultCallback : public BroadphaseContactResultCallback +struct TESSERACT_COLLISION_BULLET_LOCAL CastBroadphaseContactResultCallback : public BroadphaseContactResultCallback { CastBroadphaseContactResultCallback(ContactTestData& collisions, double contact_distance, bool verbose = false) : BroadphaseContactResultCallback(collisions, contact_distance, verbose) @@ -751,7 +752,7 @@ struct CastBroadphaseContactResultCallback : public BroadphaseContactResultCallb } }; -struct TesseractBroadphaseBridgedManifoldResult : public btManifoldResult +struct TESSERACT_COLLISION_BULLET_LOCAL TesseractBroadphaseBridgedManifoldResult : public btManifoldResult { BroadphaseContactResultCallback& result_callback_; @@ -816,7 +817,7 @@ struct TesseractBroadphaseBridgedManifoldResult : public btManifoldResult * If the AABB of two collision objects are overlapping the processOverlap method is called * and they are checked for collision/distance and the results are stored in collision_. */ -class TesseractCollisionPairCallback : public btOverlapCallback +class TESSERACT_COLLISION_BULLET_LOCAL TesseractCollisionPairCallback : public btOverlapCallback { const btDispatcherInfo& dispatch_info_; btCollisionDispatcher* dispatcher_; @@ -869,7 +870,7 @@ class TesseractCollisionPairCallback : public btOverlapCallback }; /** @brief This class is used to filter broadphase */ -class TesseractOverlapFilterCallback : public btOverlapFilterCallback +class TESSERACT_COLLISION_BULLET_LOCAL TesseractOverlapFilterCallback : public btOverlapFilterCallback { public: TesseractOverlapFilterCallback(bool verbose = false) : verbose_(verbose) {} @@ -896,9 +897,9 @@ class TesseractOverlapFilterCallback : public btOverlapFilterCallback * bullet collision shape by calling getUserIndex function. * @return Bullet collision shape. */ -btCollisionShape* createShapePrimitive(const CollisionShapeConstPtr& geom, - CollisionObjectWrapper* cow, - int shape_index); +TESSERACT_COLLISION_BULLET_LOCAL btCollisionShape* createShapePrimitive(const CollisionShapeConstPtr& geom, + CollisionObjectWrapper* cow, + int shape_index); /** * @brief Update a collision objects filters @@ -946,7 +947,7 @@ inline COW::Ptr createCollisionObject(const std::string& name, return new_cow; } -struct DiscreteCollisionCollector : public btCollisionWorld::ContactResultCallback +struct TESSERACT_COLLISION_BULLET_LOCAL DiscreteCollisionCollector : public btCollisionWorld::ContactResultCallback { ContactTestData& collisions_; const COW::Ptr cow_; @@ -983,7 +984,7 @@ struct DiscreteCollisionCollector : public btCollisionWorld::ContactResultCallba } }; -struct CastCollisionCollector : public btCollisionWorld::ContactResultCallback +struct TESSERACT_COLLISION_BULLET_LOCAL CastCollisionCollector : public btCollisionWorld::ContactResultCallback { ContactTestData& collisions_; const COW::Ptr cow_; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_collision_configuration.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_collision_configuration.h index 32a6db30618..adb6e48d346 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_collision_configuration.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_collision_configuration.h @@ -46,6 +46,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_collision { namespace tesseract_collision_bullet @@ -58,7 +60,7 @@ namespace tesseract_collision_bullet * - Compound to Compound * - Convex to Convex */ -class TesseractCollisionConfiguration : public btDefaultCollisionConfiguration +class TESSERACT_COLLISION_BULLET_LOCAL TesseractCollisionConfiguration : public btDefaultCollisionConfiguration { public: TesseractCollisionConfiguration( diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_collision_algorithm.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_collision_algorithm.h index 2795e0edd65..5740795f840 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_collision_algorithm.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_collision_algorithm.h @@ -31,6 +31,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + class btDispatcher; class btCollisionObject; class btCollisionShape; @@ -52,7 +54,8 @@ namespace tesseract_collision_bullet * with the collision shape. I don't believe this will be an issue since all of the other callback in Bullet accept * both. */ -class TesseractCompoundCollisionAlgorithm : public btActivatingCollisionAlgorithm // NOLINT +class TESSERACT_COLLISION_BULLET_LOCAL TesseractCompoundCollisionAlgorithm + : public btActivatingCollisionAlgorithm // NOLINT { btNodeStack stack2; btManifoldArray manifoldArray; @@ -77,6 +80,10 @@ class TesseractCompoundCollisionAlgorithm : public btActivatingCollisionAlgorith bool isSwapped); ~TesseractCompoundCollisionAlgorithm() override; + TesseractCompoundCollisionAlgorithm(const TesseractCompoundCollisionAlgorithm&) = default; + TesseractCompoundCollisionAlgorithm& operator=(const TesseractCompoundCollisionAlgorithm&) = default; + TesseractCompoundCollisionAlgorithm(TesseractCompoundCollisionAlgorithm&&) = default; + TesseractCompoundCollisionAlgorithm& operator=(TesseractCompoundCollisionAlgorithm&&) = default; btCollisionAlgorithm* getChildAlgorithm(int n) const { return m_childCollisionAlgorithms[n]; } diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_compound_collision_algorithm.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_compound_collision_algorithm.h index abdb5ba01c7..d43691eab96 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_compound_collision_algorithm.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_compound_compound_collision_algorithm.h @@ -33,6 +33,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include class btDispatcher; class btCollisionObject; @@ -55,7 +56,8 @@ namespace tesseract_collision_bullet * with the collision shape. I don't believe this will be an issue since all of the other callback in Bullet accept * both. */ -class TesseractCompoundCompoundCollisionAlgorithm : public TesseractCompoundCollisionAlgorithm // NOLINT +class TESSERACT_COLLISION_BULLET_LOCAL TesseractCompoundCompoundCollisionAlgorithm + : public TesseractCompoundCollisionAlgorithm // NOLINT { class btHashedSimplePairCache* m_childCollisionAlgorithmCache; btSimplePairArray m_removePairs; @@ -72,6 +74,10 @@ class TesseractCompoundCompoundCollisionAlgorithm : public TesseractCompoundColl bool isSwapped); ~TesseractCompoundCompoundCollisionAlgorithm() override; + TesseractCompoundCompoundCollisionAlgorithm(const TesseractCompoundCompoundCollisionAlgorithm&) = default; + TesseractCompoundCompoundCollisionAlgorithm& operator=(const TesseractCompoundCompoundCollisionAlgorithm&) = default; + TesseractCompoundCompoundCollisionAlgorithm(TesseractCompoundCompoundCollisionAlgorithm&&) = default; + TesseractCompoundCompoundCollisionAlgorithm& operator=(TesseractCompoundCompoundCollisionAlgorithm&&) = default; void processCollision(const btCollisionObjectWrapper* body0Wrap, const btCollisionObjectWrapper* body1Wrap, diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_convex_convex_algorithm.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_convex_convex_algorithm.h index 651a2591db1..c81e407cfb9 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_convex_convex_algorithm.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_convex_convex_algorithm.h @@ -32,6 +32,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include class btConvexPenetrationDepthSolver; @@ -64,7 +65,7 @@ namespace tesseract_collision_bullet * * Note: This will not be able to be removed. */ -class TesseractConvexConvexAlgorithm : public btActivatingCollisionAlgorithm +class TESSERACT_COLLISION_BULLET_LOCAL TesseractConvexConvexAlgorithm : public btActivatingCollisionAlgorithm { #ifdef USE_SEPDISTANCE_UTIL2 btConvexSeparatingDistanceUtil m_sepDistance; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_gjk_pair_detector.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_gjk_pair_detector.h index 56987803015..e088a5f2805 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_gjk_pair_detector.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/tesseract_gjk_pair_detector.h @@ -32,6 +32,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP class btConvexPenetrationDepthSolver; #include +#include namespace tesseract_collision { @@ -49,7 +50,7 @@ namespace tesseract_collision_bullet * * Note: This will not be able to be removed. */ -class TesseractGjkPairDetector : public btDiscreteCollisionDetectorInterface +class TESSERACT_COLLISION_BULLET_LOCAL TesseractGjkPairDetector : public btDiscreteCollisionDetectorInterface { btVector3 m_cachedSeparatingAxis; btConvexPenetrationDepthSolver* m_penetrationDepthSolver; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/bullet/visibility_control.h b/tesseract/tesseract_collision/include/tesseract_collision/bullet/visibility_control.h new file mode 100644 index 00000000000..cec4e38a3f8 --- /dev/null +++ b/tesseract/tesseract_collision/include/tesseract_collision/bullet/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_COLLISION_BULLET_VISIBILITY_CONTROL_H +#define TESSERACT_COLLISION_BULLET_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_COLLISION_BULLET_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_COLLISION_BULLET_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_COLLISION_BULLET_EXPORT __declspec(dllexport) + #define TESSERACT_COLLISION_BULLET_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_COLLISION_BULLET_STATIC_LIBRARY + #ifdef TESSERACT_COLLISION_BULLET_LIBRARY_SHARED + #define TESSERACT_COLLISION_BULLET_PUBLIC TESSERACT_COLLISION_BULLET_EXPORT + #else + #define TESSERACT_COLLISION_BULLET_PUBLIC TESSERACT_COLLISION_BULLET_IMPORT + #endif + #else + #define TESSERACT_COLLISION_BULLET_PUBLIC + #endif + #define TESSERACT_COLLISION_BULLET_PUBLIC_TYPE TESSERACT_COLLISION_BULLET_PUBLIC + #define TESSERACT_COLLISION_BULLET_LOCAL +#else + #define TESSERACT_COLLISION_BULLET_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_BULLET_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_COLLISION_BULLET_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_BULLET_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_COLLISION_BULLET_PUBLIC + #define TESSERACT_COLLISION_BULLET_LOCAL + #endif + #define TESSERACT_COLLISION_BULLET_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_COLLISION_BULLET_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager.h index 3f8ecdcfc4c..c7dc96d313c 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_collision { -class ContinuousContactManager +class TESSERACT_COLLISION_CORE_PUBLIC ContinuousContactManager { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager_factory.h b/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager_factory.h index 40b40879132..6a3ab623a12 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager_factory.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/continuous_contact_manager_factory.h @@ -28,10 +28,11 @@ #define TESSERACT_COLLISION_CONTINUOUS_CONTACT_MANAGER_FACTORY_H #include +#include namespace tesseract_collision { -class ContinuousContactManagerFactory +class TESSERACT_COLLISION_CORE_PUBLIC ContinuousContactManagerFactory { public: using CreateMethod = std::function; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager.h b/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager.h index b2f543bcc23..756c8e93e1f 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_collision { -class DiscreteContactManager +class TESSERACT_COLLISION_CORE_PUBLIC DiscreteContactManager { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager_factory.h b/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager_factory.h index a90d133ba87..d4a799a2fa3 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager_factory.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/discrete_contact_manager_factory.h @@ -27,10 +27,11 @@ #define TESSERACT_COLLISION_DISCRETE_CONTACT_MANAGER_FACTORY_H #include +#include namespace tesseract_collision { -class DiscreteContactManagerFactory +class TESSERACT_COLLISION_CORE_PUBLIC DiscreteContactManagerFactory { public: using CreateMethod = std::function; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/types.h b/tesseract/tesseract_collision/include/tesseract_collision/core/types.h index 0898b51c2dd..902ad8909a9 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/core/types.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/types.h @@ -40,6 +40,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_collision { using CollisionShapesConst = std::vector; @@ -76,7 +78,7 @@ static const std::vector ContactTestTypeStrings = { "LIMITED", }; -struct ContactResult +struct TESSERACT_COLLISION_CORE_PUBLIC ContactResult { EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -161,7 +163,7 @@ using ContactResultMap = tesseract_common::AlignedMap; /** @brief The ContactRequest struct */ -struct ContactRequest +struct TESSERACT_COLLISION_CORE_PUBLIC ContactRequest { /** @brief This controls the exit condition for the contact test type */ ContactTestType type{ ContactTestType::ALL }; @@ -212,7 +214,7 @@ inline std::size_t flattenResults(ContactResultMap&& m, ContactResultVector& v) * @brief This data is intended only to be used internal to the collision checkers as a container and should not * be externally used by other libraries or packages. */ -struct ContactTestData +struct TESSERACT_COLLISION_CORE_LOCAL ContactTestData { EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_collision/include/tesseract_collision/core/visibility_control.h b/tesseract/tesseract_collision/include/tesseract_collision/core/visibility_control.h new file mode 100644 index 00000000000..a6c9bfb01e7 --- /dev/null +++ b/tesseract/tesseract_collision/include/tesseract_collision/core/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_COLLISION_CORE_VISIBILITY_CONTROL_H +#define TESSERACT_COLLISION_CORE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_COLLISION_CORE_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_COLLISION_CORE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_COLLISION_CORE_EXPORT __declspec(dllexport) + #define TESSERACT_COLLISION_CORE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_COLLISION_CORE_STATIC_LIBRARY + #ifdef TESSERACT_COLLISION_CORE_LIBRARY_SHARED + #define TESSERACT_COLLISION_CORE_PUBLIC TESSERACT_COLLISION_CORE_EXPORT + #else + #define TESSERACT_COLLISION_CORE_PUBLIC TESSERACT_COLLISION_CORE_IMPORT + #endif + #else + #define TESSERACT_COLLISION_CORE_PUBLIC + #endif + #define TESSERACT_COLLISION_CORE_PUBLIC_TYPE TESSERACT_COLLISION_CORE_PUBLIC + #define TESSERACT_COLLISION_CORE_LOCAL +#else + #define TESSERACT_COLLISION_CORE_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_CORE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_COLLISION_CORE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_CORE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_COLLISION_CORE_PUBLIC + #define TESSERACT_COLLISION_CORE_LOCAL + #endif + #define TESSERACT_COLLISION_CORE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_COLLISION_CORE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h index 963ddfd8588..cd4e3c4e3d8 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h @@ -32,6 +32,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_collision { namespace tesseract_collision_fcl @@ -41,7 +43,7 @@ namespace tesseract_collision_fcl * * This significantly improves performance when making distance requests if performing a contact tests type FIRST. */ -class FCLCollisionObjectWrapper : public fcl::CollisionObject +class TESSERACT_COLLISION_FCL_LOCAL FCLCollisionObjectWrapper : public fcl::CollisionObject { public: FCLCollisionObjectWrapper(const std::shared_ptr>& cgeom); diff --git a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_discrete_managers.h b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_discrete_managers.h index d2d21b273cf..2f8b90358f3 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_discrete_managers.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_discrete_managers.h @@ -44,13 +44,14 @@ #include #include +#include namespace tesseract_collision { namespace tesseract_collision_fcl { /** @brief A FCL implementation of the discrete contact manager */ -class FCLDiscreteBVHManager : public DiscreteContactManager +class TESSERACT_COLLISION_FCL_PUBLIC FCLDiscreteBVHManager : public DiscreteContactManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_utils.h b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_utils.h index 4b524f8904b..998d881f7ea 100644 --- a/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_utils.h +++ b/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_utils.h @@ -54,6 +54,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_collision { @@ -76,7 +77,7 @@ enum CollisionFilterGroups * @brief This is a Tesseract link collision object wrapper which add items specific to tesseract. It is a wrapper * around a tesseract link which may contain several collision objects. */ -class CollisionObjectWrapper +class TESSERACT_COLLISION_FCL_LOCAL CollisionObjectWrapper { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -176,7 +177,7 @@ class CollisionObjectWrapper double contact_distance_{ 0 }; /**< @brief The contact distance threshold */ }; -CollisionGeometryPtr createShapePrimitive(const CollisionShapeConstPtr& geom); +TESSERACT_COLLISION_FCL_LOCAL CollisionGeometryPtr createShapePrimitive(const CollisionShapeConstPtr& geom); using COW = CollisionObjectWrapper; using Link2COW = std::map; @@ -258,9 +259,9 @@ inline void updateCollisionObjectFilters(const std::vector& active, } } -bool collisionCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data); +TESSERACT_COLLISION_FCL_LOCAL bool collisionCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data); -bool distanceCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data); +TESSERACT_COLLISION_FCL_LOCAL bool distanceCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data); } // namespace tesseract_collision_fcl } // namespace tesseract_collision diff --git a/tesseract/tesseract_collision/include/tesseract_collision/fcl/visibility_control.h b/tesseract/tesseract_collision/include/tesseract_collision/fcl/visibility_control.h new file mode 100644 index 00000000000..22f5f4d9386 --- /dev/null +++ b/tesseract/tesseract_collision/include/tesseract_collision/fcl/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_COLLISION_FCL_VISIBILITY_CONTROL_H +#define TESSERACT_COLLISION_FCL_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_COLLISION_FCL_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_COLLISION_FCL_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_COLLISION_FCL_EXPORT __declspec(dllexport) + #define TESSERACT_COLLISION_FCL_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_COLLISION_FCL_STATIC_LIBRARY + #ifdef TESSERACT_COLLISION_FCL_LIBRARY_SHARED + #define TESSERACT_COLLISION_FCL_PUBLIC TESSERACT_COLLISION_FCL_EXPORT + #else + #define TESSERACT_COLLISION_FCL_PUBLIC TESSERACT_COLLISION_FCL_IMPORT + #endif + #else + #define TESSERACT_COLLISION_FCL_PUBLIC + #endif + #define TESSERACT_COLLISION_FCL_PUBLIC_TYPE TESSERACT_COLLISION_FCL_PUBLIC + #define TESSERACT_COLLISION_FCL_LOCAL +#else + #define TESSERACT_COLLISION_FCL_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_FCL_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_COLLISION_FCL_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COLLISION_FCL_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_COLLISION_FCL_PUBLIC + #define TESSERACT_COLLISION_FCL_LOCAL + #endif + #define TESSERACT_COLLISION_FCL_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_COLLISION_FCL_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_collision/test/CMakeLists.txt b/tesseract/tesseract_collision/test/CMakeLists.txt index 3ade2491b2e..e862cb3ad73 100644 --- a/tesseract/tesseract_collision/test/CMakeLists.txt +++ b/tesseract/tesseract_collision/test/CMakeLists.txt @@ -13,6 +13,7 @@ macro(add_gtest test_name test_file) add_executable(${test_name} ${test_file}) target_link_libraries(${test_name} PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_test_suite ${PROJECT_NAME}_bullet ${PROJECT_NAME}_fcl tesseract::tesseract_geometry tesseract::tesseract_scene_graph console_bridge PkgConfig::bullet ${Boost_LIBRARIES} octomap octomath ${LIBFCL_LIBRARIES}) target_compile_options(${test_name} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) + target_compile_definitions(${test_name} PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${test_name} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${test_name} PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${test_name} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_collision/test/benchmarks/CMakeLists.txt b/tesseract/tesseract_collision/test/benchmarks/CMakeLists.txt index b20c7b4e797..97cedea0284 100644 --- a/tesseract/tesseract_collision/test/benchmarks/CMakeLists.txt +++ b/tesseract/tesseract_collision/test/benchmarks/CMakeLists.txt @@ -5,6 +5,7 @@ macro(add_benchmark benchmark_name benchmark_file) add_executable(${benchmark_name} ${benchmark_file}) target_compile_definitions(${benchmark_name} PRIVATE BENCHMARK_ARGS="${BENCHMARK_ARGS}") target_compile_options(${benchmark_name} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) + target_compile_definitions(${benchmark_name} PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${benchmark_name} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${benchmark_name} PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_link_libraries(${benchmark_name} diff --git a/tesseract/tesseract_common/CMakeLists.txt b/tesseract/tesseract_common/CMakeLists.txt index 645ccbee186..37abd2a1658 100644 --- a/tesseract/tesseract_common/CMakeLists.txt +++ b/tesseract/tesseract_common/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_common VERSION 0.1.0 LANGUAGES CXX) -include(cmake/tesseract_macros.cmake) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +include(cmake/tesseract_macros.cmake) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") find_package(Eigen3 REQUIRED) @@ -16,8 +19,10 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) tesseract_variables() add_library(${PROJECT_NAME} INTERFACE) +target_process_export(${PROJECT_NAME} INTERFACE) target_link_libraries(${PROJECT_NAME} INTERFACE ${TinyXML2_LIBRARIES}) target_compile_options(${PROJECT_NAME} INTERFACE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} INTERFACE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} INTERFACE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_common/cmake/tesseract_macros.cmake b/tesseract/tesseract_common/cmake/tesseract_macros.cmake index 79df4970168..e54190e25b0 100644 --- a/tesseract/tesseract_common/cmake/tesseract_macros.cmake +++ b/tesseract/tesseract_common/cmake/tesseract_macros.cmake @@ -22,7 +22,31 @@ # 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. + +macro(target_process_export target) + set(options INTERFACE) + cmake_parse_arguments(ARG "${options}" "" "" ${ARGN}) + + string(TOUPPER "${target}" EXPORT_PREFIX) + + if (NOT DEFINED ${EXPORT_PREFIX}_LIBRARY_SHARED) + set(${EXPORT_PREFIX}_LIBRARY_SHARED ON) + endif() + + if(NOT BUILD_SHARED_LIBS) + if (ARG_INTERFACE) + target_compile_definitions(${PROJECT_NAME} INTERFACE "${EXPORT_PREFIX}_STATIC_LIBRARY") + else() + target_compile_definitions(${PROJECT_NAME} PUBLIC "${EXPORT_PREFIX}_STATIC_LIBRARY") + endif() + endif() +endmacro() + macro(tesseract_variables) + if (NOT DEFINED BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON) + endif() + if (NOT DEFINED TESSERACT_ENABLE_CLANG_TIDY) set(TESSERACT_ENABLE_CLANG_TIDY OFF) endif() @@ -40,12 +64,31 @@ macro(tesseract_variables) set(TESSERACT_ENABLE_CLANG_TIDY ON) endif() + set(TESSERACT_COMPILE_DEFINITIONS "") if (NOT TESSERACT_ENABLE_TESTING AND NOT TESSERACT_ENABLE_TESTING_ALL) - set(TESSERACT_COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion -Wno-sign-compare) set(TESSERACT_CLANG_TIDY_ARGS "-header-filter=.*" "-line-filter=[{'name':'EnvironmentMonitorDynamicReconfigureConfig.h','lines':[[9999999,9999999]]}, {'name':'.h'}, {'name':'.hpp'}]" "-checks=-*,clang-analyzer-*,bugprone-*,cppcoreguidelines-avoid-goto,cppcoreguidelines-c-copy-assignment-signature,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-no-malloc,cppcoreguidelines-slicing,cppcoreguidelines-special-member-functions,misc-*,modernize-*,performance-*,readability-avoid-const-params-in-decls,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-*,readability-simplify-*,readability-static-*,readability-string-compare,readability-uniqueptr-delete-release,readability-rary-objects") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(TESSERACT_COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion -Wno-sign-compare) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(TESSERACT_COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(TESSERACT_COMPILE_OPTIONS "") + set(TESSERACT_COMPILE_DEFINITIONS "_USE_MATH_DEFINES=ON") + else() + message(WARNING "${CMAKE_CXX_COMPILER_ID} Unsupported compiler detected.") + endif() else() - set(TESSERACT_COMPILE_OPTIONS -Werror=all -Werror=extra -Werror=conversion -Werror=sign-conversion -Wno-sign-compare) set(TESSERACT_CLANG_TIDY_ARGS "-header-filter=.*" "-line-filter=[{'name':'EnvironmentMonitorDynamicReconfigureConfig.h','lines':[[9999999,9999999]]}, {'name':'.h'}, {'name':'.hpp'}]" "-checks=-*,clang-analyzer-*,bugprone-*,cppcoreguidelines-avoid-goto,cppcoreguidelines-c-copy-assignment-signature,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-no-malloc,cppcoreguidelines-slicing,cppcoreguidelines-special-member-functions,misc-*,modernize-*,performance-*,readability-avoid-const-params-in-decls,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-*,readability-simplify-*,readability-static-*,readability-string-compare,readability-uniqueptr-delete-release,readability-rary-objects" "-warnings-as-errors=-*,clang-analyzer-*,bugprone-*,cppcoreguidelines-avoid-goto,cppcoreguidelines-c-copy-assignment-signature,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-no-malloc,cppcoreguidelines-slicing,cppcoreguidelines-special-member-functions,misc-*,modernize-*,performance-*,readability-avoid-const-params-in-decls,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-inconsistent-declaration-parameter-name,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-*,readability-simplify-*,readability-static-*,readability-string-compare,readability-uniqueptr-delete-release,readability-rary-objects") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(TESSERACT_COMPILE_OPTIONS -Werror=all -Werror=extra -Werror=conversion -Werror=sign-conversion -Wno-sign-compare) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(TESSERACT_COMPILE_OPTIONS -Werror=all -Werror=extra -Werror=conversion -Werror=sign-conversion) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(TESSERACT_COMPILE_OPTIONS "") + set(TESSERACT_COMPILE_DEFINITIONS "_USE_MATH_DEFINES=ON") + else() + message(WARNING "${CMAKE_CXX_COMPILER_ID} Unsupported compiler detected.") + endif() endif() set(TESSERACT_CXX_VERSION 14) diff --git a/tesseract/tesseract_common/include/tesseract_common/resource.h b/tesseract/tesseract_common/include/tesseract_common/resource.h index 738992c0cc4..ca2865beb5a 100644 --- a/tesseract/tesseract_common/include/tesseract_common/resource.h +++ b/tesseract/tesseract_common/include/tesseract_common/resource.h @@ -34,13 +34,15 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_common { /** * @brief Represents resource data available from a file or url * */ -class Resource +class TESSERACT_COMMON_PUBLIC Resource { public: using Ptr = std::shared_ptr; @@ -84,7 +86,7 @@ class Resource virtual std::shared_ptr getResourceContentStream() = 0; }; -class BytesResource : public tesseract_common::Resource +class TESSERACT_COMMON_PUBLIC BytesResource : public tesseract_common::Resource { public: BytesResource(std::string url, std::vector bytes) @@ -116,4 +118,4 @@ class BytesResource : public tesseract_common::Resource }; } // namespace tesseract_common -#endif // TESSERACT_COMMON_RESOURCE_H \ No newline at end of file +#endif // TESSERACT_COMMON_RESOURCE_H diff --git a/tesseract/tesseract_common/include/tesseract_common/status_code.h b/tesseract/tesseract_common/include/tesseract_common/status_code.h index 4bf33f36868..821b37ed4c4 100644 --- a/tesseract/tesseract_common/include/tesseract_common/status_code.h +++ b/tesseract/tesseract_common/include/tesseract_common/status_code.h @@ -34,9 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_common { -class StatusCategory +class TESSERACT_COMMON_PUBLIC StatusCategory { public: using Ptr = std::shared_ptr; @@ -63,7 +65,7 @@ class StatusCategory } }; -class GeneralStatusCategory : public StatusCategory +class TESSERACT_COMMON_PUBLIC GeneralStatusCategory : public StatusCategory { public: GeneralStatusCategory(std::string name = "GeneralStatus") : name_(std::move(name)) {} @@ -108,7 +110,7 @@ class GeneralStatusCategory : public StatusCategory std::string name_; }; -class StatusCode +class TESSERACT_COMMON_PUBLIC StatusCode { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_common/include/tesseract_common/types.h b/tesseract/tesseract_common/include/tesseract_common/types.h index 19f5465da7d..8b978f166ec 100644 --- a/tesseract/tesseract_common/include/tesseract_common/types.h +++ b/tesseract/tesseract_common/include/tesseract_common/types.h @@ -36,6 +36,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_common { template @@ -59,7 +61,7 @@ using TransformMap = AlignedMap; using TrajArray = Eigen::Matrix; /** @brief Represents a joint trajectory */ -struct JointTrajectory +struct TESSERACT_COMMON_PUBLIC JointTrajectory { EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -68,7 +70,7 @@ struct JointTrajectory }; /** @brief Store kinematic limits */ -struct KinematicLimits +struct TESSERACT_COMMON_PUBLIC KinematicLimits { EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_common/include/tesseract_common/visibility_control.h b/tesseract/tesseract_common/include/tesseract_common/visibility_control.h new file mode 100644 index 00000000000..e4c0907941a --- /dev/null +++ b/tesseract/tesseract_common/include/tesseract_common/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_COMMON_VISIBILITY_CONTROL_H +#define TESSERACT_COMMON_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_COMMON_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_COMMON_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_COMMON_EXPORT __declspec(dllexport) + #define TESSERACT_COMMON_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_COMMON_STATIC_LIBRARY + #ifdef TESSERACT_COMMON_LIBRARY_SHARED + #define TESSERACT_COMMON_PUBLIC TESSERACT_COMMON_EXPORT + #else + #define TESSERACT_COMMON_PUBLIC TESSERACT_COMMON_IMPORT + #endif + #else + #define TESSERACT_COMMON_PUBLIC + #endif + #define TESSERACT_COMMON_PUBLIC_TYPE TESSERACT_COMMON_PUBLIC + #define TESSERACT_COMMON_LOCAL +#else + #define TESSERACT_COMMON_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_COMMON_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_COMMON_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COMMON_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_COMMON_PUBLIC + #define TESSERACT_COMMON_LOCAL + #endif + #define TESSERACT_COMMON_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_COMMON_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_common/test/CMakeLists.txt b/tesseract/tesseract_common/test/CMakeLists.txt index dac72477680..878c4255743 100644 --- a/tesseract/tesseract_common/test/CMakeLists.txt +++ b/tesseract/tesseract_common/test/CMakeLists.txt @@ -3,6 +3,7 @@ find_package(GTest REQUIRED) add_executable(${PROJECT_NAME}_unit tesseract_common_unit.cpp) target_link_libraries(${PROJECT_NAME}_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}) target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_unit PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_environment/CMakeLists.txt b/tesseract/tesseract_environment/CMakeLists.txt index fd39cb6d6ce..b8ecabdfd1c 100644 --- a/tesseract/tesseract_environment/CMakeLists.txt +++ b/tesseract/tesseract_environment/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_environment VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + ## System dependencies are found with CMake's conventions find_package(Eigen3 REQUIRED) find_package(orocos_kdl REQUIRED) @@ -18,9 +21,11 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) tesseract_variables() # Create interface for core -add_library(${PROJECT_NAME}_core SHARED src/core/environment.cpp) +add_library(${PROJECT_NAME}_core src/core/environment.cpp) +target_process_export(${PROJECT_NAME}_core) target_link_libraries(${PROJECT_NAME}_core PUBLIC tesseract::tesseract_common tesseract::tesseract_collision_core tesseract::tesseract_scene_graph) target_compile_options(${PROJECT_NAME}_core PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_core PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_core ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_core PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_core ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -30,9 +35,11 @@ target_include_directories(${PROJECT_NAME}_core PUBLIC target_include_directories(${PROJECT_NAME}_core SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS}) -add_library(${PROJECT_NAME}_kdl SHARED src/kdl/kdl_state_solver.cpp) +add_library(${PROJECT_NAME}_kdl src/kdl/kdl_state_solver.cpp) +target_process_export(${PROJECT_NAME}_kdl) target_link_libraries(${PROJECT_NAME}_kdl PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_scene_graph orocos-kdl console_bridge) target_compile_options(${PROJECT_NAME}_kdl PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_kdl PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_kdl ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_kdl PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_kdl ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -43,9 +50,11 @@ target_include_directories(${PROJECT_NAME}_kdl SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} ${orocos_kdl_INCLUDE_DIRS}) # Orocos did not export target correctly -add_library(${PROJECT_NAME}_ofkt SHARED src/ofkt/ofkt_state_solver.cpp src/ofkt/ofkt_nodes.cpp) +add_library(${PROJECT_NAME}_ofkt src/ofkt/ofkt_state_solver.cpp src/ofkt/ofkt_nodes.cpp) +target_process_export(${PROJECT_NAME}_ofkt) target_link_libraries(${PROJECT_NAME}_ofkt PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_scene_graph console_bridge) target_compile_options(${PROJECT_NAME}_ofkt PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_ofkt PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ofkt ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ofkt PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ofkt ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_environment/include/tesseract_environment/core/commands.h b/tesseract/tesseract_environment/include/tesseract_environment/core/commands.h index 1880f43dd24..76daa4c8f88 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/core/commands.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/core/commands.h @@ -28,11 +28,16 @@ #ifndef TESSERACT_ENVIRONMENT_COMMANDS_H #define TESSERACT_ENVIRONMENT_COMMANDS_H +#include +TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include +#include +TESSERACT_COMMON_IGNORE_WARNINGS_POP + #include #include #include -#include +#include namespace tesseract_environment { @@ -53,7 +58,7 @@ enum class CommandType ADD_SCENE_GRAPH = 12 }; -class Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC Command { public: using Ptr = std::shared_ptr; @@ -75,7 +80,7 @@ class Command using Commands = std::vector; -class AddCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC AddCommand : public Command { public: AddCommand(tesseract_scene_graph::Link::ConstPtr link, tesseract_scene_graph::Joint::ConstPtr joint) @@ -91,7 +96,7 @@ class AddCommand : public Command tesseract_scene_graph::Joint::ConstPtr joint_; }; -class MoveLinkCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC MoveLinkCommand : public Command { public: MoveLinkCommand(tesseract_scene_graph::Joint::ConstPtr joint) @@ -105,7 +110,7 @@ class MoveLinkCommand : public Command tesseract_scene_graph::Joint::ConstPtr joint_; }; -class MoveJointCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC MoveJointCommand : public Command { public: MoveJointCommand(std::string joint_name, std::string parent_link) @@ -121,7 +126,7 @@ class MoveJointCommand : public Command std::string parent_link_; }; -class RemoveLinkCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC RemoveLinkCommand : public Command { public: RemoveLinkCommand(std::string link_name) : Command(CommandType::REMOVE_LINK), link_name_(std::move(link_name)) {} @@ -132,7 +137,7 @@ class RemoveLinkCommand : public Command std::string link_name_; }; -class RemoveJointCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC RemoveJointCommand : public Command { public: RemoveJointCommand(std::string joint_name) : Command(CommandType::REMOVE_JOINT), joint_name_(std::move(joint_name)) {} @@ -143,7 +148,7 @@ class RemoveJointCommand : public Command std::string joint_name_; }; -class ChangeLinkOriginCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC ChangeLinkOriginCommand : public Command { public: ChangeLinkOriginCommand(std::string link_name, const Eigen::Isometry3d& origin) @@ -159,7 +164,7 @@ class ChangeLinkOriginCommand : public Command Eigen::Isometry3d origin_; }; -class ChangeJointOriginCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC ChangeJointOriginCommand : public Command { public: ChangeJointOriginCommand(std::string joint_name, const Eigen::Isometry3d& origin) @@ -175,7 +180,7 @@ class ChangeJointOriginCommand : public Command Eigen::Isometry3d origin_; }; -class ChangeLinkCollisionEnabledCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC ChangeLinkCollisionEnabledCommand : public Command { public: ChangeLinkCollisionEnabledCommand(std::string link_name, bool enabled) @@ -191,7 +196,7 @@ class ChangeLinkCollisionEnabledCommand : public Command bool enabled_; }; -class ChangeLinkVisibilityCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC ChangeLinkVisibilityCommand : public Command { public: ChangeLinkVisibilityCommand(std::string link_name, bool enabled) @@ -207,7 +212,7 @@ class ChangeLinkVisibilityCommand : public Command bool enabled_; }; -class AddAllowedCollisionCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC AddAllowedCollisionCommand : public Command { public: AddAllowedCollisionCommand(std::string link_name1, std::string link_name2, std::string reason) @@ -228,7 +233,7 @@ class AddAllowedCollisionCommand : public Command std::string reason_; }; -class RemoveAllowedCollisionCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC RemoveAllowedCollisionCommand : public Command { public: RemoveAllowedCollisionCommand(std::string link_name1, std::string link_name2) @@ -246,7 +251,7 @@ class RemoveAllowedCollisionCommand : public Command std::string link_name2_; }; -class RemoveAllowedCollisionLinkCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC RemoveAllowedCollisionLinkCommand : public Command { public: RemoveAllowedCollisionLinkCommand(std::string link_name) @@ -260,7 +265,7 @@ class RemoveAllowedCollisionLinkCommand : public Command std::string link_name_; }; -class AddSceneGraphCommand : public Command +class TESSERACT_ENVIRONMENT_CORE_PUBLIC AddSceneGraphCommand : public Command { public: AddSceneGraphCommand(const tesseract_scene_graph::SceneGraph& scene_graph, diff --git a/tesseract/tesseract_environment/include/tesseract_environment/core/environment.h b/tesseract/tesseract_environment/include/tesseract_environment/core/environment.h index 2c19b5d1a96..3aa861a229c 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/core/environment.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/core/environment.h @@ -41,10 +41,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_environment { -class Environment +class TESSERACT_ENVIRONMENT_CORE_PUBLIC Environment { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_environment/include/tesseract_environment/core/state_solver.h b/tesseract/tesseract_environment/include/tesseract_environment/core/state_solver.h index e570beea2c5..66ef3d7181d 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/core/state_solver.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/core/state_solver.h @@ -39,10 +39,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_environment { -class StateSolver +class TESSERACT_ENVIRONMENT_CORE_PUBLIC StateSolver { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_environment/include/tesseract_environment/core/types.h b/tesseract/tesseract_environment/include/tesseract_environment/core/types.h index 261f744a6d9..de2868cfcac 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/core/types.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/core/types.h @@ -40,6 +40,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_environment { /** @@ -49,7 +51,7 @@ namespace tesseract_environment * possible to get the joint transform using the child link transfrom of the joint, but they are both provided for * convience. Also the joint values used to calculated the link/joint transfroms is provided. */ -struct EnvState +struct TESSERACT_ENVIRONMENT_CORE_PUBLIC EnvState { EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -79,7 +81,7 @@ struct EnvState /** * @brief The AdjacencyMapPair struct */ -struct AdjacencyMapPair +struct TESSERACT_ENVIRONMENT_CORE_PUBLIC AdjacencyMapPair { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; @@ -88,7 +90,7 @@ struct AdjacencyMapPair Eigen::Isometry3d transform; /**< @brief A transform from the kinematic link (link_name) to the adjacent link */ }; -class AdjacencyMap +class TESSERACT_ENVIRONMENT_CORE_PUBLIC AdjacencyMap { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_environment/include/tesseract_environment/core/visibility_control.h b/tesseract/tesseract_environment/include/tesseract_environment/core/visibility_control.h new file mode 100644 index 00000000000..a8494101154 --- /dev/null +++ b/tesseract/tesseract_environment/include/tesseract_environment/core/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_ENVIRONMENT_CORE_VISIBILITY_CONTROL_H +#define TESSERACT_ENVIRONMENT_CORE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_ENVIRONMENT_CORE_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_ENVIRONMENT_CORE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_ENVIRONMENT_CORE_EXPORT __declspec(dllexport) + #define TESSERACT_ENVIRONMENT_CORE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_ENVIRONMENT_CORE_STATIC_LIBRARY + #ifdef TESSERACT_ENVIRONMENT_CORE_LIBRARY_SHARED + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC TESSERACT_ENVIRONMENT_CORE_EXPORT + #else + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC TESSERACT_ENVIRONMENT_CORE_IMPORT + #endif + #else + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC + #endif + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC_TYPE TESSERACT_ENVIRONMENT_CORE_PUBLIC + #define TESSERACT_ENVIRONMENT_CORE_LOCAL +#else + #define TESSERACT_ENVIRONMENT_CORE_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_CORE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_CORE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC + #define TESSERACT_ENVIRONMENT_CORE_LOCAL + #endif + #define TESSERACT_ENVIRONMENT_CORE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_ENVIRONMENT_CORE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_state_solver.h b/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_state_solver.h index 06daf3f15ce..650db5bbe76 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_state_solver.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_state_solver.h @@ -8,10 +8,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_environment { -class KDLStateSolver : public StateSolver +class TESSERACT_ENVIRONMENT_KDL_PUBLIC KDLStateSolver : public StateSolver { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_utils.h b/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_utils.h index fb421815375..65d05165086 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_utils.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/kdl/kdl_utils.h @@ -113,61 +113,5 @@ inline void KDLToEigen(const KDL::Jacobian& jacobian, const std::vector& q_ */ inline void EigenToKDL(const Eigen::Ref& vec, KDL::JntArray& joints) { joints.data = vec; } -// inline tesseract_collision::CollisionShapePtr constructShape(const urdf::Geometry* geom) -//{ -// tesseract_collision::CollisionShape* result = nullptr; -// switch (geom->type) -// { -// case urdf::Geometry::SPHERE: -// result = new tesseract_collision::SphereCollisionShape(static_cast(geom)->radius); -// break; -// case urdf::Geometry::BOX: -// { -// urdf::Vector3 dim = static_cast(geom)->dim; -// result = new tesseract_collision::BoxCollisionShape(dim.x, dim.y, dim.z); -// } -// break; -// case urdf::Geometry::CYLINDER: -// result = new tesseract_collision::CylinderCollisionShape(static_cast(geom)->radius, -// static_cast(geom)->length); -// break; -// case urdf::Geometry::MESH: -// { -// const urdf::Mesh* mesh = static_cast(geom); -// if (!mesh->filename.empty()) -// { -// Eigen::Vector3d scale(mesh->scale.x, mesh->scale.y, mesh->scale.z); -// shapes::Mesh* m = shapes::createMeshFromResource(mesh->filename, scale); - -// tesseract_collision::VectorVector3d mesh_vertices; -// mesh_vertices.reserve(m->vertex_count); -// for (unsigned int i = 0; i < m->vertex_count; ++i) -// mesh_vertices.push_back(Eigen::Vector3d(m->vertices[3 * i + 0], m->vertices[3 * i + 1], m->vertices[3 * i + -// 2])); - -// std::shared_ptr ch_vertices(new tesseract_collision::VectorVector3d()); -// std::shared_ptr> ch_faces(new std::vector()); -// int num_faces = tesseract_collision::createConvexHull(*ch_vertices, *ch_faces, mesh_vertices); - -// result = new tesseract_collision::ConvexMeshCollisionShape(ch_vertices, ch_faces, num_faces); -// } -// } -// break; -// default: -// CONSOLE_BRIDGE_logError("Unknown geometry type: %d", static_cast(geom->type)); -// break; -// } - -// return tesseract_collision::CollisionShapePtr(result); -//} - -// inline Eigen::Isometry3d urdfPose2Eigen(const urdf::Pose& pose) -//{ -// Eigen::Quaterniond q(pose.rotation.w, pose.rotation.x, pose.rotation.y, pose.rotation.z); -// Eigen::Isometry3d result; -// result.translation() = Eigen::Vector3d(pose.position.x, pose.position.y, pose.position.z); -// result.linear() = q.toRotationMatrix(); -// return result; -//} } // namespace tesseract_environment #endif // TESSERACT_ENVIRONMENT_KDL_UTILS_H diff --git a/tesseract/tesseract_environment/include/tesseract_environment/kdl/visibility_control.h b/tesseract/tesseract_environment/include/tesseract_environment/kdl/visibility_control.h new file mode 100644 index 00000000000..88d5ed62036 --- /dev/null +++ b/tesseract/tesseract_environment/include/tesseract_environment/kdl/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_ENVIRONMENT_KDL_VISIBILITY_CONTROL_H +#define TESSERACT_ENVIRONMENT_KDL_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_ENVIRONMENT_KDL_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_ENVIRONMENT_KDL_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_ENVIRONMENT_KDL_EXPORT __declspec(dllexport) + #define TESSERACT_ENVIRONMENT_KDL_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_ENVIRONMENT_KDL_STATIC_LIBRARY + #ifdef TESSERACT_ENVIRONMENT_KDL_LIBRARY_SHARED + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC TESSERACT_ENVIRONMENT_KDL_EXPORT + #else + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC TESSERACT_ENVIRONMENT_KDL_IMPORT + #endif + #else + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC + #endif + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC_TYPE TESSERACT_ENVIRONMENT_KDL_PUBLIC + #define TESSERACT_ENVIRONMENT_KDL_LOCAL +#else + #define TESSERACT_ENVIRONMENT_KDL_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_KDL_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_KDL_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC + #define TESSERACT_ENVIRONMENT_KDL_LOCAL + #endif + #define TESSERACT_ENVIRONMENT_KDL_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_ENVIRONMENT_KDL_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_node.h b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_node.h index 8083dd07903..86fc3a747c2 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_node.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_node.h @@ -40,6 +40,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_environment { @@ -52,7 +53,7 @@ namespace tesseract_environment * - World Transformation: W = W(parent) * L * */ -class OFKTNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_nodes.h b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_nodes.h index 2d35dcc74a1..672e3201dbc 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_nodes.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_nodes.h @@ -32,13 +32,14 @@ #define TESSERACT_ENVIRONMENT_OFKT_NODES_H #include +#include namespace tesseract_environment { /*********************************************************************/ /*************************** BASE NODE *******************************/ /*********************************************************************/ -class OFKTBaseNode : public OFKTNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTBaseNode : public OFKTNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -105,7 +106,7 @@ class OFKTBaseNode : public OFKTNode /*********************************************************************/ /*************************** ROOT NODE *******************************/ /*********************************************************************/ -class OFKTRootNode : public OFKTBaseNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTRootNode : public OFKTBaseNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -132,7 +133,7 @@ class OFKTRootNode : public OFKTBaseNode /**********************************************************************/ /*************************** FIXED NODE *******************************/ /**********************************************************************/ -class OFKTFixedNode : public OFKTBaseNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTFixedNode : public OFKTBaseNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -152,7 +153,7 @@ class OFKTFixedNode : public OFKTBaseNode /*********************************************************************/ /************************* REVOLUTE NODE *****************************/ /*********************************************************************/ -class OFKTRevoluteNode : public OFKTBaseNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTRevoluteNode : public OFKTBaseNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -182,7 +183,7 @@ class OFKTRevoluteNode : public OFKTBaseNode /*********************************************************************/ /************************ CONTINUOUS NODE ****************************/ /*********************************************************************/ -class OFKTContinuousNode : public OFKTBaseNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTContinuousNode : public OFKTBaseNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -208,7 +209,7 @@ class OFKTContinuousNode : public OFKTBaseNode /*********************************************************************/ /************************* PRISMATIC NODE ****************************/ /*********************************************************************/ -class OFKTPrismaticNode : public OFKTBaseNode +class TESSERACT_ENVIRONMENT_OFKT_LOCAL OFKTPrismaticNode : public OFKTBaseNode { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_state_solver.h b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_state_solver.h index a31e70720ea..83666d00cd3 100644 --- a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_state_solver.h +++ b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/ofkt_state_solver.h @@ -40,6 +40,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_environment { @@ -50,7 +51,7 @@ namespace tesseract_environment * Kinematics. In Computational Kinematics (pp. 560-568). Springer, Cham. * */ -class OFKTStateSolver : public StateSolver +class TESSERACT_ENVIRONMENT_OFKT_PUBLIC OFKTStateSolver : public StateSolver { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_environment/include/tesseract_environment/ofkt/visibility_control.h b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/visibility_control.h new file mode 100644 index 00000000000..1f16257abdc --- /dev/null +++ b/tesseract/tesseract_environment/include/tesseract_environment/ofkt/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_ENVIRONMENT_OFKT_VISIBILITY_CONTROL_H +#define TESSERACT_ENVIRONMENT_OFKT_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_ENVIRONMENT_OFKT_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_ENVIRONMENT_OFKT_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_ENVIRONMENT_OFKT_EXPORT __declspec(dllexport) + #define TESSERACT_ENVIRONMENT_OFKT_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_ENVIRONMENT_OFKT_STATIC_LIBRARY + #ifdef TESSERACT_ENVIRONMENT_OFKT_LIBRARY_SHARED + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC TESSERACT_ENVIRONMENT_OFKT_EXPORT + #else + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC TESSERACT_ENVIRONMENT_OFKT_IMPORT + #endif + #else + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC + #endif + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC_TYPE TESSERACT_ENVIRONMENT_OFKT_PUBLIC + #define TESSERACT_ENVIRONMENT_OFKT_LOCAL +#else + #define TESSERACT_ENVIRONMENT_OFKT_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_OFKT_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_ENVIRONMENT_OFKT_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC + #define TESSERACT_ENVIRONMENT_OFKT_LOCAL + #endif + #define TESSERACT_ENVIRONMENT_OFKT_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_ENVIRONMENT_OFKT_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_environment/test/CMakeLists.txt b/tesseract/tesseract_environment/test/CMakeLists.txt index 7e56aadaabd..55a2351bc99 100644 --- a/tesseract/tesseract_environment/test/CMakeLists.txt +++ b/tesseract/tesseract_environment/test/CMakeLists.txt @@ -5,6 +5,7 @@ find_package(tesseract_urdf REQUIRED) add_executable(${PROJECT_NAME}_unit tesseract_environment_unit.cpp) target_link_libraries(${PROJECT_NAME}_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_kdl ${PROJECT_NAME}_ofkt tesseract::tesseract_support tesseract::tesseract_urdf tesseract::tesseract_collision_bullet tesseract::tesseract_collision_fcl tesseract::tesseract_scene_graph) target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_geometry/CMakeLists.txt b/tesseract/tesseract_geometry/CMakeLists.txt index 7cc2b1da309..a0a7efcc9ac 100644 --- a/tesseract/tesseract_geometry/CMakeLists.txt +++ b/tesseract/tesseract_geometry/CMakeLists.txt @@ -1,19 +1,15 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_geometry VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Eigen3 REQUIRED) find_package(console_bridge REQUIRED) find_package(tesseract_common REQUIRED) find_package(octomap REQUIRED) find_package(cmake_common_scripts REQUIRED) -set(COVERAGE_EXCLUDE /usr/* /opt/* ${CMAKE_CURRENT_LIST_DIR}/test/* /*/gtest/*) - -add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) - -# Load variable for clang tidy args, compiler options and cxx version -tesseract_variables() - find_package(ASSIMP QUIET) if (NOT ASSIMP_FOUND) find_package(PkgConfig REQUIRED) @@ -33,9 +29,18 @@ if(NOT TARGET octomath) set_target_properties(octomath PROPERTIES INTERFACE_LINK_LIBRARIES "${OCTOMAP_LIBRARIES}") endif() +set(COVERAGE_EXCLUDE /usr/* /opt/* ${CMAKE_CURRENT_LIST_DIR}/test/* /*/gtest/*) + +add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) + +# Load variable for clang tidy args, compiler options and cxx version +tesseract_variables() + add_library(${PROJECT_NAME} INTERFACE) -target_link_libraries(${PROJECT_NAME} INTERFACE console_bridge octomap octomath ${ASSIMP_LIBRARIES}) +target_process_export(${PROJECT_NAME} INTERFACE) +target_link_libraries(${PROJECT_NAME} INTERFACE tesseract::tesseract_common console_bridge octomap octomath ${ASSIMP_LIBRARIES}) target_compile_options(${PROJECT_NAME} INTERFACE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} INTERFACE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} INTERFACE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -43,8 +48,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE "$" "$") target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE - ${EIGEN3_INCLUDE_DIRS} - $) #tesseract::tesseract_common Due to bug in catkin, there is an open PR + ${EIGEN3_INCLUDE_DIRS}) configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME}) diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/geometry.h b/tesseract/tesseract_geometry/include/tesseract_geometry/geometry.h index bd98847206c..3dcfe2d77ca 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/geometry.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/geometry.h @@ -32,6 +32,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_geometry { enum GeometryType @@ -51,7 +53,7 @@ static const std::vector GeometryTypeStrings = { "SPHERE", "CYLINDER", "CAPSULE", "CONE", "BOX", "PLANE", "MESH", "CONVEX_MESH", "SDF_MESH", "OCTREE" }; -class Geometry +class TESSERACT_GEOMETRY_PUBLIC Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/geometry_loaders.h b/tesseract/tesseract_geometry/include/tesseract_geometry/geometry_loaders.h index c9c3b0adaba..4a933951bc2 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/geometry_loaders.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/geometry_loaders.h @@ -23,11 +23,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef TESSERACT_GEOMETRY_GEOMETRY_LOADER_H +#define TESSERACT_GEOMETRY_GEOMETRY_LOADER_H #include -#pragma once - namespace tesseract_geometry { static std::vector createMeshFromBytes(const std::string& url, @@ -70,3 +70,5 @@ createConvexMeshFromBytes(const std::string& url, } } // namespace tesseract_geometry + +#endif // TESSERACT_GEOMETRY_GEOMETRY_LOADER_H diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/box.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/box.h index 2a3e0a4ee37..fc2176876c6 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/box.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/box.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Box : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Box : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/capsule.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/capsule.h index 26af1ff75e1..91695f0764f 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/capsule.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/capsule.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Capsule : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Capsule : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cone.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cone.h index 980681d427c..d4c4ae30873 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cone.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cone.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Cone : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Cone : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/convex_mesh.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/convex_mesh.h index f5ded31bdd9..c99dc721f9c 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/convex_mesh.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/convex_mesh.h @@ -38,7 +38,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class ConvexMesh : public Geometry +class TESSERACT_GEOMETRY_PUBLIC ConvexMesh : public Geometry { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cylinder.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cylinder.h index 7bd17ba1a71..549b1138482 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cylinder.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/cylinder.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Cylinder : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Cylinder : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/mesh.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/mesh.h index 69cb3037a27..564aca17d5b 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/mesh.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/mesh.h @@ -38,7 +38,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Mesh : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Mesh : public Geometry { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/octree.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/octree.h index c6f4cc5359b..31b89a63ec3 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/octree.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/octree.h @@ -37,7 +37,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Octree : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Octree : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/plane.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/plane.h index fdf17b224bd..084074aa833 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/plane.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/plane.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Plane : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Plane : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sdf_mesh.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sdf_mesh.h index c2a9734ffdc..0f9aef49a1d 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sdf_mesh.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sdf_mesh.h @@ -38,7 +38,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class SDFMesh : public Geometry +class TESSERACT_GEOMETRY_PUBLIC SDFMesh : public Geometry { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sphere.h b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sphere.h index bec5e8a639f..7c6bcf101e4 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sphere.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/impl/sphere.h @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_geometry { -class Sphere : public Geometry +class TESSERACT_GEOMETRY_PUBLIC Sphere : public Geometry { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/mesh_parser.h b/tesseract/tesseract_geometry/include/tesseract_geometry/mesh_parser.h index 6a40c6fd8c4..be6e1755dd7 100644 --- a/tesseract/tesseract_geometry/include/tesseract_geometry/mesh_parser.h +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/mesh_parser.h @@ -63,11 +63,11 @@ namespace tesseract_geometry */ template -inline std::vector> extractMeshData(const aiScene* scene, - const aiNode* node, - const aiMatrix4x4& parent_transform, - const Eigen::Vector3d& scale, - tesseract_common::Resource::Ptr resource) +std::vector> extractMeshData(const aiScene* scene, + const aiNode* node, + const aiMatrix4x4& parent_transform, + const Eigen::Vector3d& scale, + tesseract_common::Resource::Ptr resource) { std::vector> meshes; @@ -129,9 +129,9 @@ inline std::vector> extractMeshData(const aiScene* scene, * @return A list of tesseract meshes */ template -inline std::vector> createMeshFromAsset(const aiScene* scene, - const Eigen::Vector3d& scale, - tesseract_common::Resource::Ptr resource) +std::vector> createMeshFromAsset(const aiScene* scene, + const Eigen::Vector3d& scale, + tesseract_common::Resource::Ptr resource) { if (!scene->HasMeshes()) { @@ -159,10 +159,10 @@ inline std::vector> createMeshFromAsset(const aiScene* scene, * @return */ template -inline std::vector> createMeshFromPath(const std::string& path, - Eigen::Vector3d scale = Eigen::Vector3d(1, 1, 1), - bool triangulate = false, - bool flatten = false) +std::vector> createMeshFromPath(const std::string& path, + Eigen::Vector3d scale = Eigen::Vector3d(1, 1, 1), + bool triangulate = false, + bool flatten = false) { // Create an instance of the Importer class Assimp::Importer importer; @@ -223,10 +223,10 @@ inline std::vector> createMeshFromPath(const std::string& pat * @return */ template -inline std::vector> createMeshFromResource(tesseract_common::Resource::Ptr resource, - Eigen::Vector3d scale = Eigen::Vector3d(1, 1, 1), - bool triangulate = false, - bool flatten = false) +std::vector> createMeshFromResource(tesseract_common::Resource::Ptr resource, + Eigen::Vector3d scale = Eigen::Vector3d(1, 1, 1), + bool triangulate = false, + bool flatten = false) { if (!resource) return std::vector>(); diff --git a/tesseract/tesseract_geometry/include/tesseract_geometry/visibility_control.h b/tesseract/tesseract_geometry/include/tesseract_geometry/visibility_control.h new file mode 100644 index 00000000000..bd9851222f1 --- /dev/null +++ b/tesseract/tesseract_geometry/include/tesseract_geometry/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_GEOMETRY_VISIBILITY_CONTROL_H +#define TESSERACT_GEOMETRY_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_GEOMETRY_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_GEOMETRY_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_GEOMETRY_EXPORT __declspec(dllexport) + #define TESSERACT_GEOMETRY_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_GEOMETRY_STATIC_LIBRARY + #ifdef TESSERACT_GEOMETRY_LIBRARY_SHARED + #define TESSERACT_GEOMETRY_PUBLIC TESSERACT_GEOMETRY_EXPORT + #else + #define TESSERACT_GEOMETRY_PUBLIC TESSERACT_GEOMETRY_IMPORT + #endif + #else + #define TESSERACT_GEOMETRY_PUBLIC + #endif + #define TESSERACT_GEOMETRY_PUBLIC_TYPE TESSERACT_GEOMETRY_PUBLIC + #define TESSERACT_GEOMETRY_LOCAL +#else + #define TESSERACT_GEOMETRY_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_GEOMETRY_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_GEOMETRY_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_GEOMETRY_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_GEOMETRY_PUBLIC + #define TESSERACT_GEOMETRY_LOCAL + #endif + #define TESSERACT_GEOMETRY_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_GEOMETRY_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_geometry/test/CMakeLists.txt b/tesseract/tesseract_geometry/test/CMakeLists.txt index f2a36583001..d6f5c230452 100644 --- a/tesseract/tesseract_geometry/test/CMakeLists.txt +++ b/tesseract/tesseract_geometry/test/CMakeLists.txt @@ -4,6 +4,7 @@ find_package(tesseract_support REQUIRED) add_executable(${PROJECT_NAME}_unit tesseract_geometry_unit.cpp) target_link_libraries(${PROJECT_NAME}_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME} tesseract::tesseract_support) target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_kinematics/CMakeLists.txt b/tesseract/tesseract_kinematics/CMakeLists.txt index 87a32d6eb76..f3c2c9bfafb 100644 --- a/tesseract/tesseract_kinematics/CMakeLists.txt +++ b/tesseract/tesseract_kinematics/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_kinematics VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + ## System dependencies are found with CMake's conventions find_package(Eigen3 REQUIRED) find_package(orocos_kdl REQUIRED) @@ -18,11 +21,13 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) tesseract_variables() # Create interface for core -add_library(${PROJECT_NAME}_core SHARED +add_library(${PROJECT_NAME}_core src/core/rop_inverse_kinematics.cpp src/core/rep_inverse_kinematics.cpp) +target_process_export(${PROJECT_NAME}_core) target_link_libraries(${PROJECT_NAME}_core PUBLIC tesseract::tesseract_scene_graph console_bridge) target_compile_options(${PROJECT_NAME}_core PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_core PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_core ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_core PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_core ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -34,9 +39,11 @@ target_include_directories(${PROJECT_NAME}_core SYSTEM PUBLIC # Create ikfast kinematics interface add_library(${PROJECT_NAME}_ikfast INTERFACE) +target_process_export(${PROJECT_NAME}_ikfast INTERFACE) target_link_libraries(${PROJECT_NAME}_ikfast INTERFACE ${PROJECT_NAME}_core console_bridge) target_compile_definitions(${PROJECT_NAME}_ikfast INTERFACE -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -DIKFAST_HAS_LIBRARY) target_compile_options(${PROJECT_NAME}_ikfast INTERFACE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_ikfast INTERFACE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ikfast ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ikfast INTERFACE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ikfast INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -47,14 +54,16 @@ target_include_directories(${PROJECT_NAME}_ikfast SYSTEM INTERFACE ${EIGEN3_INCLUDE_DIRS}) # Add KDL implementation of tesseract_kinematics -add_library(${PROJECT_NAME}_kdl SHARED +add_library(${PROJECT_NAME}_kdl src/kdl/kdl_fwd_kin_chain.cpp src/kdl/kdl_fwd_kin_tree.cpp src/kdl/kdl_inv_kin_chain_lma.cpp src/kdl/kdl_inv_kin_chain_nr.cpp ) +target_process_export(${PROJECT_NAME}_kdl) target_link_libraries(${PROJECT_NAME}_kdl PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_scene_graph orocos-kdl console_bridge) target_compile_options(${PROJECT_NAME}_kdl PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_kdl PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_kdl ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_kdl PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_kdl ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -69,9 +78,11 @@ target_include_directories(${PROJECT_NAME}_kdl SYSTEM PUBLIC ${orocos_kdl_INCLUDE_DIRS}) # Orocos did not export target correctly # Add OPW implementation of tesseract_kinematics -add_library(${PROJECT_NAME}_opw SHARED src/opw/opw_inv_kin.cpp) +add_library(${PROJECT_NAME}_opw src/opw/opw_inv_kin.cpp) +target_process_export(${PROJECT_NAME}_opw) target_link_libraries(${PROJECT_NAME}_opw PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_scene_graph opw_kinematics::opw_kinematics console_bridge) target_compile_options(${PROJECT_NAME}_opw PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_opw PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_opw ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_opw PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_opw ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics.h index 30bdf03ee52..6d6063ab3ba 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics.h @@ -39,11 +39,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { /** @brief Forward kinematics functions. */ -class ForwardKinematics +class TESSERACT_KINEMATICS_CORE_PUBLIC ForwardKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics_factory.h index 89b16da2919..83f132ef9bc 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/forward_kinematics_factory.h @@ -28,6 +28,7 @@ #include #include +#include namespace tesseract_kinematics { @@ -38,7 +39,7 @@ enum class ForwardKinematicsFactoryType GRAPH = 2 }; -class ForwardKinematicsFactory +class TESSERACT_KINEMATICS_CORE_PUBLIC ForwardKinematicsFactory { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics.h index 4ef4c1b31a0..44df031c470 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics.h @@ -38,11 +38,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_kinematics { /** @brief Inverse kinematics functions. */ -class InverseKinematics +class TESSERACT_KINEMATICS_CORE_PUBLIC InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics_factory.h index a2a92e5b8e9..f1c34580b0b 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/inverse_kinematics_factory.h @@ -28,6 +28,7 @@ #include #include +#include namespace tesseract_kinematics { @@ -38,7 +39,7 @@ enum class InverseKinematicsFactoryType GRAPH = 2 }; -class InverseKinematicsFactory +class TESSERACT_KINEMATICS_CORE_PUBLIC InverseKinematicsFactory { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rep_inverse_kinematics.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rep_inverse_kinematics.h index f0b89a6d79c..1b6d1f9997a 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rep_inverse_kinematics.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rep_inverse_kinematics.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { @@ -44,7 +45,7 @@ namespace tesseract_kinematics * In this kinematic arrangement the base link is the tip link of the external positioner and the tip link is the * tip link of the manipulator. Therefore all provided target poses are expected to the tip link of the positioner. */ -class RobotWithExternalPositionerInvKin : public InverseKinematics +class TESSERACT_KINEMATICS_CORE_PUBLIC RobotWithExternalPositionerInvKin : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rop_inverse_kinematics.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rop_inverse_kinematics.h index f088019bc53..575477d53f9 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rop_inverse_kinematics.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/rop_inverse_kinematics.h @@ -36,13 +36,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { /** * @brief Robot on Positioner Inverse kinematic implementation. */ -class RobotOnPositionerInvKin : public InverseKinematics +class TESSERACT_KINEMATICS_CORE_PUBLIC RobotOnPositionerInvKin : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/visibility_control.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/visibility_control.h new file mode 100644 index 00000000000..2e313d05c6f --- /dev/null +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/core/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_KINEMATICS_CORE_VISIBILITY_CONTROL_H +#define TESSERACT_KINEMATICS_CORE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_KINEMATICS_CORE_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_KINEMATICS_CORE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_KINEMATICS_CORE_EXPORT __declspec(dllexport) + #define TESSERACT_KINEMATICS_CORE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_KINEMATICS_CORE_STATIC_LIBRARY + #ifdef TESSERACT_KINEMATICS_CORE_LIBRARY_SHARED + #define TESSERACT_KINEMATICS_CORE_PUBLIC TESSERACT_KINEMATICS_CORE_EXPORT + #else + #define TESSERACT_KINEMATICS_CORE_PUBLIC TESSERACT_KINEMATICS_CORE_IMPORT + #endif + #else + #define TESSERACT_KINEMATICS_CORE_PUBLIC + #endif + #define TESSERACT_KINEMATICS_CORE_PUBLIC_TYPE TESSERACT_KINEMATICS_CORE_PUBLIC + #define TESSERACT_KINEMATICS_CORE_LOCAL +#else + #define TESSERACT_KINEMATICS_CORE_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_CORE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_KINEMATICS_CORE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_CORE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_KINEMATICS_CORE_PUBLIC + #define TESSERACT_KINEMATICS_CORE_LOCAL + #endif + #define TESSERACT_KINEMATICS_CORE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_KINEMATICS_CORE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/ikfast_inv_kin.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/ikfast_inv_kin.h index b4c27db74d7..f922f62bfad 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/ikfast_inv_kin.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/ikfast_inv_kin.h @@ -27,6 +27,7 @@ #define TESSERACT_KINEMATICS_IKFAST_INV_KIN_H #include +#include namespace tesseract_kinematics { @@ -79,7 +80,7 @@ namespace tesseract_kinematics * } * */ -class IKFastInvKin : public InverseKinematics +class TESSERACT_KINEMATICS_IKFAST_PUBLIC IKFastInvKin : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/visibility_control.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/visibility_control.h new file mode 100644 index 00000000000..18a39eb8d2a --- /dev/null +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/ikfast/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_KINEMATICS_IKFAST_VISIBILITY_CONTROL_H +#define TESSERACT_KINEMATICS_IKFAST_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_KINEMATICS_IKFAST_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_KINEMATICS_IKFAST_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_KINEMATICS_IKFAST_EXPORT __declspec(dllexport) + #define TESSERACT_KINEMATICS_IKFAST_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_KINEMATICS_IKFAST_STATIC_LIBRARY + #ifdef TESSERACT_KINEMATICS_IKFAST_LIBRARY_SHARED + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC TESSERACT_KINEMATICS_IKFAST_EXPORT + #else + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC TESSERACT_KINEMATICS_IKFAST_IMPORT + #endif + #else + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC + #endif + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC_TYPE TESSERACT_KINEMATICS_IKFAST_PUBLIC + #define TESSERACT_KINEMATICS_IKFAST_LOCAL +#else + #define TESSERACT_KINEMATICS_IKFAST_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_IKFAST_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_IKFAST_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC + #define TESSERACT_KINEMATICS_IKFAST_LOCAL + #endif + #define TESSERACT_KINEMATICS_IKFAST_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_KINEMATICS_IKFAST_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain.h index 0d4e7a31cd7..9ac138e803d 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain.h @@ -40,6 +40,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { @@ -49,7 +50,7 @@ namespace tesseract_kinematics * Typically, just wrappers around the equivalent KDL calls. * */ -class KDLFwdKinChain : public ForwardKinematics +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLFwdKinChain : public ForwardKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain_factory.h index 2373e5612c8..9f0abdfe347 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_chain_factory.h @@ -27,10 +27,11 @@ #define TESSERACT_KINEMATICS_KDL_FWD_KIN_CHAIN_FACTORY_H #include #include +#include namespace tesseract_kinematics { -class KDLFwdKinChainFactory : public ForwardKinematicsFactory +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLFwdKinChainFactory : public ForwardKinematicsFactory { public: KDLFwdKinChainFactory() : name_(KDLFwdKinChain().getSolverName()) {} diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree.h index 432e457dce3..e3b9e7e67cc 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree.h @@ -37,7 +37,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP -#include "tesseract_kinematics/core/forward_kinematics.h" +#include +#include namespace tesseract_kinematics { @@ -47,7 +48,7 @@ namespace tesseract_kinematics * Typically, just wrappers around the equivalent KDL calls. * */ -class KDLFwdKinTree : public ForwardKinematics +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLFwdKinTree : public ForwardKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree_factory.h index 6f4251fe02a..cff5ce8bb21 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_fwd_kin_tree_factory.h @@ -25,12 +25,14 @@ */ #ifndef TESSERACT_KINEMATICS_KDL_FWD_KIN_TREE_FACTORY_H #define TESSERACT_KINEMATICS_KDL_FWD_KIN_TREE_FACTORY_H + #include #include +#include namespace tesseract_kinematics { -class KDLFwdKinTreeFactory : public ForwardKinematicsFactory +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLFwdKinTreeFactory : public ForwardKinematicsFactory { public: KDLFwdKinTreeFactory() : name_(KDLFwdKinTree().getSolverName()) {} diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma.h index 3e109dcd4c4..63bb3d98b03 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma.h @@ -38,13 +38,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { /** * @brief KDL Inverse kinematic chain implementation. */ -class KDLInvKinChainLMA : public InverseKinematics +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLInvKinChainLMA : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma_factory.h index 7057789d3a1..c0bfcc1a05b 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_lma_factory.h @@ -25,12 +25,14 @@ */ #ifndef TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_LMA_FACTORY_H #define TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_LMA_FACTORY_H + #include #include +#include namespace tesseract_kinematics { -class KDLInvKinChainLMAFactory : public InverseKinematicsFactory +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLInvKinChainLMAFactory : public InverseKinematicsFactory { public: KDLInvKinChainLMAFactory() : name_(KDLInvKinChainLMA().getSolverName()) {} diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr.h index 1481bcdc611..a49a01b3300 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr.h @@ -40,13 +40,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_kinematics { /** * @brief KDL Inverse kinematic chain implementation. */ -class KDLInvKinChainNR : public InverseKinematics +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLInvKinChainNR : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr_factory.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr_factory.h index 4b0bb78a63f..934757b4607 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr_factory.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_inv_kin_chain_nr_factory.h @@ -25,12 +25,14 @@ */ #ifndef TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_NR_FACTORY_H #define TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_NR_FACTORY_H + #include #include +#include namespace tesseract_kinematics { -class KDLInvKinChainNRFactory : public InverseKinematicsFactory +class TESSERACT_KINEMATICS_KDL_PUBLIC KDLInvKinChainNRFactory : public InverseKinematicsFactory { public: KDLInvKinChainNRFactory() : name_(KDLInvKinChainNR().getSolverName()) {} diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_utils.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_utils.h index 40fdebf8ac5..1dfd6432a3a 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_utils.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/kdl_utils.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_kinematics { @@ -138,7 +139,7 @@ inline void KDLToEigen(const KDL::JntArray& joints, Eigen::Ref * This contains common data extracted when parsing * a kdl chain from the scene graph */ -struct KDLChainData +struct TESSERACT_KINEMATICS_KDL_LOCAL KDLChainData { KDL::Chain robot_chain; /**< KDL Chain object */ KDL::Tree kdl_tree; /**< KDL tree object */ diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/visibility_control.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/visibility_control.h new file mode 100644 index 00000000000..6ab001aea4f --- /dev/null +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/kdl/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef VISIBILITY_CONTROL_H +#define VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_KINEMATICS_KDL_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_KINEMATICS_KDL_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_KINEMATICS_KDL_EXPORT __declspec(dllexport) + #define TESSERACT_KINEMATICS_KDL_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_KINEMATICS_KDL_STATIC_LIBRARY + #ifdef TESSERACT_KINEMATICS_KDL_LIBRARY_SHARED + #define TESSERACT_KINEMATICS_KDL_PUBLIC TESSERACT_KINEMATICS_KDL_EXPORT + #else + #define TESSERACT_KINEMATICS_KDL_PUBLIC TESSERACT_KINEMATICS_KDL_IMPORT + #endif + #else + #define TESSERACT_KINEMATICS_KDL_PUBLIC + #endif + #define TESSERACT_KINEMATICS_KDL_PUBLIC_TYPE TESSERACT_KINEMATICS_KDL_PUBLIC + #define TESSERACT_KINEMATICS_KDL_LOCAL +#else + #define TESSERACT_KINEMATICS_KDL_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_KDL_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_KINEMATICS_KDL_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_KDL_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_KINEMATICS_KDL_PUBLIC + #define TESSERACT_KINEMATICS_KDL_LOCAL + #endif + #define TESSERACT_KINEMATICS_KDL_PUBLIC_TYPE +#endif +// clang-format on + +#endif // VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/opw_inv_kin.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/opw_inv_kin.h index c1952da17ee..1bb3cb5797a 100644 --- a/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/opw_inv_kin.h +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/opw_inv_kin.h @@ -32,11 +32,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_kinematics { /**@brief OPW Inverse Kinematics Implmentation. */ -class OPWInvKin : public InverseKinematics +class TESSERACT_KINEMATICS_OPW_PUBLIC OPWInvKin : public InverseKinematics { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/visibility_control.h b/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/visibility_control.h new file mode 100644 index 00000000000..6151da9daf2 --- /dev/null +++ b/tesseract/tesseract_kinematics/include/tesseract_kinematics/opw/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_KINEMATICS_OPW_VISIBILITY_CONTROL_H +#define TESSERACT_KINEMATICS_OPW_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_KINEMATICS_OPW_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_KINEMATICS_OPW_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_KINEMATICS_OPW_EXPORT __declspec(dllexport) + #define TESSERACT_KINEMATICS_OPW_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_KINEMATICS_OPW_STATIC_LIBRARY + #ifdef TESSERACT_KINEMATICS_OPW_LIBRARY_SHARED + #define TESSERACT_KINEMATICS_OPW_PUBLIC TESSERACT_KINEMATICS_OPW_EXPORT + #else + #define TESSERACT_KINEMATICS_OPW_PUBLIC TESSERACT_KINEMATICS_OPW_IMPORT + #endif + #else + #define TESSERACT_KINEMATICS_OPW_PUBLIC + #endif + #define TESSERACT_KINEMATICS_OPW_PUBLIC_TYPE TESSERACT_KINEMATICS_OPW_PUBLIC + #define TESSERACT_KINEMATICS_OPW_LOCAL +#else + #define TESSERACT_KINEMATICS_OPW_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_OPW_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_KINEMATICS_OPW_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_KINEMATICS_OPW_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_KINEMATICS_OPW_PUBLIC + #define TESSERACT_KINEMATICS_OPW_LOCAL + #endif + #define TESSERACT_KINEMATICS_OPW_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_KINEMATICS_OPW_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_kinematics/test/CMakeLists.txt b/tesseract/tesseract_kinematics/test/CMakeLists.txt index 37980c30c30..06d4b1623bd 100644 --- a/tesseract/tesseract_kinematics/test/CMakeLists.txt +++ b/tesseract/tesseract_kinematics/test/CMakeLists.txt @@ -7,6 +7,7 @@ add_executable(${PROJECT_NAME}_kdl_unit kdl_kinematics_unit.cpp) target_link_libraries(${PROJECT_NAME}_kdl_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_kdl tesseract::tesseract_support tesseract::tesseract_urdf tesseract::tesseract_scene_graph) target_include_directories(${PROJECT_NAME}_kdl_unit PRIVATE ${orocos_kdl_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_kdl_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_kdl_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_kdl_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_kdl_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_kdl_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -18,6 +19,7 @@ add_executable(${PROJECT_NAME}_rop_unit rop_kinematics_unit.cpp) target_link_libraries(${PROJECT_NAME}_rop_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_kdl ${PROJECT_NAME}_opw tesseract::tesseract_support tesseract::tesseract_urdf tesseract::tesseract_scene_graph) target_include_directories(${PROJECT_NAME}_rop_unit PRIVATE ${orocos_kdl_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_rop_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_rop_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_rop_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_rop_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_rop_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -29,6 +31,7 @@ add_executable(${PROJECT_NAME}_rep_unit rep_kinematics_unit.cpp) target_link_libraries(${PROJECT_NAME}_rep_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_kdl ${PROJECT_NAME}_opw tesseract::tesseract_support tesseract::tesseract_urdf tesseract::tesseract_scene_graph) target_include_directories(${PROJECT_NAME}_rep_unit PRIVATE ${orocos_kdl_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_rep_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_rep_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_rep_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_rep_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_rep_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_command_language/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_command_language/CMakeLists.txt index 9dc3d638721..3c1bb9e8268 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_command_language/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_command_language VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(console_bridge REQUIRED) find_package(tesseract_common REQUIRED) find_package(Eigen3 REQUIRED) @@ -13,7 +16,7 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) # Load variable for clang tidy args, compiler options and cxx version tesseract_variables() -add_library(${PROJECT_NAME} SHARED +add_library(${PROJECT_NAME} src/plan_instruction.cpp src/move_instruction.cpp src/composite_instruction.cpp @@ -27,8 +30,10 @@ add_library(${PROJECT_NAME} SHARED src/utils/flatten_utils.cpp src/utils/get_instruction_utils.cpp src/utils/utils.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge tesseract::tesseract_common) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/cartesian_waypoint.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/cartesian_waypoint.h index a251322ff55..fdd301e4d6d 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/cartesian_waypoint.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/cartesian_waypoint.h @@ -36,10 +36,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -class CartesianWaypoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC CartesianWaypoint { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/composite_instruction.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/composite_instruction.h index 547645ad22a..ce4807799e9 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/composite_instruction.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/composite_instruction.h @@ -37,6 +37,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -47,7 +48,7 @@ enum class CompositeInstructionOrder ORDERED_AND_REVERABLE // Can go forward or reverse the order }; -class CompositeInstruction +class TESSERACT_COMMAND_LANGUAGE_PUBLIC CompositeInstruction { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/instruction.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/instruction.h index f8986cd0c49..d105444e658 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/instruction.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/instruction.h @@ -32,12 +32,13 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { namespace detail { -struct InstructionInnerBase +struct TESSERACT_COMMAND_LANGUAGE_LOCAL InstructionInnerBase { InstructionInnerBase() = default; virtual ~InstructionInnerBase() = default; @@ -99,7 +100,7 @@ struct InstructionInner final : InstructionInnerBase } // namespace detail -class Instruction +class TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction { template using uncvref_t = std::remove_cv_t>; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/waypoint.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/waypoint.h index 95b717f841e..be20e8cc6c6 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/waypoint.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/core/waypoint.h @@ -32,11 +32,13 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { namespace detail { -struct WaypointInnerBase +struct TESSERACT_COMMAND_LANGUAGE_LOCAL WaypointInnerBase { WaypointInnerBase() = default; virtual ~WaypointInnerBase() = default; @@ -87,7 +89,7 @@ struct WaypointInner final : WaypointInnerBase } // namespace detail -class Waypoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC Waypoint { template using uncvref_t = std::remove_cv_t>; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/deserialize.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/deserialize.h index aa5c1c49c18..0fc3b62a5cb 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/deserialize.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/deserialize.h @@ -32,28 +32,32 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { using WaypointParserFn = std::function; using InstructionParserFn = std::function; -Waypoint defaultWaypointParser(const tinyxml2::XMLElement& xml_element, int type); -Instruction defaultInstructionParser(const tinyxml2::XMLElement& xml_element, - int type, - WaypointParserFn waypoint_parser); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Waypoint defaultWaypointParser(const tinyxml2::XMLElement& xml_element, int type); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction defaultInstructionParser(const tinyxml2::XMLElement& xml_element, + int type, + WaypointParserFn waypoint_parser); -Instruction fromXMLDocument(const tinyxml2::XMLDocument& xml_doc, - InstructionParserFn instruction_parser = defaultInstructionParser, - WaypointParserFn waypoint_parser = defaultWaypointParser); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction +fromXMLDocument(const tinyxml2::XMLDocument& xml_doc, + InstructionParserFn instruction_parser = defaultInstructionParser, + WaypointParserFn waypoint_parser = defaultWaypointParser); -Instruction fromXMLFile(const std::string& file_path, - InstructionParserFn instruction_parser = defaultInstructionParser, - WaypointParserFn waypoint_parser = defaultWaypointParser); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction +fromXMLFile(const std::string& file_path, + InstructionParserFn instruction_parser = defaultInstructionParser, + WaypointParserFn waypoint_parser = defaultWaypointParser); -Instruction fromXMLString(const std::string& xml_string, - InstructionParserFn instruction_parser = defaultInstructionParser, - WaypointParserFn waypoint_parser = defaultWaypointParser); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction +fromXMLString(const std::string& xml_string, + InstructionParserFn instruction_parser = defaultInstructionParser, + WaypointParserFn waypoint_parser = defaultWaypointParser); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/instruction_type.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/instruction_type.h index 78df990a96c..9a4f2035ad5 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/instruction_type.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/instruction_type.h @@ -26,6 +26,8 @@ #ifndef TESSERACT_COMMAND_LANGUAGE_INSTRUCTION_TYPE_H #define TESSERACT_COMMAND_LANGUAGE_INSTRUCTION_TYPE_H +#include + namespace tesseract_planning { class Instruction; @@ -60,21 +62,21 @@ enum class InstructionType : int USER_DEFINED = 1000 }; -bool isCommentInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isCommentInstruction(const Instruction& instruction); -bool isVariableInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isVariableInstruction(const Instruction& instruction); -bool isAnalogInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isAnalogInstruction(const Instruction& instruction); -bool isIOInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isIOInstruction(const Instruction& instruction); -bool isCompositeInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isCompositeInstruction(const Instruction& instruction); -bool isMoveInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isMoveInstruction(const Instruction& instruction); -bool isPlanInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isPlanInstruction(const Instruction& instruction); -bool isNullInstruction(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isNullInstruction(const Instruction& instruction); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h index a9e9052ab06..7f3e3d3bd38 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h @@ -37,10 +37,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -class JointWaypoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC JointWaypoint { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/manipulator_info.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/manipulator_info.h index 1c2337023a2..0115ac4de02 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/manipulator_info.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/manipulator_info.h @@ -36,11 +36,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { /** @brief Manipulator Info Tool Center Point Definition */ -class ToolCenterPoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC ToolCenterPoint { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -98,7 +99,7 @@ class ToolCenterPoint /** * @brief Contains information about a robot manipulator */ -struct ManipulatorInfo +struct TESSERACT_COMMAND_LANGUAGE_PUBLIC ManipulatorInfo { EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/move_instruction.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/move_instruction.h index 8e932629e76..cb3be2d889c 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/move_instruction.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/move_instruction.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -46,7 +47,7 @@ enum class MoveInstructionType : int START = 3 /**< This indicates it is a start instruction. */ }; -class MoveInstruction +class TESSERACT_COMMAND_LANGUAGE_PUBLIC MoveInstruction { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_instruction.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_instruction.h index 32224f984e6..80266df1a19 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_instruction.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_instruction.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class NullInstruction +class TESSERACT_COMMAND_LANGUAGE_PUBLIC NullInstruction { public: int getType() const { return static_cast(InstructionType::NULL_INSTRUCTION); } diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_waypoint.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_waypoint.h index c2dd8a17d6a..74dc4fbfd5f 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_waypoint.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/null_waypoint.h @@ -32,9 +32,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { -class NullWaypoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC NullWaypoint { public: NullWaypoint() = default; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/plan_instruction.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/plan_instruction.h index 51b6206fac9..d1713281b5f 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/plan_instruction.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/plan_instruction.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -47,7 +48,7 @@ enum class PlanInstructionType : int START = 3 }; -class PlanInstruction +class TESSERACT_COMMAND_LANGUAGE_PUBLIC PlanInstruction { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/serialize.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/serialize.h index 95b4ad6e7af..be0487839e0 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/serialize.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/serialize.h @@ -31,14 +31,15 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -std::shared_ptr toXMLDocument(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::shared_ptr toXMLDocument(const Instruction& instruction); -bool toXMLFile(const Instruction& instruction, const std::string& file_path); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool toXMLFile(const Instruction& instruction, const std::string& file_path); -std::string toXMLString(const Instruction& instruction); +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::string toXMLString(const Instruction& instruction); } // namespace tesseract_planning #endif // TESSERACT_COMMAND_LANGUAGE_SERIALIZE_H diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/state_waypoint.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/state_waypoint.h index dc8fff4c31b..6afe9ae1ade 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/state_waypoint.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/state_waypoint.h @@ -37,10 +37,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -class StateWaypoint +class TESSERACT_COMMAND_LANGUAGE_PUBLIC StateWaypoint { public: StateWaypoint() = default; diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/flatten_utils.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/flatten_utils.h index 41371914913..23c4930f905 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/flatten_utils.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/flatten_utils.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -39,8 +40,8 @@ namespace tesseract_planning * @param filter Used to filter only what should be considered. Should return true to include otherwise false * @return A new flattened vector referencing the original instruction elements */ -std::vector> flatten(CompositeInstruction& composite_instruction, - flattenFilterFn filter = nullptr); +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::vector> +flatten(CompositeInstruction& composite_instruction, flattenFilterFn filter = nullptr); /** * @brief Flattens a CompositeInstruction into a vector of Instruction& @@ -48,8 +49,8 @@ std::vector> flatten(CompositeInstruction& c * @param filter Used to filter only what should be considered. Should return true to include otherwise false * @return A new flattened vector referencing the original instruction elements */ -std::vector> flatten(const CompositeInstruction& composite_instruction, - flattenFilterFn filter = nullptr); +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::vector> +flatten(const CompositeInstruction& composite_instruction, flattenFilterFn filter = nullptr); /** * @brief Flattens a composite instruction to the same pattern as the pattern composite instruction. ie, an element of @@ -61,9 +62,10 @@ std::vector> flatten(const CompositeIn * @param filter Used to filter only what should be considered. Should return true to include otherwise false * @return A new flattened vector referencing the original instruction elements */ -std::vector> flattenToPattern(CompositeInstruction& composite_instruction, - const CompositeInstruction& pattern, - flattenFilterFn filter = nullptr); +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::vector> +flattenToPattern(CompositeInstruction& composite_instruction, + const CompositeInstruction& pattern, + flattenFilterFn filter = nullptr); /** * @brief Flattens a composite instruction to the same pattern as the pattern composite instruction. ie, an element of @@ -73,7 +75,7 @@ std::vector> flattenToPattern(CompositeInstr * @param filter Used to filter only what should be considered. Should return true to include otherwise false * @return A new flattened vector referencing the original instruction elements */ -std::vector> +TESSERACT_COMMAND_LANGUAGE_PUBLIC std::vector> flattenToPattern(const CompositeInstruction& composite_instruction, const CompositeInstruction& pattern, flattenFilterFn filter = nullptr); diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/get_instruction_utils.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/get_instruction_utils.h index 6223a87c5d0..5062a22cfc5 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/get_instruction_utils.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/get_instruction_utils.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -40,9 +41,10 @@ namespace tesseract_planning * @param process_child_composites Indicate if child Composite Instructions should be searched * @return The first Instruction (Const) */ -const Instruction* getFirstInstruction(const CompositeInstruction& composite_instruction, - locateFilterFn locate_filter = nullptr, - bool process_child_composites = true); +TESSERACT_COMMAND_LANGUAGE_PUBLIC const Instruction* +getFirstInstruction(const CompositeInstruction& composite_instruction, + locateFilterFn locate_filter = nullptr, + bool process_child_composites = true); /** * @brief Get the first Instruction in a Composite Instruction that is identified by the filter @@ -51,9 +53,9 @@ const Instruction* getFirstInstruction(const CompositeInstruction& composite_ins * @param process_child_composites Indicate if child Composite Instructions should be searched * @return The first Instruction (Non-Const) */ -Instruction* getFirstInstruction(CompositeInstruction& composite_instruction, - locateFilterFn locate_filter = nullptr, - bool process_child_composites = true); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction* getFirstInstruction(CompositeInstruction& composite_instruction, + locateFilterFn locate_filter = nullptr, + bool process_child_composites = true); /** * @brief Get the last Instruction in a Composite Instruction that is identified by the filter @@ -62,9 +64,10 @@ Instruction* getFirstInstruction(CompositeInstruction& composite_instruction, * @param process_child_composites Indicate if child Composite Instructions should be searched * @return The Last Instruction (Const) */ -const Instruction* getLastInstruction(const CompositeInstruction& composite_instruction, - locateFilterFn locate_filter = nullptr, - bool process_child_composites = true); +TESSERACT_COMMAND_LANGUAGE_PUBLIC const Instruction* +getLastInstruction(const CompositeInstruction& composite_instruction, + locateFilterFn locate_filter = nullptr, + bool process_child_composites = true); /** * @brief Get the last Instruction in a Composite Instruction that is identified by the filter @@ -73,9 +76,9 @@ const Instruction* getLastInstruction(const CompositeInstruction& composite_inst * @param process_child_composites Indicate if child Composite Instructions should be searched * @return The Last Instruction (Non-Const) */ -Instruction* getLastInstruction(CompositeInstruction& composite_instruction, - locateFilterFn locate_filter = nullptr, - bool process_child_composites = true); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Instruction* getLastInstruction(CompositeInstruction& composite_instruction, + locateFilterFn locate_filter = nullptr, + bool process_child_composites = true); /** * @brief Get the first Move Instruction in a Composite Instruction @@ -204,9 +207,9 @@ inline const PlanInstruction* getLastPlanInstruction(const CompositeInstruction& * @param process_child_composites Indicate if child Composite Instructions should be searched * @return The number of Instructions */ -long getInstructionCount(const CompositeInstruction& composite_instruction, - locateFilterFn locate_filter = nullptr, - bool process_child_composites = true); +TESSERACT_COMMAND_LANGUAGE_PUBLIC long getInstructionCount(const CompositeInstruction& composite_instruction, + locateFilterFn locate_filter = nullptr, + bool process_child_composites = true); /** * @brief Get number of Move Instruction in a Composite Instruction diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/utils.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/utils.h index 5c95d2355be..2bb047300c9 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/utils.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/utils.h @@ -31,6 +31,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -41,7 +42,7 @@ namespace tesseract_planning * @param waypoint The waypoint to try and extract the joint position from * @return The joint values */ -const Eigen::VectorXd& getJointPosition(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC const Eigen::VectorXd& getJointPosition(const Waypoint& waypoint); /** * @brief Gets joint names from waypoints that contain that information. @@ -51,7 +52,7 @@ const Eigen::VectorXd& getJointPosition(const Waypoint& waypoint); * @param waypoint The waypoint to try and extract the joint position from * @return The joint names */ -const std::vector& getJointNames(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC const std::vector& getJointNames(const Waypoint& waypoint); /** * @brief Get the joint positions ordered by the provided joint names @@ -65,7 +66,8 @@ const std::vector& getJointNames(const Waypoint& waypoint); * @param waypoint The waypoint to * @return The joint values ordered by the provied joint_names */ -Eigen::VectorXd getJointPosition(const std::vector& joint_names, const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC Eigen::VectorXd getJointPosition(const std::vector& joint_names, + const Waypoint& waypoint); /** * @brief Set the joint position for waypoints that contain that information @@ -73,7 +75,8 @@ Eigen::VectorXd getJointPosition(const std::vector& joint_names, co * @param position Joint position * @return true if successful (if the waypoint is a supported type) */ -bool setJointPosition(Waypoint& waypoint, const Eigen::Ref& position); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool setJointPosition(Waypoint& waypoint, + const Eigen::Ref& position); /** * @brief Checks if a waypoint is @@ -81,7 +84,8 @@ bool setJointPosition(Waypoint& waypoint, const Eigen::Ref& limits); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isWithinJointLimits(const Waypoint& wp, + const Eigen::Ref& limits); /** * @brief Clamps a waypoint to be within joint limits @@ -90,9 +94,9 @@ bool isWithinJointLimits(const Waypoint& wp, const Eigen::Ref& limits, - double max_deviation = std::numeric_limits::max()); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool clampToJointLimits(Waypoint& wp, + const Eigen::Ref& limits, + double max_deviation = std::numeric_limits::max()); /** * @brief Clamps a waypoint to be within joint limits @@ -101,16 +105,17 @@ bool clampToJointLimits(Waypoint& wp, * @param max_deviation. Max deviation that will be clamped * @return True if successful or if the waypoint doesn't contain that information. */ -bool clampToJointLimits(Waypoint& wp, - const Eigen::Ref& limits, - const Eigen::Ref& max_deviation); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool clampToJointLimits(Waypoint& wp, + const Eigen::Ref& limits, + const Eigen::Ref& max_deviation); /** * @brief This creates a seed by looping over and replacing every plan instruction with a composite instruction * @param instructions * @return */ -CompositeInstruction generateSkeletonSeed(const CompositeInstruction& composite_instructions); +TESSERACT_COMMAND_LANGUAGE_PUBLIC CompositeInstruction +generateSkeletonSeed(const CompositeInstruction& composite_instructions); /** * @brief This loops over the instructions validates the structure @@ -121,8 +126,8 @@ CompositeInstruction generateSkeletonSeed(const CompositeInstruction& composite_ * @param composite_seed * @return */ -bool validateSeedStructure(const CompositeInstruction& composite_instructions, - const CompositeInstruction& composite_seed); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool validateSeedStructure(const CompositeInstruction& composite_instructions, + const CompositeInstruction& composite_seed); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/visibility_control.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/visibility_control.h new file mode 100644 index 00000000000..ce6cf69158b --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_COMMAND_LANGUAGE_VISIBILITY_CONTROL_H +#define TESSERACT_COMMAND_LANGUAGE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_COMMAND_LANGUAGE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC __declspec(dllexport) + #define TESSERACT_COMMAND_LANGUAGE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_COMMAND_LANGUAGE_STATIC_LIBRARY + #ifdef TESSERACT_COMMAND_LANGUAGE_LIBRARY_SHARED + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC TESSERACT_COMMAND_LANGUAGE_PUBLIC + #else + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC TESSERACT_COMMAND_LANGUAGE_IMPORT + #endif + #else + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC + #endif + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC_TYPE TESSERACT_COMMAND_LANGUAGE_PUBLIC + #define TESSERACT_COMMAND_LANGUAGE_LOCAL +#else + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COMMAND_LANGUAGE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_COMMAND_LANGUAGE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC + #define TESSERACT_COMMAND_LANGUAGE_LOCAL + #endif + #define TESSERACT_COMMAND_LANGUAGE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_COMMAND_LANGUAGE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/waypoint_type.h b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/waypoint_type.h index fc80ce1cc25..bb2a903d030 100644 --- a/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/waypoint_type.h +++ b/tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/waypoint_type.h @@ -26,6 +26,8 @@ #ifndef TESSERACT_COMMAND_LANGUAGE_WAYPOINT_TYPE_H #define TESSERACT_COMMAND_LANGUAGE_WAYPOINT_TYPE_H +#include + namespace tesseract_planning { class Waypoint; @@ -48,13 +50,13 @@ enum class WaypointType : int USER_DEFINED = 1000 }; -bool isCartesianWaypoint(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isCartesianWaypoint(const Waypoint& waypoint); -bool isJointWaypoint(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isJointWaypoint(const Waypoint& waypoint); -bool isStateWaypoint(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isStateWaypoint(const Waypoint& waypoint); -bool isNullWaypoint(const Waypoint& waypoint); +TESSERACT_COMMAND_LANGUAGE_PUBLIC bool isNullWaypoint(const Waypoint& waypoint); } // namespace tesseract_planning #endif // TESSERACT_COMMAND_LANGUAGE_WAYPOINT_TYPE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_motion_planners/CMakeLists.txt index 414da454ddf..70917d680ec 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_motion_planners/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_motion_planners VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Boost REQUIRED) find_package(console_bridge REQUIRED) find_package(descartes_light REQUIRED) @@ -21,9 +24,11 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) tesseract_variables() # Create interface for core -add_library(${PROJECT_NAME}_core SHARED src/core/utils.cpp) +add_library(${PROJECT_NAME}_core src/core/utils.cpp) +target_process_export(${PROJECT_NAME}_core) target_link_libraries(${PROJECT_NAME}_core PUBLIC tesseract::tesseract tesseract::tesseract_common tesseract::tesseract_command_language trajopt::trajopt console_bridge) target_compile_options(${PROJECT_NAME}_core PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_core PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_core ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_core PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_core ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -34,7 +39,7 @@ target_include_directories(${PROJECT_NAME}_core SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS}) # Descartes Planner -add_library(${PROJECT_NAME}_descartes SHARED +add_library(${PROJECT_NAME}_descartes src/descartes/descartes_motion_planner.cpp src/descartes/descartes_collision.cpp src/descartes/descartes_collision_edge_evaluator.cpp @@ -43,8 +48,10 @@ add_library(${PROJECT_NAME}_descartes SHARED src/descartes/profile/descartes_default_plan_profile.cpp src/descartes/serialize.cpp src/descartes/deserialize.cpp) +target_process_export(${PROJECT_NAME}_descartes) target_link_libraries(${PROJECT_NAME}_descartes PUBLIC ${PROJECT_NAME}_core descartes::descartes_light descartes::descartes_samplers) target_compile_options(${PROJECT_NAME}_descartes PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_descartes PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_descartes ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_descartes PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_descartes ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -72,9 +79,11 @@ set(OMPL_SRC src/ompl/ompl_motion_planner.cpp # list(APPEND OMPL_SRC src/ompl/config/ompl_planner_constrained_config.cpp) #endif() -add_library(${PROJECT_NAME}_ompl SHARED ${OMPL_SRC}) +add_library(${PROJECT_NAME}_ompl ${OMPL_SRC}) +target_process_export(${PROJECT_NAME}_ompl) target_link_libraries(${PROJECT_NAME}_ompl PUBLIC ${PROJECT_NAME}_core ${OMPL_LIBRARIES}) target_compile_options(${PROJECT_NAME}_ompl PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_ompl PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ompl ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ompl PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ompl ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -88,17 +97,18 @@ if(OMPL_VERSION VERSION_LESS "1.4.0") endif() # Simple Planner -add_library(${PROJECT_NAME}_simple SHARED +add_library(${PROJECT_NAME}_simple src/simple/simple_motion_planner.cpp src/simple/profile/simple_planner_default_lvs_plan_profile.cpp src/simple/profile/simple_planner_default_plan_profile.cpp src/simple/profile/simple_planner_interpolation_plan_profile.cpp src/simple/step_generators/fixed_size_assign_position.cpp src/simple/step_generators/fixed_size_interpolation.cpp - src/simple/step_generators/lvs_interpolation.cpp - ) + src/simple/step_generators/lvs_interpolation.cpp) +target_process_export(${PROJECT_NAME}_simple) target_link_libraries(${PROJECT_NAME}_simple PUBLIC ${Boost_LIBRARIES} ${PROJECT_NAME}_core) target_compile_options(${PROJECT_NAME}_simple PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_simple PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_simple ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_simple PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_simple ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -110,7 +120,7 @@ target_include_directories(${PROJECT_NAME}_simple SYSTEM PUBLIC ${Boost_INCLUDE_DIRS}) # Trajopt Planner -add_library(${PROJECT_NAME}_trajopt SHARED +add_library(${PROJECT_NAME}_trajopt src/trajopt/trajopt_collision_config.cpp src/trajopt/trajopt_motion_planner.cpp src/trajopt/trajopt_utils.cpp @@ -119,8 +129,10 @@ add_library(${PROJECT_NAME}_trajopt SHARED src/trajopt/problem_generators/default_problem_generator.cpp src/trajopt/serialize.cpp src/trajopt/deserialize.cpp) +target_process_export(${PROJECT_NAME}_trajopt) target_link_libraries(${PROJECT_NAME}_trajopt PUBLIC ${Boost_LIBRARIES} ${PROJECT_NAME}_core trajopt::trajopt trajopt::trajopt_utils trajopt::trajopt_sco) target_compile_options(${PROJECT_NAME}_trajopt PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_trajopt PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_trajopt ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_trajopt PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_trajopt ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/examples/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_motion_planners/examples/CMakeLists.txt index cf85cd32e84..b31719379ce 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/examples/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_motion_planners/examples/CMakeLists.txt @@ -4,18 +4,21 @@ find_package(tesseract_visualization REQUIRED) add_executable(${PROJECT_NAME}_chain_example chain_example.cpp) target_link_libraries(${PROJECT_NAME}_chain_example ${PROJECT_NAME}_descartes ${PROJECT_NAME}_trajopt ${PROJECT_NAME}_simple tesseract::tesseract_support tesseract::tesseract_visualization) target_compile_options(${PROJECT_NAME}_chain_example PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_chain_example PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_chain_example ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_chain_example PRIVATE VERSION ${TESSERACT_CXX_VERSION}) add_executable(${PROJECT_NAME}_raster_example raster_example.cpp) target_link_libraries(${PROJECT_NAME}_raster_example ${PROJECT_NAME}_descartes ${PROJECT_NAME}_trajopt ${PROJECT_NAME}_simple tesseract::tesseract_support tesseract::tesseract_visualization) target_compile_options(${PROJECT_NAME}_raster_example PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_raster_example PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_raster_example ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_raster_example PRIVATE VERSION ${TESSERACT_CXX_VERSION}) add_executable(${PROJECT_NAME}_freespace_example freespace_example.cpp) target_link_libraries(${PROJECT_NAME}_freespace_example ${PROJECT_NAME}_ompl ${PROJECT_NAME}_trajopt ${PROJECT_NAME}_simple tesseract::tesseract_support tesseract::tesseract_visualization) target_compile_options(${PROJECT_NAME}_freespace_example PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_freespace_example PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_freespace_example ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_freespace_example PRIVATE VERSION ${TESSERACT_CXX_VERSION}) diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/planner.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/planner.h index 9abdf0cc46b..91282e8200b 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/planner.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/planner.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { -class MotionPlanner +class TESSERACT_MOTION_PLANNERS_CORE_PUBLIC MotionPlanner { public: /** @brief Construct a basic planner */ diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/trajectory_validator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/trajectory_validator.h index 4365961b796..23e991fec72 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/trajectory_validator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/trajectory_validator.h @@ -32,6 +32,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -59,7 +60,7 @@ inline PostPlanCheckType operator&(PostPlanCheckType lhs, PostPlanCheckType rhs) /** * @brief Class for performing validation checks on a planned trajectory */ -class TrajectoryValidator +class TESSERACT_MOTION_PLANNERS_CORE_PUBLIC TrajectoryValidator { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/types.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/types.h index 3a0b0c27ed0..32b07b107a2 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/types.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/types.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -42,7 +43,7 @@ namespace tesseract_planning */ using PlannerProfileRemapping = std::unordered_map>; -struct PlannerRequest +struct TESSERACT_MOTION_PLANNERS_CORE_PUBLIC PlannerRequest { std::string name; /**< @brief The name of the process manager to use */ tesseract::Tesseract::ConstPtr tesseract; /**< @brief Tesseract */ @@ -78,7 +79,7 @@ struct PlannerRequest std::shared_ptr data; }; -struct PlannerResponse +struct TESSERACT_MOTION_PLANNERS_CORE_PUBLIC PlannerResponse { CompositeInstruction results; tesseract_common::StatusCode status; /**< @brief The status information */ diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/visibility_control.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/visibility_control.h new file mode 100644 index 00000000000..7e1d1fc2e47 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/core/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_MOTION_PLANNERS_CORE_VISIBILITY_CONTROL_H +#define TESSERACT_MOTION_PLANNERS_CORE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_MOTION_PLANNERS_CORE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC __declspec(dllexport) + #define TESSERACT_MOTION_PLANNERS_CORE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_MOTION_PLANNERS_CORE_STATIC_LIBRARY + #ifdef TESSERACT_MOTION_PLANNERS_CORE_LIBRARY_SHARED + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC TESSERACT_MOTION_PLANNERS_CORE_PUBLIC + #else + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC TESSERACT_MOTION_PLANNERS_CORE_IMPORT + #endif + #else + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC + #endif + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC_TYPE TESSERACT_MOTION_PLANNERS_CORE_PUBLIC + #define TESSERACT_MOTION_PLANNERS_CORE_LOCAL +#else + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_CORE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_CORE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC + #define TESSERACT_MOTION_PLANNERS_CORE_LOCAL + #endif + #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_MOTION_PLANNERS_CORE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/descartes_motion_planner_status_category.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/descartes_motion_planner_status_category.h index 4c4d739c3d9..b4c57f6a562 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/descartes_motion_planner_status_category.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/descartes_motion_planner_status_category.h @@ -32,6 +32,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { @@ -41,7 +42,8 @@ namespace tesseract_planning * It contains both successfull and error status codes. */ -class DescartesMotionPlannerStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesMotionPlannerStatusCategory + : public tesseract_common::StatusCategory { public: DescartesMotionPlannerStatusCategory(std::string name); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/deserialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/deserialize.h index d15bd364cc3..ab7be8e95fb 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/deserialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/deserialize.h @@ -30,18 +30,24 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -DescartesDefaultPlanProfile descartesPlanParser(const tinyxml2::XMLElement& xml_element); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile +descartesPlanParser(const tinyxml2::XMLElement& xml_element); -DescartesDefaultPlanProfile descartesPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile +descartesPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); -DescartesDefaultPlanProfile descartesPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile +descartesPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); -DescartesDefaultPlanProfile descartesPlanFromXMLFile(const std::string& file_path); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile +descartesPlanFromXMLFile(const std::string& file_path); -DescartesDefaultPlanProfile descartesPlanFromXMLString(const std::string& xml_string); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile +descartesPlanFromXMLString(const std::string& xml_string); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/serialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/serialize.h index 5b6c4e83f3d..6c43fd03a68 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/serialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/serialize.h @@ -31,14 +31,17 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -std::shared_ptr toXMLDocument(const DescartesPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC std::shared_ptr +toXMLDocument(const DescartesPlanProfile& plan_profile); -bool toXMLFile(const DescartesPlanProfile& plan_profile, const std::string& file_path); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC bool toXMLFile(const DescartesPlanProfile& plan_profile, + const std::string& file_path); -std::string toXMLString(const DescartesPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC std::string toXMLString(const DescartesPlanProfile& plan_profile); } // namespace tesseract_planning #endif // TESSERACT_MOTION_PLANNERS_DESCARTES_SERIALIZE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/visibility_control.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/visibility_control.h new file mode 100644 index 00000000000..b1bf255f0f6 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/descartes/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_MOTION_PLANNERS_DESCARTES_VISIBILITY_CONTROL_H +#define TESSERACT_MOTION_PLANNERS_DESCARTES_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_MOTION_PLANNERS_DESCARTES_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC __declspec(dllexport) + #define TESSERACT_MOTION_PLANNERS_DESCARTES_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_MOTION_PLANNERS_DESCARTES_STATIC_LIBRARY + #ifdef TESSERACT_MOTION_PLANNERS_DESCARTES_LIBRARY_SHARED + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC + #else + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC TESSERACT_MOTION_PLANNERS_DESCARTES_IMPORT + #endif + #else + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC + #endif + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC_TYPE TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC + #define TESSERACT_MOTION_PLANNERS_DESCARTES_LOCAL +#else + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_DESCARTES_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_DESCARTES_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC + #define TESSERACT_MOTION_PLANNERS_DESCARTES_LOCAL + #endif + #define TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_MOTION_PLANNERS_DESCARTES_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/compound_state_validator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/compound_state_validator.h index e2ec7d86583..b00bbc4f608 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/compound_state_validator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/compound_state_validator.h @@ -33,10 +33,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { /** @brief Create a single state validity checker from multiple */ -class CompoundStateValidator : public ompl::base::StateValidityChecker +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC CompoundStateValidator : public ompl::base::StateValidityChecker { public: CompoundStateValidator(); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/continuous_motion_validator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/continuous_motion_validator.h index 13add313358..deaf959c0fe 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/continuous_motion_validator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/continuous_motion_validator.h @@ -36,11 +36,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { /** @brief Continuous collision check between two states */ -class ContinuousMotionValidator : public ompl::base::MotionValidator +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC ContinuousMotionValidator : public ompl::base::MotionValidator { public: ContinuousMotionValidator(const ompl::base::SpaceInformationPtr& space_info, diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/deserialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/deserialize.h index cf7540c3468..94f74d215d0 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/deserialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/deserialize.h @@ -30,18 +30,21 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -OMPLDefaultPlanProfile omplPlanParser(const tinyxml2::XMLElement& xml_element); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile omplPlanParser(const tinyxml2::XMLElement& xml_element); -OMPLDefaultPlanProfile omplPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile +omplPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); -OMPLDefaultPlanProfile omplPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile +omplPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); -OMPLDefaultPlanProfile omplPlanFromXMLFile(const std::string& file_path); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile omplPlanFromXMLFile(const std::string& file_path); -OMPLDefaultPlanProfile omplPlanFromXMLString(const std::string& xml_string); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile omplPlanFromXMLString(const std::string& xml_string); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/discrete_motion_validator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/discrete_motion_validator.h index ca936c2e1dd..4b150483145 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/discrete_motion_validator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/discrete_motion_validator.h @@ -23,18 +23,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef TESSERACT_MOTION_PLANNERS_DISCRETE_MOTION_VALIDATOR_H -#define TESSERACT_MOTION_PLANNERS_DISCRETE_MOTION_VALIDATOR_H +#ifndef TESSERACT_MOTION_PLANNERS_OMPL_DISCRETE_MOTION_VALIDATOR_H +#define TESSERACT_MOTION_PLANNERS_OMPL_DISCRETE_MOTION_VALIDATOR_H #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include namespace tesseract_planning { /** @brief Continuous collision check between two states */ -class DiscreteMotionValidator : public ompl::base::MotionValidator +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC DiscreteMotionValidator : public ompl::base::MotionValidator { public: DiscreteMotionValidator(const ompl::base::SpaceInformationPtr& space_info); @@ -47,4 +48,4 @@ class DiscreteMotionValidator : public ompl::base::MotionValidator }; } // namespace tesseract_planning -#endif // TESSERACT_MOTION_PLANNERS_DISCRETE_MOTION_VALIDATOR_H +#endif // TESSERACT_MOTION_PLANNERS_OMPL_DISCRETE_MOTION_VALIDATOR_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner.h index 4e6883f415c..12d8b182b8b 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner.h @@ -33,6 +33,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace ompl { @@ -52,7 +53,7 @@ using OMPLProblemGeneratorFn = * @brief This planner is intended to provide an easy to use interface to OMPL for freespace planning. It is made to * take a start and end point and automate the generation of the OMPL problem. */ -class OMPLMotionPlanner : public MotionPlanner +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLMotionPlanner : public MotionPlanner { public: /** @brief Construct a planner */ diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner_status_category.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner_status_category.h index 1dcc166c4f0..8f9593856db 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner_status_category.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_motion_planner_status_category.h @@ -32,10 +32,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class OMPLMotionPlannerStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLMotionPlannerStatusCategory : public tesseract_common::StatusCategory { public: OMPLMotionPlannerStatusCategory(std::string name); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_planner_configurator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_planner_configurator.h index d4a9b4eaeaf..053501acdf2 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_planner_configurator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_planner_configurator.h @@ -39,6 +39,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { enum class OMPLPlannerType @@ -59,7 +61,7 @@ enum class OMPLPlannerType SPARS = 13 }; -struct OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLPlannerConfigurator { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; @@ -78,7 +80,7 @@ struct OMPLPlannerConfigurator virtual tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const = 0; }; -struct SBLConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC SBLConfigurator : public OMPLPlannerConfigurator { SBLConfigurator() = default; ~SBLConfigurator() override = default; @@ -100,7 +102,7 @@ struct SBLConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct ESTConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC ESTConfigurator : public OMPLPlannerConfigurator { ESTConfigurator() = default; ~ESTConfigurator() override = default; @@ -125,7 +127,7 @@ struct ESTConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct LBKPIECE1Configurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC LBKPIECE1Configurator : public OMPLPlannerConfigurator { LBKPIECE1Configurator() = default; ~LBKPIECE1Configurator() override = default; @@ -153,7 +155,7 @@ struct LBKPIECE1Configurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct BKPIECE1Configurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC BKPIECE1Configurator : public OMPLPlannerConfigurator { BKPIECE1Configurator() = default; ~BKPIECE1Configurator() override = default; @@ -184,7 +186,7 @@ struct BKPIECE1Configurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct KPIECE1Configurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC KPIECE1Configurator : public OMPLPlannerConfigurator { KPIECE1Configurator() = default; ~KPIECE1Configurator() override = default; @@ -218,7 +220,7 @@ struct KPIECE1Configurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct BiTRRTConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC BiTRRTConfigurator : public OMPLPlannerConfigurator { BiTRRTConfigurator() = default; ~BiTRRTConfigurator() override = default; @@ -256,7 +258,7 @@ struct BiTRRTConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct RRTConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC RRTConfigurator : public OMPLPlannerConfigurator { RRTConfigurator() = default; ~RRTConfigurator() override = default; @@ -281,7 +283,7 @@ struct RRTConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct RRTConnectConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC RRTConnectConfigurator : public OMPLPlannerConfigurator { RRTConnectConfigurator() = default; ~RRTConnectConfigurator() override = default; @@ -303,7 +305,7 @@ struct RRTConnectConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct RRTstarConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC RRTstarConfigurator : public OMPLPlannerConfigurator { RRTstarConfigurator() = default; ~RRTstarConfigurator() override = default; @@ -331,7 +333,7 @@ struct RRTstarConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct TRRTConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC TRRTConfigurator : public OMPLPlannerConfigurator { TRRTConfigurator() = default; ~TRRTConfigurator() override = default; @@ -368,7 +370,7 @@ struct TRRTConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct PRMConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC PRMConfigurator : public OMPLPlannerConfigurator { PRMConfigurator() = default; ~PRMConfigurator() override = default; @@ -390,7 +392,7 @@ struct PRMConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct PRMstarConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC PRMstarConfigurator : public OMPLPlannerConfigurator { PRMstarConfigurator() = default; ~PRMstarConfigurator() override = default; @@ -409,7 +411,7 @@ struct PRMstarConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct LazyPRMstarConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC LazyPRMstarConfigurator : public OMPLPlannerConfigurator { LazyPRMstarConfigurator() = default; ~LazyPRMstarConfigurator() override = default; @@ -428,7 +430,7 @@ struct LazyPRMstarConfigurator : public OMPLPlannerConfigurator tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const override; }; -struct SPARSConfigurator : public OMPLPlannerConfigurator +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC SPARSConfigurator : public OMPLPlannerConfigurator { SPARSConfigurator() = default; ~SPARSConfigurator() override = default; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_problem.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_problem.h index 1c803b0bf2c..666a02006ed 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_problem.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/ompl_problem.h @@ -38,6 +38,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -61,7 +62,7 @@ enum class OMPLProblemStateSpace SE3_STATE_SPACE, }; -struct OMPLProblem +struct TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLProblem { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/problem_generators/default_problem_generator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/problem_generators/default_problem_generator.h index dd6ee0e06ec..f7a04d6ac95 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/problem_generators/default_problem_generator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/problem_generators/default_problem_generator.h @@ -33,12 +33,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -std::vector DefaultOMPLProblemGenerator(const std::string& name, - const PlannerRequest& request, - const OMPLPlanProfileMap& plan_profiles); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC std::vector +DefaultOMPLProblemGenerator(const std::string& name, + const PlannerRequest& request, + const OMPLPlanProfileMap& plan_profiles); } // namespace tesseract_planning #endif diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_default_plan_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_default_plan_profile.h index 238c49ec11b..7687409913f 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_default_plan_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_default_plan_profile.h @@ -37,6 +37,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -45,7 +46,7 @@ namespace tesseract_planning * every plan instruction will be its a seperate ompl motion plan and therefore planning information is relevent * for this motion planner in the profile. */ -class OMPLDefaultPlanProfile : public OMPLPlanProfile +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLDefaultPlanProfile : public OMPLPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_profile.h index e1024ecadc9..665b47cdd29 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/profile/ompl_profile.h @@ -35,10 +35,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { -class OMPLPlanProfile +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC OMPLPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/serialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/serialize.h index 5d087bbc17a..2bc94df9b86 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/serialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/serialize.h @@ -31,14 +31,16 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -std::shared_ptr toXMLDocument(const OMPLPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC std::shared_ptr +toXMLDocument(const OMPLPlanProfile& plan_profile); -bool toXMLFile(const OMPLPlanProfile& plan_profile, const std::string& file_path); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC bool toXMLFile(const OMPLPlanProfile& plan_profile, const std::string& file_path); -std::string toXMLString(const OMPLPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC std::string toXMLString(const OMPLPlanProfile& plan_profile); } // namespace tesseract_planning #endif // TESSERACT_MOTION_PLANNERS_OMPL_SERIALIZE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/state_collision_validator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/state_collision_validator.h index 6a76fe111a2..774bc048264 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/state_collision_validator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/state_collision_validator.h @@ -35,11 +35,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { /** @brief Continuous collision check between two states */ -class StateCollisionValidator : public ompl::base::StateValidityChecker +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC StateCollisionValidator : public ompl::base::StateValidityChecker { public: StateCollisionValidator(const ompl::base::SpaceInformationPtr& space_info, diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/utils.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/utils.h index 526c44675e2..c2c47ff237f 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/utils.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/utils.h @@ -36,13 +36,16 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -Eigen::Map RealVectorStateSpaceExtractor(const ompl::base::State* s1, unsigned dimension); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC Eigen::Map +RealVectorStateSpaceExtractor(const ompl::base::State* s1, unsigned dimension); #ifndef OMPL_LESS_1_4_0 -Eigen::Map ConstrainedStateSpaceExtractor(const ompl::base::State* s1); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC Eigen::Map +ConstrainedStateSpaceExtractor(const ompl::base::State* s1); #endif /** @@ -51,7 +54,8 @@ Eigen::Map ConstrainedStateSpaceExtractor(const ompl::base::Sta * @param extractor This function understands the type of state space and converts it to an eigen vector. * @return Tesseract TrajArray */ -tesseract_common::TrajArray toTrajArray(const ompl::geometric::PathGeometric& path, OMPLStateExtractor extractor); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC tesseract_common::TrajArray +toTrajArray(const ompl::geometric::PathGeometric& path, OMPLStateExtractor extractor); /** * @brief Given longest valid fraction and length it will set the correct information of the state space @@ -59,9 +63,9 @@ tesseract_common::TrajArray toTrajArray(const ompl::geometric::PathGeometric& pa * @param longest_valid_segment_fraction * @param longest_valid_segment_length */ -void processLongestValidSegment(const ompl::base::StateSpacePtr& state_space_ptr, - double longest_valid_segment_fraction, - double longest_valid_segment_length); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC void processLongestValidSegment(const ompl::base::StateSpacePtr& state_space_ptr, + double longest_valid_segment_fraction, + double longest_valid_segment_length); /** * @brief For the provided problem check if the state is in collision @@ -70,9 +74,9 @@ void processLongestValidSegment(const ompl::base::StateSpacePtr& state_space_ptr * @param contact_map Map of contact results. Will be empty if return true * @return True if in collision otherwise false */ -bool checkStateInCollision(OMPLProblem& prob, - const Eigen::VectorXd& state, - tesseract_collision::ContactResultMap& contact_map); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC bool checkStateInCollision(OMPLProblem& prob, + const Eigen::VectorXd& state, + tesseract_collision::ContactResultMap& contact_map); /** * @brief For the provided problem check if the state is in collision @@ -80,7 +84,7 @@ bool checkStateInCollision(OMPLProblem& prob, * @param state The joint state * @return True if in collision otherwise false */ -bool checkStateInCollision(OMPLProblem& prob, const Eigen::VectorXd& state); +TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC bool checkStateInCollision(OMPLProblem& prob, const Eigen::VectorXd& state); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/visibility_control.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/visibility_control.h new file mode 100644 index 00000000000..69a85873f54 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_MOTION_PLANNERS_OMPL_VISIBILITY_CONTROL_H +#define TESSERACT_MOTION_PLANNERS_OMPL_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_MOTION_PLANNERS_OMPL_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC __declspec(dllexport) + #define TESSERACT_MOTION_PLANNERS_OMPL_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_MOTION_PLANNERS_OMPL_STATIC_LIBRARY + #ifdef TESSERACT_MOTION_PLANNERS_OMPL_LIBRARY_SHARED + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC + #else + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC TESSERACT_MOTION_PLANNERS_OMPL_IMPORT + #endif + #else + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC + #endif + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC_TYPE TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC + #define TESSERACT_MOTION_PLANNERS_OMPL_LOCAL +#else + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_OMPL_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_OMPL_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC + #define TESSERACT_MOTION_PLANNERS_OMPL_LOCAL + #endif + #define TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_MOTION_PLANNERS_OMPL_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/weighted_real_vector_state_sampler.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/weighted_real_vector_state_sampler.h index 80a43789160..25b94b9c41d 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/weighted_real_vector_state_sampler.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/ompl/weighted_real_vector_state_sampler.h @@ -35,6 +35,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { /** @@ -45,7 +47,7 @@ namespace tesseract_planning * gantry with two linear axis with a robot attached. When * sampling near you may want to scale down the rail sampling. */ -class WeightedRealVectorStateSampler : public ompl::base::StateSampler +class TESSERACT_MOTION_PLANNERS_OMPL_PUBLIC WeightedRealVectorStateSampler : public ompl::base::StateSampler { public: WeightedRealVectorStateSampler(const ompl::base::StateSpace* space, diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/planner_utils.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/planner_utils.h index 9103777ecc6..83426c07eb8 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/planner_utils.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/planner_utils.h @@ -26,6 +26,11 @@ #ifndef TESSERACT_MOTION_PLANNERS_PLANNER_UTILS_H #define TESSERACT_MOTION_PLANNERS_PLANNER_UTILS_H +#include +TESSERACT_COMMON_IGNORE_WARNINGS_PUSH +#include +TESSERACT_COMMON_IGNORE_WARNINGS_POP + namespace tesseract_planning { /** diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/robot_config.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/robot_config.h index d821faa8364..b80c465e5fd 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/robot_config.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/robot_config.h @@ -26,6 +26,13 @@ #ifndef TESSERACT_MOTION_PLANNERS_ROBOT_CONFIG_H #define TESSERACT_MOTION_PLANNERS_ROBOT_CONFIG_H +#include +TESSERACT_COMMON_IGNORE_WARNINGS_PUSH +#include +TESSERACT_COMMON_IGNORE_WARNINGS_POP + +#include + namespace tesseract_planning { /** diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_lvs_plan_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_lvs_plan_profile.h index 706bc0d8746..afa052e7d01 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_lvs_plan_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_lvs_plan_profile.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class SimplePlannerDefaultLVSPlanProfile : public SimplePlannerPlanProfile +class TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimplePlannerDefaultLVSPlanProfile : public SimplePlannerPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_plan_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_plan_profile.h index 904b6ed39ea..f62bf0dbce1 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_plan_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_default_plan_profile.h @@ -34,11 +34,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class DEPRECATED("Please use SimplePlannerLVSDefaultPlanProfile") SimplePlannerDefaultPlanProfile - : public SimplePlannerPlanProfile +class DEPRECATED("Please use SimplePlannerLVSDefaultPlanProfile") + TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimplePlannerDefaultPlanProfile : public SimplePlannerPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_interpolation_plan_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_interpolation_plan_profile.h index 71963604c67..67e37713146 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_interpolation_plan_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_interpolation_plan_profile.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class SimplePlannerInterpolationPlanProfile : public SimplePlannerPlanProfile +class TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimplePlannerInterpolationPlanProfile : public SimplePlannerPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_profile.h index deeb76b90df..eb499feb7c9 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/profile/simple_planner_profile.h @@ -34,6 +34,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -62,7 +63,7 @@ using CartCartStepGenerator = std::function; @@ -79,7 +80,7 @@ class SimplePlannerPlanProfile CartCartStepGenerator cart_cart_linear; }; -class SimplePlannerCompositeProfile +class TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimplePlannerCompositeProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/simple_motion_planner.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/simple_motion_planner.h index 573e7cfa69b..73f8d638130 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/simple_motion_planner.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/simple_motion_planner.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -45,7 +46,7 @@ class SimpleMotionPlannerStatusCategory; * of the PlanInstructions and then calls the appropriate function from the profile. These functions do not depend on * the seed, so this may be used to initialize the seed appropriately using e.g. linear interpolation. */ -class SimpleMotionPlanner : public MotionPlanner +class TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimpleMotionPlanner : public MotionPlanner { public: using Ptr = std::shared_ptr; @@ -107,7 +108,8 @@ class SimpleMotionPlanner : public MotionPlanner const PlannerRequest& request) const; }; -class SimpleMotionPlannerStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC SimpleMotionPlannerStatusCategory + : public tesseract_common::StatusCategory { public: SimpleMotionPlannerStatusCategory(std::string name); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/fixed_size_assign_position.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/fixed_size_assign_position.h index f4d25e29332..72c46150c39 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/fixed_size_assign_position.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/fixed_size_assign_position.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -49,11 +50,12 @@ namespace tesseract_planning * @param steps The fixed number of steps * @return A composite instruction of move instruction with state waypoints */ -CompositeInstruction fixedSizeAssignStateWaypoint(const Eigen::Ref& position, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeAssignStateWaypoint(const Eigen::Ref& position, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); /** * @brief fixedSizeAssignStateWaypoint * @@ -67,12 +69,13 @@ CompositeInstruction fixedSizeAssignStateWaypoint(const Eigen::Ref #include +#include namespace tesseract_planning { -CompositeInstruction fixedSizeInterpolateStateWaypoint(const JointWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateStateWaypoint(const JointWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateStateWaypoint(const JointWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateStateWaypoint(const JointWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateStateWaypoint(const CartesianWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateStateWaypoint(const CartesianWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateStateWaypoint(const CartesianWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateStateWaypoint(const CartesianWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateCartStateWaypoint(const JointWaypoint& start, - const JointWaypoint&, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateCartStateWaypoint(const JointWaypoint& start, + const JointWaypoint&, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateCartStateWaypoint(const JointWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateCartStateWaypoint(const JointWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateCartStateWaypoint(const CartesianWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateCartStateWaypoint(const CartesianWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); -CompositeInstruction fixedSizeInterpolateCartStateWaypoint(const CartesianWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - int steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +fixedSizeInterpolateCartStateWaypoint(const CartesianWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + int steps); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/lvs_interpolation.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/lvs_interpolation.h index c1b7578ea0a..ce5c617a647 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/lvs_interpolation.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/step_generators/lvs_interpolation.h @@ -34,6 +34,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -65,15 +66,16 @@ namespace tesseract_planning * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateStateWaypoint(const JointWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateStateWaypoint(const JointWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateStateWaypoint(JointWaypoint to CartesianWaypoint) @@ -90,15 +92,16 @@ CompositeInstruction LVSInterpolateStateWaypoint(const JointWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateStateWaypoint(const JointWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateStateWaypoint(const JointWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateStateWaypoint(JointWaypoint to JointWaypoint) @@ -128,15 +131,16 @@ CompositeInstruction LVSInterpolateStateWaypoint(const JointWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateStateWaypoint(const CartesianWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateStateWaypoint(const CartesianWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateStateWaypoint(JointWaypoint to JointWaypoint) @@ -166,15 +170,16 @@ CompositeInstruction LVSInterpolateStateWaypoint(const CartesianWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateStateWaypoint(const CartesianWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateStateWaypoint(const CartesianWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateCartStateWaypoint(JointWaypoint to JointWaypoint) @@ -204,15 +209,16 @@ CompositeInstruction LVSInterpolateStateWaypoint(const CartesianWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateCartStateWaypoint(const JointWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateCartStateWaypoint(const JointWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateCartStateWaypoint(JointWaypoint to CartesianWaypoint) @@ -242,15 +248,16 @@ CompositeInstruction LVSInterpolateCartStateWaypoint(const JointWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateCartStateWaypoint(const JointWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateCartStateWaypoint(const JointWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateCartStateWaypoint(CartesianWaypoint to JointWaypoint) @@ -280,15 +287,16 @@ CompositeInstruction LVSInterpolateCartStateWaypoint(const JointWaypoint& start, * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateCartStateWaypoint(const CartesianWaypoint& start, - const JointWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateCartStateWaypoint(const CartesianWaypoint& start, + const JointWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); /** * @brief LVSInterpolateCartStateWaypoint(CartesianWaypoint to CartesianWaypoint) @@ -318,15 +326,16 @@ CompositeInstruction LVSInterpolateCartStateWaypoint(const CartesianWaypoint& st * @param min_steps The minimum number of steps for the plan * @return A composite instruction of move instruction with state waypoints **/ -CompositeInstruction LVSInterpolateCartStateWaypoint(const CartesianWaypoint& start, - const CartesianWaypoint& end, - const PlanInstruction& base_instruction, - const PlannerRequest& request, - const ManipulatorInfo& manip_info, - double state_longest_valid_segment_length, - double translation_longest_valid_segment_length, - double rotation_longest_valid_segment_length, - int min_steps); +TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC CompositeInstruction +LVSInterpolateCartStateWaypoint(const CartesianWaypoint& start, + const CartesianWaypoint& end, + const PlanInstruction& base_instruction, + const PlannerRequest& request, + const ManipulatorInfo& manip_info, + double state_longest_valid_segment_length, + double translation_longest_valid_segment_length, + double rotation_longest_valid_segment_length, + int min_steps); } // namespace tesseract_planning #endif // TESSERACT_MOTION_PLANNERS_SIMPLE_PROFILE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/visibility_control.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/visibility_control.h new file mode 100644 index 00000000000..dbdcb13291a --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/simple/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_MOTION_PLANNERS_SIMPLE_VISIBILITY_CONTROL_H +#define TESSERACT_MOTION_PLANNERS_SIMPLE_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_MOTION_PLANNERS_SIMPLE_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC __declspec(dllexport) + #define TESSERACT_MOTION_PLANNERS_SIMPLE_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_MOTION_PLANNERS_SIMPLE_STATIC_LIBRARY + #ifdef TESSERACT_MOTION_PLANNERS_SIMPLE_LIBRARY_SHARED + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC + #else + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC TESSERACT_MOTION_PLANNERS_SIMPLE_IMPORT + #endif + #else + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC + #endif + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC_TYPE TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC + #define TESSERACT_MOTION_PLANNERS_SIMPLE_LOCAL +#else + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_SIMPLE_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_SIMPLE_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC + #define TESSERACT_MOTION_PLANNERS_SIMPLE_LOCAL + #endif + #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_MOTION_PLANNERS_SIMPLE_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/deserialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/deserialize.h index 05ce9e0982e..794dfe21299 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/deserialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/deserialize.h @@ -31,28 +31,38 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -TrajOptDefaultPlanProfile trajOptPlanParser(const tinyxml2::XMLElement& xml_element); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile +trajOptPlanParser(const tinyxml2::XMLElement& xml_element); -TrajOptDefaultPlanProfile trajOptPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile +trajOptPlanFromXMLElement(const tinyxml2::XMLElement* profile_xml); -TrajOptDefaultPlanProfile trajOptPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile +trajOptPlanFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); -TrajOptDefaultPlanProfile trajOptPlanFromXMLFile(const std::string& file_path); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile trajOptPlanFromXMLFile(const std::string& file_path); -TrajOptDefaultPlanProfile trajOptPlanFromXMLString(const std::string& xml_string); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile +trajOptPlanFromXMLString(const std::string& xml_string); -TrajOptDefaultCompositeProfile trajOptCompositeParser(const tinyxml2::XMLElement& xml_element); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile +trajOptCompositeParser(const tinyxml2::XMLElement& xml_element); -TrajOptDefaultCompositeProfile trajOptCompositeFromXMLElement(const tinyxml2::XMLElement* profile_xml); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile +trajOptCompositeFromXMLElement(const tinyxml2::XMLElement* profile_xml); -TrajOptDefaultCompositeProfile trajOptCompositeFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile +trajOptCompositeFromXMLDocument(const tinyxml2::XMLDocument& xml_doc); -TrajOptDefaultCompositeProfile trajOptCompositeFromXMLFile(const std::string& file_path); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile +trajOptCompositeFromXMLFile(const std::string& file_path); -TrajOptDefaultCompositeProfile trajOptCompositeFromXMLString(const std::string& xml_string); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile +trajOptCompositeFromXMLString(const std::string& xml_string); } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/problem_generators/default_problem_generator.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/problem_generators/default_problem_generator.h index 96a177a4488..01d682ab971 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/problem_generators/default_problem_generator.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/problem_generators/default_problem_generator.h @@ -33,13 +33,15 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -trajopt::TrajOptProb::Ptr DefaultTrajoptProblemGenerator(const std::string& name, - const PlannerRequest& request, - const TrajOptPlanProfileMap& plan_profiles, - const TrajOptCompositeProfileMap& composite_profiles); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TrajOptProb::Ptr +DefaultTrajoptProblemGenerator(const std::string& name, + const PlannerRequest& request, + const TrajOptPlanProfileMap& plan_profiles, + const TrajOptCompositeProfileMap& composite_profiles); } // namespace tesseract_planning #endif diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_composite_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_composite_profile.h index 3b80d5f2a7c..930e2083fb3 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_composite_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_composite_profile.h @@ -36,10 +36,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -class TrajOptDefaultCompositeProfile : public TrajOptCompositeProfile +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultCompositeProfile : public TrajOptCompositeProfile { public: TrajOptDefaultCompositeProfile() = default; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_plan_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_plan_profile.h index 7243d3cea14..7bfd7a89e58 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_plan_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_default_plan_profile.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class TrajOptDefaultPlanProfile : public TrajOptPlanProfile +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptDefaultPlanProfile : public TrajOptPlanProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_profile.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_profile.h index 2e0953b1768..0f4a4dac4bd 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_profile.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/profile/trajopt_profile.h @@ -35,10 +35,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -class TrajOptPlanProfile +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptPlanProfile { public: using Ptr = std::shared_ptr; @@ -61,7 +62,7 @@ class TrajOptPlanProfile virtual tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const = 0; }; -class TrajOptCompositeProfile +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptCompositeProfile { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/serialize.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/serialize.h index 88256b56e27..d4cbf04f52d 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/serialize.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/serialize.h @@ -31,20 +31,25 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -std::shared_ptr toXMLDocument(const TrajOptPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC std::shared_ptr +toXMLDocument(const TrajOptPlanProfile& plan_profile); -bool toXMLFile(const TrajOptPlanProfile& plan_profile, const std::string& file_path); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC bool toXMLFile(const TrajOptPlanProfile& plan_profile, + const std::string& file_path); -std::string toXMLString(const TrajOptPlanProfile& plan_profile); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC std::string toXMLString(const TrajOptPlanProfile& plan_profile); -std::shared_ptr toXMLDocument(const TrajOptCompositeProfile& composite_profile); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC std::shared_ptr +toXMLDocument(const TrajOptCompositeProfile& composite_profile); -bool toXMLFile(const TrajOptCompositeProfile& composite_profile, const std::string& file_path); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC bool toXMLFile(const TrajOptCompositeProfile& composite_profile, + const std::string& file_path); -std::string toXMLString(const TrajOptCompositeProfile& composite_profile); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC std::string toXMLString(const TrajOptCompositeProfile& composite_profile); } // namespace tesseract_planning #endif // TESSERACT_MOTION_PLANNERS_TRAJOPT_SERIALIZE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_collision_config.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_collision_config.h index be9f91f5580..ff29886e1ba 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_collision_config.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_collision_config.h @@ -34,13 +34,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { /** * @brief Config settings for collision cost terms. */ -struct CollisionCostConfig +struct TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC CollisionCostConfig { CollisionCostConfig() = default; CollisionCostConfig(const tinyxml2::XMLElement& xml_element); @@ -72,7 +73,7 @@ struct CollisionCostConfig /** * @brief Config settings for collision constraint terms. */ -struct CollisionConstraintConfig +struct TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC CollisionConstraintConfig { CollisionConstraintConfig() = default; CollisionConstraintConfig(const tinyxml2::XMLElement& xml_element); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_motion_planner.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_motion_planner.h index abead93a3c8..19a68fc001f 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_motion_planner.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_motion_planner.h @@ -33,6 +33,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -43,7 +44,7 @@ using TrajOptProblemGeneratorFn = std::function; -class TrajOptMotionPlanner : public MotionPlanner +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptMotionPlanner : public MotionPlanner { public: /** @brief Construct a basic planner */ @@ -102,7 +103,8 @@ class TrajOptMotionPlanner : public MotionPlanner std::shared_ptr status_category_; /** @brief The planners status codes */ }; -class TrajOptMotionPlannerStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TrajOptMotionPlannerStatusCategory + : public tesseract_common::StatusCategory { public: TrajOptMotionPlannerStatusCategory(std::string name); diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_utils.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_utils.h index a392c1f18cf..c15c6d5dcbf 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_utils.h +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/trajopt_utils.h @@ -33,37 +33,42 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -trajopt::TermInfo::Ptr createCartesianWaypointTermInfo(const Eigen::Isometry3d& c_wp, - int index, - std::string working_frame, - Eigen::Isometry3d tcp, - const Eigen::VectorXd& coeffs, - std::string link, - trajopt::TermType type); - -trajopt::TermInfo::Ptr createDynamicCartesianWaypointTermInfo(const Eigen::Isometry3d& c_wp, - int index, - std::string working_frame, - const Eigen::Isometry3d& tcp, - const Eigen::VectorXd& coeffs, - const std::string& link, - trajopt::TermType type); - -trajopt::TermInfo::Ptr createNearJointStateTermInfo(const Eigen::VectorXd& target, - const std::vector& joint_names, - int index, - const Eigen::VectorXd& coeffs, - trajopt::TermType type); - -trajopt::TermInfo::Ptr createJointWaypointTermInfo(const Eigen::VectorXd& j_wp, - int index, - const Eigen::VectorXd& coeffs, - trajopt::TermType type); - -trajopt::TermInfo::Ptr createCollisionTermInfo( +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createCartesianWaypointTermInfo(const Eigen::Isometry3d& c_wp, + int index, + std::string working_frame, + Eigen::Isometry3d tcp, + const Eigen::VectorXd& coeffs, + std::string link, + trajopt::TermType type); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createDynamicCartesianWaypointTermInfo(const Eigen::Isometry3d& c_wp, + int index, + std::string working_frame, + const Eigen::Isometry3d& tcp, + const Eigen::VectorXd& coeffs, + const std::string& link, + trajopt::TermType type); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createNearJointStateTermInfo(const Eigen::VectorXd& target, + const std::vector& joint_names, + int index, + const Eigen::VectorXd& coeffs, + trajopt::TermType type); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createJointWaypointTermInfo(const Eigen::VectorXd& j_wp, + int index, + const Eigen::VectorXd& coeffs, + trajopt::TermType type); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr createCollisionTermInfo( int start_index, int end_index, double collision_safety_margin, @@ -75,50 +80,58 @@ trajopt::TermInfo::Ptr createCollisionTermInfo( double longest_valid_segment_length = 0.5, trajopt::TermType type = trajopt::TermType::TT_COST); -trajopt::TermInfo::Ptr createSmoothVelocityTermInfo(int start_index, - int end_index, - int n_joints, - double coeff = 5.0, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createSmoothVelocityTermInfo(int start_index, - int end_index, - const Eigen::Ref& coeff, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createSmoothAccelerationTermInfo(int start_index, - int end_index, - int n_joints, - double coeff = 1.0, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createSmoothAccelerationTermInfo(int start_index, - int end_index, - const Eigen::Ref& coeff, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createSmoothJerkTermInfo(int start_index, - int end_index, - int n_joints, - double coeff = 1.0, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createSmoothJerkTermInfo(int start_index, - int end_index, - const Eigen::Ref& coeff, - trajopt::TermType type = trajopt::TermType::TT_COST); - -trajopt::TermInfo::Ptr createUserDefinedTermInfo(int start_index, - int end_index, - sco::VectorOfVector::func error_function, - sco::MatrixOfVector::func jacobian_function, - trajopt::TermType type); - -trajopt::TermInfo::Ptr createAvoidSingularityTermInfo(int start_index, - int end_index, - const std::string& link, - double coeff = 5.0, - trajopt::TermType type = trajopt::TermType::TT_COST); +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothVelocityTermInfo(int start_index, + int end_index, + int n_joints, + double coeff = 5.0, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothVelocityTermInfo(int start_index, + int end_index, + const Eigen::Ref& coeff, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothAccelerationTermInfo(int start_index, + int end_index, + int n_joints, + double coeff = 1.0, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothAccelerationTermInfo(int start_index, + int end_index, + const Eigen::Ref& coeff, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothJerkTermInfo(int start_index, + int end_index, + int n_joints, + double coeff = 1.0, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createSmoothJerkTermInfo(int start_index, + int end_index, + const Eigen::Ref& coeff, + trajopt::TermType type = trajopt::TermType::TT_COST); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createUserDefinedTermInfo(int start_index, + int end_index, + sco::VectorOfVector::func error_function, + sco::MatrixOfVector::func jacobian_function, + trajopt::TermType type); + +TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC trajopt::TermInfo::Ptr +createAvoidSingularityTermInfo(int start_index, + int end_index, + const std::string& link, + double coeff = 5.0, + trajopt::TermType type = trajopt::TermType::TT_COST); } // namespace tesseract_planning #endif // TESSERACT_MOTION_PLANNERS_TRAJOPT_UTILS_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/visibility_control.h b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/visibility_control.h new file mode 100644 index 00000000000..297c568ebd6 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_motion_planners/include/tesseract_motion_planners/trajopt/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_MOTION_PLANNERS_TRAJOPT_VISIBILITY_CONTROL_H +#define TESSERACT_MOTION_PLANNERS_TRAJOPT_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC __declspec(dllexport) + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_MOTION_PLANNERS_TRAJOPT_STATIC_LIBRARY + #ifdef TESSERACT_MOTION_PLANNERS_TRAJOPT_LIBRARY_SHARED + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC + #else + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC TESSERACT_MOTION_PLANNERS_TRAJOPT_IMPORT + #endif + #else + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC + #endif + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC_TYPE TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_LOCAL +#else + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_LOCAL + #endif + #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_MOTION_PLANNERS_TRAJOPT_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision.cpp index 39709bbb409..8789e905e3f 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision.cpp @@ -24,11 +24,12 @@ * limitations under the License. */ #include +#include namespace tesseract_planning { // Explicit template instantiation -template class DescartesCollision; -template class DescartesCollision; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesCollision; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesCollision; } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision_edge_evaluator.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision_edge_evaluator.cpp index 6cf7cb7f1ee..8f080ca4574 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision_edge_evaluator.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_collision_edge_evaluator.cpp @@ -24,11 +24,12 @@ * limitations under the License. */ #include +#include namespace tesseract_planning { // Explicit template instantiation -template class DescartesCollisionEdgeEvaluator; -template class DescartesCollisionEdgeEvaluator; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesCollisionEdgeEvaluator; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesCollisionEdgeEvaluator; } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_motion_planner.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_motion_planner.cpp index 2782459e44a..6e0c352095e 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_motion_planner.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_motion_planner.cpp @@ -24,11 +24,12 @@ * limitations under the License. */ #include +#include namespace tesseract_planning { // Explicit template instantiation -template class DescartesMotionPlanner; -template class DescartesMotionPlanner; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesMotionPlanner; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesMotionPlanner; } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_robot_sampler.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_robot_sampler.cpp index 93d07c0ba50..3c392a9a456 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_robot_sampler.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/descartes_robot_sampler.cpp @@ -24,11 +24,12 @@ * limitations under the License. */ #include +#include namespace tesseract_planning { // Explicit template instantiation -template class DescartesRobotSampler; -template class DescartesRobotSampler; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesRobotSampler; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesRobotSampler; } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/profile/descartes_default_plan_profile.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/profile/descartes_default_plan_profile.cpp index af0b93125e8..f27716b4fc0 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/profile/descartes_default_plan_profile.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/descartes/profile/descartes_default_plan_profile.cpp @@ -24,11 +24,12 @@ * limitations under the License. */ #include +#include namespace tesseract_planning { // Explicit template instantiation -template class DescartesDefaultPlanProfile; -template class DescartesDefaultPlanProfile; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile; +template class TESSERACT_MOTION_PLANNERS_DESCARTES_PUBLIC DescartesDefaultPlanProfile; } // namespace tesseract_planning diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/src/simple/step_generators/lvs_interpolation.cpp b/tesseract/tesseract_planning/tesseract_motion_planners/src/simple/step_generators/lvs_interpolation.cpp index 5adcc346ede..8e632b0d90d 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/src/simple/step_generators/lvs_interpolation.cpp +++ b/tesseract/tesseract_planning/tesseract_motion_planners/src/simple/step_generators/lvs_interpolation.cpp @@ -24,8 +24,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef TESSERACT_MOTION_PLANNERS_LVS_INTERPOLATION_H -#define TESSERACT_MOTION_PLANNERS_LVS_INTERPOLATION_H #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH @@ -37,7 +35,6 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include -#include namespace tesseract_planning { @@ -677,5 +674,3 @@ CompositeInstruction LVSInterpolateCartStateWaypoint(const CartesianWaypoint& st } } // namespace tesseract_planning - -#endif // TESSERACT_MOTION_PLANNERS_SIMPLE_PROFILE_H diff --git a/tesseract/tesseract_planning/tesseract_motion_planners/test/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_motion_planners/test/CMakeLists.txt index 9cade781616..07584c84cc8 100644 --- a/tesseract/tesseract_planning/tesseract_motion_planners/test/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_motion_planners/test/CMakeLists.txt @@ -5,6 +5,7 @@ find_package(tesseract_support REQUIRED) add_executable(${PROJECT_NAME}_descartes_kin_unit descartes_tesseract_kinematics_tests.cpp) target_link_libraries(${PROJECT_NAME}_descartes_kin_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_descartes tesseract::tesseract_support ${PROJECT_NAME}_simple) target_compile_options(${PROJECT_NAME}_descartes_kin_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_descartes_kin_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_descartes_kin_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_descartes_kin_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_descartes_kin_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -17,6 +18,7 @@ add_executable(${PROJECT_NAME}_ompl_unit ompl_planner_tests.cpp) target_link_libraries(${PROJECT_NAME}_ompl_unit PRIVATE ${Boost_LIBRARIES} GTest::GTest GTest::Main ${PROJECT_NAME}_ompl tesseract::tesseract_support trajopt::trajopt ${PROJECT_NAME}_simple) target_include_directories(${PROJECT_NAME}_ompl_unit SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_ompl_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_ompl_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ompl_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ompl_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ompl_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -41,6 +43,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_ompl_unit) add_executable(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit simple_planner_fixed_size_interpolation.cpp) target_link_libraries(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_simple tesseract::tesseract_support) target_compile_options(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_simple_planner_fixed_size_interpolation_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -51,6 +54,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_simple_planner_fixed_size_interpolati add_executable(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit simple_planner_fixed_size_assign_position.cpp) target_link_libraries(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_simple tesseract::tesseract_support) target_compile_options(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_simple_planner_fixed_size_assign_position_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -61,6 +65,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_simple_planner_fixed_size_assign_posi add_executable(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit simple_planner_lvs_interpolation.cpp) target_link_libraries(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_simple tesseract::tesseract_support) target_compile_options(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_simple_planner_lvs_interpolation_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -72,6 +77,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_simple_planner_lvs_interpolation_unit add_executable(${PROJECT_NAME}_trajopt_unit trajopt_planner_tests.cpp) target_link_libraries(${PROJECT_NAME}_trajopt_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_trajopt tesseract::tesseract_support ${PROJECT_NAME}_simple) target_compile_options(${PROJECT_NAME}_trajopt_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_trajopt_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_trajopt_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_trajopt_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_trajopt_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -83,6 +89,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_trajopt_unit) add_executable(${PROJECT_NAME}_descartes_unit descartes_planner_tests.cpp) target_link_libraries(${PROJECT_NAME}_descartes_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_descartes tesseract::tesseract_support tesseract::tesseract_kinematics_opw ${PROJECT_NAME}_simple) target_compile_options(${PROJECT_NAME}_descartes_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_descartes_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_descartes_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_descartes_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_descartes_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -94,6 +101,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_descartes_unit) add_executable(${PROJECT_NAME}_utils_unit utils_test.cpp) target_link_libraries(${PROJECT_NAME}_utils_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_core tesseract::tesseract_support tesseract::tesseract_command_language ${PROJECT_NAME}_simple) target_compile_options(${PROJECT_NAME}_utils_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_utils_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_utils_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_utils_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_utils_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -105,6 +113,7 @@ add_dependencies(run_tests ${PROJECT_NAME}_utils_unit) add_executable(${PROJECT_NAME}_serialize_unit serialize_test.cpp) target_link_libraries(${PROJECT_NAME}_serialize_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}_trajopt ${PROJECT_NAME}_ompl ${PROJECT_NAME}_descartes) target_compile_options(${PROJECT_NAME}_serialize_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_serialize_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_serialize_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_serialize_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_serialize_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_process_managers/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_process_managers/CMakeLists.txt index ccb706d7180..22278c405c9 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_process_managers/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_process_managers VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + ## System dependencies are found with CMake's conventions find_package(Eigen3 REQUIRED) find_package(Taskflow REQUIRED) @@ -19,8 +22,10 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) # Load variable for clang tidy args, compiler options and cxx version tesseract_variables() +include(GenerateExportHeader) + # Create interface -add_library(${PROJECT_NAME} SHARED +add_library(${PROJECT_NAME} src/process_input.cpp src/debug_observer.cpp src/process_generators/continuous_contact_check_process_generator.cpp @@ -41,6 +46,7 @@ add_library(${PROJECT_NAME} SHARED src/taskflows/trajopt_taskflow.cpp src/taskflows/cartesian_taskflow.cpp src/taskflows/freespace_taskflow.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge Taskflow::Taskflow @@ -52,6 +58,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_motion_planners_ompl tesseract::tesseract_time_parameterization) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_process_managers/examples/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_process_managers/examples/CMakeLists.txt index d99f3c38ffe..f2e1b4ebfb5 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/examples/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_process_managers/examples/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(${PROJECT_NAME}_freespace_manager_example freespace_manager_example.cpp) target_link_libraries(${PROJECT_NAME}_freespace_manager_example console_bridge ${PROJECT_NAME} tesseract::tesseract tesseract::tesseract_command_language tesseract::tesseract_support ${CMAKE_THREAD_LIBS_INIT}) target_compile_options(${PROJECT_NAME}_freespace_manager_example PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_freespace_manager_example PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_freespace_manager_example ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_freespace_manager_example PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_include_directories(${PROJECT_NAME}_freespace_manager_example PRIVATE @@ -11,6 +12,7 @@ target_include_directories(${PROJECT_NAME}_freespace_manager_example SYSTEM PRIV add_executable(${PROJECT_NAME}_raster_manager_example raster_manager_example.cpp) target_link_libraries(${PROJECT_NAME}_raster_manager_example console_bridge ${PROJECT_NAME} tesseract::tesseract tesseract::tesseract_command_language tesseract::tesseract_support ${CMAKE_THREAD_LIBS_INIT}) target_compile_options(${PROJECT_NAME}_raster_manager_example PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_raster_manager_example PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_raster_manager_example ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_raster_manager_example PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_include_directories(${PROJECT_NAME}_raster_manager_example PRIVATE diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/debug_observer.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/debug_observer.h index ec92d9b82a8..b6f4c8f7be1 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/debug_observer.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/debug_observer.h @@ -32,12 +32,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_planning { /** * @brief This is currently simple debug observer which prints a message when each of the functions below are called. */ -class DebugObserver : public tf::ObserverInterface +class TESSERACT_PROCESS_MANAGERS_PUBLIC DebugObserver : public tf::ObserverInterface { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generator.h index a75b1ee5d6d..e35f4c569c3 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generator.h @@ -33,6 +33,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { @@ -42,7 +43,7 @@ namespace tesseract_planning * * Only unique pointers should be used because of the ability to abort the process. */ -class ProcessGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC ProcessGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/continuous_contact_check_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/continuous_contact_check_process_generator.h index cef8940407a..894b795c64e 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/continuous_contact_check_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/continuous_contact_check_process_generator.h @@ -32,10 +32,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class ContinuousContactCheckProcessGenerator : public ProcessGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC ContinuousContactCheckProcessGenerator : public ProcessGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/discrete_contact_check_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/discrete_contact_check_process_generator.h index 6915eda8aec..e2e24a299be 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/discrete_contact_check_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/discrete_contact_check_process_generator.h @@ -32,10 +32,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class DiscreteContactCheckProcessGenerator : public ProcessGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC DiscreteContactCheckProcessGenerator : public ProcessGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_bounds_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_bounds_process_generator.h index 8adec1b27cc..2db42a96852 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_bounds_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_bounds_process_generator.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -struct FixStateBoundsProfile +struct TESSERACT_PROCESS_MANAGERS_PUBLIC FixStateBoundsProfile { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; @@ -63,7 +64,7 @@ using FixStateBoundsProfileMap = std::unordered_map; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_collision_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_collision_process_generator.h index 5601292ef11..77fcd452bd3 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_collision_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/fix_state_collision_process_generator.h @@ -32,10 +32,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -struct FixStateCollisionProfile +struct TESSERACT_PROCESS_MANAGERS_PUBLIC FixStateCollisionProfile { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; @@ -65,7 +66,7 @@ using FixStateCollisionProfileMap = std::unordered_map; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/iterative_spline_parameterization_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/iterative_spline_parameterization_process_generator.h index 31606c6a028..9acd276161c 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/iterative_spline_parameterization_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/iterative_spline_parameterization_process_generator.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { -struct IterativeSplineParameterizationProfile +struct TESSERACT_PROCESS_MANAGERS_PUBLIC IterativeSplineParameterizationProfile { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; @@ -53,7 +54,7 @@ struct IterativeSplineParameterizationProfile using IterativeSplineParameterizationProfileMap = std::unordered_map; -class IterativeSplineParameterizationProcessGenerator : public ProcessGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC IterativeSplineParameterizationProcessGenerator : public ProcessGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/motion_planner_process_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/motion_planner_process_generator.h index 0b759d8ab95..c1c7f5836c2 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/motion_planner_process_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_generators/motion_planner_process_generator.h @@ -32,13 +32,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { // Forward Declare class MotionPlanner; -class MotionPlannerProcessGenerator : public ProcessGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC MotionPlannerProcessGenerator : public ProcessGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_input.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_input.h index 86bb6ea31a9..07a47cef352 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_input.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_input.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -44,7 +45,7 @@ namespace tesseract_planning * Note that it does not have ownership of any of its members (except the pointer). This means that if a ProcessInput * spawns a child that is a subset, it does not have to remain in scope as the references will still be valid */ -struct ProcessInput +struct TESSERACT_PROCESS_MANAGERS_PUBLIC ProcessInput { using Ptr = std::shared_ptr; using ConstPtr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_manager.h index 03d181c15aa..70dc18f2044 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_manager.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { -class ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_dt_process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_dt_process_manager.h index c1db0b9145f..53235a6e5c2 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_dt_process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_dt_process_manager.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -67,7 +68,7 @@ namespace tesseract_planning * Composite - to end * } */ -class RasterDTProcessManager : public ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC RasterDTProcessManager : public ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_process_manager.h index 295abfe0a54..1ef54fbae89 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_process_manager.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -59,7 +60,7 @@ namespace tesseract_planning * Composite - to end * } */ -class RasterProcessManager : public ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC RasterProcessManager : public ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_dt_process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_dt_process_manager.h index dd77724c579..3f51bd68eb8 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_dt_process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_dt_process_manager.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -82,7 +83,7 @@ namespace tesseract_planning * Composite - to end * } */ -class RasterWAADDTProcessManager : public ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC RasterWAADDTProcessManager : public ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_process_manager.h index 4ad8081494c..1a413c03cad 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/raster_waad_process_manager.h @@ -37,6 +37,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -75,7 +76,7 @@ namespace tesseract_planning * Composite - to end * } */ -class RasterWAADProcessManager : public ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC RasterWAADProcessManager : public ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/simple_process_manager.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/simple_process_manager.h index 6f560ea27ca..ab06da200f5 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/simple_process_manager.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/process_managers/simple_process_manager.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -52,7 +53,7 @@ namespace tesseract_planning * ... Must not contain any child composite instructions * } */ -class SimpleProcessManager : public ProcessManager +class TESSERACT_PROCESS_MANAGERS_PUBLIC SimpleProcessManager : public ProcessManager { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generator.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generator.h index dee6d52c9b3..7ee4d5d58ca 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generator.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generator.h @@ -32,6 +32,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include // Forward Declare namespace tf @@ -42,7 +43,7 @@ class Taskflow; namespace tesseract_planning { /** @brief Base class for generating a taskflow */ -class TaskflowGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC TaskflowGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/graph_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/graph_taskflow.h index dfa898a7775..2be494dffb6 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/graph_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/graph_taskflow.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -43,7 +44,7 @@ namespace tesseract_planning * @brief This class generates taskflow graph. It allows you to connect different channels from the source to the * destination process */ -class GraphTaskflow : public TaskflowGenerator +class TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow : public TaskflowGenerator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/sequential_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/sequential_taskflow.h index 1d4cdc8ba27..2d434fb6856 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/sequential_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflow_generators/sequential_taskflow.h @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_planning { @@ -50,7 +51,7 @@ using SequentialProcesses = std::vector; diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/cartesian_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/cartesian_taskflow.h index ab06da2c8a9..40f25aa1d8d 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/cartesian_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/cartesian_taskflow.h @@ -30,10 +30,11 @@ #include #include #include +#include namespace tesseract_planning { -GraphTaskflow::UPtr createCartesianTaskflow( +TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow::UPtr createCartesianTaskflow( bool create_seed, const SimplePlannerPlanProfileMap& simple_plan_profiles = SimplePlannerPlanProfileMap(), const SimplePlannerCompositeProfileMap& simple_composite_profiles = SimplePlannerCompositeProfileMap(), diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/descartes_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/descartes_taskflow.h index 0a786e0c935..8bd3af35f17 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/descartes_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/descartes_taskflow.h @@ -29,10 +29,11 @@ #include #include #include +#include namespace tesseract_planning { -struct DescartesTaskflowParams +struct TESSERACT_PROCESS_MANAGERS_PUBLIC DescartesTaskflowParams { bool enable_simple_planner{ true }; bool enable_post_contact_discrete_check{ false }; @@ -43,7 +44,7 @@ struct DescartesTaskflowParams DescartesPlanProfileMap descartes_plan_profiles; }; -GraphTaskflow::UPtr createDescartesTaskflow(DescartesTaskflowParams params); +TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow::UPtr createDescartesTaskflow(DescartesTaskflowParams params); } // namespace tesseract_planning #endif // TESSERACT_PROCESS_MANAGERS_DESCARTES_TASKFLOW_H diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/freespace_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/freespace_taskflow.h index 4af6ef76406..e3b87e7e60c 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/freespace_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/freespace_taskflow.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace tesseract_planning { @@ -39,7 +40,7 @@ enum class FreespaceTaskflowType : int TRAJOPT_FIRST = 1, /**< @brief This will run trajopt first then if it fails it will run ompl followed by trajopt */ }; -struct FreespaceTaskflowParams +struct TESSERACT_PROCESS_MANAGERS_PUBLIC FreespaceTaskflowParams { FreespaceTaskflowType type{ FreespaceTaskflowType::DEFAULT }; bool enable_simple_planner{ true }; @@ -53,7 +54,7 @@ struct FreespaceTaskflowParams TrajOptCompositeProfileMap trajopt_composite_profiles; }; -GraphTaskflow::UPtr createFreespaceTaskflow(FreespaceTaskflowParams params); +TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow::UPtr createFreespaceTaskflow(FreespaceTaskflowParams params); } // namespace tesseract_planning #endif // TESSERACT_PROCESS_MANAGERS_FREESPACE_TASKFLOW_H diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/ompl_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/ompl_taskflow.h index 925a23af8d2..92811668a8e 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/ompl_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/ompl_taskflow.h @@ -29,10 +29,11 @@ #include #include #include +#include namespace tesseract_planning { -GraphTaskflow::UPtr createOMPLTaskflow( +TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow::UPtr createOMPLTaskflow( bool create_seed, const SimplePlannerPlanProfileMap& simple_plan_profiles = SimplePlannerPlanProfileMap(), const SimplePlannerCompositeProfileMap& simple_composite_profiles = SimplePlannerCompositeProfileMap(), diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/trajopt_taskflow.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/trajopt_taskflow.h index 28097f22f58..485bfb3d047 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/trajopt_taskflow.h +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/taskflows/trajopt_taskflow.h @@ -29,10 +29,11 @@ #include #include #include +#include namespace tesseract_planning { -GraphTaskflow::UPtr createTrajOptTaskflow( +TESSERACT_PROCESS_MANAGERS_PUBLIC GraphTaskflow::UPtr createTrajOptTaskflow( bool create_seed, const SimplePlannerPlanProfileMap& simple_plan_profiles = SimplePlannerPlanProfileMap(), const SimplePlannerCompositeProfileMap& simple_composite_profiles = SimplePlannerCompositeProfileMap(), diff --git a/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/visibility_control.h b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/visibility_control.h new file mode 100644 index 00000000000..d1546326cf6 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_process_managers/include/tesseract_process_managers/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_PROCESS_MANAGERS_VISIBILITY_CONTROL_H +#define TESSERACT_PROCESS_MANAGERS_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_PROCESS_MANAGERS_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_PROCESS_MANAGERS_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_PROCESS_MANAGERS_PUBLIC __declspec(dllexport) + #define TESSERACT_PROCESS_MANAGERS_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_PROCESS_MANAGERS_STATIC_LIBRARY + #ifdef TESSERACT_PROCESS_MANAGERS_LIBRARY_SHARED + #define TESSERACT_PROCESS_MANAGERS_PUBLIC TESSERACT_PROCESS_MANAGERS_PUBLIC + #else + #define TESSERACT_PROCESS_MANAGERS_PUBLIC TESSERACT_PROCESS_MANAGERS_IMPORT + #endif + #else + #define TESSERACT_PROCESS_MANAGERS_PUBLIC + #endif + #define TESSERACT_PROCESS_MANAGERS_PUBLIC_TYPE TESSERACT_PROCESS_MANAGERS_PUBLIC + #define TESSERACT_PROCESS_MANAGERS_LOCAL +#else + #define TESSERACT_PROCESS_MANAGERS_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_PROCESS_MANAGERS_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_PROCESS_MANAGERS_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_PROCESS_MANAGERS_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_PROCESS_MANAGERS_PUBLIC + #define TESSERACT_PROCESS_MANAGERS_LOCAL + #endif + #define TESSERACT_PROCESS_MANAGERS_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_PROCESS_MANAGERS_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/cartesian_taskflow.cpp b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/cartesian_taskflow.cpp index 796f22f12d0..272f16aa438 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/cartesian_taskflow.cpp +++ b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/cartesian_taskflow.cpp @@ -52,7 +52,7 @@ GraphTaskflow::UPtr createCartesianTaskflow(bool create_seed, /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (create_seed) { auto interpolator = std::make_shared("Interpolator"); diff --git a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/descartes_taskflow.cpp b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/descartes_taskflow.cpp index 876cf6ca362..ba112fbb1a3 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/descartes_taskflow.cpp +++ b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/descartes_taskflow.cpp @@ -46,7 +46,7 @@ GraphTaskflow::UPtr createDescartesTaskflow(DescartesTaskflowParams params) /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (params.enable_simple_planner) { auto interpolator = std::make_shared("Interpolator"); @@ -64,7 +64,7 @@ GraphTaskflow::UPtr createDescartesTaskflow(DescartesTaskflowParams params) int descartes_idx = graph->addNode(std::move(descartes_generator), GraphTaskflow::NodeType::CONDITIONAL); // Add Final Continuous Contact Check of trajectory - int contact_check_idx; + int contact_check_idx{ -1 }; if (params.enable_post_contact_continuous_check) { auto contact_check_generator = std::make_unique(); @@ -77,7 +77,7 @@ GraphTaskflow::UPtr createDescartesTaskflow(DescartesTaskflowParams params) } // Time parameterization trajectory - int time_parameterization_idx; + int time_parameterization_idx{ -1 }; if (params.enable_time_parameterization) { auto time_parameterization_generator = std::make_unique(); diff --git a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/freespace_taskflow.cpp b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/freespace_taskflow.cpp index d3b35f4f437..c25157af836 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/freespace_taskflow.cpp +++ b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/freespace_taskflow.cpp @@ -48,7 +48,7 @@ GraphTaskflow::UPtr createFreespaceTaskflowDefault(const FreespaceTaskflowParams /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (params.enable_simple_planner) { auto interpolator = std::make_shared("Interpolator"); @@ -87,7 +87,7 @@ GraphTaskflow::UPtr createFreespaceTaskflowDefault(const FreespaceTaskflowParams } // Time parameterization trajectory - int time_parameterization_idx; + int time_parameterization_idx{ -1 }; if (params.enable_time_parameterization) { auto time_parameterization_generator = std::make_unique(); @@ -147,7 +147,7 @@ GraphTaskflow::UPtr createFreespaceTaskflowTrajOptFirst(const FreespaceTaskflowP /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (params.enable_simple_planner) { auto interpolator = std::make_shared("Interpolator"); @@ -194,7 +194,7 @@ GraphTaskflow::UPtr createFreespaceTaskflowTrajOptFirst(const FreespaceTaskflowP } // Time parameterization trajectory - int time_parameterization_idx; + int time_parameterization_idx{ -1 }; if (params.enable_time_parameterization) { auto time_parameterization_generator = std::make_unique(); diff --git a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/ompl_taskflow.cpp b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/ompl_taskflow.cpp index 7bae1fb27ab..14aa54ebdd2 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/ompl_taskflow.cpp +++ b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/ompl_taskflow.cpp @@ -47,7 +47,7 @@ GraphTaskflow::UPtr createOMPLTaskflow(bool create_seed, /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (create_seed) { auto interpolator = std::make_shared("Interpolator"); diff --git a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/trajopt_taskflow.cpp b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/trajopt_taskflow.cpp index bb8d18b1ea8..47d16fa0665 100644 --- a/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/trajopt_taskflow.cpp +++ b/tesseract/tesseract_planning/tesseract_process_managers/src/taskflows/trajopt_taskflow.cpp @@ -49,7 +49,7 @@ GraphTaskflow::UPtr createTrajOptTaskflow(bool create_seed, /////////////////// // Setup Interpolator - int interpolator_idx; + int interpolator_idx{ -1 }; if (create_seed) { auto interpolator = std::make_shared("Interpolator"); diff --git a/tesseract/tesseract_planning/tesseract_process_planners/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_process_planners/CMakeLists.txt index f1ec54f51c1..0467b93190c 100644 --- a/tesseract/tesseract_planning/tesseract_process_planners/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_process_planners/CMakeLists.txt @@ -9,7 +9,7 @@ set(COVERAGE_EXCLUDE /usr/* /opt/* ${CMAKE_CURRENT_LIST_DIR}/test/* /*/gtest/*) add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) -add_library(${PROJECT_NAME} SHARED +add_library(${PROJECT_NAME} src/${PROJECT_NAME}/process_definition.cpp src/${PROJECT_NAME}/process_segment_definition.cpp) target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_common tesseract::tesseract_motion_planners_core) diff --git a/tesseract/tesseract_planning/tesseract_time_parameterization/CMakeLists.txt b/tesseract/tesseract_planning/tesseract_time_parameterization/CMakeLists.txt index 686a56d9459..71581a4daa9 100644 --- a/tesseract/tesseract_planning/tesseract_time_parameterization/CMakeLists.txt +++ b/tesseract/tesseract_planning/tesseract_time_parameterization/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_time_parameterization VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(console_bridge REQUIRED) find_package(tesseract_common REQUIRED) find_package(tesseract_command_language REQUIRED) @@ -14,9 +17,11 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) # Load variable for clang tidy args, compiler options and cxx version tesseract_variables() -add_library(${PROJECT_NAME} SHARED src/iterative_spline_parameterization) +add_library(${PROJECT_NAME} src/iterative_spline_parameterization) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge tesseract::tesseract_common tesseract::tesseract_command_language) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/iterative_spline_parameterization.h b/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/iterative_spline_parameterization.h index 7356a802f13..e99b3084888 100644 --- a/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/iterative_spline_parameterization.h +++ b/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/iterative_spline_parameterization.h @@ -44,6 +44,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_planning { @@ -74,7 +75,7 @@ namespace tesseract_planning /// If this is a problem, try retuning (increasing) the limits. /// -class IterativeSplineParameterization +class TESSERACT_TIME_PARAMETERIZATION_PUBLIC IterativeSplineParameterization { public: IterativeSplineParameterization(bool add_points = true); diff --git a/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/visibility_control.h b/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/visibility_control.h new file mode 100644 index 00000000000..53687484c04 --- /dev/null +++ b/tesseract/tesseract_planning/tesseract_time_parameterization/include/tesseract_time_parameterization/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_TIME_PARAMETERIZATION_VISIBILITY_CONTROL_H +#define TESSERACT_TIME_PARAMETERIZATION_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_TIME_PARAMETERIZATION_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC __declspec(dllexport) + #define TESSERACT_TIME_PARAMETERIZATION_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_TIME_PARAMETERIZATION_STATIC_LIBRARY + #ifdef TESSERACT_TIME_PARAMETERIZATION_LIBRARY_SHARED + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC TESSERACT_TIME_PARAMETERIZATION_PUBLIC + #else + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC TESSERACT_TIME_PARAMETERIZATION_IMPORT + #endif + #else + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC + #endif + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC_TYPE TESSERACT_TIME_PARAMETERIZATION_PUBLIC + #define TESSERACT_TIME_PARAMETERIZATION_LOCAL +#else + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_TIME_PARAMETERIZATION_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_TIME_PARAMETERIZATION_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC + #define TESSERACT_TIME_PARAMETERIZATION_LOCAL + #endif + #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_TIME_PARAMETERIZATION_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_scene_graph/CMakeLists.txt b/tesseract/tesseract_scene_graph/CMakeLists.txt index 8de7cb945cf..f2a4b3bc14d 100644 --- a/tesseract/tesseract_scene_graph/CMakeLists.txt +++ b/tesseract/tesseract_scene_graph/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_scene_graph VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Boost REQUIRED) find_package(Eigen3 REQUIRED) find_package(console_bridge REQUIRED) @@ -16,9 +19,11 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) # Load variable for clang tidy args, compiler options and cxx version tesseract_variables() -add_library(${PROJECT_NAME} SHARED src/graph.cpp src/resource_locator.cpp src/srdf_model.cpp) +add_library(${PROJECT_NAME} src/graph.cpp src/resource_locator.cpp src/srdf_model.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_geometry tesseract::tesseract_common orocos-kdl console_bridge ${Boost_LIBRARIES}) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -29,9 +34,8 @@ target_include_directories(${PROJECT_NAME} PUBLIC target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ${orocos_kdl_INCLUDE_DIRS} # Orocos did not export target correctly - $) #tesseract::tesseract_common Due to bug in catkin, there is an open PR + ${Boost_INCLUDE_DIRS}) configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME}) diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/allowed_collision_matrix.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/allowed_collision_matrix.h index d3d5f9bd339..8e0a01e9687 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/allowed_collision_matrix.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/allowed_collision_matrix.h @@ -10,9 +10,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_scene_graph { -class AllowedCollisionMatrix +class TESSERACT_SCENE_GRAPH_PUBLIC AllowedCollisionMatrix { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/graph.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/graph.h index 2a67d851fb4..69e795b5c41 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/graph.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/graph.h @@ -40,6 +40,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include /* definition of basic boost::graph properties */ namespace boost @@ -93,7 +94,7 @@ using EdgeProperty = boost::property; -class SceneGraph : public Graph +class TESSERACT_SCENE_GRAPH_PUBLIC SceneGraph : public Graph { public: /** diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/joint.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/joint.h index 1b35e62c159..80380b558dc 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/joint.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/joint.h @@ -45,11 +45,13 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_scene_graph { class Link; -class JointDynamics +class TESSERACT_SCENE_GRAPH_PUBLIC JointDynamics { public: using Ptr = std::shared_ptr; @@ -66,7 +68,7 @@ class JointDynamics } }; -class JointLimits +class TESSERACT_SCENE_GRAPH_PUBLIC JointLimits { public: using Ptr = std::shared_ptr; @@ -97,7 +99,7 @@ class JointLimits }; /// \brief Parameters for Joint Safety Controllers -class JointSafety +class TESSERACT_SCENE_GRAPH_PUBLIC JointSafety { public: using Ptr = std::shared_ptr; @@ -159,7 +161,7 @@ class JointSafety }; }; -class JointCalibration +class TESSERACT_SCENE_GRAPH_PUBLIC JointCalibration { public: using Ptr = std::shared_ptr; @@ -184,7 +186,7 @@ class JointCalibration }; }; -class JointMimic +class TESSERACT_SCENE_GRAPH_PUBLIC JointMimic { public: using Ptr = std::shared_ptr; @@ -220,7 +222,7 @@ enum class JointType FIXED }; -class Joint +class TESSERACT_SCENE_GRAPH_PUBLIC Joint { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/link.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/link.h index bb0281b858c..a3d27674dce 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/link.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/link.h @@ -48,10 +48,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_scene_graph { -class Material +class TESSERACT_SCENE_GRAPH_PUBLIC Material { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -78,7 +79,7 @@ class Material static auto DEFAULT_TESSERACT_MATERIAL = std::make_shared("default_tesseract_material"); -class Inertial +class TESSERACT_SCENE_GRAPH_PUBLIC Inertial { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -99,7 +100,7 @@ class Inertial } }; -class Visual +class TESSERACT_SCENE_GRAPH_PUBLIC Visual { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -124,7 +125,7 @@ class Visual std::string name; }; -class Collision +class TESSERACT_SCENE_GRAPH_PUBLIC Collision { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW @@ -146,7 +147,7 @@ class Collision std::string name; }; -class Link +class TESSERACT_SCENE_GRAPH_PUBLIC Link { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/resource_locator.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/resource_locator.h index 2ef639470d8..b01f7717546 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/resource_locator.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/resource_locator.h @@ -34,13 +34,15 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_scene_graph { /** * @brief Abstract class for resource loaders * */ -class ResourceLocator +class TESSERACT_SCENE_GRAPH_PUBLIC ResourceLocator { public: using Ptr = std::shared_ptr; @@ -66,7 +68,7 @@ class ResourceLocator * @brief Resource locator implementation using a provided function to locate file resources * */ -class SimpleResourceLocator : public ResourceLocator +class TESSERACT_SCENE_GRAPH_PUBLIC SimpleResourceLocator : public ResourceLocator { public: using Ptr = std::shared_ptr; @@ -91,7 +93,7 @@ class SimpleResourceLocator : public ResourceLocator * @brief Resource implementation for a local file * */ -class SimpleLocatedResource : public tesseract_common::Resource +class TESSERACT_SCENE_GRAPH_PUBLIC SimpleLocatedResource : public tesseract_common::Resource { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf/types.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf/types.h index e521fc0f39d..a15f6c7adb1 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf/types.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf/types.h @@ -9,17 +9,19 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_scene_graph { /** @brief A structure to hold opw kinematics data */ -struct OPWKinematicParameters +struct TESSERACT_SCENE_GRAPH_PUBLIC OPWKinematicParameters { double a1{ 0 }, a2{ 0 }, b{ 0 }, c1{ 0 }, c2{ 0 }, c3{ 0 }, c4{ 0 }; double offsets[6]{ 0, 0, 0, 0, 0, 0 }; signed char sign_corrections[6]{ 1, 1, 1, 1, 1, 1 }; }; -struct ROPKinematicParameters +struct TESSERACT_SCENE_GRAPH_PUBLIC ROPKinematicParameters { std::string manipulator_group; std::string manipulator_ik_solver; @@ -29,7 +31,7 @@ struct ROPKinematicParameters std::unordered_map positioner_sample_resolution; }; -struct REPKinematicParameters +struct TESSERACT_SCENE_GRAPH_PUBLIC REPKinematicParameters { std::string manipulator_group; std::string manipulator_ik_solver; diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf_model.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf_model.h index d5a312e1161..f6f75d18a57 100644 --- a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf_model.h +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/srdf_model.h @@ -42,12 +42,13 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include /// Main namespace namespace tesseract_scene_graph { /** @brief Representation of semantic information about the robot */ -class SRDFModel +class TESSERACT_SCENE_GRAPH_PUBLIC SRDFModel { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/visibility_control.h b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/visibility_control.h new file mode 100644 index 00000000000..d7bb376c507 --- /dev/null +++ b/tesseract/tesseract_scene_graph/include/tesseract_scene_graph/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_SCENE_GRAPH_VISIBILITY_CONTROL_H +#define TESSERACT_SCENE_GRAPH_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_SCENE_GRAPH_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_SCENE_GRAPH_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_SCENE_GRAPH_PUBLIC __declspec(dllexport) + #define TESSERACT_SCENE_GRAPH_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_SCENE_GRAPH_STATIC_LIBRARY + #ifdef TESSERACT_SCENE_GRAPH_LIBRARY_SHARED + #define TESSERACT_SCENE_GRAPH_PUBLIC TESSERACT_SCENE_GRAPH_PUBLIC + #else + #define TESSERACT_SCENE_GRAPH_PUBLIC TESSERACT_SCENE_GRAPH_IMPORT + #endif + #else + #define TESSERACT_SCENE_GRAPH_PUBLIC + #endif + #define TESSERACT_SCENE_GRAPH_PUBLIC_TYPE TESSERACT_SCENE_GRAPH_PUBLIC + #define TESSERACT_SCENE_GRAPH_LOCAL +#else + #define TESSERACT_SCENE_GRAPH_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_SCENE_GRAPH_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_SCENE_GRAPH_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_SCENE_GRAPH_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_SCENE_GRAPH_PUBLIC + #define TESSERACT_SCENE_GRAPH_LOCAL + #endif + #define TESSERACT_SCENE_GRAPH_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_SCENE_GRAPH_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_scene_graph/test/CMakeLists.txt b/tesseract/tesseract_scene_graph/test/CMakeLists.txt index 8fbd6af7e67..d5e6a8961e4 100644 --- a/tesseract/tesseract_scene_graph/test/CMakeLists.txt +++ b/tesseract/tesseract_scene_graph/test/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable(${PROJECT_NAME}_unit tesseract_scene_graph_unit.cpp) target_link_libraries(${PROJECT_NAME}_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME} tesseract::tesseract_support tesseract::tesseract_geometry) target_include_directories(${PROJECT_NAME}_unit PRIVATE ${orocos_kdl_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_urdf/CMakeLists.txt b/tesseract/tesseract_urdf/CMakeLists.txt index 28ba5204dd3..9923cf3d295 100644 --- a/tesseract/tesseract_urdf/CMakeLists.txt +++ b/tesseract/tesseract_urdf/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_urdf VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Boost REQUIRED) find_package(Eigen3 REQUIRED) find_package(console_bridge REQUIRED) @@ -18,9 +21,11 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE}) # Load variable for clang tidy args, compiler options and cxx version tesseract_variables() -add_library(${PROJECT_NAME} SHARED src/urdf_parser.cpp) +add_library(${PROJECT_NAME} src/urdf_parser.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract_common tesseract::tesseract_geometry tesseract::tesseract_scene_graph tesseract::tesseract_collision_core console_bridge ${Boost_LIBRARIES}) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -56,8 +61,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - $) #tesseract::tesseract_common Due to bug in catkin, there is an open PR + ${Boost_INCLUDE_DIRS}) configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME}) diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/box.h b/tesseract/tesseract_urdf/include/tesseract_urdf/box.h index 40f744575b7..0a5a6c46481 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/box.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/box.h @@ -36,10 +36,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class BoxStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL BoxStatusCategory : public tesseract_common::StatusCategory { public: BoxStatusCategory() : name_("BoxStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/calibration.h b/tesseract/tesseract_urdf/include/tesseract_urdf/calibration.h index 24abdd035dc..3ba2ec3cb13 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/calibration.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/calibration.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class CalibrationStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL CalibrationStatusCategory : public tesseract_common::StatusCategory { public: CalibrationStatusCategory() : name_("CalibrationStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/capsule.h b/tesseract/tesseract_urdf/include/tesseract_urdf/capsule.h index 3677a6c59a2..23a5ad6cf18 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/capsule.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/capsule.h @@ -33,10 +33,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class CapsuleStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL CapsuleStatusCategory : public tesseract_common::StatusCategory { public: CapsuleStatusCategory() : name_("CapsuleStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/collision.h b/tesseract/tesseract_urdf/include/tesseract_urdf/collision.h index fbedd4a9939..053cfbe8645 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/collision.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/collision.h @@ -38,10 +38,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class CollisionStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL CollisionStatusCategory : public tesseract_common::StatusCategory { public: CollisionStatusCategory() : name_("CollisionStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/cone.h b/tesseract/tesseract_urdf/include/tesseract_urdf/cone.h index a6ed4cd846f..c29f027ac12 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/cone.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/cone.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class ConeStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL ConeStatusCategory : public tesseract_common::StatusCategory { public: ConeStatusCategory() : name_("ConeStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/convex_mesh.h b/tesseract/tesseract_urdf/include/tesseract_urdf/convex_mesh.h index 11e30ab38f0..dd87bee9e09 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/convex_mesh.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/convex_mesh.h @@ -40,10 +40,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class ConvexMeshStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL ConvexMeshStatusCategory : public tesseract_common::StatusCategory { public: ConvexMeshStatusCategory() : name_("ConvexMeshStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/cylinder.h b/tesseract/tesseract_urdf/include/tesseract_urdf/cylinder.h index 67d87d7c4bf..7fe030dfa4a 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/cylinder.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/cylinder.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class CylinderStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL CylinderStatusCategory : public tesseract_common::StatusCategory { public: CylinderStatusCategory() : name_("CylinderStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/dynamics.h b/tesseract/tesseract_urdf/include/tesseract_urdf/dynamics.h index 99eb6c3153c..fdb4bdf6006 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/dynamics.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/dynamics.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class DynamicsStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL DynamicsStatusCategory : public tesseract_common::StatusCategory { public: DynamicsStatusCategory() : name_("DynamicsStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/geometry.h b/tesseract/tesseract_urdf/include/tesseract_urdf/geometry.h index 2ecc98f7dff..a984e0c962e 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/geometry.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/geometry.h @@ -46,10 +46,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class GeometryStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL GeometryStatusCategory : public tesseract_common::StatusCategory { public: GeometryStatusCategory() : name_("GeometryStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/inertial.h b/tesseract/tesseract_urdf/include/tesseract_urdf/inertial.h index 419015fe3d8..902f636fc73 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/inertial.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/inertial.h @@ -35,10 +35,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include namespace tesseract_urdf { -class InertialStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL InertialStatusCategory : public tesseract_common::StatusCategory { public: InertialStatusCategory() : name_("InertialStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/joint.h b/tesseract/tesseract_urdf/include/tesseract_urdf/joint.h index c532e8367c2..79c960b5d0d 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/joint.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/joint.h @@ -41,10 +41,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class JointStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL JointStatusCategory : public tesseract_common::StatusCategory { public: JointStatusCategory(std::string joint_name = "") : name_("JointStatusCategory"), joint_name_(std::move(joint_name)) {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/limits.h b/tesseract/tesseract_urdf/include/tesseract_urdf/limits.h index b58dc03cb7b..595ed2f5b97 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/limits.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/limits.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class LimitsStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL LimitsStatusCategory : public tesseract_common::StatusCategory { public: LimitsStatusCategory() : name_("LimitsStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/link.h b/tesseract/tesseract_urdf/include/tesseract_urdf/link.h index a2ba10e1819..89aaba34341 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/link.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/link.h @@ -39,10 +39,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class LinkStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL LinkStatusCategory : public tesseract_common::StatusCategory { public: LinkStatusCategory(std::string link_name = "") : name_("LinkStatusCategory"), link_name_(std::move(link_name)) {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/material.h b/tesseract/tesseract_urdf/include/tesseract_urdf/material.h index be347b06466..20961e87bce 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/material.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/material.h @@ -37,10 +37,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class MaterialStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL MaterialStatusCategory : public tesseract_common::StatusCategory { public: MaterialStatusCategory() : name_("MaterialStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/mesh.h b/tesseract/tesseract_urdf/include/tesseract_urdf/mesh.h index 88b169b24d6..e9ea0765a43 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/mesh.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/mesh.h @@ -40,10 +40,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class MeshStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL MeshStatusCategory : public tesseract_common::StatusCategory { public: MeshStatusCategory() : name_("MeshStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/mimic.h b/tesseract/tesseract_urdf/include/tesseract_urdf/mimic.h index ffc7abb6a90..9f9120b0662 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/mimic.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/mimic.h @@ -35,10 +35,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class MimicStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL MimicStatusCategory : public tesseract_common::StatusCategory { public: MimicStatusCategory() : name_("MimicStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/octomap.h b/tesseract/tesseract_urdf/include/tesseract_urdf/octomap.h index c761cf85f12..f16a9715191 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/octomap.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/octomap.h @@ -37,6 +37,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include #ifdef TESSERACT_PARSE_POINT_CLOUDS #include @@ -44,7 +45,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP namespace tesseract_urdf { -class OctomapStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL OctomapStatusCategory : public tesseract_common::StatusCategory { public: OctomapStatusCategory() : name_("OctomapStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/octree.h b/tesseract/tesseract_urdf/include/tesseract_urdf/octree.h index 02dea4b0a73..707a9fc3909 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/octree.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/octree.h @@ -39,10 +39,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class OctreeStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL OctreeStatusCategory : public tesseract_common::StatusCategory { public: OctreeStatusCategory() : name_("OctreeStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/origin.h b/tesseract/tesseract_urdf/include/tesseract_urdf/origin.h index 57fe27aaf6f..eb64c7da577 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/origin.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/origin.h @@ -36,9 +36,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_urdf { -class OriginStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL OriginStatusCategory : public tesseract_common::StatusCategory { public: OriginStatusCategory() : name_("OriginStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/point_cloud.h b/tesseract/tesseract_urdf/include/tesseract_urdf/point_cloud.h index d92848aeeee..c088d0f78e7 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/point_cloud.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/point_cloud.h @@ -38,10 +38,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class PointCloudStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL PointCloudStatusCategory : public tesseract_common::StatusCategory { public: PointCloudStatusCategory() : name_("PointCloudStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/safety_controller.h b/tesseract/tesseract_urdf/include/tesseract_urdf/safety_controller.h index 5de7fcbf375..47d97882b1c 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/safety_controller.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/safety_controller.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class SafetyStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL SafetyStatusCategory : public tesseract_common::StatusCategory { public: SafetyStatusCategory() : name_("SafetyStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/sdf_mesh.h b/tesseract/tesseract_urdf/include/tesseract_urdf/sdf_mesh.h index 3124cf960f5..b2a2e368019 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/sdf_mesh.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/sdf_mesh.h @@ -40,10 +40,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class SDFMeshStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL SDFMeshStatusCategory : public tesseract_common::StatusCategory { public: SDFMeshStatusCategory() : name_("SDFMeshStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/sphere.h b/tesseract/tesseract_urdf/include/tesseract_urdf/sphere.h index bc2d10d7b65..ae668250cc7 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/sphere.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/sphere.h @@ -34,10 +34,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_urdf { -class SphereStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL SphereStatusCategory : public tesseract_common::StatusCategory { public: SphereStatusCategory() : name_("SphereStatusCategory") {} diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/urdf_parser.h b/tesseract/tesseract_urdf/include/tesseract_urdf/urdf_parser.h index a52428427b4..3c7406766e7 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/urdf_parser.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/urdf_parser.h @@ -40,10 +40,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class URDFStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL URDFStatusCategory : public tesseract_common::StatusCategory { public: URDFStatusCategory(std::string desc = "") : name_("URDFStatusCategory"), desc_(std::move(desc)) {} @@ -124,9 +125,10 @@ class URDFStatusCategory : public tesseract_common::StatusCategory * @param locator The resource locator function * @return Status Code */ -tesseract_common::StatusCode::Ptr parseURDFString(tesseract_scene_graph::SceneGraph::Ptr& scene_graph, - const std::string& urdf_xml_string, - const tesseract_scene_graph::ResourceLocator::Ptr& locator); +TESSERACT_URDF_PUBLIC tesseract_common::StatusCode::Ptr +parseURDFString(tesseract_scene_graph::SceneGraph::Ptr& scene_graph, + const std::string& urdf_xml_string, + const tesseract_scene_graph::ResourceLocator::Ptr& locator); /** * @brief Parse a URDF file into a Tesseract Scene Graph @@ -135,9 +137,10 @@ tesseract_common::StatusCode::Ptr parseURDFString(tesseract_scene_graph::SceneGr * @param locator The resource locator function * @return Status Code */ -tesseract_common::StatusCode::Ptr parseURDFFile(tesseract_scene_graph::SceneGraph::Ptr& scene_graph, - const std::string& path, - const tesseract_scene_graph::ResourceLocator::Ptr& locator); +TESSERACT_URDF_PUBLIC tesseract_common::StatusCode::Ptr +parseURDFFile(tesseract_scene_graph::SceneGraph::Ptr& scene_graph, + const std::string& path, + const tesseract_scene_graph::ResourceLocator::Ptr& locator); /** * @brief Parse a URDF string into a Tesseract Scene Graph @@ -145,8 +148,8 @@ tesseract_common::StatusCode::Ptr parseURDFFile(tesseract_scene_graph::SceneGrap * @param locator The resource locator function * @return Tesseract Scene Graph, nullptr if failed to parse URDF */ -tesseract_scene_graph::SceneGraph::Ptr parseURDFString(const std::string& urdf_xml_string, - const tesseract_scene_graph::ResourceLocator::Ptr& locator); +TESSERACT_URDF_PUBLIC tesseract_scene_graph::SceneGraph::Ptr +parseURDFString(const std::string& urdf_xml_string, const tesseract_scene_graph::ResourceLocator::Ptr& locator); /** * @brief Parse a URDF file into a Tesseract Scene Graph @@ -154,8 +157,8 @@ tesseract_scene_graph::SceneGraph::Ptr parseURDFString(const std::string& urdf_x * @param The resource locator function * @return Tesseract Scene Graph, nullptr if failed to parse URDF */ -tesseract_scene_graph::SceneGraph::Ptr parseURDFFile(const std::string& path, - const tesseract_scene_graph::ResourceLocator::Ptr& locator); +TESSERACT_URDF_PUBLIC tesseract_scene_graph::SceneGraph::Ptr +parseURDFFile(const std::string& path, const tesseract_scene_graph::ResourceLocator::Ptr& locator); } // namespace tesseract_urdf diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/visibility_control.h b/tesseract/tesseract_urdf/include/tesseract_urdf/visibility_control.h new file mode 100644 index 00000000000..fc36ef514b4 --- /dev/null +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_URDF_VISIBILITY_CONTROL_H +#define TESSERACT_URDF_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_URDF_EXPORT __attribute__ ((dllexport)) + #define TESSERACT_URDF_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_URDF_EXPORT __declspec(dllexport) + #define TESSERACT_URDF_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_URDF_STATIC_LIBRARY + #ifdef TESSERACT_URDF_LIBRARY_SHARED + #define TESSERACT_URDF_PUBLIC TESSERACT_URDF_EXPORT + #else + #define TESSERACT_URDF_PUBLIC TESSERACT_URDF_IMPORT + #endif + #else + #define TESSERACT_URDF_PUBLIC + #endif + #define TESSERACT_URDF_PUBLIC_TYPE TESSERACT_URDF_PUBLIC + #define TESSERACT_URDF_LOCAL +#else + #define TESSERACT_URDF_EXPORT __attribute__ ((visibility("default"))) + #define TESSERACT_URDF_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_URDF_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_URDF_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_URDF_PUBLIC + #define TESSERACT_URDF_LOCAL + #endif + #define TESSERACT_URDF_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_URDF_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_urdf/include/tesseract_urdf/visual.h b/tesseract/tesseract_urdf/include/tesseract_urdf/visual.h index eaec90f7a07..abd57ea45a7 100644 --- a/tesseract/tesseract_urdf/include/tesseract_urdf/visual.h +++ b/tesseract/tesseract_urdf/include/tesseract_urdf/visual.h @@ -40,10 +40,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_urdf { -class VisualStatusCategory : public tesseract_common::StatusCategory +class TESSERACT_URDF_LOCAL VisualStatusCategory : public tesseract_common::StatusCategory { public: VisualStatusCategory() : name_("VisualStatusCategory") {} diff --git a/tesseract/tesseract_urdf/test/CMakeLists.txt b/tesseract/tesseract_urdf/test/CMakeLists.txt index fcfd8f5ba08..b998d9d86cd 100644 --- a/tesseract/tesseract_urdf/test/CMakeLists.txt +++ b/tesseract/tesseract_urdf/test/CMakeLists.txt @@ -32,6 +32,7 @@ target_link_libraries(${PROJECT_NAME}_unit PRIVATE GTest::GTest GTest::Main ${PR target_include_directories(${PROJECT_NAME}_unit PRIVATE "$") target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) diff --git a/tesseract/tesseract_visualization/CMakeLists.txt b/tesseract/tesseract_visualization/CMakeLists.txt index 9373108a455..ef50e0da066 100644 --- a/tesseract/tesseract_visualization/CMakeLists.txt +++ b/tesseract/tesseract_visualization/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.5.0) project(tesseract_visualization VERSION 0.1.0 LANGUAGES CXX) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + find_package(Eigen3 REQUIRED) find_package(console_bridge REQUIRED) find_package(tesseract_collision REQUIRED) @@ -39,12 +42,14 @@ else() set(TESSERACT_VISUALIZATION_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/lib) endif() -add_library(${PROJECT_NAME} SHARED +add_library(${PROJECT_NAME} src/visualization_loader.cpp src/trajectory_interpolator.cpp src/trajectory_player.cpp) +target_process_export(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PUBLIC tesseract::tesseract tesseract::tesseract_environment_core tesseract::tesseract_scene_graph tesseract::tesseract_command_language tesseract::tesseract_collision_core tesseract::tesseract_common console_bridge ${class_loader_LIBRARIES}) target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -65,9 +70,10 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC list(APPEND PACKAGE_LIBRARIES ${PROJECT_NAME}) if (IGNITION_FOUND) - add_library(${PROJECT_NAME}_ignition SHARED + add_library(${PROJECT_NAME}_ignition src/ignition/entity_manager.cpp src/ignition/conversions.cpp) + target_process_export(${PROJECT_NAME}_ignition) target_link_libraries(${PROJECT_NAME}_ignition PUBLIC tesseract::tesseract_scene_graph tesseract::tesseract_common @@ -75,6 +81,7 @@ if (IGNITION_FOUND) ${IGNITION-MSGS_LIBRARIES} console_bridge) target_compile_options(${PROJECT_NAME}_ignition PRIVATE ${TESSERACT_COMPILE_OPTIONS}) + target_compile_definitions(${PROJECT_NAME}_ignition PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ignition ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ignition PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ignition ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -85,8 +92,9 @@ if (IGNITION_FOUND) ${IGNITION-COMMON_INCLUDE_DIRS} ${IGNITION-MSGS_INCLUDE_DIRS}) - add_library(${PROJECT_NAME}_ignition_visualization SHARED + add_library(${PROJECT_NAME}_ignition_visualization src/ignition/tesseract_ignition_visualization.cpp) + target_process_export(${PROJECT_NAME}_ignition_visualization) target_link_libraries(${PROJECT_NAME}_ignition_visualization PUBLIC ${PROJECT_NAME} ${PROJECT_NAME}_ignition @@ -98,6 +106,7 @@ if (IGNITION_FOUND) ${IGNITION-MSGS_LIBRARIES} console_bridge) target_compile_options(${PROJECT_NAME}_ignition_visualization PRIVATE ${TESSERACT_COMPILE_OPTIONS}) + target_compile_definitions(${PROJECT_NAME}_ignition_visualization PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_ignition_visualization ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_ignition_visualization PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_ignition_visualization ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING}) @@ -109,11 +118,12 @@ if (IGNITION_FOUND) ${IGNITION-TRANSPORT_INCLUDE_DIRS} ${IGNITION-MSGS_INCLUDE_DIRS}) - add_library(${PROJECT_NAME}_ignition_visualization_plugin SHARED + add_library(${PROJECT_NAME}_ignition_visualization_plugin src/ignition/tesseract_ignition_visualization_plugin.cpp) target_link_libraries(${PROJECT_NAME}_ignition_visualization_plugin PUBLIC ${PROJECT_NAME}_ignition_visualization ${class_loader_LIBRARIES}) target_compile_options(${PROJECT_NAME}_ignition_visualization_plugin PRIVATE ${TESSERACT_COMPILE_OPTIONS}) + target_compile_definitions(${PROJECT_NAME}_ignition_visualization_plugin PUBLIC ${TESSERACT_COMPILE_DEFINITIONS}) target_cxx_version(${PROJECT_NAME}_ignition_visualization_plugin PUBLIC VERSION ${TESSERACT_CXX_VERSION}) target_include_directories(${PROJECT_NAME}_ignition_visualization_plugin PUBLIC "$" diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/conversions.h b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/conversions.h index 55b1216c51d..aae53b50b0a 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/conversions.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/conversions.h @@ -34,15 +34,16 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_visualization { -bool isMeshWithColor(const std::string& file_path); +TESSERACT_VISUALIZATION_IGNITION_PUBLIC bool isMeshWithColor(const std::string& file_path); -bool toMsg(ignition::msgs::Scene& scene_msg, - EntityManager& entity_manager, - const tesseract_scene_graph::SceneGraph& scene_graph, - const tesseract_common::TransformMap& link_transforms); +TESSERACT_VISUALIZATION_IGNITION_PUBLIC bool toMsg(ignition::msgs::Scene& scene_msg, + EntityManager& entity_manager, + const tesseract_scene_graph::SceneGraph& scene_graph, + const tesseract_common::TransformMap& link_transforms); } // namespace tesseract_visualization #endif // TESSERACT_VISUALIZATION_IGNITION_CONVERSIONS_H diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/entity_manager.h b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/entity_manager.h index f49b67dcf02..3c4951a13a9 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/entity_manager.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/entity_manager.h @@ -32,13 +32,15 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include + namespace tesseract_visualization { static const int NULL_ENTITY_ID = -1; using EntityID = int; using EntityMap = std::unordered_map; -class EntityManager +class TESSERACT_VISUALIZATION_IGNITION_PUBLIC EntityManager { public: /** diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/tesseract_ignition_visualization.h b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/tesseract_ignition_visualization.h index 1e7cdab5224..8404b460aa0 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/tesseract_ignition_visualization.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/tesseract_ignition_visualization.h @@ -36,11 +36,13 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_visualization { /** @brief The Tesseract Ignition Vizualization class */ -class TesseractIgnitionVisualization : public tesseract_visualization::Visualization +class TESSERACT_VISUALIZATION_IGNITION_PUBLIC TesseractIgnitionVisualization + : public tesseract_visualization::Visualization { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/visibility_control.h b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/visibility_control.h new file mode 100644 index 00000000000..6640a7c7b5c --- /dev/null +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/ignition/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_VISUALIZATION_IGNITION_VISIBILITY_CONTROL_H +#define TESSERACT_VISUALIZATION_IGNITION_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_VISUALIZATION_IGNITION_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC __declspec(dllexport) + #define TESSERACT_VISUALIZATION_IGNITION_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_VISUALIZATION_IGNITION_STATIC_LIBRARY + #ifdef TESSERACT_VISUALIZATION_IGNITION_LIBRARY_SHARED + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC TESSERACT_VISUALIZATION_IGNITION_PUBLIC + #else + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC TESSERACT_VISUALIZATION_IGNITION_IMPORT + #endif + #else + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC + #endif + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC_TYPE TESSERACT_VISUALIZATION_IGNITION_PUBLIC + #define TESSERACT_VISUALIZATION_IGNITION_LOCAL +#else + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_VISUALIZATION_IGNITION_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_VISUALIZATION_IGNITION_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC + #define TESSERACT_VISUALIZATION_IGNITION_LOCAL + #endif + #define TESSERACT_VISUALIZATION_IGNITION_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_VISUALIZATION_IGNITION_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_interpolator.h b/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_interpolator.h index 987741ec534..ed85d1e59b2 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_interpolator.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_interpolator.h @@ -35,10 +35,11 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_visualization { -class TrajectoryInterpolator +class TESSERACT_VISUALIZATION_PUBLIC TrajectoryInterpolator { public: using UPtr = std::unique_ptr; diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_player.h b/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_player.h index b4cddcf914f..7c692f9f57c 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_player.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/trajectory_player.h @@ -34,11 +34,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_visualization { /** @brief Enables the ability to play a trajectory provided by the set program */ -class TrajectoryPlayer +class TESSERACT_VISUALIZATION_PUBLIC TrajectoryPlayer { public: TrajectoryPlayer() = default; diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/visibility_control.h b/tesseract/tesseract_visualization/include/tesseract_visualization/visibility_control.h new file mode 100644 index 00000000000..b6cd69fac93 --- /dev/null +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/visibility_control.h @@ -0,0 +1,61 @@ +// Copyright 2015 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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. + +/* This header must be included by all descartes headers which declare symbols + * which are defined in the descartes library. When not building the descartes + * library, i.e. when using the headers in other package's code, the contents + * of this header change the visibility of certain symbols which the descartes + * library cannot have, but the consuming code must have inorder to link. + */ +#ifndef TESSERACT_VISUALIZATION_VISIBILITY_CONTROL_H +#define TESSERACT_VISUALIZATION_VISIBILITY_CONTROL_H + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +// clang-format off +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define TESSERACT_VISUALIZATION_PUBLIC __attribute__ ((dllexport)) + #define TESSERACT_VISUALIZATION_IMPORT __attribute__ ((dllimport)) + #else + #define TESSERACT_VISUALIZATION_PUBLIC __declspec(dllexport) + #define TESSERACT_VISUALIZATION_IMPORT __declspec(dllimport) + #endif + #ifndef TESSERACT_VISUALIZATION_STATIC_LIBRARY + #ifdef TESSERACT_VISUALIZATION_LIBRARY_SHARED + #define TESSERACT_VISUALIZATION_PUBLIC TESSERACT_VISUALIZATION_PUBLIC + #else + #define TESSERACT_VISUALIZATION_PUBLIC TESSERACT_VISUALIZATION_IMPORT + #endif + #else + #define TESSERACT_VISUALIZATION_PUBLIC + #endif + #define TESSERACT_VISUALIZATION_PUBLIC_TYPE TESSERACT_VISUALIZATION_PUBLIC + #define TESSERACT_VISUALIZATION_LOCAL +#else + #define TESSERACT_VISUALIZATION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_VISUALIZATION_IMPORT + #if __GNUC__ >= 4 + #define TESSERACT_VISUALIZATION_PUBLIC __attribute__ ((visibility("default"))) + #define TESSERACT_VISUALIZATION_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define TESSERACT_VISUALIZATION_PUBLIC + #define TESSERACT_VISUALIZATION_LOCAL + #endif + #define TESSERACT_VISUALIZATION_PUBLIC_TYPE +#endif +// clang-format on + +#endif // TESSERACT_VISUALIZATION_VISIBILITY_CONTROL_H diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/visualization.h b/tesseract/tesseract_visualization/include/tesseract_visualization/visualization.h index 8aad4aa13d6..d46e5e5659e 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/visualization.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/visualization.h @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include #include +#include namespace tesseract_planning { @@ -45,7 +46,7 @@ class Instruction; namespace tesseract_visualization { /** @brief The Vizualization class */ -class Visualization +class TESSERACT_VISUALIZATION_PUBLIC Visualization { public: using Ptr = std::shared_ptr; diff --git a/tesseract/tesseract_visualization/include/tesseract_visualization/visualization_loader.h b/tesseract/tesseract_visualization/include/tesseract_visualization/visualization_loader.h index 95d77e4eb77..23cdb9c3971 100644 --- a/tesseract/tesseract_visualization/include/tesseract_visualization/visualization_loader.h +++ b/tesseract/tesseract_visualization/include/tesseract_visualization/visualization_loader.h @@ -33,6 +33,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include namespace tesseract_visualization { @@ -40,7 +41,7 @@ namespace tesseract_visualization * @brief This is used to dynamically load tesseract visualizer. * This class must remain around for the life of the loaded visualization class. */ -class VisualizationLoader +class TESSERACT_VISUALIZATION_PUBLIC VisualizationLoader { public: /** @brief This will attempt to load the tesseract_ignition visualizer provided by snap package */ diff --git a/tesseract/tesseract_visualization/test/CMakeLists.txt b/tesseract/tesseract_visualization/test/CMakeLists.txt index 8b93ea85510..bd841b1793d 100644 --- a/tesseract/tesseract_visualization/test/CMakeLists.txt +++ b/tesseract/tesseract_visualization/test/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable(${PROJECT_NAME}_player_unit trajectory_player_unit.cpp) target_link_libraries(${PROJECT_NAME}_player_unit PRIVATE GTest::GTest GTest::Main ${PROJECT_NAME}) target_include_directories(${PROJECT_NAME}_player_unit PRIVATE ${EIGEN3_INCLUDE_DIRS}) target_compile_options(${PROJECT_NAME}_player_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS}) +target_compile_definitions(${PROJECT_NAME}_player_unit PRIVATE ${TESSERACT_COMPILE_DEFINITIONS}) target_clang_tidy(${PROJECT_NAME}_player_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY}) target_cxx_version(${PROJECT_NAME}_player_unit PRIVATE VERSION ${TESSERACT_CXX_VERSION}) target_code_coverage(${PROJECT_NAME}_player_unit ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})