Skip to content

Commit 3bbd95f

Browse files
authored
Merge pull request #19 from VU-ASE/breaking-feature/future-extensions
Future proof camera and imaging definitions
2 parents 3a16c47 + 042a261 commit 3bbd95f

42 files changed

Lines changed: 3037 additions & 4408 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

definitions/outputs/battery.proto

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ package protobuf_msgs;
55
option go_package = "ase/pb_outputs";
66

77
//
8-
// Messages that can be outputted by a battery sensor module
8+
// This is the message format that a battery service can send out. It contains information about the battery's current state.
99
//
10-
1110
message BatterySensorOutput {
12-
float currentOutputVoltage = 1;
13-
float warnVoltage = 2;
14-
float killVoltage = 3;
11+
float currentOutputVoltage = 1; // The current voltage of the battery in volts
12+
float warnVoltage = 2; // The voltage at which the framework will warn the user about low battery
13+
float killVoltage = 3; // The voltage at which the framework will shut down the debix to prevent undercharge
1514
}

definitions/outputs/camera.proto

Lines changed: 48 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,22 @@ package protobuf_msgs;
55
option 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
5924
enum 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
}

definitions/outputs/rpm.proto

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ package protobuf_msgs;
55
option go_package = "ase/pb_outputs";
66

77
//
8-
// Messages that can be output by the pwm-reader that
9-
// is connected to the RPM sensors of the motors.
8+
// This is the message format that a RPM sensor service can send out. It is deliberately left with many details, to allow
9+
// for different use cases.
1010
//
11-
1211
message RpmSensorOutput {
13-
float leftRpm = 1;
14-
float leftAngle = 2;
15-
float rightRpm = 3;
16-
float rightAngle = 4;
12+
MotorInformation leftMotor = 1;
13+
MotorInformation rightMotor = 2;
14+
}
15+
16+
message MotorInformation {
17+
// This is probably all the information you need to understand how the motor behaves
18+
float rpm = 1; // RPM
19+
float speed = 2; // Speed in m/s, as computed from the RPM
20+
21+
// More fine-grained details to (re)compute the RPM and speed or other parameters you are interested in
22+
uint32 ticks = 3; // Number of ticks since the last timer reset
23+
uint32 timeoutCount = 4; // Number of timeouts since the last timer reset, if this is greater than 0, the motor is not spinning
24+
uint32 sequenceNumber = 5; // Sequence number of the message, can be used to detect if the message is stale
1725
}

definitions/outputs/wrapper.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ message SensorOutput {
4141
ControllerOutput controllerOutput = 7;
4242
ImuSensorOutput imuOutput = 8;
4343
BatterySensorOutput batteryOutput = 9;
44-
RpmSensorOutput rpmOuput = 10;
44+
RpmSensorOutput rpmOutput = 10;
4545
LuxSensorOutput luxOutput = 11;
46-
LapTimeOutput laptimeOutput = 12;
4746
GenericIntScalar genericIntScalar = 13;
4847
GenericFloatScalar genericFloatScalar = 14;
4948
GenericBoolScalar genericBoolScalar = 15;

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/VU-ASE/rovercom
1+
module github.com/VU-ASE/rovercom/v2
22

33
go 1.21.6
44

packages/c/gen/outputs/battery.pb-c.h

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)