From 8d70a10411e12645a4b72f672daf701df8e9e24e Mon Sep 17 00:00:00 2001 From: Maksim Derbasov Date: Sun, 16 Feb 2025 23:42:27 +0900 Subject: [PATCH] Code cleanup Signed-off-by: Maksim Derbasov --- Changelog.md | 2 +- Migration.md | 2 +- cmake/gz_msgs_generate.cmake | 12 ++++++------ core/generator/Generator.cc | 6 +++--- core/include/gz/msgs/Factory.hh | 4 ++-- core/include/gz/msgs/MessageFactory.hh | 2 +- core/include/gz/msgs/convert/AxisAlignedBox.hh | 2 +- core/include/gz/msgs/convert/Color.hh | 2 +- core/include/gz/msgs/convert/DiscoveryType.hh | 2 +- core/include/gz/msgs/convert/FuelMetadata.hh | 2 +- core/include/gz/msgs/convert/GeometryType.hh | 2 +- core/include/gz/msgs/convert/Inertial.hh | 2 +- core/include/gz/msgs/convert/JointType.hh | 2 +- core/include/gz/msgs/convert/PixelFormatType.hh | 2 +- core/include/gz/msgs/convert/Plane.hh | 2 +- core/include/gz/msgs/convert/Pose.hh | 2 +- core/include/gz/msgs/convert/Quaternion.hh | 2 +- core/include/gz/msgs/convert/ShaderType.hh | 2 +- core/include/gz/msgs/convert/SphericalCoordinates.hh | 2 +- core/include/gz/msgs/convert/StdTypes.hh | 2 +- core/include/gz/msgs/convert/Vector2.hh | 2 +- core/include/gz/msgs/convert/make_stubs.py | 2 +- core/include/gz/msgs/detail/dynamic_message_cast.hh | 1 + core/src/DynamicFactory.hh | 2 +- core/src/MessageFactory.cc | 11 +++++------ examples/generating_custom_msgs/CMakeLists.txt | 2 +- examples/generating_custom_msgs/README.md | 2 +- examples/generating_custom_msgs/main.cc | 9 +++------ examples/using_gz_msgs/main.cc | 2 +- gz-msgs-extras.cmake.in | 2 +- proto/gz/msgs/data_load_options.proto | 2 +- proto/gz/msgs/discovery.proto | 2 +- proto/gz/msgs/response.proto | 2 +- test/integration/gz_TEST.cc | 4 ++-- tutorials/message_generation.md | 4 ++-- 35 files changed, 51 insertions(+), 54 deletions(-) diff --git a/Changelog.md b/Changelog.md index a6a0c3f6..00234ee9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -363,7 +363,7 @@ * [Pull request #241](https://github.com/gazebosim/gz-msgs/pull/241) * [Pull request #298](https://github.com/gazebosim/gz-msgs/pull/298) -1. Remove redunant namespace references +1. Remove redundant namespace references * [Pull request #293](https://github.com/gazebosim/gz-msgs/pull/293) ### Gazebo Msgs 8.6.0 (2022-08-02) diff --git a/Migration.md b/Migration.md index 9f7ebb37..0eb49c26 100644 --- a/Migration.md +++ b/Migration.md @@ -80,7 +80,7 @@ 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 +6. `camerasensor.proto` has deprecated the `string image_format = 4`. Please use `PixelFormatType pixel_format = 21;` ### Breaking Changes diff --git a/cmake/gz_msgs_generate.cmake b/cmake/gz_msgs_generate.cmake index 5fc0cf3d..93e0a7cb 100644 --- a/cmake/gz_msgs_generate.cmake +++ b/cmake/gz_msgs_generate.cmake @@ -4,13 +4,13 @@ # One value arguments: # PYTHON_INTERPRETER - Target or path to the python interpreter used # PROTO_PACKAGE - Protobuf package the file belongs to (e.g. "gz.msgs") -# MSGS_GEN_SCRIPT - Location of the messge generator script +# MSGS_GEN_SCRIPT - Location of the message generator script # GZ_PROTOC_PLUGIN - Location of the gazebo generator plugin # FACTORY_GEN_SCRIPT - Location of the factory generator script # PROTO_PATH - Base directory of the proto files # DEPENDENCY_DESCRIPTIONS - .gz_desc files for each dependency -# DLLEXPORT_DECL - Visibilty macro to apply to messages -# OUTPUT_DIRECTORY - CMake binary directoy to place generated artifacts +# DLLEXPORT_DECL - Visibility macro to apply to messages +# OUTPUT_DIRECTORY - CMake binary directory to place generated artifacts # OUTPUT_SOURCES - Variable to contain list of generated source files # OUTPUT_HEADERS - Variable to contain list of generated header files # OUTPUT_DETAIL_HEADERS - Variable to contain list of generated detail header files @@ -133,7 +133,7 @@ function(gz_msgs_generate_messages_impl) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Disable warning in generated *.pb.cc code - set_source_files_properties(${${generate_messges_OUTPUT_SOURCES}} + set_source_files_properties(${${generate_messages_OUTPUT_SOURCES}} COMPILE_FLAGS "-Wno-invalid-offsetof") endif() @@ -148,7 +148,7 @@ endfunction() # One value arguments: # PROTOC_EXEC - protoc target or executable to use # PROTO_PATH - Base directory of the proto files -# DEPENDENCY_DESCRIPTIONS - Variable containing all depedency description files +# DEPENDENCY_DESCRIPTIONS - Variable containing all dependency description files # OUTPUT_DIRECTORY - Directory of output gz_desc file # OUTPUT_FILENAME - Name of output gz_desc file # Multi value arguments @@ -196,7 +196,7 @@ endfunction() # One value arguments: # TARGET - Target (static library) to create # PROTO_PACKAGE - Protobuf package the file belongs to (e.g. "gz.msgs") -# MSGS_GEN_SCRIPT - Location of the messge generator script +# MSGS_GEN_SCRIPT - Location of the message generator script # PYTHON_INTERPRETER - Target or path to the python interpreter used # PROTOC_EXEC - Protoc target or executable to use # GZ_PROTOC_PLUGIN - Location of the gazebo generator plugin diff --git a/core/generator/Generator.cc b/core/generator/Generator.cc index e15505d3..70edc18e 100644 --- a/core/generator/Generator.cc +++ b/core/generator/Generator.cc @@ -67,9 +67,9 @@ Generator::~Generator() = default; ///////////////////////////////////////////////// bool Generator::Generate(const FileDescriptor *_file, - const std::string &/*_parameter*/, - OutputDirectory *_generatorContext, - std::string * /*_error*/) const + const std::string &/*_parameter*/, + OutputDirectory *_generatorContext, + std::string * /*_error*/) const { auto filePath = std::filesystem::path(_file->name()); auto parent_path = filePath.parent_path(); diff --git a/core/include/gz/msgs/Factory.hh b/core/include/gz/msgs/Factory.hh index 80607c1d..9b0f5144 100644 --- a/core/include/gz/msgs/Factory.hh +++ b/core/include/gz/msgs/Factory.hh @@ -47,7 +47,7 @@ namespace gz::msgs /// \brief A map of message types as strings to factory functions public: using FactoryFnCollection = MessageFactory::FactoryFnCollection; - /// \brief Private constuctor + /// \brief Private constructor private: Factory() = default; /// \brief Deleted copy constructor @@ -113,7 +113,7 @@ namespace gz::msgs public: static void Types(std::vector &_types); /// \brief Load a collection of descriptor .desc files. - /// \param[in] _paths A set of directories containing .desc decriptor + /// \param[in] _paths A set of directories containing .desc descriptor /// files. Each directory should be separated by ":". public: static void LoadDescriptors(const std::string &_paths); }; diff --git a/core/include/gz/msgs/MessageFactory.hh b/core/include/gz/msgs/MessageFactory.hh index 6bb0cd01..932a6674 100644 --- a/core/include/gz/msgs/MessageFactory.hh +++ b/core/include/gz/msgs/MessageFactory.hh @@ -106,7 +106,7 @@ namespace gz::msgs { public: void Types(std::vector &_types); /// \brief Load a collection of descriptor .desc files. - /// \param[in] _paths A set of directories containing .desc decriptor + /// \param[in] _paths A set of directories containing .desc descriptor /// files. Each directory should be separated by ":". public: void LoadDescriptors(const std::string &_paths); diff --git a/core/include/gz/msgs/convert/AxisAlignedBox.hh b/core/include/gz/msgs/convert/AxisAlignedBox.hh index 136e824e..107984ef 100644 --- a/core/include/gz/msgs/convert/AxisAlignedBox.hh +++ b/core/include/gz/msgs/convert/AxisAlignedBox.hh @@ -58,7 +58,7 @@ inline gz::math::AxisAlignedBox Convert(const gz::msgs::AxisAlignedBox &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/Color.hh b/core/include/gz/msgs/convert/Color.hh index 9632ec12..1a142e47 100644 --- a/core/include/gz/msgs/convert/Color.hh +++ b/core/include/gz/msgs/convert/Color.hh @@ -56,7 +56,7 @@ inline gz::math::Color Convert(const gz::msgs::Color &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/DiscoveryType.hh b/core/include/gz/msgs/convert/DiscoveryType.hh index cdd5b66a..0c015c59 100644 --- a/core/include/gz/msgs/convert/DiscoveryType.hh +++ b/core/include/gz/msgs/convert/DiscoveryType.hh @@ -118,7 +118,7 @@ inline std::string ToString(const msgs::Discovery::Type &_t) { return ConvertDiscoveryType(_t); } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_DISCOVERYTYPE_HH_ diff --git a/core/include/gz/msgs/convert/FuelMetadata.hh b/core/include/gz/msgs/convert/FuelMetadata.hh index 35546dc8..6df00c5d 100644 --- a/core/include/gz/msgs/convert/FuelMetadata.hh +++ b/core/include/gz/msgs/convert/FuelMetadata.hh @@ -254,7 +254,7 @@ inline bool ConvertFuelMetadata(const msgs::FuelMetadata &_meta, _modelConfigStr = out.str(); return true; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_FUELMETADATA_HH_ diff --git a/core/include/gz/msgs/convert/GeometryType.hh b/core/include/gz/msgs/convert/GeometryType.hh index 167e18c3..55020799 100644 --- a/core/include/gz/msgs/convert/GeometryType.hh +++ b/core/include/gz/msgs/convert/GeometryType.hh @@ -161,7 +161,7 @@ inline std::string ConvertGeometryType(const msgs::Geometry::Type _type) } return result; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_GEOMETRYTYPE_HH_ diff --git a/core/include/gz/msgs/convert/Inertial.hh b/core/include/gz/msgs/convert/Inertial.hh index 3fd3d973..43a44e07 100644 --- a/core/include/gz/msgs/convert/Inertial.hh +++ b/core/include/gz/msgs/convert/Inertial.hh @@ -167,6 +167,6 @@ inline gz::math::Inertiald Convert(const gz::msgs::Inertial &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/JointType.hh b/core/include/gz/msgs/convert/JointType.hh index a9dd8e28..611214e4 100644 --- a/core/include/gz/msgs/convert/JointType.hh +++ b/core/include/gz/msgs/convert/JointType.hh @@ -143,7 +143,7 @@ inline std::string ConvertJointType(const msgs::Joint::Type &_type) return result; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_JOINTTYPE_HH_ diff --git a/core/include/gz/msgs/convert/PixelFormatType.hh b/core/include/gz/msgs/convert/PixelFormatType.hh index 98e0e955..43d1007a 100644 --- a/core/include/gz/msgs/convert/PixelFormatType.hh +++ b/core/include/gz/msgs/convert/PixelFormatType.hh @@ -156,7 +156,7 @@ inline std::string ConvertPixelFormatType(const msgs::PixelFormatType &_t) } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_PIXELFORMATTYPE_HH_ diff --git a/core/include/gz/msgs/convert/Plane.hh b/core/include/gz/msgs/convert/Plane.hh index c87227e0..a302342b 100644 --- a/core/include/gz/msgs/convert/Plane.hh +++ b/core/include/gz/msgs/convert/Plane.hh @@ -62,7 +62,7 @@ inline gz::math::Planed Convert(const gz::msgs::PlaneGeom &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/Pose.hh b/core/include/gz/msgs/convert/Pose.hh index f2efea7c..efe1e925 100644 --- a/core/include/gz/msgs/convert/Pose.hh +++ b/core/include/gz/msgs/convert/Pose.hh @@ -68,7 +68,7 @@ inline gz::math::Pose3d Convert(const gz::msgs::Pose &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/Quaternion.hh b/core/include/gz/msgs/convert/Quaternion.hh index 13af06d9..ef717d35 100644 --- a/core/include/gz/msgs/convert/Quaternion.hh +++ b/core/include/gz/msgs/convert/Quaternion.hh @@ -56,7 +56,7 @@ inline gz::math::Quaterniond Convert(const gz::msgs::Quaternion &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/ShaderType.hh b/core/include/gz/msgs/convert/ShaderType.hh index d39ed163..caff57c1 100644 --- a/core/include/gz/msgs/convert/ShaderType.hh +++ b/core/include/gz/msgs/convert/ShaderType.hh @@ -98,7 +98,7 @@ inline std::string ConvertShaderType(const msgs::Material::ShaderType &_type) return result; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_SHADERTYPE_HH_ diff --git a/core/include/gz/msgs/convert/SphericalCoordinates.hh b/core/include/gz/msgs/convert/SphericalCoordinates.hh index 95860b21..60749527 100644 --- a/core/include/gz/msgs/convert/SphericalCoordinates.hh +++ b/core/include/gz/msgs/convert/SphericalCoordinates.hh @@ -161,6 +161,6 @@ inline gz::math::SphericalCoordinates Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/StdTypes.hh b/core/include/gz/msgs/convert/StdTypes.hh index b9a2c6be..70f96c6d 100644 --- a/core/include/gz/msgs/convert/StdTypes.hh +++ b/core/include/gz/msgs/convert/StdTypes.hh @@ -278,6 +278,6 @@ inline double Convert(const gz::msgs::Double &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/Vector2.hh b/core/include/gz/msgs/convert/Vector2.hh index c543cd8a..2bfd0b98 100644 --- a/core/include/gz/msgs/convert/Vector2.hh +++ b/core/include/gz/msgs/convert/Vector2.hh @@ -54,6 +54,6 @@ inline gz::math::Vector2d Convert(const gz::msgs::Vector2d &_msg) Set(&ret, _msg); return ret; } -} // namespce +} // namespace } // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/convert/make_stubs.py b/core/include/gz/msgs/convert/make_stubs.py index 6bbebdf8..b6a2f63f 100755 --- a/core/include/gz/msgs/convert/make_stubs.py +++ b/core/include/gz/msgs/convert/make_stubs.py @@ -60,7 +60,7 @@ {conversions} -}} // namespce +}} // namespace }} // namespace gz::msgs #endif // GZ_MSGS_CONVERT_VECTOR3_HH_ diff --git a/core/include/gz/msgs/detail/dynamic_message_cast.hh b/core/include/gz/msgs/detail/dynamic_message_cast.hh index de9a3ee4..7ebfa700 100644 --- a/core/include/gz/msgs/detail/dynamic_message_cast.hh +++ b/core/include/gz/msgs/detail/dynamic_message_cast.hh @@ -39,6 +39,7 @@ dynamic_message_cast(std::unique_ptr &&_baseMsg) { auto converted = std::unique_ptr{dynamic_cast(_baseMsg.get())}; if (converted) { + // transfer ownership to a new unique_ptr object by releasing from old one (void) _baseMsg.release(); } return converted; diff --git a/core/src/DynamicFactory.hh b/core/src/DynamicFactory.hh index afe4c4c4..9ce845f9 100644 --- a/core/src/DynamicFactory.hh +++ b/core/src/DynamicFactory.hh @@ -58,7 +58,7 @@ class DynamicFactory ////////////////////////////////////////////////// /// \brief Load descriptors into the descriptor pool. - /// \param[in] _paths A set of directories containing .desc decriptor files. + /// \param[in] _paths A set of directories containing .desc descriptor files. /// Each directory should be separated by ":". public: void LoadDescriptors(const std::string &_paths); diff --git a/core/src/MessageFactory.cc b/core/src/MessageFactory.cc index 4c432cd2..2655faf4 100644 --- a/core/src/MessageFactory.cc +++ b/core/src/MessageFactory.cc @@ -63,7 +63,7 @@ MessageFactory::MessagePtr MessageFactory::New( // Convert ".gz_msgs." prefix else if (_msgType.find(".gz_msgs.") == 0) { - type = kGzMsgsPrefix + _msgType.substr(9); + type = kGzMsgsPrefix + _msgType.substr(9); } // Convert ".gz.msgs." prefix else if (_msgType.find(".gz.msgs.") == 0) @@ -77,11 +77,11 @@ MessageFactory::MessagePtr MessageFactory::New( auto getMessagePtr = [this](const std::string &_type) { - MessageFactory::MessagePtr ret = nullptr; - if (msgMap.find(_type) != msgMap.end()) + MessageFactory::MessagePtr ret; + if (auto it = msgMap.find(_type); it != msgMap.end()) { // Create a new message via FactoryFn - ret = msgMap[_type](); + ret = it->second(); } else { @@ -118,8 +118,7 @@ void MessageFactory::Types(std::vector &_types) _types.clear(); // Return the list of all known message types. - std::map::const_iterator iter; - for (iter = msgMap.begin(); iter != msgMap.end(); ++iter) + for (auto iter = msgMap.begin(); iter != msgMap.end(); ++iter) { _types.push_back(iter->first); } diff --git a/examples/generating_custom_msgs/CMakeLists.txt b/examples/generating_custom_msgs/CMakeLists.txt index fd5f7dd3..eeb93d6c 100644 --- a/examples/generating_custom_msgs/CMakeLists.txt +++ b/examples/generating_custom_msgs/CMakeLists.txt @@ -32,7 +32,7 @@ gz_msgs_generate_messages( MSGS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/proto # List of proto files to process MSGS_PROTOS ${MSGS_PROTOS} - # Depenency on gz-msgs + # Dependency on gz-msgs DEPENDENCIES gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER} ) diff --git a/examples/generating_custom_msgs/README.md b/examples/generating_custom_msgs/README.md index ef06b099..e89081b4 100644 --- a/examples/generating_custom_msgs/README.md +++ b/examples/generating_custom_msgs/README.md @@ -1,6 +1,6 @@ # Creating custom gz-msgs entries -The example in this folder demonstrates how to create your own message defintions. +The example in this folder demonstrates how to create your own message definitions. Most of the setup is the same as the `using_gz_msgs` example, so if you are not familiar, view that first. diff --git a/examples/generating_custom_msgs/main.cc b/examples/generating_custom_msgs/main.cc index 665a655b..9be88098 100644 --- a/examples/generating_custom_msgs/main.cc +++ b/examples/generating_custom_msgs/main.cc @@ -7,11 +7,8 @@ // A simple example that demonstrates the use of the message factory // // ./generating_custom_messages -int main(int argc, char** argv) +int main() { - (void) argc; - (void) argv; - gz::custom_msgs::BazStamped msg; // msg has header and baz field @@ -45,7 +42,7 @@ int main(int argc, char** argv) auto *bar = baz->mutable_bar(); { - // Set the values of our custom sub-messges + // Set the values of our custom sub-messages foo->set_value(1.0); bar->set_value(1.0); } @@ -63,6 +60,6 @@ int main(int argc, char** argv) { // Print the populated values of a message std::cout << "===============================" << std::endl; - std::cout << "Pouplated Message: \n" << msg.DebugString() << std::endl; + std::cout << "Populated Message: \n" << msg.DebugString() << std::endl; } } diff --git a/examples/using_gz_msgs/main.cc b/examples/using_gz_msgs/main.cc index e81abea4..40761616 100644 --- a/examples/using_gz_msgs/main.cc +++ b/examples/using_gz_msgs/main.cc @@ -18,7 +18,7 @@ int main(int argc, char** argv) std::cout << "Known types: " << std::endl; for (const auto &t: known_types) { - std::cout << t << std::endl; + std::cout << t << std::endl; } } else diff --git a/gz-msgs-extras.cmake.in b/gz-msgs-extras.cmake.in index 39936b57..d1e1c859 100644 --- a/gz-msgs-extras.cmake.in +++ b/gz-msgs-extras.cmake.in @@ -43,7 +43,7 @@ set(@PROJECT_NAME@_PROTO_GENERATOR_SCRIPT ${@PROJECT_NAME@_INSTALL_PATH}/bin/${P set(@PROJECT_NAME@_FACTORY_GENERATOR_SCRIPT ${@PROJECT_NAME@_INSTALL_PATH}/bin/${FACTORY_SCRIPT_NAME}) ################################################## -# A function to generate a target mesage library from a group of protobuf files . +# A function to generate a target message library from a group of protobuf files . # The generation follows the conventions to make the messages available in gazebo tooling # # For an example use, consult gz-msgs/examples/generating_custom_messages diff --git a/proto/gz/msgs/data_load_options.proto b/proto/gz/msgs/data_load_options.proto index 6216e79b..ba37f5b8 100644 --- a/proto/gz/msgs/data_load_options.proto +++ b/proto/gz/msgs/data_load_options.proto @@ -53,6 +53,6 @@ message DataLoadPathOptions /// Units DataAngularUnits units = 7; - /// Spherical Coodinate type + /// Spherical Coordinate type gz.msgs.SphericalCoordinatesType coordinate_type = 8; } diff --git a/proto/gz/msgs/discovery.proto b/proto/gz/msgs/discovery.proto index 93c56792..aec0b4ed 100644 --- a/proto/gz/msgs/discovery.proto +++ b/proto/gz/msgs/discovery.proto @@ -43,7 +43,7 @@ message Discovery /// \brief Unadvertise message. UNADVERTISE = 3; - /// \brief Hearbeat message. + /// \brief Heartbeat message. HEARTBEAT = 4; /// \brief Bye message. diff --git a/proto/gz/msgs/response.proto b/proto/gz/msgs/response.proto index b8e44bfc..d202b04b 100644 --- a/proto/gz/msgs/response.proto +++ b/proto/gz/msgs/response.proto @@ -22,7 +22,7 @@ option java_outer_classname = "ResponseProtos"; /// \ingroup gz.msgs /// \interface Response -/// \brief Message that encapsulates a respons message with a type description +/// \brief Message that encapsulates a response message with a type description import "gz/msgs/header.proto"; diff --git a/test/integration/gz_TEST.cc b/test/integration/gz_TEST.cc index 1cea4b7d..79b57fc5 100644 --- a/test/integration/gz_TEST.cc +++ b/test/integration/gz_TEST.cc @@ -40,7 +40,7 @@ std::string make_exec_string(const std::string &_args) } ///////////////////////////////////////////////// -std::string custom_exec_str(std::string _cmd) +std::string custom_exec_str(const std::string &_cmd) { FILE *pipe = popen(_cmd.c_str(), "r"); @@ -48,7 +48,7 @@ std::string custom_exec_str(std::string _cmd) return "ERROR"; char buffer[128]; - std::string result = ""; + std::string result; while (!feof(pipe)) { diff --git a/tutorials/message_generation.md b/tutorials/message_generation.md index bf119c01..11bf6ffb 100644 --- a/tutorials/message_generation.md +++ b/tutorials/message_generation.md @@ -214,7 +214,7 @@ gz_msgs_generate_messages( MSGS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/proto # List of proto files to process MSGS_PROTOS ${MSGS_PROTOS} - # Depenency on gz-msgs + # Dependency on gz-msgs DEPENDENCIES gz-msgs12::gz-msgs12 ) ``` @@ -286,7 +286,7 @@ Unable to create message of type[gz.custom_msgs.Foo] with data[value: 1.0]. ``` To use the new messages, point the `GZ_DESCRIPTOR_PATH` environment variable to -the location of the `build` folder or where you have choosen to install the +the location of the `build` folder or where you have chosen to install the `.gz_desc` file: ```sh