Skip to content

Commit 22a600a

Browse files
nkoenigNate Koenigchapulina
authored
Adding additional fields to the camera sensor message (#201)
Signed-off-by: Nate Koenig <nate@openrobotics.org> Signed-off-by: Louise Poubel <louise@openrobotics.org> Co-authored-by: Nate Koenig <nate@openrobotics.org> Co-authored-by: Louise Poubel <louise@openrobotics.org>
1 parent 39bbcdf commit 22a600a

File tree

3 files changed

+183
-2
lines changed

3 files changed

+183
-2
lines changed

Migration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ release will remove the deprecated code.
1414
3. Protobuf messages and packages will no longer use `ignition.msgs`, use `gz.msgs` instead
1515
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.
1616
5. `IGN_DESCRIPTOR_PATH` is deprecated and will be removed. Use `GZ_DESCRIPTOR_PATH` instead.
17-
17+
6. `camerasensor.proto` has deprected the `string image_format = 4`. Please
18+
use `PixelFormatType pixel_format = 21;`
1819
### Breaking Changes
1920

2021
1. The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix!

proto/gz/msgs/camerasensor.proto

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,109 @@ option java_outer_classname = "CameraSensorProtos";
2424
/// \interface CameraSensor
2525
/// \brief Information about a camera sensor element
2626

27-
import "gz/msgs/vector2d.proto";
2827
import "gz/msgs/distortion.proto";
28+
import "gz/msgs/double.proto";
2929
import "gz/msgs/header.proto";
30+
import "gz/msgs/image.proto";
31+
import "gz/msgs/lens.proto";
32+
import "gz/msgs/sensor_noise.proto";
33+
import "gz/msgs/vector2d.proto";
3034

3135
message CameraSensor
3236
{
37+
/// \brief Bounding box types.
38+
enum BoundingBoxType
39+
{
40+
/// \brief No bounding box.
41+
NO_BOUNDING_BOX = 0;
42+
43+
/// \brief 2D box that shows the full box of occluded objects
44+
FULL_BOX_2D = 1;
45+
46+
/// \brief 2D box that shows the visible part of the occluded object
47+
VISIBLE_BOX_2D = 2;
48+
49+
/// \brief 3D oriented box
50+
BOX_3D = 3;
51+
}
52+
53+
/// \brief Segmentation types.
54+
enum SegmentationType
55+
{
56+
/// \brief No segmentation.
57+
NO_SEGMENTATION = 0;
58+
59+
/// \brief Pixels of same label from different items
60+
/// have the same color & id.
61+
SEMANTIC = 1;
62+
63+
/// \brief Pixels of same label from different items, have different
64+
/// color & id. 1 channel for label id & 2 channels for instance id
65+
PANOPTIC = 2;
66+
}
67+
3368
/// \brief Optional header data
3469
Header header = 1;
3570

71+
/// \brief Horizontal field of view in radians
3672
double horizontal_fov = 2;
73+
74+
/// \brief Image size in pixels.
3775
Vector2d image_size = 3;
76+
77+
/// \brief Image format. This field is deprecated, please use pixel_format.
3878
string image_format = 4;
79+
80+
/// \brief Near clip distance in meters.
3981
double near_clip = 5;
82+
83+
/// \brief Far clip distance in meters.
4084
double far_clip = 6;
85+
86+
/// \brief True if frames should be saved.
4187
bool save_enabled = 7;
88+
89+
/// \brief Path in which to save frames.
4290
string save_path = 8;
91+
92+
/// \brief Optional distortion information.
4393
Distortion distortion = 9;
94+
95+
/// \brief Optional noise parameters for the image.
96+
SensorNoise image_noise = 10;
97+
98+
/// \brief Optional depth near clip in meters.
99+
Double depth_near_clip = 11;
100+
101+
/// \brief Optional depth far clip in meters.
102+
Double depth_far_clip = 12;
103+
104+
/// \brief Optional bounding box camera type.
105+
BoundingBoxType bounding_box_type = 13;
106+
107+
/// \brief Optional segmentation camera type.
108+
SegmentationType segmentation_type = 14;
109+
110+
/// \brief Optional lens information
111+
Lens lens = 15;
112+
113+
/// \brief True if the camera will be triggered by a topic
114+
bool triggered = 16;
115+
116+
/// \brief Name of the topic that will trigger the camera if enabled
117+
string triggered_topic = 17;
118+
119+
/// \brief Value used for anti-aliasing
120+
int32 anti_aliasing = 18;
121+
122+
/// \brief Visibility mask of a camera. When the camera's visibility_mask and
123+
/// a visual's visibility_flags evaluates to non-zero, then the visual will
124+
/// be visible to the camera.
125+
uint32 visibility_mask = 19;
126+
127+
/// \brief True if the camera is a depth camera.
128+
bool is_depth_camera = 20;
129+
130+
/// \brief Pixel format used by the camera. This replaces image_format.
131+
PixelFormatType pixel_format = 21;
44132
}

proto/gz/msgs/lens.proto

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (C) 2022 Open Source Robotics Foundation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
syntax = "proto3";
19+
package gz.msgs;
20+
option java_package = "com.gz.msgs";
21+
option java_outer_classname = "LensProtos";
22+
23+
/// \ingroup ignition.msgs
24+
/// \interface Lens
25+
/// \brief Information about a lens element
26+
27+
message Lens
28+
{
29+
/// \brief Types of lens models.
30+
enum Type
31+
{
32+
TYPE_NOT_SPECIFIED = 0;
33+
GNOMONICAL = 1;
34+
STEREOGRAPHIC = 2;
35+
EQUIDISTANT = 3;
36+
EQUISOLID_ANGLE = 4;
37+
ORTHOGRAPHIC = 5;
38+
CUSTOM = 6;
39+
}
40+
41+
/// \brief Lens custom function type.
42+
enum FunctionType
43+
{
44+
FUNCTION_NOT_SPECIFIED = 0;
45+
SIN = 1;
46+
TAN = 2;
47+
ID = 3;
48+
}
49+
50+
/// \brief Lens type
51+
Type type = 1;
52+
53+
/// \brief Lens scale to horizontal field of view.
54+
bool scale_to_hfov = 2;
55+
56+
/// \brief Lens custom function linear scaling constant
57+
double c1 = 3;
58+
59+
/// \brief Lens custom function angular scaling constant.
60+
double c2 = 4;
61+
62+
/// \brief Lens custom function angle offset constant.
63+
double c3 = 5;
64+
65+
/// \brief Lens custom function focal length.
66+
double focal_length = 6;
67+
68+
/// \brief Lens custom function type.
69+
FunctionType function_type = 7;
70+
71+
/// \brief Lens cutoff angle in radians. Everything outside of the specified
72+
/// angle will be hidden.
73+
double cutoff_angle = 8;
74+
75+
/// \brief The resolution of the environment cube map used to draw the world.
76+
int32 environment_texture_size = 9;
77+
78+
/// \brief Lens X focal length in pixels.
79+
double intrinsics_fx = 10;
80+
81+
/// \brief Lens Y focal length in pixels.
82+
double intrinsics_fy = 11;
83+
84+
/// \brief Lens X principal point in pixels.
85+
double intrinsics_cx = 12;
86+
87+
/// \brief Lens Y principal point in pixels.
88+
double intrinsics_cy = 13;
89+
90+
/// \brief Lens XY axis skew.
91+
double intrinsics_skew = 14;
92+
}

0 commit comments

Comments
 (0)