action_server.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef ROS2
4 #define MAKE_SERVER(CallbackClass, ActionName, TopicName) \
5  ensenso::std::make_unique<ActionName##Server>( \
6  nh, TopicName, ensenso::std::bind(&CallbackClass::on##ActionName, this, std::placeholders::_1));
7 
8 #define MAKE_MONO_SERVER(CallbackClass, ActionName, TopicName) \
9  ensenso::std::make_unique<ActionName##MonoServer>( \
10  nh, TopicName, ensenso::std::bind(&CallbackClass::on##ActionName, this, std::placeholders::_1));
11 
12 #define USING_ENSENSO_CAMERA_ACTION(ACTION_NAME) \
13  namespace ensenso \
14  { \
15  namespace action \
16  { \
17  using ACTION_NAME##Action = ensenso_camera_msgs::action::ACTION_NAME; \
18  using ACTION_NAME##ActionPtr = ::std::shared_ptr<ACTION_NAME##Action>; \
19  using ACTION_NAME##ActionConstPtr = ::std::shared_ptr<ACTION_NAME##Action const>; \
20  \
21  using ACTION_NAME##Goal = typename ensenso_camera_msgs::action::ACTION_NAME::Goal; \
22  using ACTION_NAME##GoalPtr = ::std::shared_ptr<ACTION_NAME##Goal>; \
23  using ACTION_NAME##GoalConstPtr = ::std::shared_ptr<ACTION_NAME##Goal const>; \
24  \
25  using ACTION_NAME##Result = typename ensenso_camera_msgs::action::ACTION_NAME::Result; \
26  using ACTION_NAME##ResultPtr = ::std::shared_ptr<ACTION_NAME##Result>; \
27  using ACTION_NAME##ResultConstPtr = ::std::shared_ptr<ACTION_NAME##Result const>; \
28  \
29  using ACTION_NAME##Feedback = typename ensenso_camera_msgs::action::ACTION_NAME::Feedback; \
30  using ACTION_NAME##FeedbackPtr = ::std::shared_ptr<ACTION_NAME##Feedback>; \
31  using ACTION_NAME##FeedbackConstPtr = ::std::shared_ptr<ACTION_NAME##Feedback const>; \
32  } \
33  }
34 #else
35 #define MAKE_SERVER(CallbackClass, ActionName, TopicName) \
36  ensenso::std::make_unique<ActionName##Server>(nh, TopicName, \
37  ensenso::std::bind(&CallbackClass::on##ActionName, this, _1));
38 
39 #define MAKE_MONO_SERVER(CallbackClass, ActionName, TopicName) \
40  ensenso::std::make_unique<ActionName##MonoServer>(nh, TopicName, \
41  ensenso::std::bind(&CallbackClass::on##ActionName, this, _1));
42 
43 // In ROS1 the pointer typedefs look like this:
44 // typedef boost::shared_ptr< ::ensenso_camera_msgs::AccessTreeAction_<ContainerAllocator> > Ptr;
45 // typedef boost::shared_ptr< ::ensenso_camera_msgs::AccessTreeAction_<ContainerAllocator> const> ConstPtr;
46 
47 #define USING_ENSENSO_CAMERA_ACTION(ACTION_NAME) \
48  namespace ensenso \
49  { \
50  namespace action \
51  { \
52  using ACTION_NAME##Action = ensenso_camera_msgs::ACTION_NAME##Action; \
53  using ACTION_NAME##ActionPtr = ensenso_camera_msgs::ACTION_NAME##ActionPtr; \
54  using ACTION_NAME##ActionConstPtr = ensenso_camera_msgs::ACTION_NAME##ActionConstPtr; \
55  \
56  using ACTION_NAME##Goal = ensenso_camera_msgs::ACTION_NAME##Goal; \
57  using ACTION_NAME##GoalPtr = ensenso_camera_msgs::ACTION_NAME##GoalPtr; \
58  using ACTION_NAME##GoalConstPtr = ensenso_camera_msgs::ACTION_NAME##GoalConstPtr; \
59  \
60  using ACTION_NAME##Result = ensenso_camera_msgs::ACTION_NAME##Result; \
61  using ACTION_NAME##ResultPtr = ensenso_camera_msgs::ACTION_NAME##ResultPtr; \
62  using ACTION_NAME##ResultConstPtr = ensenso_camera_msgs::ACTION_NAME##ResultConstPtr; \
63  \
64  using ACTION_NAME##Feedback = ensenso_camera_msgs::ACTION_NAME##Feedback; \
65  using ACTION_NAME##FeedbackPtr = ensenso_camera_msgs::ACTION_NAME##FeedbackPtr; \
66  using ACTION_NAME##FeedbackConstPtr = ensenso_camera_msgs::ACTION_NAME##FeedbackConstPtr; \
67  } \
68  }
69 #endif
70 
71 #define USING_ENSENSO_CAMERA_ACTION_WITH_SERVER(ACTION_NAME) \
72  USING_ENSENSO_CAMERA_ACTION(ACTION_NAME) \
73  using ACTION_NAME##Server = QueuedActionServer<ensenso::action::ACTION_NAME##Action>;


ensenso_camera
Author(s): Ensenso
autogenerated on Wed Apr 2 2025 02:37:46