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