-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotomo.proto
87 lines (72 loc) · 1.37 KB
/
otomo.proto
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
syntax = "proto3";
import "google/protobuf/timestamp.proto";
package otomo;
option java_outer_classname = "OtomoProto";
message TopMsg {
oneof msg {
Config config = 1;
Joystick joystick = 2;
FanControl fan = 3;
RobotState state = 4;
DriveResponse drive_response = 5;
Pid pid = 6;
Imu imu = 7;
Battery battery = 8;
DiffDrive diff_drive = 10;
}
}
message Config {
LogLevel new_level = 1;
google.protobuf.Timestamp set_time = 2;
}
message Joystick {
float heading = 1;
float speed = 2;
}
message DiffDrive {
float left_motor = 1;
float right_motor = 2;
}
message DriveResponse {
bool ok = 1;
}
message FanControl {
bool on = 1;
}
message MotorState {
float angular_velocity = 1;
float encoder = 2;
}
message RobotState {
MotorState left_motor = 1;
MotorState right_motor = 2;
bool fan_on = 3;
bool e_stop = 4;
}
message Pid {
float p = 1;
float i = 2;
float d = 3;
}
enum LogLevel {
TRACE = 0;
DEBUG = 1;
INFO = 2;
WARN = 3;
ERROR = 4;
}
message Vector3 {
float x = 1;
float y = 2;
float z = 3;
}
message Imu {
Vector3 gyro = 1;
Vector3 accel = 2;
}
// Don't use a repeated here to save on memory on the embedded device
message Battery {
float cell0 = 1;
float cell1 = 2;
float cell2 = 3;
}