Skip to content

Commit

Permalink
Fix windows static field exports and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwason committed Jul 29, 2024
1 parent f17958b commit 3f12c95
Show file tree
Hide file tree
Showing 24 changed files with 149 additions and 100 deletions.
7 changes: 4 additions & 3 deletions tesseract_task_composer/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ add_library(
src/task_composer_server.cpp
src/task_composer_task.cpp)

generate_export_header(${PROJECT_NAME})

target_link_libraries(
${PROJECT_NAME}
PUBLIC console_bridge::console_bridge
Expand Down Expand Up @@ -54,6 +52,9 @@ add_library(
src/nodes/start_task.cpp
src/nodes/sync_task.cpp
src/test_suite/test_task.cpp)

generate_export_header(${PROJECT_NAME}_nodes)

target_link_libraries(
${PROJECT_NAME}_nodes
PUBLIC ${PROJECT_NAME}
Expand Down Expand Up @@ -104,7 +105,7 @@ install(
PATTERN "*.h"
PATTERN "*.hpp")

install(FILES ${PROJECT_BINARY_DIR}/core/tesseract_task_composer_export.h DESTINATION include/${PROJECT_NAME}/core/
install(FILES ${PROJECT_BINARY_DIR}/core/tesseract_task_composer_nodes_export.h DESTINATION include/${PROJECT_NAME}/core/
COMPONENT core)

# Plugin should not be export only installed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/core/tesseract_task_composer_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>

namespace tesseract_planning
{
class TaskComposerPluginFactory;
class HasDataStorageEntryTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_NODES_EXPORT HasDataStorageEntryTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_KEYS_PORT;
static const std::string INPUT_KEYS_PORT;

using Ptr = std::shared_ptr<HasDataStorageEntryTask>;
using ConstPtr = std::shared_ptr<const HasDataStorageEntryTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/uuid/uuid.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/core/tesseract_task_composer_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_common/fwd.h>
Expand Down
9 changes: 9 additions & 0 deletions tesseract_task_composer/planning/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Need to create export header so static class variables can be exported on windows build
include(GenerateExportHeader)

find_package(tesseract_command_language REQUIRED)
find_package(
tesseract_motion_planners REQUIRED
Expand Down Expand Up @@ -138,8 +141,11 @@ target_code_coverage(
ENABLE ${TESSERACT_ENABLE_CODE_COVERAGE})
target_include_directories(
${PROJECT_NAME}_planning_nodes PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/../>"
"$<INSTALL_INTERFACE:include>")

generate_export_header(${PROJECT_NAME}_planning_nodes)

# Create factories target
add_library(${PROJECT_NAME}_planning_factories ${FACTORIES_SOURCE_FILES})
target_link_libraries(${PROJECT_NAME}_planning_factories PUBLIC ${FACTORIES_SOURCE_LINK_LIBRARIES})
Expand Down Expand Up @@ -171,6 +177,9 @@ install(
PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE)

install(FILES ${PROJECT_BINARY_DIR}/planning/tesseract_task_composer_planning_nodes_export.h DESTINATION include/${PROJECT_NAME}/planning/
COMPONENT planning)

# Plugin should not be export only installed
install(
TARGETS ${PROJECT_NAME}_planning_factories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <vector>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -41,17 +42,17 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
namespace tesseract_planning
{
class TaskComposerPluginFactory;
class ContinuousContactCheckTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT ContinuousContactCheckTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INPUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<ContinuousContactCheckTask>;
using ConstPtr = std::shared_ptr<const ContinuousContactCheckTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <vector>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -41,17 +42,17 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
namespace tesseract_planning
{
class TaskComposerPluginFactory;
class DiscreteContactCheckTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT DiscreteContactCheckTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INPUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<DiscreteContactCheckTask>;
using ConstPtr = std::shared_ptr<const DiscreteContactCheckTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -42,17 +43,17 @@ class TaskComposerPluginFactory;
* @brief This task modifies the input instructions in order to push waypoints that are outside of their
* limits back within them.
*/
class FixStateBoundsTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT FixStateBoundsTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INOUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<FixStateBoundsTask>;
using ConstPtr = std::shared_ptr<const FixStateBoundsTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -50,17 +51,17 @@ struct FixStateCollisionProfile;
*
* First it uses TrajOpt to correct the waypoint. If that fails, it reverts to random sampling
*/
class FixStateCollisionTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT FixStateCollisionTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INOUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<FixStateCollisionTask>;
using ConstPtr = std::shared_ptr<const FixStateCollisionTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -51,13 +52,13 @@ class TaskComposerPluginFactory;
* input_keys[0]: The original input to motion planning
* input_keys[1]: The output of the first motion plan which failed collision checking
*/
class FormatAsInputTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT FormatAsInputTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PRE_PLANNING_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_POST_PLANNING_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string OUTPUT_PROGRAM_PORT;
static const std::string INPUT_PRE_PLANNING_PROGRAM_PORT;
static const std::string INPUT_POST_PLANNING_PROGRAM_PORT;
static const std::string OUTPUT_PROGRAM_PORT;

using Ptr = std::shared_ptr<FormatAsInputTask>;
using ConstPtr = std::shared_ptr<const FormatAsInputTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>

namespace tesseract_planning
{
class TaskComposerPluginFactory;
class FormatAsResultTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT FormatAsResultTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAMS_PORT;
static const std::string INOUT_PROGRAMS_PORT;

using Ptr = std::shared_ptr<FormatAsResultTask>;
using ConstPtr = std::shared_ptr<const FormatAsResultTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -39,18 +40,18 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
namespace tesseract_planning
{
class TaskComposerPluginFactory;
class IterativeSplineParameterizationTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT IterativeSplineParameterizationTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INOUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MOVE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MOVE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<IterativeSplineParameterizationTask>;
using ConstPtr = std::shared_ptr<const IterativeSplineParameterizationTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,24 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>

namespace tesseract_planning
{
class TaskComposerPluginFactory;
class MinLengthTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT MinLengthTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INOUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<MinLengthTask>;
using ConstPtr = std::shared_ptr<const MinLengthTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class MotionPlannerTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INOUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_ENVIRONMENT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INOUT_PROGRAM_PORT;
static const std::string INPUT_ENVIRONMENT_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MANIP_INFO_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_MOVE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MANIP_INFO_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_MOVE_PROFILE_REMAPPING_PORT;

MotionPlannerTask() : TaskComposerTask("MotionPlannerTask", MotionPlannerTask<MotionPlannerType>::ports(), true) {}
explicit MotionPlannerTask(std::string name, // NOLINT(performance-unnecessary-value-param)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>

namespace tesseract_planning
{
class TaskComposerPluginFactory;
class ProcessPlanningInputTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT ProcessPlanningInputTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PLANNING_INPUT_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string OUTPUT_PROGRAM_PORT;
static const std::string INPUT_PLANNING_INPUT_PORT;
static const std::string OUTPUT_PROGRAM_PORT;

using Ptr = std::shared_ptr<ProcessPlanningInputTask>;
using ConstPtr = std::shared_ptr<const ProcessPlanningInputTask>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <tesseract_task_composer/planning/tesseract_task_composer_planning_nodes_export.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_task.h>
Expand All @@ -39,15 +40,15 @@ class TaskComposerPluginFactory;
* @brief This task simply returns a value specified in the composite profile. This can be used to switch execution
* based on the profile
*/
class ProfileSwitchTask : public TaskComposerTask
class TESSERACT_TASK_COMPOSER_PLANNING_NODES_EXPORT ProfileSwitchTask : public TaskComposerTask
{
public:
// Requried
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROGRAM_PORT;
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_PROFILES_PORT;
static const std::string INPUT_PROGRAM_PORT;
static const std::string INPUT_PROFILES_PORT;

// Optional
static const TESSERACT_TASK_COMPOSER_EXPORT std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;
static const std::string INPUT_COMPOSITE_PROFILE_REMAPPING_PORT;

using Ptr = std::shared_ptr<ProfileSwitchTask>;
using ConstPtr = std::shared_ptr<const ProfileSwitchTask>;
Expand Down
Loading

0 comments on commit 3f12c95

Please sign in to comment.