From eed2a21b66538337eee0239d1b88c14cddb8ba01 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Wed, 17 Nov 2021 16:48:56 -0800 Subject: [PATCH 1/6] Adding addition fields to the camera sensor message Signed-off-by: Nate Koenig --- proto/ignition/msgs/camerasensor.proto | 69 ++++++++++++++++++- proto/ignition/msgs/lens.proto | 92 ++++++++++++++++++++++++++ 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 proto/ignition/msgs/lens.proto diff --git a/proto/ignition/msgs/camerasensor.proto b/proto/ignition/msgs/camerasensor.proto index dbc9d99a..ec5f76f2 100644 --- a/proto/ignition/msgs/camerasensor.proto +++ b/proto/ignition/msgs/camerasensor.proto @@ -24,21 +24,88 @@ option java_outer_classname = "CameraSensorProtos"; /// \interface CameraSensor /// \brief Information about a camera sensor element -import "ignition/msgs/vector2d.proto"; import "ignition/msgs/distortion.proto"; +import "ignition/msgs/double.proto"; import "ignition/msgs/header.proto"; +import "ignition/msgs/lens.proto"; +import "ignition/msgs/sensor_noise.proto"; +import "ignition/msgs/vector2d.proto"; message CameraSensor { + /// \brief Bounding box types. + enum BoundingBoxType + { + /// \brief No bounding box. + NO_BOUNDING_BOX = 0; + + /// \brief 2D box that shows the full box of occluded objects + FULL_BOX_2D = 1; + + /// \brief 2D box that shows the visible part of the occluded object + VISIBLE_BOX_2D = 2; + + /// \brief 3D oriented box + BOX_3D = 3; + } + + /// \brief Segmentation types. + enum SegmentationType + { + /// \brief No segmentation. + NO_SEGMENTATION = 0; + + /// \brief Pixels of same label from different items + /// have the same color & id. + SEMANTIC = 1; + + /// \brief Pixels of same label from different items, have different + /// color & id. 1 channel for label id & 2 channels for instance id + PANTOPIC = 2; + } + /// \brief Optional header data Header header = 1; + /// \brief Horizontal field of view double horizontal_fov = 2; + + /// \brief Image size in pixels. Vector2d image_size = 3; + + /// \brief Image format string image_format = 4; + + /// \brief Near clip distance in meters. double near_clip = 5; + + /// \brief Far clip distance in meters. double far_clip = 6; + + /// \brief True if frames should be saved. bool save_enabled = 7; + + /// \brief Path in which to save frames. string save_path = 8; + + /// \brief Optional distortion information. Distortion distortion = 9; + + /// \brief Optional noise parameters for the image. + SensorNoise image_noise = 10; + + /// \brief Optional depth near clip + Double depth_near_clip = 11; + + /// \brief Optional depth f ar clip + Double depth_far_clip = 12; + + /// \brief Optional bounding box camera type. + BoundingBoxType bounding_box_type = 13; + + /// \brief Optional segmentation camera type. + SegmentationType segemntation_type = 14; + + /// \brief Optional lens information + Lens lens = 15; } diff --git a/proto/ignition/msgs/lens.proto b/proto/ignition/msgs/lens.proto new file mode 100644 index 00000000..8ed4b400 --- /dev/null +++ b/proto/ignition/msgs/lens.proto @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2021 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +syntax = "proto3"; +package ignition.msgs; +option java_package = "com.ignition.msgs"; +option java_outer_classname = "LensProtos"; + +/// \ingroup ignition.msgs +/// \interface Lens +/// \brief Information about a lens element + +message Lens +{ + /// \brief Types of lens models. + enum Type + { + TYPE_NOT_SPECIFIED = 0; + GNOMONICAL = 1; + STEREOGRAPHIC = 2; + EQUIDISTANT = 3; + EQUISOLID_ANGLE = 4; + ORTHOGRAPHIC = 5; + CUSTOM = 6; + } + + /// \brief Lens custom function type. + enum FunctionType + { + FUNCTION_NOT_SPECIFIED = 0; + SIN = 1; + TAN = 2; + ID = 3; + } + + /// \brief Lens type + Type type = 1; + + /// \brief Lens scale to horizontal field of view. + bool scale_to_hfov = 2; + + /// \brief Lens custom function linear scaling constant + double c1 = 3; + + /// \brief Lens custom function angular scaling constant. + double c2 = 4; + + /// \brief Lens custom function angle offset constant. + double c3 = 5; + + /// \brief Lens custom function focal length. + double focal_length = 6; + + /// \brief Lens custom function type. + FunctionType function_type = 7; + + /// \brief Lens cutoff angle in radians. Everything outside of the specified + /// angle will be hidden. + double cutoff_angle = 8; + + /// \brief The resolution of the environment cube map used to draw the world. + int32 environment_texture_size = 9; + + /// \brief Lens X focal length in pixels. + double intrinsics_fx = 10; + + /// \brief Lens Y focal length in pixels. + double intrinsics_fy = 11; + + /// \brief Lens X principal point in pixels. + double intrinsics_cx = 12; + + /// \brief Lens Y principal point in pixels. + double intrinsics_cy = 13; + + /// \brief Lens XY axis skew. + double intrinsics_skew = 14; +} From 4ec9818c19d29b8ba3584d3fc30b3690d4519779 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Tue, 26 Jul 2022 08:55:42 -0700 Subject: [PATCH 2/6] Fix naming Signed-off-by: Nate Koenig --- proto/gz/msgs/lens.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/gz/msgs/lens.proto b/proto/gz/msgs/lens.proto index 8ed4b400..68029b06 100644 --- a/proto/gz/msgs/lens.proto +++ b/proto/gz/msgs/lens.proto @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ */ syntax = "proto3"; -package ignition.msgs; -option java_package = "com.ignition.msgs"; +package gz.msgs; +option java_package = "com.gz.msgs"; option java_outer_classname = "LensProtos"; /// \ingroup ignition.msgs From 0eb0afa70d367484b20f4f653bb6b4b9d65e3d9b Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Fri, 29 Jul 2022 14:24:48 -0700 Subject: [PATCH 3/6] spelling and docs Signed-off-by: Nate Koenig --- proto/gz/msgs/camerasensor.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/gz/msgs/camerasensor.proto b/proto/gz/msgs/camerasensor.proto index 4ca42197..e6d6e342 100644 --- a/proto/gz/msgs/camerasensor.proto +++ b/proto/gz/msgs/camerasensor.proto @@ -61,13 +61,13 @@ message CameraSensor /// \brief Pixels of same label from different items, have different /// color & id. 1 channel for label id & 2 channels for instance id - PANTOPIC = 2; + PANOTOPIC = 2; } /// \brief Optional header data Header header = 1; - /// \brief Horizontal field of view + /// \brief Horizontal field of view in radians double horizontal_fov = 2; /// \brief Image size in pixels. @@ -94,10 +94,10 @@ message CameraSensor /// \brief Optional noise parameters for the image. SensorNoise image_noise = 10; - /// \brief Optional depth near clip + /// \brief Optional depth near clip in meters. Double depth_near_clip = 11; - /// \brief Optional depth f ar clip + /// \brief Optional depth far clip in meters. Double depth_far_clip = 12; /// \brief Optional bounding box camera type. From 37ad84c01a6847bdf7598345739c2076b0378419 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Fri, 29 Jul 2022 14:38:23 -0700 Subject: [PATCH 4/6] is_depth Signed-off-by: Nate Koenig --- proto/gz/msgs/camerasensor.proto | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/proto/gz/msgs/camerasensor.proto b/proto/gz/msgs/camerasensor.proto index e6d6e342..3aa754d3 100644 --- a/proto/gz/msgs/camerasensor.proto +++ b/proto/gz/msgs/camerasensor.proto @@ -108,4 +108,21 @@ message CameraSensor /// \brief Optional lens information Lens lens = 15; + + /// \brief True if the camera will be triggered by a topic + bool triggered = 16; + + /// \brief Name of the topic that will trigger the camera if enabled + string triggered_topic = 17; + + /// \brief Value used for anti-aliasing + int32 anti_aliasing = 18; + + /// \brief Visibility mask of a camera. When the camera's visibility_mask and + /// a visual's visibility_flags evaluates to non-zero, then the visual will + /// be visible to the camera. + uint32 visibility_mask = 19; + + /// \brief True if the camera is a depth camera. + bool is_depth_camera = 20; } From d7e3d01dd74c000162776dee4b0b61006283ffe9 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Fri, 29 Jul 2022 14:45:55 -0700 Subject: [PATCH 5/6] Added pixel_format as a replacement to image_format Signed-off-by: Nate Koenig --- Migration.md | 3 ++- proto/gz/msgs/camerasensor.proto | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Migration.md b/Migration.md index b539b0aa..14291916 100644 --- a/Migration.md +++ b/Migration.md @@ -14,7 +14,8 @@ release will remove the deprecated code. 3. Protobuf messages and packages will no longer use `ignition.msgs`, use `gz.msgs` instead 4. `INSTALL_IGN_MSGS_GEN_EXECUTABLE` and `IGN_MSGS_GEN_EXECUTABLE` are deprecated and will be removed. Use `INSTALL_GZ_MSGS_GEN_EXECUTABLE` and `GZ_MSGS_GEN_EXECUTABLE` instead. 5. `IGN_DESCRIPTOR_PATH` is deprecated and will be removed. Use `GZ_DESCRIPTOR_PATH` instead. - +6. `camerasensor.proto` has deprected the `string image_format = 4`. Please + use `PixelFormatType pixel_format = 21;` ### Breaking Changes 1. The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix! diff --git a/proto/gz/msgs/camerasensor.proto b/proto/gz/msgs/camerasensor.proto index 3aa754d3..05d73518 100644 --- a/proto/gz/msgs/camerasensor.proto +++ b/proto/gz/msgs/camerasensor.proto @@ -27,6 +27,7 @@ option java_outer_classname = "CameraSensorProtos"; import "gz/msgs/distortion.proto"; import "gz/msgs/double.proto"; import "gz/msgs/header.proto"; +import "gz/msgs/image.proto"; import "gz/msgs/lens.proto"; import "gz/msgs/sensor_noise.proto"; import "gz/msgs/vector2d.proto"; @@ -73,7 +74,7 @@ message CameraSensor /// \brief Image size in pixels. Vector2d image_size = 3; - /// \brief Image format + /// \brief Image format. This field is deprecated, please use pixel_format. string image_format = 4; /// \brief Near clip distance in meters. @@ -125,4 +126,7 @@ message CameraSensor /// \brief True if the camera is a depth camera. bool is_depth_camera = 20; + + /// \brief Pixel format used by the camera. This replaces image_format. + PixelFormatType pixel_format = 21; } From 58b9dd0b63e328eaf277f4571496ad16cb58ae17 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Fri, 29 Jul 2022 16:24:29 -0700 Subject: [PATCH 6/6] typos Signed-off-by: Louise Poubel --- proto/gz/msgs/camerasensor.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/gz/msgs/camerasensor.proto b/proto/gz/msgs/camerasensor.proto index 05d73518..65cc19c3 100644 --- a/proto/gz/msgs/camerasensor.proto +++ b/proto/gz/msgs/camerasensor.proto @@ -62,7 +62,7 @@ message CameraSensor /// \brief Pixels of same label from different items, have different /// color & id. 1 channel for label id & 2 channels for instance id - PANOTOPIC = 2; + PANOPTIC = 2; } /// \brief Optional header data @@ -105,7 +105,7 @@ message CameraSensor BoundingBoxType bounding_box_type = 13; /// \brief Optional segmentation camera type. - SegmentationType segemntation_type = 14; + SegmentationType segmentation_type = 14; /// \brief Optional lens information Lens lens = 15;