From cf1116e3cc7eb416a609d72191fc6cd6592fbc39 Mon Sep 17 00:00:00 2001 From: Levi Lesches Date: Fri, 7 Feb 2025 00:34:49 -0500 Subject: [PATCH 1/4] Moved Vision results to be with their associated frame (#37) --- core.proto | 2 ++ video.proto | 8 +++++++- vision.proto | 4 +--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core.proto b/core.proto index c1d5479..f1c5a15 100644 --- a/core.proto +++ b/core.proto @@ -27,4 +27,6 @@ enum Device { RELAY = 10; BASE_STATION = 11; ANTENNA = 12; + VISION = 13; + LIDAR = 14; } diff --git a/video.proto b/video.proto index 1977a52..1f70532 100644 --- a/video.proto +++ b/video.proto @@ -1,7 +1,8 @@ -// Version: 1.1 +// Version: 1.2 syntax = "proto3"; import "version.proto"; +import "vision.proto"; enum CameraStatus { CAMERA_STATUS_UNDEFINED = 0; @@ -78,9 +79,14 @@ message VideoData { /// The latest frame from this camera. bytes frame = 3; + /// The version of this video data. Version version = 4; + /// The path that a high-quality screenshot was saved to. string imagePath = 5; + + /// Any objects that were detected in the frame. + repeated DetectedObject detectedObjects = 6; } /// Make changes to a camera feed. diff --git a/vision.proto b/vision.proto index d114494..1834bf1 100644 --- a/vision.proto +++ b/vision.proto @@ -1,9 +1,8 @@ -// Version: 1.0 +// Version: 2.0 syntax = "proto3"; import "geometry.proto"; -import "video.proto"; enum DetectedObjectType { DETECTION_TYPE_UNDEFINED = 0; @@ -21,7 +20,6 @@ message DetectedObject { // What was detected DetectedObjectType objectType = 1; int32 arucoTagId = 2; - CameraName camera = 3; // Where it was detected float xPosition = 4; // -1 to +1 (left to right) From 3b9b16be708143f9f7472a0cfdbb7948e643b24a Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:17:24 -0500 Subject: [PATCH 2/4] Add lidar messages (#36) Co-authored-by: Levi Lesches --- lidar.proto | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lidar.proto diff --git a/lidar.proto b/lidar.proto new file mode 100644 index 0000000..137488d --- /dev/null +++ b/lidar.proto @@ -0,0 +1,19 @@ +// Version 1.0 +syntax = "proto3"; +import "version.proto"; + +message LidarCartesianPoint { + float x = 1; + float y = 2; +} + +message LidarPolarPoint { + float angle = 1; + float distance = 2; +} + +message LidarPointCloud { + repeated LidarCartesianPoint cartesian = 1; + repeated LidarPolarPoint polar = 2; + Version version = 3; +} \ No newline at end of file From 1aab700bbed9aae493ce4fd047c0383a87a24922 Mon Sep 17 00:00:00 2001 From: ruari-r Date: Tue, 11 Feb 2025 19:01:52 -0500 Subject: [PATCH 3/4] Setup support for auger commands in arm.proto --- arm.proto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arm.proto b/arm.proto index 4bd3168..56bbd00 100644 --- a/arm.proto +++ b/arm.proto @@ -42,6 +42,11 @@ message ArmCommand { Version version = 11; } +message AugerData { + int32 speedActual = 1; + BoolState augerOn = 2; +} + message GripperData { MotorData lift = 1; MotorData rotate = 2; @@ -50,6 +55,17 @@ message GripperData { Version version = 4; int32 servoAngle = 5; BoolState laserState = 6; + + AugerData augerData = 7; +} + +message AugerCommand { + float augerSpeed = 1; + + // Indicates that [augerSpeed] = 0 is valid, even though 0 usually means no value. + bool speedSet = 2; + + BoolState augerOn = 3; } message GripperCommand { @@ -70,4 +86,6 @@ message GripperCommand { Version version = 9; int32 servoAngle = 10; BoolState laserState = 11; + + AugerCommand auger = 12; } From 4f655bd54c04cbf52d43f1a5cb2a4461ef695494 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Wed, 12 Feb 2025 04:32:01 -0500 Subject: [PATCH 4/4] Fix vision messages (#35) - The message didn't account for one camera being able to detect multiple targets per frame - CenterX and CenterY is necessary for mallet detection --- vision.proto | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vision.proto b/vision.proto index 1834bf1..b5bf89b 100644 --- a/vision.proto +++ b/vision.proto @@ -12,8 +12,8 @@ enum DetectedObjectType { } message PnpResult { - Pose3d pose = 1; - double error = 2; + Pose3d cameraToTarget = 1; + double reprojectionError = 2; } message DetectedObject { @@ -25,11 +25,14 @@ message DetectedObject { float xPosition = 4; // -1 to +1 (left to right) float relativeSize = 5; // 0 to 1 (percent of frame) - // Experimental: Use pinhole model to find the object's position - float yaw = 6; - float pitch = 7; + int32 centerX = 6; + int32 centerY = 7; + + // Experimental: Use pinhole camera model to find the object's position + float yaw = 8; + float pitch = 9; // Experimental: Use PnP to determine the 3D pose - PnpResult bestPnpResult = 8; - PnpResult alternatePnpResult = 9; + PnpResult bestPnpResult = 10; + PnpResult alternatePnpResult = 11; }