YARP
Yet Another Robot Platform
MobileBaseVelocity.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_MOBILEBASEVELOCITY_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_MOBILEBASEVELOCITY_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 vel_x;
34  double vel_y;
38  double vel_theta;
39 
40  // Default constructor
42 
43  // Constructor with field values
44  MobileBaseVelocity(const double vel_x,
45  const double vel_y,
46  const double vel_theta);
47 
48  // Read structure on a Wire
49  bool read(yarp::os::idl::WireReader& reader) override;
50 
51  // Read structure on a Connection
52  bool read(yarp::os::ConnectionReader& connection) override;
53 
54  // Write structure on a Wire
55  bool write(const yarp::os::idl::WireWriter& writer) const override;
56 
57  // Write structure on a Connection
58  bool write(yarp::os::ConnectionWriter& connection) const override;
59 
60  // Convert to a printable string
61  std::string toString() const;
62 
63  // If you want to serialize this class without nesting, use this helper
65 
66  class Editor :
67  public yarp::os::Wire,
69  {
70  public:
71  // Editor: default constructor
72  Editor();
73 
74  // Editor: constructor with base class
76 
77  // Editor: destructor
78  ~Editor() override;
79 
80  // Editor: Deleted constructors and operator=
81  Editor(const Editor& rhs) = delete;
82  Editor(Editor&& rhs) = delete;
83  Editor& operator=(const Editor& rhs) = delete;
84  Editor& operator=(Editor&& rhs) = delete;
85 
86  // Editor: edit
87  bool edit(MobileBaseVelocity& obj, bool dirty = true);
88 
89  // Editor: validity check
90  bool isValid() const;
91 
92  // Editor: state
93  MobileBaseVelocity& state();
94 
95  // Editor: start editing
96  void start_editing();
97 
98 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
99  YARP_DEPRECATED_MSG("Use start_editing() instead")
100  void begin()
101  {
102  start_editing();
103  }
104 #endif // YARP_NO_DEPRECATED
105 
106  // Editor: stop editing
107  void stop_editing();
108 
109 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
110  YARP_DEPRECATED_MSG("Use stop_editing() instead")
111  void end()
112  {
113  stop_editing();
114  }
115 #endif // YARP_NO_DEPRECATED
116 
117  // Editor: vel_x field
118  void set_vel_x(const double vel_x);
119  double get_vel_x() const;
120  virtual bool will_set_vel_x();
121  virtual bool did_set_vel_x();
122 
123  // Editor: vel_y field
124  void set_vel_y(const double vel_y);
125  double get_vel_y() const;
126  virtual bool will_set_vel_y();
127  virtual bool did_set_vel_y();
128 
129  // Editor: vel_theta field
130  void set_vel_theta(const double vel_theta);
131  double get_vel_theta() const;
132  virtual bool will_set_vel_theta();
133  virtual bool did_set_vel_theta();
134 
135  // Editor: clean
136  void clean();
137 
138  // Editor: read
139  bool read(yarp::os::ConnectionReader& connection) override;
140 
141  // Editor: write
142  bool write(yarp::os::ConnectionWriter& connection) const override;
143 
144  private:
145  // Editor: state
146  MobileBaseVelocity* obj;
147  bool obj_owned;
148  int group;
149 
150  // Editor: dirty variables
151  bool is_dirty;
152  bool is_dirty_vel_x;
153  bool is_dirty_vel_y;
154  bool is_dirty_vel_theta;
155  int dirty_count;
156 
157  // Editor: send if possible
158  void communicate();
159 
160  // Editor: mark dirty overall
161  void mark_dirty();
162 
163  // Editor: mark dirty single fields
164  void mark_dirty_vel_x();
165  void mark_dirty_vel_y();
166  void mark_dirty_vel_theta();
167 
168  // Editor: dirty_flags
169  void dirty_flags(bool flag);
170  };
171 
172 private:
173  // read/write vel_x field
174  bool read_vel_x(yarp::os::idl::WireReader& reader);
175  bool write_vel_x(const yarp::os::idl::WireWriter& writer) const;
176  bool nested_read_vel_x(yarp::os::idl::WireReader& reader);
177  bool nested_write_vel_x(const yarp::os::idl::WireWriter& writer) const;
178 
179  // read/write vel_y field
180  bool read_vel_y(yarp::os::idl::WireReader& reader);
181  bool write_vel_y(const yarp::os::idl::WireWriter& writer) const;
182  bool nested_read_vel_y(yarp::os::idl::WireReader& reader);
183  bool nested_write_vel_y(const yarp::os::idl::WireWriter& writer) const;
184 
185  // read/write vel_theta field
186  bool read_vel_theta(yarp::os::idl::WireReader& reader);
187  bool write_vel_theta(const yarp::os::idl::WireWriter& writer) const;
188  bool nested_read_vel_theta(yarp::os::idl::WireReader& reader);
189  bool nested_write_vel_theta(const yarp::os::idl::WireWriter& writer) const;
190 };
191 
192 } // namespace yarp
193 } // namespace dev
194 
195 #endif // YARP_THRIFT_GENERATOR_STRUCT_MOBILEBASEVELOCITY_H
Editor & operator=(const Editor &rhs)=delete
Editor & operator=(Editor &&rhs)=delete
Editor(const Editor &rhs)=delete
double vel_theta
angular velocity of the robot [deg/s]
double vel_y
velocity of the robot [m/s]
yarp::os::idl::Unwrapped< MobileBaseVelocity > unwrapped
double vel_x
velocity of the robot [m/s]
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