-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi_data_t.java
177 lines (142 loc) · 4.74 KB
/
spi_data_t.java
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/* LCM type definition class file
* This file was automatically generated by lcm-gen
* DO NOT MODIFY BY HAND!!!!
*/
package lcmtypes;
import java.io.*;
import java.util.*;
import lcm.lcm.*;
public final class spi_data_t implements lcm.lcm.LCMEncodable
{
public float q_abad[];
public float q_hip[];
public float q_knee[];
public float qd_abad[];
public float qd_hip[];
public float qd_knee[];
public int flags[];
public int spi_driver_status;
public spi_data_t()
{
q_abad = new float[4];
q_hip = new float[4];
q_knee = new float[4];
qd_abad = new float[4];
qd_hip = new float[4];
qd_knee = new float[4];
flags = new int[4];
}
public static final long LCM_FINGERPRINT;
public static final long LCM_FINGERPRINT_BASE = 0x9d2fa835a926bf27L;
static {
LCM_FINGERPRINT = _hashRecursive(new ArrayList<Class<?>>());
}
public static long _hashRecursive(ArrayList<Class<?>> classes)
{
if (classes.contains(lcmtypes.spi_data_t.class))
return 0L;
classes.add(lcmtypes.spi_data_t.class);
long hash = LCM_FINGERPRINT_BASE
;
classes.remove(classes.size() - 1);
return (hash<<1) + ((hash>>63)&1);
}
public void encode(DataOutput outs) throws IOException
{
outs.writeLong(LCM_FINGERPRINT);
_encodeRecursive(outs);
}
public void _encodeRecursive(DataOutput outs) throws IOException
{
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.q_abad[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.q_hip[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.q_knee[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.qd_abad[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.qd_hip[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeFloat(this.qd_knee[a]);
}
for (int a = 0; a < 4; a++) {
outs.writeInt(this.flags[a]);
}
outs.writeInt(this.spi_driver_status);
}
public spi_data_t(byte[] data) throws IOException
{
this(new LCMDataInputStream(data));
}
public spi_data_t(DataInput ins) throws IOException
{
if (ins.readLong() != LCM_FINGERPRINT)
throw new IOException("LCM Decode error: bad fingerprint");
_decodeRecursive(ins);
}
public static lcmtypes.spi_data_t _decodeRecursiveFactory(DataInput ins) throws IOException
{
lcmtypes.spi_data_t o = new lcmtypes.spi_data_t();
o._decodeRecursive(ins);
return o;
}
public void _decodeRecursive(DataInput ins) throws IOException
{
this.q_abad = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.q_abad[a] = ins.readFloat();
}
this.q_hip = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.q_hip[a] = ins.readFloat();
}
this.q_knee = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.q_knee[a] = ins.readFloat();
}
this.qd_abad = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.qd_abad[a] = ins.readFloat();
}
this.qd_hip = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.qd_hip[a] = ins.readFloat();
}
this.qd_knee = new float[(int) 4];
for (int a = 0; a < 4; a++) {
this.qd_knee[a] = ins.readFloat();
}
this.flags = new int[(int) 4];
for (int a = 0; a < 4; a++) {
this.flags[a] = ins.readInt();
}
this.spi_driver_status = ins.readInt();
}
public lcmtypes.spi_data_t copy()
{
lcmtypes.spi_data_t outobj = new lcmtypes.spi_data_t();
outobj.q_abad = new float[(int) 4];
System.arraycopy(this.q_abad, 0, outobj.q_abad, 0, 4);
outobj.q_hip = new float[(int) 4];
System.arraycopy(this.q_hip, 0, outobj.q_hip, 0, 4);
outobj.q_knee = new float[(int) 4];
System.arraycopy(this.q_knee, 0, outobj.q_knee, 0, 4);
outobj.qd_abad = new float[(int) 4];
System.arraycopy(this.qd_abad, 0, outobj.qd_abad, 0, 4);
outobj.qd_hip = new float[(int) 4];
System.arraycopy(this.qd_hip, 0, outobj.qd_hip, 0, 4);
outobj.qd_knee = new float[(int) 4];
System.arraycopy(this.qd_knee, 0, outobj.qd_knee, 0, 4);
outobj.flags = new int[(int) 4];
System.arraycopy(this.flags, 0, outobj.flags, 0, 4);
outobj.spi_driver_status = this.spi_driver_status;
return outobj;
}
}