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