YARP
Yet Another Robot Platform
OdometryData.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 // Autogenerated by Thrift Compiler (0.14.1-yarped)
7 //
8 // This is an automatically generated file.
9 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10 
11 #ifndef YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 
19 namespace yarp {
20 namespace dev {
21 
24 {
25 public:
26  // Fields
30  double odom_x;
34  double odom_y;
38  double odom_theta;
42  double base_vel_x;
46  double base_vel_y;
54  double odom_vel_x;
58  double odom_vel_y;
63 
64  // Default constructor
65  OdometryData();
66 
67  // Constructor with field values
68  OdometryData(const double odom_x,
69  const double odom_y,
70  const double odom_theta,
71  const double base_vel_x,
72  const double base_vel_y,
73  const double base_vel_theta,
74  const double odom_vel_x,
75  const double odom_vel_y,
76  const double odom_vel_theta);
77 
78  // Read structure on a Wire
79  bool read(yarp::os::idl::WireReader& reader) override;
80 
81  // Read structure on a Connection
82  bool read(yarp::os::ConnectionReader& connection) override;
83 
84  // Write structure on a Wire
85  bool write(const yarp::os::idl::WireWriter& writer) const override;
86 
87  // Write structure on a Connection
88  bool write(yarp::os::ConnectionWriter& connection) const override;
89 
90  // Convert to a printable string
91  std::string toString() const;
92 
93  // If you want to serialize this class without nesting, use this helper
95 
96  class Editor :
97  public yarp::os::Wire,
99  {
100  public:
101  // Editor: default constructor
102  Editor();
103 
104  // Editor: constructor with base class
105  Editor(OdometryData& obj);
106 
107  // Editor: destructor
108  ~Editor() override;
109 
110  // Editor: Deleted constructors and operator=
111  Editor(const Editor& rhs) = delete;
112  Editor(Editor&& rhs) = delete;
113  Editor& operator=(const Editor& rhs) = delete;
114  Editor& operator=(Editor&& rhs) = delete;
115 
116  // Editor: edit
117  bool edit(OdometryData& obj, bool dirty = true);
118 
119  // Editor: validity check
120  bool isValid() const;
121 
122  // Editor: state
123  OdometryData& state();
124 
125  // Editor: start editing
126  void start_editing();
127 
128 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
129  YARP_DEPRECATED_MSG("Use start_editing() instead")
130  void begin()
131  {
132  start_editing();
133  }
134 #endif // YARP_NO_DEPRECATED
135 
136  // Editor: stop editing
137  void stop_editing();
138 
139 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
140  YARP_DEPRECATED_MSG("Use stop_editing() instead")
141  void end()
142  {
143  stop_editing();
144  }
145 #endif // YARP_NO_DEPRECATED
146 
147  // Editor: odom_x field
148  void set_odom_x(const double odom_x);
149  double get_odom_x() const;
150  virtual bool will_set_odom_x();
151  virtual bool did_set_odom_x();
152 
153  // Editor: odom_y field
154  void set_odom_y(const double odom_y);
155  double get_odom_y() const;
156  virtual bool will_set_odom_y();
157  virtual bool did_set_odom_y();
158 
159  // Editor: odom_theta field
160  void set_odom_theta(const double odom_theta);
161  double get_odom_theta() const;
162  virtual bool will_set_odom_theta();
163  virtual bool did_set_odom_theta();
164 
165  // Editor: base_vel_x field
166  void set_base_vel_x(const double base_vel_x);
167  double get_base_vel_x() const;
168  virtual bool will_set_base_vel_x();
169  virtual bool did_set_base_vel_x();
170 
171  // Editor: base_vel_y field
172  void set_base_vel_y(const double base_vel_y);
173  double get_base_vel_y() const;
174  virtual bool will_set_base_vel_y();
175  virtual bool did_set_base_vel_y();
176 
177  // Editor: base_vel_theta field
178  void set_base_vel_theta(const double base_vel_theta);
179  double get_base_vel_theta() const;
180  virtual bool will_set_base_vel_theta();
181  virtual bool did_set_base_vel_theta();
182 
183  // Editor: odom_vel_x field
184  void set_odom_vel_x(const double odom_vel_x);
185  double get_odom_vel_x() const;
186  virtual bool will_set_odom_vel_x();
187  virtual bool did_set_odom_vel_x();
188 
189  // Editor: odom_vel_y field
190  void set_odom_vel_y(const double odom_vel_y);
191  double get_odom_vel_y() const;
192  virtual bool will_set_odom_vel_y();
193  virtual bool did_set_odom_vel_y();
194 
195  // Editor: odom_vel_theta field
196  void set_odom_vel_theta(const double odom_vel_theta);
197  double get_odom_vel_theta() const;
198  virtual bool will_set_odom_vel_theta();
199  virtual bool did_set_odom_vel_theta();
200 
201  // Editor: clean
202  void clean();
203 
204  // Editor: read
205  bool read(yarp::os::ConnectionReader& connection) override;
206 
207  // Editor: write
208  bool write(yarp::os::ConnectionWriter& connection) const override;
209 
210  private:
211  // Editor: state
212  OdometryData* obj;
213  bool obj_owned;
214  int group;
215 
216  // Editor: dirty variables
217  bool is_dirty;
218  bool is_dirty_odom_x;
219  bool is_dirty_odom_y;
220  bool is_dirty_odom_theta;
221  bool is_dirty_base_vel_x;
222  bool is_dirty_base_vel_y;
223  bool is_dirty_base_vel_theta;
224  bool is_dirty_odom_vel_x;
225  bool is_dirty_odom_vel_y;
226  bool is_dirty_odom_vel_theta;
227  int dirty_count;
228 
229  // Editor: send if possible
230  void communicate();
231 
232  // Editor: mark dirty overall
233  void mark_dirty();
234 
235  // Editor: mark dirty single fields
236  void mark_dirty_odom_x();
237  void mark_dirty_odom_y();
238  void mark_dirty_odom_theta();
239  void mark_dirty_base_vel_x();
240  void mark_dirty_base_vel_y();
241  void mark_dirty_base_vel_theta();
242  void mark_dirty_odom_vel_x();
243  void mark_dirty_odom_vel_y();
244  void mark_dirty_odom_vel_theta();
245 
246  // Editor: dirty_flags
247  void dirty_flags(bool flag);
248  };
249 
250 private:
251  // read/write odom_x field
252  bool read_odom_x(yarp::os::idl::WireReader& reader);
253  bool write_odom_x(const yarp::os::idl::WireWriter& writer) const;
254  bool nested_read_odom_x(yarp::os::idl::WireReader& reader);
255  bool nested_write_odom_x(const yarp::os::idl::WireWriter& writer) const;
256 
257  // read/write odom_y field
258  bool read_odom_y(yarp::os::idl::WireReader& reader);
259  bool write_odom_y(const yarp::os::idl::WireWriter& writer) const;
260  bool nested_read_odom_y(yarp::os::idl::WireReader& reader);
261  bool nested_write_odom_y(const yarp::os::idl::WireWriter& writer) const;
262 
263  // read/write odom_theta field
264  bool read_odom_theta(yarp::os::idl::WireReader& reader);
265  bool write_odom_theta(const yarp::os::idl::WireWriter& writer) const;
266  bool nested_read_odom_theta(yarp::os::idl::WireReader& reader);
267  bool nested_write_odom_theta(const yarp::os::idl::WireWriter& writer) const;
268 
269  // read/write base_vel_x field
270  bool read_base_vel_x(yarp::os::idl::WireReader& reader);
271  bool write_base_vel_x(const yarp::os::idl::WireWriter& writer) const;
272  bool nested_read_base_vel_x(yarp::os::idl::WireReader& reader);
273  bool nested_write_base_vel_x(const yarp::os::idl::WireWriter& writer) const;
274 
275  // read/write base_vel_y field
276  bool read_base_vel_y(yarp::os::idl::WireReader& reader);
277  bool write_base_vel_y(const yarp::os::idl::WireWriter& writer) const;
278  bool nested_read_base_vel_y(yarp::os::idl::WireReader& reader);
279  bool nested_write_base_vel_y(const yarp::os::idl::WireWriter& writer) const;
280 
281  // read/write base_vel_theta field
282  bool read_base_vel_theta(yarp::os::idl::WireReader& reader);
283  bool write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const;
284  bool nested_read_base_vel_theta(yarp::os::idl::WireReader& reader);
285  bool nested_write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const;
286 
287  // read/write odom_vel_x field
288  bool read_odom_vel_x(yarp::os::idl::WireReader& reader);
289  bool write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const;
290  bool nested_read_odom_vel_x(yarp::os::idl::WireReader& reader);
291  bool nested_write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const;
292 
293  // read/write odom_vel_y field
294  bool read_odom_vel_y(yarp::os::idl::WireReader& reader);
295  bool write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const;
296  bool nested_read_odom_vel_y(yarp::os::idl::WireReader& reader);
297  bool nested_write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const;
298 
299  // read/write odom_vel_theta field
300  bool read_odom_vel_theta(yarp::os::idl::WireReader& reader);
301  bool write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const;
302  bool nested_read_odom_vel_theta(yarp::os::idl::WireReader& reader);
303  bool nested_write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const;
304 };
305 
306 } // namespace yarp
307 } // namespace dev
308 
309 #endif // YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H
Editor & operator=(Editor &&rhs)=delete
Editor(const Editor &rhs)=delete
Editor(Editor &&rhs)=delete
Editor & operator=(const Editor &rhs)=delete
double base_vel_x
velocity of the robot [m/s] expressed in the robot reference frame
Definition: OdometryData.h:42
double odom_vel_y
velocity of the robot [m/s] expressed in the world reference frame
Definition: OdometryData.h:58
double base_vel_theta
angular velocity of the robot [deg/s] expressed in the robot reference frame
Definition: OdometryData.h:50
double odom_vel_theta
angular velocity of the robot [deg/s] expressed in the world reference frame
Definition: OdometryData.h:62
double base_vel_y
velocity of the robot [m/s] expressed in the robot reference frame
Definition: OdometryData.h:46
double odom_x
position of the robot [m], expressed in the world reference frame
Definition: OdometryData.h:30
double odom_y
position of the robot [m], expressed in the world reference frame
Definition: OdometryData.h:34
double odom_theta
orientation the robot [deg], expressed in the world reference frame
Definition: OdometryData.h:38
double odom_vel_x
velocity of the robot [m/s] expressed in the world reference frame
Definition: OdometryData.h:54
yarp::os::idl::Unwrapped< OdometryData > unwrapped
Definition: OdometryData.h:94
An interface for reading from a network connection.
An interface for writing to a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
Base class for IDL client/server.
Definition: Wire.h:19
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2885
std::string toString(const T &value)
convert an arbitrary type to string.
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:922
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1098
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18