-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathros-noetic-moveit-ros-warehouse.win.patch
152 lines (135 loc) · 5.62 KB
/
ros-noetic-moveit-ros-warehouse.win.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
diff --git a/warehouse/include/moveit/warehouse/constraints_storage.h b/warehouse/include/moveit/warehouse/constraints_storage.h
index 337a57dc5..e6dfa9d27 100644
--- a/warehouse/include/moveit/warehouse/constraints_storage.h
+++ b/warehouse/include/moveit/warehouse/constraints_storage.h
@@ -40,6 +40,18 @@
#include <moveit/macros/class_forward.h>
#include <moveit_msgs/Constraints.h>
+// Import/export for windows dll's and visibility for gcc shared libraries.
+
+#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries
+ #ifdef moveit_warehouse_EXPORTS // we are building a shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_EXPORT
+ #else // we are using shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_IMPORT
+ #endif
+#else // ros is being built around static libraries
+ #define MOVEIT_WAREHOUSE_DECL
+#endif
+
namespace moveit_warehouse
{
typedef warehouse_ros::MessageWithMetadata<moveit_msgs::Constraints>::ConstPtr ConstraintsWithMetadata;
@@ -50,11 +62,11 @@ MOVEIT_CLASS_FORWARD(ConstraintsStorage);
class ConstraintsStorage : public MoveItMessageStorage
{
public:
- static const std::string DATABASE_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string DATABASE_NAME;
- static const std::string CONSTRAINTS_ID_NAME;
- static const std::string CONSTRAINTS_GROUP_NAME;
- static const std::string ROBOT_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string CONSTRAINTS_ID_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string CONSTRAINTS_GROUP_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string ROBOT_NAME;
ConstraintsStorage(warehouse_ros::DatabaseConnection::Ptr conn);
diff --git a/warehouse/include/moveit/warehouse/planning_scene_storage.h b/warehouse/include/moveit/warehouse/planning_scene_storage.h
index e7899729a..1db257174 100644
--- a/warehouse/include/moveit/warehouse/planning_scene_storage.h
+++ b/warehouse/include/moveit/warehouse/planning_scene_storage.h
@@ -42,6 +42,18 @@
#include <moveit_msgs/MotionPlanRequest.h>
#include <moveit_msgs/RobotTrajectory.h>
+// Import/export for windows dll's and visibility for gcc shared libraries.
+
+#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries
+ #ifdef moveit_warehouse_EXPORTS // we are building a shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_EXPORT
+ #else // we are using shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_IMPORT
+ #endif
+#else // ros is being built around static libraries
+ #define MOVEIT_WAREHOUSE_DECL
+#endif
+
namespace moveit_warehouse
{
typedef warehouse_ros::MessageWithMetadata<moveit_msgs::PlanningScene>::ConstPtr PlanningSceneWithMetadata;
@@ -57,10 +69,10 @@ MOVEIT_CLASS_FORWARD(PlanningSceneStorage);
class PlanningSceneStorage : public MoveItMessageStorage
{
public:
- static const std::string DATABASE_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string DATABASE_NAME;
- static const std::string PLANNING_SCENE_ID_NAME;
- static const std::string MOTION_PLAN_REQUEST_ID_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string PLANNING_SCENE_ID_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string MOTION_PLAN_REQUEST_ID_NAME;
PlanningSceneStorage(warehouse_ros::DatabaseConnection::Ptr conn);
diff --git a/warehouse/include/moveit/warehouse/state_storage.h b/warehouse/include/moveit/warehouse/state_storage.h
index e008a5fbd..83f34a01c 100644
--- a/warehouse/include/moveit/warehouse/state_storage.h
+++ b/warehouse/include/moveit/warehouse/state_storage.h
@@ -40,6 +40,18 @@
#include <moveit/macros/class_forward.h>
#include <moveit_msgs/RobotState.h>
+// Import/export for windows dll's and visibility for gcc shared libraries.
+
+#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries
+ #ifdef moveit_warehouse_EXPORTS // we are building a shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_EXPORT
+ #else // we are using shared lib/dll
+ #define MOVEIT_WAREHOUSE_DECL ROS_HELPER_IMPORT
+ #endif
+#else // ros is being built around static libraries
+ #define MOVEIT_WAREHOUSE_DECL
+#endif
+
namespace moveit_warehouse
{
typedef warehouse_ros::MessageWithMetadata<moveit_msgs::RobotState>::ConstPtr RobotStateWithMetadata;
@@ -50,10 +62,10 @@ MOVEIT_CLASS_FORWARD(RobotStateStorage);
class RobotStateStorage : public MoveItMessageStorage
{
public:
- static const std::string DATABASE_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string DATABASE_NAME;
- static const std::string STATE_NAME;
- static const std::string ROBOT_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string STATE_NAME;
+ static MOVEIT_WAREHOUSE_DECL const std::string ROBOT_NAME;
RobotStateStorage(warehouse_ros::DatabaseConnection::Ptr conn);
diff --git a/warehouse/src/warehouse_connector.cpp b/warehouse/src/warehouse_connector.cpp
index d15e3cda8..216dfd6a1 100644
--- a/warehouse/src/warehouse_connector.cpp
+++ b/warehouse/src/warehouse_connector.cpp
@@ -36,7 +36,9 @@
#include <sys/types.h>
#include <signal.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <ros/ros.h>
#include <moveit/warehouse/warehouse_connector.h>
@@ -48,12 +50,15 @@ WarehouseConnector::WarehouseConnector(const std::string& dbexec) : dbexec_(dbex
WarehouseConnector::~WarehouseConnector()
{
+#ifndef WIN32
if (child_pid_ != 0)
kill(child_pid_, SIGTERM);
+#endif
}
bool WarehouseConnector::connectToDatabase(const std::string& dirname)
{
+#ifndef WIN32
if (child_pid_ != 0)
kill(child_pid_, SIGTERM);
@@ -98,5 +103,8 @@ bool WarehouseConnector::connectToDatabase(const std::string& dirname)
ros::WallDuration(1.0).sleep();
}
return true;
+#else
+ return false;
+#endif
}
} // namespace moveit_warehouse