Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding additional fields to the camera sensor message #201

Merged
merged 10 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
90 changes: 89 additions & 1 deletion proto/gz/msgs/camerasensor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,109 @@ option java_outer_classname = "CameraSensorProtos";
/// \interface CameraSensor
/// \brief Information about a camera sensor element

import "gz/msgs/vector2d.proto";
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";

message CameraSensor
chapulina marked this conversation as resolved.
Show resolved Hide resolved
{
/// \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
PANOPTIC = 2;
}

/// \brief Optional header data
Header header = 1;

/// \brief Horizontal field of view in radians
double horizontal_fov = 2;

/// \brief Image size in pixels.
Vector2d image_size = 3;

/// \brief Image format. This field is deprecated, please use pixel_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 in meters.
Double depth_near_clip = 11;

/// \brief Optional depth far clip in meters.
Double depth_far_clip = 12;

/// \brief Optional bounding box camera type.
BoundingBoxType bounding_box_type = 13;

/// \brief Optional segmentation camera type.
SegmentationType segmentation_type = 14;

/// \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;

/// \brief Pixel format used by the camera. This replaces image_format.
PixelFormatType pixel_format = 21;
}
92 changes: 92 additions & 0 deletions proto/gz/msgs/lens.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* 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.
* 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 gz.msgs;
option java_package = "com.gz.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;
chapulina marked this conversation as resolved.
Show resolved Hide resolved

/// \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;
nkoenig marked this conversation as resolved.
Show resolved Hide resolved

/// \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;
}