From 1515b472d82b46220be8c4dd3564c83bb7375df6 Mon Sep 17 00:00:00 2001 From: Sam Nosenzo Date: Thu, 23 May 2024 15:43:15 +0200 Subject: [PATCH] update ImageAnnotation coordinate fields with comment specifying the coordinate space --- .../exportTypeScriptSchemas.test.ts.snap | 15 ++++++++++++--- internal/schemas.ts | 9 ++++++--- ros_foxglove_msgs/ros1/CircleAnnotation.msg | 3 ++- ros_foxglove_msgs/ros1/PointsAnnotation.msg | 3 ++- ros_foxglove_msgs/ros1/TextAnnotation.msg | 3 ++- ros_foxglove_msgs/ros2/CircleAnnotation.msg | 3 ++- ros_foxglove_msgs/ros2/PointsAnnotation.msg | 3 ++- ros_foxglove_msgs/ros2/TextAnnotation.msg | 3 ++- schemas/README.md | 9 ++++++--- schemas/flatbuffer/CircleAnnotation.fbs | 3 ++- schemas/flatbuffer/PointsAnnotation.fbs | 3 ++- schemas/flatbuffer/TextAnnotation.fbs | 3 ++- schemas/jsonschema/CircleAnnotation.json | 2 +- schemas/jsonschema/ImageAnnotations.json | 6 +++--- schemas/jsonschema/PointsAnnotation.json | 2 +- schemas/jsonschema/TextAnnotation.json | 2 +- schemas/jsonschema/index.ts | 12 ++++++------ schemas/omgidl/foxglove/CircleAnnotation.idl | 3 ++- schemas/omgidl/foxglove/PointsAnnotation.idl | 3 ++- schemas/omgidl/foxglove/TextAnnotation.idl | 3 ++- schemas/proto/foxglove/CircleAnnotation.proto | 3 ++- schemas/proto/foxglove/PointsAnnotation.proto | 3 ++- schemas/proto/foxglove/TextAnnotation.proto | 3 ++- schemas/ros1/CircleAnnotation.msg | 3 ++- schemas/ros1/PointsAnnotation.msg | 3 ++- schemas/ros1/TextAnnotation.msg | 3 ++- schemas/ros2/CircleAnnotation.msg | 3 ++- schemas/ros2/PointsAnnotation.msg | 3 ++- schemas/ros2/TextAnnotation.msg | 3 ++- schemas/typescript/CircleAnnotation.ts | 5 ++++- schemas/typescript/PointsAnnotation.ts | 5 ++++- schemas/typescript/TextAnnotation.ts | 5 ++++- 32 files changed, 90 insertions(+), 45 deletions(-) diff --git a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap index 14bce990..ab591832 100644 --- a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap +++ b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap @@ -122,7 +122,10 @@ export type CircleAnnotation = { /** Timestamp of circle */ timestamp: Time; - /** Center of the circle in 2D image coordinates (pixels) */ + /** + * Center of the circle in 2D image coordinates (pixels). + * The coordinate uses the top-left corner of the top-left pixel of the image as the origin. + */ position: Point2; /** Circle diameter in pixels */ @@ -708,7 +711,10 @@ export type PointsAnnotation = { /** Type of points annotation to draw */ type: PointsAnnotationType; - /** Points in 2D image coordinates (pixels) */ + /** + * Points in 2D image coordinates (pixels). + * These coordinates use the top-left corner of the top-left pixel of the image as the origin. + */ points: Point2[]; /** Outline color */ @@ -857,7 +863,10 @@ export type TextAnnotation = { /** Timestamp of annotation */ timestamp: Time; - /** Bottom-left origin of the text label in 2D image coordinates (pixels) */ + /** + * Bottom-left origin of the text label in 2D image coordinates (pixels). + * The coordinate uses the top-left corner of the top-left pixel of the image as the origin. + */ position: Point2; /** Text to display */ diff --git a/internal/schemas.ts b/internal/schemas.ts index f0a44268..0e843931 100644 --- a/internal/schemas.ts +++ b/internal/schemas.ts @@ -1085,7 +1085,8 @@ const CircleAnnotation: FoxgloveMessageSchema = { { name: "position", type: { type: "nested", schema: Point2 }, - description: "Center of the circle in 2D image coordinates (pixels)", + description: + "Center of the circle in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", }, { name: "diameter", @@ -1147,7 +1148,8 @@ const PointsAnnotation: FoxgloveMessageSchema = { { name: "points", type: { type: "nested", schema: Point2 }, - description: "Points in 2D image coordinates (pixels)", + description: + "Points in 2D image coordinates (pixels).\nThese coordinates use the top-left corner of the top-left pixel of the image as the origin.", array: true, }, { @@ -1188,7 +1190,8 @@ const TextAnnotation: FoxgloveMessageSchema = { { name: "position", type: { type: "nested", schema: Point2 }, - description: "Bottom-left origin of the text label in 2D image coordinates (pixels)", + description: + "Bottom-left origin of the text label in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", }, { name: "text", diff --git a/ros_foxglove_msgs/ros1/CircleAnnotation.msg b/ros_foxglove_msgs/ros1/CircleAnnotation.msg index 5fa08f0a..fbbcd36c 100644 --- a/ros_foxglove_msgs/ros1/CircleAnnotation.msg +++ b/ros_foxglove_msgs/ros1/CircleAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of circle time timestamp -# Center of the circle in 2D image coordinates (pixels) +# Center of the circle in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Circle diameter in pixels diff --git a/ros_foxglove_msgs/ros1/PointsAnnotation.msg b/ros_foxglove_msgs/ros1/PointsAnnotation.msg index 123e4b81..25c67417 100644 --- a/ros_foxglove_msgs/ros1/PointsAnnotation.msg +++ b/ros_foxglove_msgs/ros1/PointsAnnotation.msg @@ -23,7 +23,8 @@ uint8 LINE_LIST=4 # Type of points annotation to draw uint8 type -# Points in 2D image coordinates (pixels) +# Points in 2D image coordinates (pixels). +# These coordinates use the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2[] points # Outline color diff --git a/ros_foxglove_msgs/ros1/TextAnnotation.msg b/ros_foxglove_msgs/ros1/TextAnnotation.msg index 36a960f8..e1054495 100644 --- a/ros_foxglove_msgs/ros1/TextAnnotation.msg +++ b/ros_foxglove_msgs/ros1/TextAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of annotation time timestamp -# Bottom-left origin of the text label in 2D image coordinates (pixels) +# Bottom-left origin of the text label in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Text to display diff --git a/ros_foxglove_msgs/ros2/CircleAnnotation.msg b/ros_foxglove_msgs/ros2/CircleAnnotation.msg index 4519ad1e..a14cb8a6 100644 --- a/ros_foxglove_msgs/ros2/CircleAnnotation.msg +++ b/ros_foxglove_msgs/ros2/CircleAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of circle builtin_interfaces/Time timestamp -# Center of the circle in 2D image coordinates (pixels) +# Center of the circle in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Circle diameter in pixels diff --git a/ros_foxglove_msgs/ros2/PointsAnnotation.msg b/ros_foxglove_msgs/ros2/PointsAnnotation.msg index 6f915c7e..a1bc59ed 100644 --- a/ros_foxglove_msgs/ros2/PointsAnnotation.msg +++ b/ros_foxglove_msgs/ros2/PointsAnnotation.msg @@ -23,7 +23,8 @@ uint8 LINE_LIST=4 # Type of points annotation to draw uint8 type -# Points in 2D image coordinates (pixels) +# Points in 2D image coordinates (pixels). +# These coordinates use the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2[] points # Outline color diff --git a/ros_foxglove_msgs/ros2/TextAnnotation.msg b/ros_foxglove_msgs/ros2/TextAnnotation.msg index ec19fc6a..4383c514 100644 --- a/ros_foxglove_msgs/ros2/TextAnnotation.msg +++ b/ros_foxglove_msgs/ros2/TextAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of annotation builtin_interfaces/Time timestamp -# Bottom-left origin of the text label in 2D image coordinates (pixels) +# Bottom-left origin of the text label in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Text to display diff --git a/schemas/README.md b/schemas/README.md index b397d807..984d50e3 100644 --- a/schemas/README.md +++ b/schemas/README.md @@ -427,7 +427,8 @@ Timestamp of circle -Center of the circle in 2D image coordinates (pixels) +Center of the circle in 2D image coordinates (pixels). +The coordinate uses the top-left corner of the top-left pixel of the image as the origin. @@ -1950,7 +1951,8 @@ Type of points annotation to draw -Points in 2D image coordinates (pixels) +Points in 2D image coordinates (pixels). +These coordinates use the top-left corner of the top-left pixel of the image as the origin. @@ -2683,7 +2685,8 @@ Timestamp of annotation -Bottom-left origin of the text label in 2D image coordinates (pixels) +Bottom-left origin of the text label in 2D image coordinates (pixels). +The coordinate uses the top-left corner of the top-left pixel of the image as the origin. diff --git a/schemas/flatbuffer/CircleAnnotation.fbs b/schemas/flatbuffer/CircleAnnotation.fbs index 312624ee..c95a6805 100644 --- a/schemas/flatbuffer/CircleAnnotation.fbs +++ b/schemas/flatbuffer/CircleAnnotation.fbs @@ -11,7 +11,8 @@ table CircleAnnotation { /// Timestamp of circle timestamp:Time (id: 0); - /// Center of the circle in 2D image coordinates (pixels) + /// Center of the circle in 2D image coordinates (pixels). + /// The coordinate uses the top-left corner of the top-left pixel of the image as the origin. position:foxglove.Point2 (id: 1); /// Circle diameter in pixels diff --git a/schemas/flatbuffer/PointsAnnotation.fbs b/schemas/flatbuffer/PointsAnnotation.fbs index e5559dc7..aeb3ea87 100644 --- a/schemas/flatbuffer/PointsAnnotation.fbs +++ b/schemas/flatbuffer/PointsAnnotation.fbs @@ -30,7 +30,8 @@ table PointsAnnotation { /// Type of points annotation to draw type:PointsAnnotationType (id: 1); - /// Points in 2D image coordinates (pixels) + /// Points in 2D image coordinates (pixels). + /// These coordinates use the top-left corner of the top-left pixel of the image as the origin. points:[foxglove.Point2] (id: 2); /// Outline color diff --git a/schemas/flatbuffer/TextAnnotation.fbs b/schemas/flatbuffer/TextAnnotation.fbs index 94d406a2..46d351d5 100644 --- a/schemas/flatbuffer/TextAnnotation.fbs +++ b/schemas/flatbuffer/TextAnnotation.fbs @@ -11,7 +11,8 @@ table TextAnnotation { /// Timestamp of annotation timestamp:Time (id: 0); - /// Bottom-left origin of the text label in 2D image coordinates (pixels) + /// Bottom-left origin of the text label in 2D image coordinates (pixels). + /// The coordinate uses the top-left corner of the top-left pixel of the image as the origin. position:foxglove.Point2 (id: 1); /// Text to display diff --git a/schemas/jsonschema/CircleAnnotation.json b/schemas/jsonschema/CircleAnnotation.json index 47c4ffd2..469b7c56 100644 --- a/schemas/jsonschema/CircleAnnotation.json +++ b/schemas/jsonschema/CircleAnnotation.json @@ -22,7 +22,7 @@ }, "position": { "title": "foxglove.Point2", - "description": "Center of the circle in 2D image coordinates (pixels)", + "description": "Center of the circle in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { diff --git a/schemas/jsonschema/ImageAnnotations.json b/schemas/jsonschema/ImageAnnotations.json index 7e8462b4..e0a67fd7 100644 --- a/schemas/jsonschema/ImageAnnotations.json +++ b/schemas/jsonschema/ImageAnnotations.json @@ -29,7 +29,7 @@ }, "position": { "title": "foxglove.Point2", - "description": "Center of the circle in 2D image coordinates (pixels)", + "description": "Center of the circle in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { @@ -170,7 +170,7 @@ } } }, - "description": "Points in 2D image coordinates (pixels)" + "description": "Points in 2D image coordinates (pixels).\nThese coordinates use the top-left corner of the top-left pixel of the image as the origin." }, "outline_color": { "title": "foxglove.Color", @@ -278,7 +278,7 @@ }, "position": { "title": "foxglove.Point2", - "description": "Bottom-left origin of the text label in 2D image coordinates (pixels)", + "description": "Bottom-left origin of the text label in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { diff --git a/schemas/jsonschema/PointsAnnotation.json b/schemas/jsonschema/PointsAnnotation.json index 0a9a5f55..0e310386 100644 --- a/schemas/jsonschema/PointsAnnotation.json +++ b/schemas/jsonschema/PointsAnnotation.json @@ -67,7 +67,7 @@ } } }, - "description": "Points in 2D image coordinates (pixels)" + "description": "Points in 2D image coordinates (pixels).\nThese coordinates use the top-left corner of the top-left pixel of the image as the origin." }, "outline_color": { "title": "foxglove.Color", diff --git a/schemas/jsonschema/TextAnnotation.json b/schemas/jsonschema/TextAnnotation.json index 3ee60f6d..119c2138 100644 --- a/schemas/jsonschema/TextAnnotation.json +++ b/schemas/jsonschema/TextAnnotation.json @@ -22,7 +22,7 @@ }, "position": { "title": "foxglove.Point2", - "description": "Bottom-left origin of the text label in 2D image coordinates (pixels)", + "description": "Bottom-left origin of the text label in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { diff --git a/schemas/jsonschema/index.ts b/schemas/jsonschema/index.ts index be3af9a9..7a03bd16 100644 --- a/schemas/jsonschema/index.ts +++ b/schemas/jsonschema/index.ts @@ -198,7 +198,7 @@ export const CircleAnnotation = { }, "position": { "title": "foxglove.Point2", - "description": "Center of the circle in 2D image coordinates (pixels)", + "description": "Center of the circle in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { @@ -957,7 +957,7 @@ export const ImageAnnotations = { }, "position": { "title": "foxglove.Point2", - "description": "Center of the circle in 2D image coordinates (pixels)", + "description": "Center of the circle in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { @@ -1098,7 +1098,7 @@ export const ImageAnnotations = { } } }, - "description": "Points in 2D image coordinates (pixels)" + "description": "Points in 2D image coordinates (pixels).\nThese coordinates use the top-left corner of the top-left pixel of the image as the origin." }, "outline_color": { "title": "foxglove.Color", @@ -1206,7 +1206,7 @@ export const ImageAnnotations = { }, "position": { "title": "foxglove.Point2", - "description": "Bottom-left origin of the text label in 2D image coordinates (pixels)", + "description": "Bottom-left origin of the text label in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { @@ -4272,7 +4272,7 @@ export const PointsAnnotation = { } } }, - "description": "Points in 2D image coordinates (pixels)" + "description": "Points in 2D image coordinates (pixels).\nThese coordinates use the top-left corner of the top-left pixel of the image as the origin." }, "outline_color": { "title": "foxglove.Color", @@ -4767,7 +4767,7 @@ export const TextAnnotation = { }, "position": { "title": "foxglove.Point2", - "description": "Bottom-left origin of the text label in 2D image coordinates (pixels)", + "description": "Bottom-left origin of the text label in 2D image coordinates (pixels).\nThe coordinate uses the top-left corner of the top-left pixel of the image as the origin.", "type": "object", "properties": { "x": { diff --git a/schemas/omgidl/foxglove/CircleAnnotation.idl b/schemas/omgidl/foxglove/CircleAnnotation.idl index 27e2d8a6..ee33566b 100644 --- a/schemas/omgidl/foxglove/CircleAnnotation.idl +++ b/schemas/omgidl/foxglove/CircleAnnotation.idl @@ -11,7 +11,8 @@ struct CircleAnnotation { // Timestamp of circle Time timestamp; - // Center of the circle in 2D image coordinates (pixels) + // Center of the circle in 2D image coordinates (pixels). + // The coordinate uses the top-left corner of the top-left pixel of the image as the origin. Point2 position; // Circle diameter in pixels diff --git a/schemas/omgidl/foxglove/PointsAnnotation.idl b/schemas/omgidl/foxglove/PointsAnnotation.idl index 491915be..418defbe 100644 --- a/schemas/omgidl/foxglove/PointsAnnotation.idl +++ b/schemas/omgidl/foxglove/PointsAnnotation.idl @@ -15,7 +15,8 @@ struct PointsAnnotation { // Type of points annotation to draw PointsAnnotationType type; - // Points in 2D image coordinates (pixels) + // Points in 2D image coordinates (pixels). + // These coordinates use the top-left corner of the top-left pixel of the image as the origin. sequence points; // Outline color diff --git a/schemas/omgidl/foxglove/TextAnnotation.idl b/schemas/omgidl/foxglove/TextAnnotation.idl index fadee057..4d6404d5 100644 --- a/schemas/omgidl/foxglove/TextAnnotation.idl +++ b/schemas/omgidl/foxglove/TextAnnotation.idl @@ -11,7 +11,8 @@ struct TextAnnotation { // Timestamp of annotation Time timestamp; - // Bottom-left origin of the text label in 2D image coordinates (pixels) + // Bottom-left origin of the text label in 2D image coordinates (pixels). + // The coordinate uses the top-left corner of the top-left pixel of the image as the origin. Point2 position; // Text to display diff --git a/schemas/proto/foxglove/CircleAnnotation.proto b/schemas/proto/foxglove/CircleAnnotation.proto index 89643583..a0ebabc0 100644 --- a/schemas/proto/foxglove/CircleAnnotation.proto +++ b/schemas/proto/foxglove/CircleAnnotation.proto @@ -13,7 +13,8 @@ message CircleAnnotation { // Timestamp of circle google.protobuf.Timestamp timestamp = 1; - // Center of the circle in 2D image coordinates (pixels) + // Center of the circle in 2D image coordinates (pixels). + // The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove.Point2 position = 2; // Circle diameter in pixels diff --git a/schemas/proto/foxglove/PointsAnnotation.proto b/schemas/proto/foxglove/PointsAnnotation.proto index c4436994..9c73c56f 100644 --- a/schemas/proto/foxglove/PointsAnnotation.proto +++ b/schemas/proto/foxglove/PointsAnnotation.proto @@ -32,7 +32,8 @@ message PointsAnnotation { // Type of points annotation to draw Type type = 2; - // Points in 2D image coordinates (pixels) + // Points in 2D image coordinates (pixels). + // These coordinates use the top-left corner of the top-left pixel of the image as the origin. repeated foxglove.Point2 points = 3; // Outline color diff --git a/schemas/proto/foxglove/TextAnnotation.proto b/schemas/proto/foxglove/TextAnnotation.proto index 1fee439f..86c923ef 100644 --- a/schemas/proto/foxglove/TextAnnotation.proto +++ b/schemas/proto/foxglove/TextAnnotation.proto @@ -13,7 +13,8 @@ message TextAnnotation { // Timestamp of annotation google.protobuf.Timestamp timestamp = 1; - // Bottom-left origin of the text label in 2D image coordinates (pixels) + // Bottom-left origin of the text label in 2D image coordinates (pixels). + // The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove.Point2 position = 2; // Text to display diff --git a/schemas/ros1/CircleAnnotation.msg b/schemas/ros1/CircleAnnotation.msg index 5fa08f0a..fbbcd36c 100644 --- a/schemas/ros1/CircleAnnotation.msg +++ b/schemas/ros1/CircleAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of circle time timestamp -# Center of the circle in 2D image coordinates (pixels) +# Center of the circle in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Circle diameter in pixels diff --git a/schemas/ros1/PointsAnnotation.msg b/schemas/ros1/PointsAnnotation.msg index 123e4b81..25c67417 100644 --- a/schemas/ros1/PointsAnnotation.msg +++ b/schemas/ros1/PointsAnnotation.msg @@ -23,7 +23,8 @@ uint8 LINE_LIST=4 # Type of points annotation to draw uint8 type -# Points in 2D image coordinates (pixels) +# Points in 2D image coordinates (pixels). +# These coordinates use the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2[] points # Outline color diff --git a/schemas/ros1/TextAnnotation.msg b/schemas/ros1/TextAnnotation.msg index 36a960f8..e1054495 100644 --- a/schemas/ros1/TextAnnotation.msg +++ b/schemas/ros1/TextAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of annotation time timestamp -# Bottom-left origin of the text label in 2D image coordinates (pixels) +# Bottom-left origin of the text label in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Text to display diff --git a/schemas/ros2/CircleAnnotation.msg b/schemas/ros2/CircleAnnotation.msg index 4519ad1e..a14cb8a6 100644 --- a/schemas/ros2/CircleAnnotation.msg +++ b/schemas/ros2/CircleAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of circle builtin_interfaces/Time timestamp -# Center of the circle in 2D image coordinates (pixels) +# Center of the circle in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Circle diameter in pixels diff --git a/schemas/ros2/PointsAnnotation.msg b/schemas/ros2/PointsAnnotation.msg index 6f915c7e..a1bc59ed 100644 --- a/schemas/ros2/PointsAnnotation.msg +++ b/schemas/ros2/PointsAnnotation.msg @@ -23,7 +23,8 @@ uint8 LINE_LIST=4 # Type of points annotation to draw uint8 type -# Points in 2D image coordinates (pixels) +# Points in 2D image coordinates (pixels). +# These coordinates use the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2[] points # Outline color diff --git a/schemas/ros2/TextAnnotation.msg b/schemas/ros2/TextAnnotation.msg index ec19fc6a..4383c514 100644 --- a/schemas/ros2/TextAnnotation.msg +++ b/schemas/ros2/TextAnnotation.msg @@ -6,7 +6,8 @@ # Timestamp of annotation builtin_interfaces/Time timestamp -# Bottom-left origin of the text label in 2D image coordinates (pixels) +# Bottom-left origin of the text label in 2D image coordinates (pixels). +# The coordinate uses the top-left corner of the top-left pixel of the image as the origin. foxglove_msgs/Point2 position # Text to display diff --git a/schemas/typescript/CircleAnnotation.ts b/schemas/typescript/CircleAnnotation.ts index 128c996f..c90c16bd 100644 --- a/schemas/typescript/CircleAnnotation.ts +++ b/schemas/typescript/CircleAnnotation.ts @@ -10,7 +10,10 @@ export type CircleAnnotation = { /** Timestamp of circle */ timestamp: Time; - /** Center of the circle in 2D image coordinates (pixels) */ + /** + * Center of the circle in 2D image coordinates (pixels). + * The coordinate uses the top-left corner of the top-left pixel of the image as the origin. + */ position: Point2; /** Circle diameter in pixels */ diff --git a/schemas/typescript/PointsAnnotation.ts b/schemas/typescript/PointsAnnotation.ts index 03fa1d76..faeb397b 100644 --- a/schemas/typescript/PointsAnnotation.ts +++ b/schemas/typescript/PointsAnnotation.ts @@ -14,7 +14,10 @@ export type PointsAnnotation = { /** Type of points annotation to draw */ type: PointsAnnotationType; - /** Points in 2D image coordinates (pixels) */ + /** + * Points in 2D image coordinates (pixels). + * These coordinates use the top-left corner of the top-left pixel of the image as the origin. + */ points: Point2[]; /** Outline color */ diff --git a/schemas/typescript/TextAnnotation.ts b/schemas/typescript/TextAnnotation.ts index d5dc6bd3..de8128b8 100644 --- a/schemas/typescript/TextAnnotation.ts +++ b/schemas/typescript/TextAnnotation.ts @@ -10,7 +10,10 @@ export type TextAnnotation = { /** Timestamp of annotation */ timestamp: Time; - /** Bottom-left origin of the text label in 2D image coordinates (pixels) */ + /** + * Bottom-left origin of the text label in 2D image coordinates (pixels). + * The coordinate uses the top-left corner of the top-left pixel of the image as the origin. + */ position: Point2; /** Text to display */