ATOS
commandchannels.hpp
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 #pragma once
7 
8 #include "roschannel.hpp"
9 #include "std_msgs/msg/empty.hpp"
10 #include "std_msgs/msg/u_int8.hpp"
11 #include "std_msgs/msg/string.hpp"
12 #include "atos_interfaces/msg/object_id_array.hpp"
13 #include "atos_interfaces/msg/object_trigger_start.hpp"
14 
16 namespace ROSChannels {
17  namespace Init {
18  const std::string topicName = "init";
19  using message_type = std_msgs::msg::Empty;
20  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
21 
22  class Pub : public BasePub<message_type> {
23  public:
24  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
25  };
26 
27  class Sub : public BaseSub<message_type> {
28  public:
29  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
30  };
31  }
32 
33  namespace Connect {
34  const std::string topicName = "connect";
35  using message_type = std_msgs::msg::Empty;
36  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
37 
38  class Pub : public BasePub<message_type> {
39  public:
40  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
41  };
42 
43  class Sub : public BaseSub<message_type> {
44  public:
45  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
46  };
47  }
48 
49  namespace Arm {
50  const std::string topicName = "arm";
51  using message_type = std_msgs::msg::Empty;
52  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
53 
54  class Pub : public BasePub<message_type> {
55  public:
56  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
57  };
58 
59  class Sub : public BaseSub<message_type> {
60  public:
61  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
62  };
63  }
64 
65  namespace Disarm {
66  const std::string topicName = "disarm";
67  using message_type = std_msgs::msg::Empty;
68  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
69 
70  class Pub : public BasePub<message_type> {
71  public:
72  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
73  };
74 
75  class Sub : public BaseSub<message_type> {
76  public:
77  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
78  };
79  }
80 
81  namespace Start {
82  const std::string topicName = "start";
83  using message_type = std_msgs::msg::Empty;
84  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
85 
86  class Pub : public BasePub<message_type> {
87  public:
88  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
89  };
90 
91  class Sub : public BaseSub<message_type> {
92  public:
93  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
94  };
95  }
96 
97  namespace StartObject {
98  const std::string topicName = "start_object";
99  using message_type = atos_interfaces::msg::ObjectTriggerStart;
100 
101  class Pub : public BasePub<message_type> {
102  public:
103  Pub(rclcpp::Node& node) :
104  BasePub<message_type>(node, topicName) {}
105  };
106 
107  class Sub : public BaseSub<message_type> {
108  public:
109  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback) : BaseSub<message_type>(node, topicName, callback) {}
110  };
111  }
112 
113  namespace Stop {
114  const std::string topicName = "stop";
115  using message_type = std_msgs::msg::Empty;
116  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
117 
118  class Pub : public BasePub<message_type> {
119  public:
120  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
121  };
122 
123  class Sub : public BaseSub<message_type> {
124  public:
125  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
126  };
127  }
128 
129  namespace Disconnect {
130  const std::string topicName = "disconnect";
131  using message_type = std_msgs::msg::Empty;
132  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
133 
134  class Pub : public BasePub<message_type> {
135  public:
136  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
137  };
138 
139  class Sub : public BaseSub<message_type> {
140  public:
141  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
142  };
143  }
144 
145  namespace Failure {
146  const std::string topicName = "failure";
147  using message_type = std_msgs::msg::UInt8;
148  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
149 
150  class Pub : public BasePub<message_type> {
151  public:
152  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
153  };
154 
155  class Sub : public BaseSub<message_type> {
156  public:
157  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
158  };
159  }
160 
161  namespace GetStatus {
162  const std::string topicName = "get_status";
163  using message_type = std_msgs::msg::Empty;
164  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
165 
166  class Pub : public BasePub<message_type> {
167  public:
168  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
169  };
170 
171  class Sub : public BaseSub<message_type> {
172  public:
173  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
174  };
175  }
176 
177  namespace GetStatusResponse {
178  const std::string topicName = "get_status_response";
179  using message_type = std_msgs::msg::String;
180  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
181 
182  class Pub : public BasePub<message_type> {
183  public:
184  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
185  };
186 
187  class Sub : public BaseSub<message_type> {
188  public:
189  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
190  };
191  }
192 
193  namespace AllClear {
194  const std::string topicName = "all_clear";
195  using message_type = std_msgs::msg::Empty;
196  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
197 
198  class Pub : public BasePub<message_type> {
199  public:
200  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
201  };
202 
203  class Sub : public BaseSub<message_type> {
204  public:
205  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
206  };
207  }
208 
209  namespace Abort {
210  const std::string topicName = "abort";
211  using message_type = std_msgs::msg::Empty;
212  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
213 
214  class Pub : public BasePub<message_type> {
215  public:
216  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
217  };
218 
219  class Sub : public BaseSub<message_type> {
220  public:
221  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
222  };
223  }
224 
225  namespace Exit {
226  const std::string topicName = "exit";
227  using message_type = std_msgs::msg::Empty;
228  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
229 
230  class Pub : public BasePub<message_type> {
231  public:
232  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
233  };
234 
235  class Sub : public BaseSub<message_type> {
236  public:
237  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
238  };
239  }
240 
241  namespace Replay {
242  const std::string topicName = "replay";
243  using message_type = std_msgs::msg::Empty;
244  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
245 
246  class Pub : public BasePub<message_type> {
247  public:
248  Pub(rclcpp::Node& node, const rclcpp::QoS& qos = defaultQoS) : BasePub<message_type>(node, topicName, qos) {}
249  };
250 
251  class Sub : public BaseSub<message_type> {
252  public:
253  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback, const rclcpp::QoS& qos = defaultQoS) : BaseSub<message_type>(node, topicName, callback, qos) {}
254  };
255  }
256 
257  namespace ObjectsConnected {
258  const std::string topicName = "objects_connected";
259  using message_type = std_msgs::msg::Empty;
260  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
261 
262  class Pub : public BasePub<message_type> {
263  public:
264  Pub(rclcpp::Node& node) : BasePub<message_type>(node, topicName) {}
265  };
266 
267  class Sub : public BaseSub<message_type> {
268  public:
269  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback) : BaseSub<message_type>(node, topicName, callback) {}
270  };
271  }
272 
273  namespace ConnectedObjectIds {
274  const std::string topicName = "connected_object_ids";
275  using message_type = atos_interfaces::msg::ObjectIdArray;
276  const rclcpp::QoS defaultQoS = rclcpp::QoS(rclcpp::KeepAll());
277 
278  class Pub : public BasePub<message_type> {
279  public:
280  Pub(rclcpp::Node& node) : BasePub<message_type>(node, topicName) {}
281  };
282 
283  class Sub : public BaseSub<message_type> {
284  public:
285  Sub(rclcpp::Node& node, std::function<void(const message_type::SharedPtr)> callback) : BaseSub<message_type>(node, topicName, callback) {}
286  };
287  }
288 }
Definition: commandchannels.hpp:214
Definition: commandchannels.hpp:219
Definition: commandchannels.hpp:198
Definition: commandchannels.hpp:203
Definition: commandchannels.hpp:54
Definition: commandchannels.hpp:59
Definition: roschannel.hpp:15
Definition: roschannel.hpp:27
Definition: commandchannels.hpp:38
Definition: commandchannels.hpp:43
Definition: commandchannels.hpp:278
Definition: commandchannels.hpp:283
Definition: commandchannels.hpp:70
Definition: commandchannels.hpp:75
Definition: commandchannels.hpp:134
Definition: commandchannels.hpp:139
Definition: commandchannels.hpp:230
Definition: commandchannels.hpp:235
Definition: commandchannels.hpp:150
Definition: commandchannels.hpp:155
Definition: commandchannels.hpp:182
Definition: commandchannels.hpp:187
Definition: commandchannels.hpp:166
Definition: commandchannels.hpp:171
Definition: commandchannels.hpp:22
Definition: commandchannels.hpp:27
Definition: commandchannels.hpp:262
Definition: commandchannels.hpp:267
Definition: commandchannels.hpp:246
Definition: commandchannels.hpp:251
Definition: commandchannels.hpp:101
Definition: commandchannels.hpp:107
Definition: commandchannels.hpp:86
Definition: commandchannels.hpp:91
Definition: commandchannels.hpp:118
Definition: commandchannels.hpp:123
ROSChannels namespace.
Definition: cartesiantrajectorychannel.hpp:11