From 7c62b885e29352fbf1eda8c8351408bf2e110a2e Mon Sep 17 00:00:00 2001 From: C88-YQ <1409947012@qq.com> Date: Tue, 9 Jun 2026 22:51:06 +0800 Subject: [PATCH 1/4] Add entity_factory_with_ns.proto & entity_factory_with_ns_v.proto Signed-off-by: C88-YQ <1409947012@qq.com> --- proto/gz/msgs/entity_factory_with_ns.proto | 89 ++++++++++++++++++++ proto/gz/msgs/entity_factory_with_ns_v.proto | 36 ++++++++ 2 files changed, 125 insertions(+) create mode 100644 proto/gz/msgs/entity_factory_with_ns.proto create mode 100644 proto/gz/msgs/entity_factory_with_ns_v.proto diff --git a/proto/gz/msgs/entity_factory_with_ns.proto b/proto/gz/msgs/entity_factory_with_ns.proto new file mode 100644 index 00000000..023f8fa9 --- /dev/null +++ b/proto/gz/msgs/entity_factory_with_ns.proto @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2026 Jiayi Cai + * + * 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 = "EntityFactoryWithNsProtos"; + +/// \ingroup gz.msgs +/// \interface EntityFactory +/// \brief Message with namespace to create new entities at a given pose. +/// An entity can be created in one of the following ways: +/// +/// 1. From an SDF string (sdf) +/// 2. From an SDF file (sdf_filename) +/// 3. From a message (model / light) +/// 4. Cloning an existing entity (clone_name) + +import "gz/msgs/header.proto"; +import "gz/msgs/light.proto"; +import "gz/msgs/model.proto"; +import "gz/msgs/pose.proto"; +import "gz/msgs/spherical_coordinates.proto"; + +message EntityFactoryWithNs +{ + /// \brief Optional header data + Header header = 1; + + /// \brief Only one method is supported at a time + oneof from + { + /// \brief SDF description in string format. + string sdf = 2; + + /// \brief Full path to SDF file. + string sdf_filename = 3; + + /// \brief Description of model to be inserted. + Model model = 4; + + /// \brief Description of light to be inserted. + Light light = 5; + + /// \brief Name of entity to clone. + string clone_name = 6; + } + + /// \brief Pose where the entity will be spawned in the world. + /// If set, `spherical_coordinates` will be ignored. + Pose pose = 7; + + /// \brief New name for the entity, overrides the name on the SDF. + string name = 8; + + /// \brief New namespace for the entity, overrides the namespace on the SDF. + string ns = 9; + + /// \brief Whether the server is allowed to rename the entity in case of + /// overlap with existing entities. + bool allow_renaming = 10; + + /// \brief The pose will be defined relative to this frame. If left empty, + /// the "world" frame will be used. + string relative_to = 11; + + /// \brief Spherical coordinates where the entity will be spawned in the + /// world. + /// If `pose` is also set: + /// * `pose.position` is ignored in favor of latitude, longitude and + /// elevation. + /// * `pose.orientation` is used in conjunction with heading: + /// Quaternion::fromEuler(0, 0, heading) * pose.orientation + SphericalCoordinates spherical_coordinates = 12; +} diff --git a/proto/gz/msgs/entity_factory_with_ns_v.proto b/proto/gz/msgs/entity_factory_with_ns_v.proto new file mode 100644 index 00000000..c2bfec07 --- /dev/null +++ b/proto/gz/msgs/entity_factory_with_ns_v.proto @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2026 Jiayi Cai + * 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 = "EntityFactoryWithNsVProtos"; + +/// \ingroup gz.msgs +/// \interface EntityFactoryWithNs_V +/// \brief A message for a vector of EntityFactoryWithNs messages +// +import "gz/msgs/entity_factory_with_ns.proto"; +import "gz/msgs/header.proto"; + +message EntityFactoryWithNs_V +{ + /// \brief Optional header data + Header header = 1; + + /// \brief The set of entity factory messages. + repeated EntityFactoryWithNs data = 2; +} From ff16f520e23f5dccb81ddad105efcbe5c9f244b7 Mon Sep 17 00:00:00 2001 From: C88-YQ <1409947012@qq.com> Date: Thu, 11 Jun 2026 20:51:36 +0800 Subject: [PATCH 2/4] Change the tpye of ns from string to StringMsg Signed-off-by: C88-YQ <1409947012@qq.com> --- proto/gz/msgs/entity_factory_with_ns.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proto/gz/msgs/entity_factory_with_ns.proto b/proto/gz/msgs/entity_factory_with_ns.proto index 023f8fa9..8c2cf019 100644 --- a/proto/gz/msgs/entity_factory_with_ns.proto +++ b/proto/gz/msgs/entity_factory_with_ns.proto @@ -21,7 +21,7 @@ option java_package = "com.gz.msgs"; option java_outer_classname = "EntityFactoryWithNsProtos"; /// \ingroup gz.msgs -/// \interface EntityFactory +/// \interface EntityFactoryWithNs /// \brief Message with namespace to create new entities at a given pose. /// An entity can be created in one of the following ways: /// @@ -34,6 +34,7 @@ import "gz/msgs/header.proto"; import "gz/msgs/light.proto"; import "gz/msgs/model.proto"; import "gz/msgs/pose.proto"; +import "gz/msgs/stringmsg.proto"; import "gz/msgs/spherical_coordinates.proto"; message EntityFactoryWithNs @@ -67,8 +68,8 @@ message EntityFactoryWithNs /// \brief New name for the entity, overrides the name on the SDF. string name = 8; - /// \brief New namespace for the entity, overrides the namespace on the SDF. - string ns = 9; + /// \brief Optional new namespace for the entity, overrides the namespace on the SDF. + StringMsg ns = 9; /// \brief Whether the server is allowed to rename the entity in case of /// overlap with existing entities. From 003e37d2b8305c366e71854aedf204bf4a2c2f3c Mon Sep 17 00:00:00 2001 From: C88-YQ <1409947012@qq.com> Date: Fri, 12 Jun 2026 10:11:59 +0800 Subject: [PATCH 3/4] Update Signed-off-by: C88-YQ <1409947012@qq.com> --- proto/gz/msgs/entity_factory_with_ns.proto | 14 +++++++------- proto/gz/msgs/entity_factory_with_ns_v.proto | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/proto/gz/msgs/entity_factory_with_ns.proto b/proto/gz/msgs/entity_factory_with_ns.proto index 8c2cf019..cced9218 100644 --- a/proto/gz/msgs/entity_factory_with_ns.proto +++ b/proto/gz/msgs/entity_factory_with_ns.proto @@ -1,5 +1,5 @@ /* - * Copyright (C) 2026 Jiayi Cai + * Copyright (C) 2026 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. @@ -68,16 +68,13 @@ message EntityFactoryWithNs /// \brief New name for the entity, overrides the name on the SDF. string name = 8; - /// \brief Optional new namespace for the entity, overrides the namespace on the SDF. - StringMsg ns = 9; - /// \brief Whether the server is allowed to rename the entity in case of /// overlap with existing entities. - bool allow_renaming = 10; + bool allow_renaming = 9; /// \brief The pose will be defined relative to this frame. If left empty, /// the "world" frame will be used. - string relative_to = 11; + string relative_to = 10; /// \brief Spherical coordinates where the entity will be spawned in the /// world. @@ -86,5 +83,8 @@ message EntityFactoryWithNs /// elevation. /// * `pose.orientation` is used in conjunction with heading: /// Quaternion::fromEuler(0, 0, heading) * pose.orientation - SphericalCoordinates spherical_coordinates = 12; + SphericalCoordinates spherical_coordinates = 11; + + /// \brief Optional new namespace for the entity, overrides the namespace on the SDF. + StringMsg namespace = 12; } diff --git a/proto/gz/msgs/entity_factory_with_ns_v.proto b/proto/gz/msgs/entity_factory_with_ns_v.proto index c2bfec07..aac64040 100644 --- a/proto/gz/msgs/entity_factory_with_ns_v.proto +++ b/proto/gz/msgs/entity_factory_with_ns_v.proto @@ -1,5 +1,6 @@ /* - * Copyright (C) 2026 Jiayi Cai + * Copyright (C) 2026 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 From 907ebcd4413f3ab634b7724920aafd1f5c69b204 Mon Sep 17 00:00:00 2001 From: C88-YQ <1409947012@qq.com> Date: Tue, 23 Jun 2026 16:25:57 +0800 Subject: [PATCH 4/4] Use string type for namespace in EntityFactoryWithNs Signed-off-by: C88-YQ <1409947012@qq.com> --- proto/gz/msgs/entity_factory_with_ns.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/gz/msgs/entity_factory_with_ns.proto b/proto/gz/msgs/entity_factory_with_ns.proto index cced9218..cbabd9dc 100644 --- a/proto/gz/msgs/entity_factory_with_ns.proto +++ b/proto/gz/msgs/entity_factory_with_ns.proto @@ -86,5 +86,5 @@ message EntityFactoryWithNs SphericalCoordinates spherical_coordinates = 11; /// \brief Optional new namespace for the entity, overrides the namespace on the SDF. - StringMsg namespace = 12; + string namespace = 12; }