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