|
| 1 | +/* |
| 2 | + * Copyright (C) 2026 Jiayi Cai |
| 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 = "EntityFactoryWithNsProtos"; |
| 22 | + |
| 23 | +/// \ingroup gz.msgs |
| 24 | +/// \interface EntityFactory |
| 25 | +/// \brief Message with namespace to create new entities at a given pose. |
| 26 | +/// An entity can be created in one of the following ways: |
| 27 | +/// |
| 28 | +/// 1. From an SDF string (sdf) |
| 29 | +/// 2. From an SDF file (sdf_filename) |
| 30 | +/// 3. From a message (model / light) |
| 31 | +/// 4. Cloning an existing entity (clone_name) |
| 32 | + |
| 33 | +import "gz/msgs/header.proto"; |
| 34 | +import "gz/msgs/light.proto"; |
| 35 | +import "gz/msgs/model.proto"; |
| 36 | +import "gz/msgs/pose.proto"; |
| 37 | +import "gz/msgs/spherical_coordinates.proto"; |
| 38 | + |
| 39 | +message EntityFactoryWithNs |
| 40 | +{ |
| 41 | + /// \brief Optional header data |
| 42 | + Header header = 1; |
| 43 | + |
| 44 | + /// \brief Only one method is supported at a time |
| 45 | + oneof from |
| 46 | + { |
| 47 | + /// \brief SDF description in string format. |
| 48 | + string sdf = 2; |
| 49 | + |
| 50 | + /// \brief Full path to SDF file. |
| 51 | + string sdf_filename = 3; |
| 52 | + |
| 53 | + /// \brief Description of model to be inserted. |
| 54 | + Model model = 4; |
| 55 | + |
| 56 | + /// \brief Description of light to be inserted. |
| 57 | + Light light = 5; |
| 58 | + |
| 59 | + /// \brief Name of entity to clone. |
| 60 | + string clone_name = 6; |
| 61 | + } |
| 62 | + |
| 63 | + /// \brief Pose where the entity will be spawned in the world. |
| 64 | + /// If set, `spherical_coordinates` will be ignored. |
| 65 | + Pose pose = 7; |
| 66 | + |
| 67 | + /// \brief New name for the entity, overrides the name on the SDF. |
| 68 | + string name = 8; |
| 69 | + |
| 70 | + /// \brief New namespace for the entity, overrides the namespace on the SDF. |
| 71 | + string ns = 9; |
| 72 | + |
| 73 | + /// \brief Whether the server is allowed to rename the entity in case of |
| 74 | + /// overlap with existing entities. |
| 75 | + bool allow_renaming = 10; |
| 76 | + |
| 77 | + /// \brief The pose will be defined relative to this frame. If left empty, |
| 78 | + /// the "world" frame will be used. |
| 79 | + string relative_to = 11; |
| 80 | + |
| 81 | + /// \brief Spherical coordinates where the entity will be spawned in the |
| 82 | + /// world. |
| 83 | + /// If `pose` is also set: |
| 84 | + /// * `pose.position` is ignored in favor of latitude, longitude and |
| 85 | + /// elevation. |
| 86 | + /// * `pose.orientation` is used in conjunction with heading: |
| 87 | + /// Quaternion::fromEuler(0, 0, heading) * pose.orientation |
| 88 | + SphericalCoordinates spherical_coordinates = 12; |
| 89 | +} |
0 commit comments