@@ -5,57 +5,22 @@ package protobuf_msgs;
55option go_package = "ase/pb_outputs" ;
66
77//
8- // Messages that can be outputed by a camera module
8+ // This is the message format that a camera-like service can send out. For example, the official ASE imaging service
9+ // uses this output format. This can then be used by (for example) a controller, to determine how to steer, to stay
10+ // on the track, or to detect obstacles, intersections, etc.
911//
10-
11- message CanvasObject {
12- message Point {
13- uint32 x = 1 ;
14- uint32 y = 2 ;
15- }
16-
17- message Color {
18- uint32 r = 1 ;
19- uint32 g = 2 ;
20- uint32 b = 3 ;
21- uint32 a = 4 ;
22- }
23-
24- message Line {
25- Point start = 1 ;
26- Point end = 2 ;
27- uint32 width = 3 ;
28- Color color = 4 ;
29- }
30-
31- message Rectangle {
32- Point topLeft = 1 ;
33- Point bottomRight = 2 ;
34- uint32 width = 3 ;
35- Color color = 4 ;
36- }
37-
38- message Circle {
39- Point center = 1 ;
40- uint32 radius = 2 ;
41- uint32 width = 3 ;
42- Color color = 4 ;
43- }
44-
45- oneof object {
46- Line line = 1 ;
47- Rectangle rectangle = 2 ;
48- Circle circle = 3 ;
49- }
50- }
51-
52- message Canvas {
53- uint32 width = 1 ;
54- uint32 height = 2 ;
55- repeated CanvasObject objects = 3 ;
12+ message CameraSensorOutput {
13+ // Basic information, contains everything you need to know to steer and compute the middle of the track
14+ Resolution resolution = 1 ; // Resolution of the image in pixels
15+ repeated HorizontalScan horizontalScans = 2 ; // Horizontal scans of the track, where each scan returns the track edges it finds in the image
16+ repeated DetectedObjects detectedObjects = 3 ;
17+
18+ // Additional information that can be used to debug the image processing
19+ // if present, it is rendered in roverctl-web
20+ DebugFrame debugFrame = 4 ;
5621}
5722
58- // Possible Objects the Imaging Module may detect
23+ // Possible Objects the Imaging Service may detect
5924enum DetectedObjects {
6025 FINISH_LINE = 0 ; /* Finish_line_detected */
6126 OFF_TRACK = 1 ; /* Car no longer on the track */
@@ -69,34 +34,45 @@ enum DetectedObjects {
6934 S_TURN = 9 ; /* Detected S turn (double u turn) */
7035}
7136
72- //
73- // The following sensor outputs are specific to the sensor type, bring your own sensor and add your own output here!
74- //
75- message CameraSensorOutput {
76- // Defined by the Path Planner
77- message Trajectory {
78- message Point {
79- int32 x = 1 ;
80- int32 y = 2 ;
81- }
82- repeated Point points = 1 ;
83- uint32 width = 2 ;
84- uint32 height = 3 ;
85- }
37+ message Resolution {
38+ uint32 width = 1 ; // Width of the image in pixels
39+ uint32 height = 2 ; // Height of the image in pixels
40+ }
41+
42+ message HorizontalScan {
43+ uint32 xLeft = 1 ; // Leftmost point in the scan in pixels (is left edge of the track)
44+ uint32 xRight = 2 ; // Rightmost point in the scan in pixels (is right edge of the track)
45+ uint32 y = 3 ; // Y coordinate of the scan in pixels
46+ }
8647
87- Trajectory trajectory = 1 ;
48+ message DebugFrame {
49+ // (Compressed) JPEG image of the camera output, useful for debugging
50+ // just JPEG bytes, that will be rendered in roverctl-web
51+ bytes jpeg = 1 ;
52+ // A "canvas" that you can "draw" on, for example by placing points, these are also rendered in roverctl-web
53+ Canvas canvas = 5 ;
54+ }
8855
89- message DebugFrame {
90- bytes jpeg = 1 ;
91- // if image livestreaming is disabled, or imaging module wants to draw additional information on the image, it can be done here
92- Canvas canvas = 5 ;
56+ message CanvasObject {
57+ message Point {
58+ uint32 x = 1 ;
59+ uint32 y = 2 ;
9360 }
94-
95- DebugFrame debug_frame = 2 ;
9661
97- message Objects {
98- repeated DetectedObjects items = 1 ;
62+ message Circle {
63+ Point center = 1 ;
64+ uint32 radius = 2 ;
65+ uint32 width = 3 ;
9966 }
10067
101- Objects objects = 3 ;
68+ oneof object {
69+ Circle circle = 1 ;
70+ }
71+ }
72+
73+ message Canvas {
74+ // The width and height are a legacy feature, they should be the same as the resolution of the camera
75+ uint32 width = 1 ;
76+ uint32 height = 2 ;
77+ repeated CanvasObject objects = 3 ;
10278}
0 commit comments