YARP
Yet Another Robot Platform
NavSatStatus.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 // This is an automatically generated file.
7 
8 // Generated from the following "sensor_msgs/NavSatStatus" msg definition:
9 // # Navigation Satellite fix status for any Global Navigation Satellite System
10 //
11 // # Whether to output an augmented fix is determined by both the fix
12 // # type and the last time differential corrections were received. A
13 // # fix is valid when status >= STATUS_FIX.
14 //
15 // int8 STATUS_NO_FIX = -1 # unable to fix position
16 // int8 STATUS_FIX = 0 # unaugmented fix
17 // int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation
18 // int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation
19 //
20 // int8 status
21 //
22 // # Bits defining which Global Navigation Satellite System signals were
23 // # used by the receiver.
24 //
25 // uint16 SERVICE_GPS = 1
26 // uint16 SERVICE_GLONASS = 2
27 // uint16 SERVICE_COMPASS = 4 # includes BeiDou.
28 // uint16 SERVICE_GALILEO = 8
29 //
30 // uint16 service
31 // Instances of this class can be read and written with YARP ports,
32 // using a ROS-compatible format.
33 
34 #ifndef YARP_ROSMSG_sensor_msgs_NavSatStatus_h
35 #define YARP_ROSMSG_sensor_msgs_NavSatStatus_h
36 
37 #include <yarp/os/Wire.h>
38 #include <yarp/os/Type.h>
39 #include <yarp/os/idl/WireTypes.h>
40 #include <string>
41 #include <vector>
42 
43 namespace yarp {
44 namespace rosmsg {
45 namespace sensor_msgs {
46 
48 {
49 public:
50  static const std::int8_t STATUS_NO_FIX = -1;
51  static const std::int8_t STATUS_FIX = 0;
52  static const std::int8_t STATUS_SBAS_FIX = 1;
53  static const std::int8_t STATUS_GBAS_FIX = 2;
54  std::int8_t status;
55  static const std::uint16_t SERVICE_GPS = 1;
56  static const std::uint16_t SERVICE_GLONASS = 2;
57  static const std::uint16_t SERVICE_COMPASS = 4;
58  static const std::uint16_t SERVICE_GALILEO = 8;
59  std::uint16_t service;
60 
62  status(0),
63  service(0)
64  {
65  }
66 
67  void clear()
68  {
69  // *** STATUS_NO_FIX ***
70 
71  // *** STATUS_FIX ***
72 
73  // *** STATUS_SBAS_FIX ***
74 
75  // *** STATUS_GBAS_FIX ***
76 
77  // *** status ***
78  status = 0;
79 
80  // *** SERVICE_GPS ***
81 
82  // *** SERVICE_GLONASS ***
83 
84  // *** SERVICE_COMPASS ***
85 
86  // *** SERVICE_GALILEO ***
87 
88  // *** service ***
89  service = 0;
90  }
91 
92  bool readBare(yarp::os::ConnectionReader& connection) override
93  {
94  // *** status ***
95  status = connection.expectInt8();
96 
97  // *** service ***
98  service = connection.expectInt16();
99 
100  return !connection.isError();
101  }
102 
103  bool readBottle(yarp::os::ConnectionReader& connection) override
104  {
105  connection.convertTextMode();
106  yarp::os::idl::WireReader reader(connection);
107  if (!reader.readListHeader(10)) {
108  return false;
109  }
110 
111  // *** status ***
112  status = reader.expectInt8();
113 
114  // *** service ***
115  service = reader.expectInt16();
116 
117  return !connection.isError();
118  }
119 
121  bool read(yarp::os::ConnectionReader& connection) override
122  {
123  return (connection.isBareMode() ? readBare(connection)
124  : readBottle(connection));
125  }
126 
127  bool writeBare(yarp::os::ConnectionWriter& connection) const override
128  {
129  // *** status ***
130  connection.appendInt8(status);
131 
132  // *** service ***
133  connection.appendInt16(service);
134 
135  return !connection.isError();
136  }
137 
138  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
139  {
140  connection.appendInt32(BOTTLE_TAG_LIST);
141  connection.appendInt32(10);
142 
143  // *** status ***
144  connection.appendInt32(BOTTLE_TAG_INT8);
145  connection.appendInt8(status);
146 
147  // *** service ***
148  connection.appendInt32(BOTTLE_TAG_INT16);
149  connection.appendInt16(service);
150 
151  connection.convertTextMode();
152  return !connection.isError();
153  }
154 
156  bool write(yarp::os::ConnectionWriter& connection) const override
157  {
158  return (connection.isBareMode() ? writeBare(connection)
159  : writeBottle(connection));
160  }
161 
162  // This class will serialize ROS style or YARP style depending on protocol.
163  // If you need to force a serialization style, use one of these classes:
166 
167  // The name for this message, ROS will need this
168  static constexpr const char* typeName = "sensor_msgs/NavSatStatus";
169 
170  // The checksum for this message, ROS will need this
171  static constexpr const char* typeChecksum = "331cdbddfa4bc96ffc3b9ad98900a54c";
172 
173  // The source text for this message, ROS will need this
174  static constexpr const char* typeText = "\
175 # Navigation Satellite fix status for any Global Navigation Satellite System\n\
176 \n\
177 # Whether to output an augmented fix is determined by both the fix\n\
178 # type and the last time differential corrections were received. A\n\
179 # fix is valid when status >= STATUS_FIX.\n\
180 \n\
181 int8 STATUS_NO_FIX = -1 # unable to fix position\n\
182 int8 STATUS_FIX = 0 # unaugmented fix\n\
183 int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation\n\
184 int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation\n\
185 \n\
186 int8 status\n\
187 \n\
188 # Bits defining which Global Navigation Satellite System signals were\n\
189 # used by the receiver.\n\
190 \n\
191 uint16 SERVICE_GPS = 1\n\
192 uint16 SERVICE_GLONASS = 2\n\
193 uint16 SERVICE_COMPASS = 4 # includes BeiDou.\n\
194 uint16 SERVICE_GALILEO = 8\n\
195 \n\
196 uint16 service\n\
197 ";
198 
199  yarp::os::Type getType() const override
200  {
202  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
203  typ.addProperty("message_definition", yarp::os::Value(typeText));
204  return typ;
205  }
206 };
207 
208 } // namespace sensor_msgs
209 } // namespace rosmsg
210 } // namespace yarp
211 
212 #endif // YARP_ROSMSG_sensor_msgs_NavSatStatus_h
#define BOTTLE_TAG_INT8
Definition: Bottle.h:19
#define BOTTLE_TAG_INT16
Definition: Bottle.h:20
#define BOTTLE_TAG_LIST
Definition: Bottle.h:28
An interface for reading from a network connection.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual bool isError() const =0
virtual std::int16_t expectInt16()=0
Read a 16-bit integer from the network connection.
virtual std::int8_t expectInt8()=0
Read a 8-bit integer from the network connection.
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual void appendInt8(std::int8_t data)=0
Send a representation of a 8-bit integer to the network connection.
virtual void appendInt16(std::int16_t data)=0
Send a representation of a 16-bit integer to the network connection.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
static Type byName(const char *name)
Definition: Type.cpp:171
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:134
A single value (typically within a Bottle).
Definition: Value.h:45
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool write(const yarp::os::idl::WireWriter &writer) const
IDL-friendly connection reader.
Definition: WireReader.h:30
std::int8_t expectInt8()
Definition: WireReader.h:80
std::int16_t expectInt16()
Definition: WireReader.h:86
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: NavSatStatus.h:138
yarp::os::idl::BareStyle< yarp::rosmsg::sensor_msgs::NavSatStatus > rosStyle
Definition: NavSatStatus.h:164
static const std::uint16_t SERVICE_GPS
Definition: NavSatStatus.h:55
yarp::os::Type getType() const override
Definition: NavSatStatus.h:199
yarp::os::idl::BottleStyle< yarp::rosmsg::sensor_msgs::NavSatStatus > bottleStyle
Definition: NavSatStatus.h:165
static const std::int8_t STATUS_FIX
Definition: NavSatStatus.h:51
static const std::uint16_t SERVICE_GALILEO
Definition: NavSatStatus.h:58
static const std::int8_t STATUS_GBAS_FIX
Definition: NavSatStatus.h:53
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: NavSatStatus.h:156
static const std::int8_t STATUS_NO_FIX
Definition: NavSatStatus.h:50
static const std::uint16_t SERVICE_COMPASS
Definition: NavSatStatus.h:57
static const std::int8_t STATUS_SBAS_FIX
Definition: NavSatStatus.h:52
static const std::uint16_t SERVICE_GLONASS
Definition: NavSatStatus.h:56
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: NavSatStatus.h:121
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: NavSatStatus.h:127
static constexpr const char * typeName
Definition: NavSatStatus.h:168
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: NavSatStatus.h:92
static constexpr const char * typeText
Definition: NavSatStatus.h:174
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: NavSatStatus.h:103
static constexpr const char * typeChecksum
Definition: NavSatStatus.h:171
The main, catch-all namespace for YARP.
Definition: dirs.h:16