-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEulerSegment.java
More file actions
35 lines (30 loc) · 805 Bytes
/
EulerSegment.java
File metadata and controls
35 lines (30 loc) · 805 Bytes
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
import java.nio.ByteBuffer;
/**
* Created by C. Andrews on 6/2/17.
*/
public class EulerSegment {
public int segmentId;
public float x;
public float y;
public float z;
public float rx;
public float ry;
public float rz;
/**
* Create a new segment by reading the appropriate data out of the passed in ByteBuffer.
*
* @param buffer a ByteBuffer containing pose data
*/
public EulerSegment(ByteBuffer buffer){
segmentId = buffer.getInt();
x = buffer.getFloat();
y = buffer.getFloat();
z = buffer.getFloat();
rx = buffer.getFloat();
ry = buffer.getFloat();
rz = buffer.getFloat();
}
public String toString(){
return String.format("%d (%f, %f, %f)",segmentId, x,y,z);
}
}