aboutsummaryrefslogtreecommitdiff
path: root/elegoo.proto
blob: c34fbc08cdab743456cd7023763469f8fca61da5 (plain)
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
syntax = "proto3";

package elegoo;

// Command send to car
message Command {
	// Set speed
	Speed Speed = 1;
	// Rotate sonar head degree: -90 right .. +90 left
	sint32 Look = 2;
}

// Speed command
message Speed {
	// Left motor speed: -255 .. +255
	sint32 L = 1;
	// Right motor speed: -255 .. +255
	sint32 R = 2;
	// Stop after milliseconds, ignored if set to 0
	uint32 StopAfter = 3;
}

// Event recieved from car
message Event {
	// TimeStamp in milliseconds
	uint32 TimeStamp = 1;
	// Sonar sensor head
	Sonar Head = 2;
	// Infrared sensors
	Sensor Sensor = 3;
	// Remote control
	Remote Remote = 4;
}

// Sonar event
message Sonar {
	// Distance in centimeter
	uint32 Distance = 1;
	// Head Direction in degree
	sint32 Direction = 2;
}

// Infrared sensors event
message Sensor {
	bool R = 1;
	bool C = 2;
	bool L = 3;
}

// Remote control event
message Remote {
	uint32 Key = 1;
}