Skip to content

Commit 75eaee6

Browse files
authored
Merge pull request #134 from orocos/fix-rtt_roscomm-rosservice-namespace
rtt_roscomm: add rtt_roscomm namespace for rosservice plugins and helper classes
2 parents c64c2e4 + 92ff2a0 commit 75eaee6

File tree

8 files changed

+32
-1
lines changed

8 files changed

+32
-1
lines changed

rtt_roscomm/include/rtt_roscomm/rtt_rosservice_proxy.h

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <boost/utility/enable_if.hpp>
1111
#include <boost/type_traits/is_void.hpp>
1212

13+
namespace rtt_roscomm {
14+
1315
//! Abstract ROS Service Proxy
1416
class ROSServiceProxyBase
1517
{
@@ -260,4 +262,6 @@ class ROSServiceProxyFactory : public ROSServiceProxyFactoryBase
260262
}
261263
};
262264

265+
} // namespace rtt_roscomm
266+
263267
#endif // ifndef __RTT_ROSCOMM_RTT_ROSSERVICE_PROXY_H

rtt_roscomm/include/rtt_roscomm/rtt_rosservice_registry_service.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <rtt/RTT.hpp>
55
#include <boost/shared_ptr.hpp>
66

7+
namespace rtt_roscomm {
8+
79
class ROSServiceRegistryService;
810
class ROSServiceProxyFactoryBase;
911
typedef boost::shared_ptr<ROSServiceRegistryService> ROSServiceRegistryServicePtr;
@@ -42,4 +44,6 @@ class ROSServiceRegistryService : public RTT::Service
4244
static ROSServiceRegistryServicePtr s_instance_;
4345
};
4446

47+
} // namespace rtt_roscomm
48+
4549
#endif // __RTT_ROSSERVICE_RTT_ROSSERVICE_REGISTRY_SERVICE_H

rtt_roscomm/src/rtt_rosservice_registry_service.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <rtt_roscomm/rtt_rosservice_registry_service.h>
77
#include <rtt_roscomm/rtt_rosservice_proxy.h>
88

9+
namespace rtt_roscomm {
10+
911
ROSServiceRegistryServicePtr ROSServiceRegistryService::s_instance_;
1012

1113
ROSServiceRegistryServicePtr ROSServiceRegistryService::Instance()
@@ -101,7 +103,10 @@ static void loadROSServiceRegistryService()
101103
ROSServiceRegistryService::Instance();
102104
}
103105

106+
} // namespace rtt_roscomm
107+
104108
using namespace RTT;
109+
using namespace rtt_roscomm;
105110
extern "C" {
106111
bool loadRTTPlugin(RTT::TaskContext* c){
107112
if (c != 0) return false;

rtt_roscomm/src/rtt_rosservice_service.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
using namespace RTT;
1010
using namespace std;
1111

12+
namespace rtt_roscomm {
13+
1214
/**
1315
* The globally loadable ROS service.
1416
*/
@@ -215,4 +217,6 @@ class ROSServiceService : public RTT::Service
215217
std::map<std::string, ROSServiceClientProxyBase*> client_proxies_;
216218
};
217219

218-
ORO_SERVICE_NAMED_PLUGIN(ROSServiceService, "rosservice")
220+
} // namespace rtt_roscomm
221+
222+
ORO_SERVICE_NAMED_PLUGIN(rtt_roscomm::ROSServiceService, "rosservice")

rtt_roscomm/src/templates/service/rtt_rosservice_proxies.cpp.in

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
namespace rtt_@ROSPACKAGE@_ros_service_proxies {
1414

15+
using namespace rtt_roscomm;
16+
1517
bool registerROSServiceProxies() {
1618
// Get the ros service registry service
1719
ROSServiceRegistryServicePtr rosservice_registry = ROSServiceRegistryService::Instance();

typekits/rtt_std_srvs/include/rtt_std_srvs/Empty.h

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// - void empty()
1313
//
1414

15+
namespace rtt_roscomm {
16+
1517
template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::Empty,1> {
1618
typedef bool Signature();
1719
typedef RTT::OperationCaller<Signature> ProxyOperationCallerType;
@@ -29,4 +31,6 @@ template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::Empty,2> {
2931
}
3032
};
3133

34+
} // namespace rtt_roscomm
35+
3236
#endif // RTT_STD_SRVS_EMPTY_H

typekits/rtt_std_srvs/include/rtt_std_srvs/SetBool.h

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// - void setBool(bool) // response.success = true and response.message will be empty
1515
//
1616

17+
namespace rtt_roscomm {
18+
1719
template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::SetBool,1> {
1820
typedef bool Signature(bool, std::string&);
1921
typedef RTT::OperationCaller<Signature> ProxyOperationCallerType;
@@ -52,4 +54,6 @@ template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::SetBool,4> {
5254
}
5355
};
5456

57+
} // namespace rtt_roscomm
58+
5559
#endif // RTT_STD_SRVS_SETBOOL_H

typekits/rtt_std_srvs/include/rtt_std_srvs/Trigger.h

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// - std::string trigger() // response.success = true
1414
//
1515

16+
namespace rtt_roscomm {
17+
1618
template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::Trigger,1> {
1719
typedef bool Signature(std::string &message_out);
1820
typedef RTT::OperationCaller<Signature> ProxyOperationCallerType;
@@ -41,4 +43,6 @@ template<> struct ROSServiceServerOperationCallerWrapper<std_srvs::Trigger,3> {
4143
}
4244
};
4345

46+
} // namespace rtt_roscomm
47+
4448
#endif // RTT_STD_SRVS_TRIGGER_H

0 commit comments

Comments
 (0)