forked from vislab-tecnico-lisboa/KinectBody2Yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTickTime.h
103 lines (83 loc) · 2.77 KB
/
TickTime.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// This is an automatically generated file.
// Generated from this TickTime.msg definition:
// Instances of this class can be read and written with YARP ports,
// using a ROS-compatible format.
#ifndef YARPMSG_TYPE_TickTime
#define YARPMSG_TYPE_TickTime
#include <string>
#include <vector>
#include <yarp/os/Wire.h>
#include <yarp/os/idl/WireTypes.h>
#include "FloorPlane.h"
#include "geometry_msgs_Point.h"
#include "geometry_msgs_Quaternion.h"
#include "geometry_msgs_Pose.h"
#include "JointROSmsg.h"
#include "Body.h"
class TickTime : public yarp::os::idl::WirePortable {
public:
yarp::os::NetUint32 sec;
yarp::os::NetUint32 nsec;
TickTime() {
}
bool readBare(yarp::os::ConnectionReader& connection) {
// *** sec ***
sec = connection.expectInt();
// *** nsec ***
nsec = connection.expectInt();
return !connection.isError();
}
bool readBottle(yarp::os::ConnectionReader& connection) {
connection.convertTextMode();
yarp::os::idl::WireReader reader(connection);
if (!reader.readListHeader(2)) return false;
// *** sec ***
sec = reader.expectInt();
// *** nsec ***
nsec = reader.expectInt();
return !connection.isError();
}
bool read(yarp::os::ConnectionReader& connection) {
if (connection.isBareMode()) return readBare(connection);
return readBottle(connection);
}
bool writeBare(yarp::os::ConnectionWriter& connection) {
// *** sec ***
connection.appendInt(sec);
// *** nsec ***
connection.appendInt(nsec);
return !connection.isError();
}
bool writeBottle(yarp::os::ConnectionWriter& connection) {
connection.appendInt(BOTTLE_TAG_LIST);
connection.appendInt(2);
// *** sec ***
connection.appendInt(BOTTLE_TAG_INT);
connection.appendInt((int)sec);
// *** nsec ***
connection.appendInt(BOTTLE_TAG_INT);
connection.appendInt((int)nsec);
connection.convertTextMode();
return !connection.isError();
}
bool write(yarp::os::ConnectionWriter& connection) {
if (connection.isBareMode()) return writeBare(connection);
return writeBottle(connection);
}
// This class will serialize ROS style or YARP style depending on protocol.
// If you need to force a serialization style, use one of these classes:
typedef yarp::os::idl::BareStyle<TickTime> rosStyle;
typedef yarp::os::idl::BottleStyle<TickTime> bottleStyle;
// Give source text for class, ROS will need this
yarp::os::ConstString getTypeText() {
return "";
}
// Name the class, ROS will need this
yarp::os::Type getType() {
yarp::os::Type typ = yarp::os::Type::byName("TickTime","TickTime");
typ.addProperty("md5sum",yarp::os::Value("4f8dc7710c22b42c7b09295dcda33fa0"));
typ.addProperty("message_definition",yarp::os::Value(getTypeText()));
return typ;
}
};
#endif