-
Notifications
You must be signed in to change notification settings - Fork 110
/
messages.go
75 lines (65 loc) · 1.89 KB
/
messages.go
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
// Package ros implements functionality that bridges the gap between `rdk` and ROS
package ros
// TimeStamp contains the timestamp expressed as:
// * TimeStamp.Secs: seconds since epoch
// * TimeStamp.Nsecs: nanoseconds since TimeStamp.Secs.
type TimeStamp struct {
Secs int
Nsecs int
}
// MultiArrayDimension is a ROS std_msgs/MultiArrayDimension message.
type MultiArrayDimension struct {
Label string
Size uint32
Stride uint32
}
// MultiArrayLayout is a ROS std_msgs/MultiArrayLayout message.
type MultiArrayLayout struct {
Dim []MultiArrayDimension
DataOffset int `json:"data_offset"`
}
// ByteMultiArray is a ROS std_msgs/ByteMultiArray message.
type ByteMultiArray struct {
Layout MultiArrayLayout
Data []byte
}
// MessageHeader is a ROS std_msgs/Header message.
type MessageHeader struct {
Seq int
Stamp TimeStamp
FrameID string `json:"frame_id"`
}
// Quaternion is a ROS geometry_msgs/Quaternion message.
type Quaternion struct {
X float64
Y float64
Z float64
W float64
}
// Vector3 is a ROS geometry_msgs/Vector3 message.
type Vector3 struct {
X float64
Y float64
Z float64
}
// L515Message reflects the JSON data format for rosbag Intel Realsense data.
type L515Message struct {
Meta TimeStamp
ColorData ByteMultiArray
DepthData ByteMultiArray
}
// ImuData contains the IMU data.
type ImuData struct {
Header MessageHeader
Orientation Quaternion
OrientationCovariance [9]int `json:"orientation_covariance"`
AngularVelocity Vector3 `json:"angular_velocity"`
AngularVelocityCovariance [9]int `json:"angular_velocity_covariance"`
LinearAcceleration Vector3 `json:"linear_acceleration"`
LinearAccelerationCovariance [9]int `json:"linear_acceleration_covariance"`
}
// ImuMessage reflects the JSON data format for rosbag imu data.
type ImuMessage struct {
Meta TimeStamp
Data ImuData
}