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

Merge forward msgs5 to master #71

Merged
merged 40 commits into from Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
34277f8
Ignore deprecation warnings on generated code
chapulina Dec 21, 2019
2f3d771
suppress warning in test
chapulina Dec 21, 2019
8c3c71e
Close branch ignore_deprecations
chapulina Dec 22, 2019
935ec5d
Merged in ignore_deprecations (pull request #170)
chapulina Dec 22, 2019
827785b
Handle empty xml elements
nkoenig Jan 9, 2020
90be842
Merged ign-msgs5 into fix_tinyxml_gettext
scpeters Jan 9, 2020
d4a3217
Close branch fix_tinyxml_gettext
nkoenig Jan 10, 2020
07012f7
Merged in fix_tinyxml_gettext (pull request #172)
nkoenig Jan 10, 2020
71fd956
Add sdf_generator_config
azeey Mar 4, 2020
027e78f
Update documentation
azeey Mar 31, 2020
348f4ef
Address reviewer feedback
azeey Apr 8, 2020
bbebbf6
Update changelog
azeey Apr 8, 2020
d4196a7
Close branch sdf_generator_config
chapulina Apr 9, 2020
a401309
Merged in sdf_generator_config (pull request #174)
chapulina Apr 9, 2020
9f6b28b
Bump to 4.8.0
chapulina Apr 9, 2020
9be8d7e
Dates, why don't we all just agree?
chapulina Apr 9, 2020
b0dc6e6
update PR number. Changelog.md edited online with Bitbucket
iche033 Apr 9, 2020
4a8d795
Close branch bump_4.8.0
chapulina Apr 9, 2020
50645d9
Merged in bump_4.8.0 (pull request #177)
chapulina Apr 9, 2020
6bdfe3e
Added tag ignition-msgs4_4.8.0 for changeset 2b35a7c6156f
chapulina Apr 9, 2020
9e79223
mv hgignotr
Apr 20, 2020
adebec8
remove hg syntax add comments
Apr 20, 2020
ff67c5a
mv hgignore
Apr 20, 2020
7c8df16
add gitignore
Apr 20, 2020
57d9490
[ign-msgs4] Update BitBucket links (#39)
chapulina Apr 22, 2020
84ff940
[ign-msgs5] Update BitBucket links (#40)
chapulina Apr 22, 2020
4aa7e37
[ign-msgs4] Workflow updates (#49)
chapulina May 4, 2020
5309506
[ign-msgs5] Workflow updates (#50)
chapulina May 7, 2020
4eb9f68
merge from ign-msgs4
iche033 May 7, 2020
1b3aee3
cleanup
iche033 May 7, 2020
2ca01f6
Merge pull request #53 from ignitionrobotics/merge_4_5_20200506
chapulina May 8, 2020
0546b22
:arrow_up: Bump to 5.2.0 (#54)
chapulina May 14, 2020
2b85601
Add multi entity factory message
May 20, 2020
feae6f4
Bump version to 4.9.0 so that we can relase asap.
May 20, 2020
8714110
Merge pull request #58 from ignitionrobotics/mult_enitty
nkoenig May 20, 2020
e496d66
Merge 4 to 5
May 21, 2020
fcb5806
Bump to 5.3.0 and update changelog
May 21, 2020
28d7eec
Merge pull request #59 from ignitionrobotics/4_to_5_may2020
nkoenig May 21, 2020
57e877b
Add CMake options to support cross-compilation (#60)
traversaro Jun 6, 2020
8088dbe
Merge branch 'ign-msgs5' of github.com:ignitionrobotics/ign-msgs into…
j-rivero Jul 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ build_*
# OS generated files
.DS_Store
*.swp
*.orig
29 changes: 28 additions & 1 deletion CMakeLists.txt
Expand Up @@ -20,7 +20,34 @@ ign_configure_project(VERSION_SUFFIX pre1)
# Set project-specific options
#============================================================================

# ignition-msgs currently has no options that are unique to it
# Cross-compilation related options
# In a cross-compilation scenario, it is possible that the ign_msgs_gen
# generator compiled for the target machine cannot be used to generate
# the C++ code corresponding to the .proto definition. For this scenario,
# the following two options can be used as follows.
# First of all, ign-msgs is compiled targeting the host machine, and in the
# build targeting the host, the INSTALL_IGN_MSGS_GEN_EXECUTABLE option is
# enabled:
# > cmake -DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=ON ..
# ensuring that the ign_msgs_gen is installed in
# <host_install_prefix>/bin/ign_msgs_gen . Then, the same version of ign-msgs
# can be cross-compiled, and in the cross-compilation build the location of the
# host ign_msgs_gen is specified via the IGN_MSGS_GEN_EXECUTABLE
# CMake cache variable:
# > cmake -IGN_MSGS_GEN_EXECUTABLE=<host_install_prefix>/bin/ign_msgs_gen ..

option(
INSTALL_IGN_MSGS_GEN_EXECUTABLE
"Install the ign_msgs_gen executable."
OFF)
mark_as_advanced(INSTALL_IGN_MSGS_GEN_EXECUTABLE)

set(
IGN_MSGS_GEN_EXECUTABLE
"$<TARGET_FILE:ign_msgs_gen>"
CACHE STRING
"ign_msgs_gen executable used in the ign_msgs_protoc CMake function.")
mark_as_advanced(IGN_MSGS_GEN_EXECUTABLE)

#============================================================================
# Search for project-specific dependencies
Expand Down
35 changes: 33 additions & 2 deletions Changelog.md
Expand Up @@ -6,7 +6,26 @@

## Ignition Msgs 5.x

### Ignition Msgs 5.x.x
### Ignition Msgs 5.3.0 (2020-05-20)

1. Added the `EntityFactory_V` message.
* [Pull request 58](https://github.com/ignitionrobotics/ign-msgs/pull/58)

### Ignition Msgs 5.2.0 (2020-05-14)

1. Handle empty xml elements
* [BitBucket pull request 172](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/172)

1. Ignore deprecation warnings on generated code
* [BitBucket pull request 170](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/170)

1. Add SdfGeneratorConfig message containing configuration options for generating SDFormat from currently loaded worlds
* [BitBucket pull request 174](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/174)

1. BitBucket to GitHub migration
* [Pull request](https://github.com/ignitionrobotics/ign-msgs/pull/39)
* [Pull request](https://github.com/ignitionrobotics/ign-msgs/pull/40)
* [Pull request](https://github.com/ignitionrobotics/ign-msgs/pull/43)

### Ignition Msgs 5.1.0

Expand All @@ -33,13 +52,25 @@
1. Added `fuel_metadata.proto`, `version.proto`, `version_range.proto`, and `versioned_name.proto` message files. Added conversion functions to/from the model.config/metadata.pbtxt formats.
* [BitBucket pull request 157](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/157)


## Ignition Msgs 4.x

### Ignition Msgs 4.x.x
### Ignition Msgs 4.9.0 (2020-05-20)

1. Added the `EntityFactory_V` message.
* [Pull request 58](https://github.com/ignitionrobotics/ign-msgs/pull/58)

### Ignition Msgs 4.8.0 (2020-04-09)

1. Add SdfGeneratorConfig message containing configuration options for generating SDFormat from currently loaded worlds
* [BitBucket pull request 174](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/174)

1. Fix linking order of Protocol Buffers static libraries on GCC
* [BitBucket pull request 151](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/151)

1. Ignore deprecation warnings on generated code
* [BitBucket pull request 170](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-msgs/pull-requests/170)

### Ignition Msgs 4.7.0 (2019-08-22)

1. Add video record message
Expand Down
37 changes: 37 additions & 0 deletions proto/ignition/msgs/entity_factory_v.proto
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2020 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 ignition.msgs;
option java_package = "com.ignition.msgs";
option java_outer_classname = "EntityFactoryVProtos";

/// \ingroup ignition.msgs
/// \interface EntityFactory_V
/// \brief A message for a vector of EntityFactory messages
//
import "ignition/msgs/entity_factory.proto";
import "ignition/msgs/header.proto";

message EntityFactory_V
{
/// \brief Optional header data
Header header = 1;

/// \brief The set of entity factory messages.
repeated EntityFactory data = 2;
}
58 changes: 58 additions & 0 deletions proto/ignition/msgs/sdf_generator_config.proto
@@ -0,0 +1,58 @@
/*
* Copyright (C) 2020 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 ignition.msgs;
option java_package = "com.ignition.msgs";
option java_outer_classname = "SdfGeneratorConfigProtos";

/// \ingroup ignition.msgs
/// \interface SdfGeneratorConfig
/// \brief Message containing configuration options for generating SDFormat from
/// currently loaded worlds

import "ignition/msgs/boolean.proto";
import "ignition/msgs/header.proto";

message SdfGeneratorConfig
{
/// \brief Configuration for SDFormat generation of entities (eg. models, actors, lights)
message EntityGeneratorConfig
{
/// \brief Expand and inline included entities
ignition.msgs.Boolean expand_include_tags = 1;
/// \brief Use the Fuel version in generated URIs of Fuel resources
ignition.msgs.Boolean save_fuel_version = 2;
/// \brief Use absolute paths for resources such as meshes
ignition.msgs.Boolean resources_use_absolute_paths = 3;
/// \brief Copy model resources, such as meshes, and create a self contained
/// model.
ignition.msgs.Boolean copy_model_resources = 4;
};

/// \brief Optional header data
ignition.msgs.Header header = 1;

/// \brief Global setting for SDFormat generation of entities
EntityGeneratorConfig global_entity_gen_config = 2;

/// \brief Per-entity override of global settings for SDFormat generation.
/// The key is the scoped name of an entity.
map<string, EntityGeneratorConfig> override_entity_gen_configs = 3;
};

6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -11,6 +11,10 @@ if (UNIX)
target_link_libraries(ign_msgs_gen pthread)
endif()

if(INSTALL_IGN_MSGS_GEN_EXECUTABLE)
set_target_properties(ign_msgs_gen PROPERTIES VERSION ${PROJECT_VERSION_FULL})
install(TARGETS ign_msgs_gen DESTINATION ${IGN_BIN_INSTALL_DIR})
endif()

##################################################
# A function that calls protoc on a protobuf file
Expand Down Expand Up @@ -57,7 +61,7 @@ function(ign_msgs_protoc)
list(APPEND ${ign_msgs_protoc_OUTPUT_CPP_CC_VAR} ${output_source})
list(APPEND output_files ${output_header})
list(APPEND output_files ${output_source})
list(APPEND protoc_args "--plugin=protoc-gen-ignmsgs=$<TARGET_FILE:ign_msgs_gen>")
list(APPEND protoc_args "--plugin=protoc-gen-ignmsgs=${IGN_MSGS_GEN_EXECUTABLE}")
list(APPEND protoc_args "--cpp_out=dllexport_decl=IGNITION_MSGS_VISIBLE:${ign_msgs_protoc_OUTPUT_CPP_DIR}")
list(APPEND protoc_args "--ignmsgs_out" "${ign_msgs_protoc_OUTPUT_CPP_DIR}")
set(${ign_msgs_protoc_OUTPUT_CPP_HH_VAR} ${${ign_msgs_protoc_OUTPUT_CPP_HH_VAR}} PARENT_SCOPE)
Expand Down
37 changes: 21 additions & 16 deletions src/Utility.cc
Expand Up @@ -998,7 +998,7 @@ namespace ignition

// Read the name, which is a mandatory element.
tinyxml2::XMLElement *elem = modelElement->FirstChildElement("name");
if (!elem)
if (!elem || !elem->GetText())
{
std::cerr << "Model config string does not contain a <name> element\n";
return false;
Expand All @@ -1007,7 +1007,7 @@ namespace ignition

// Read the description, if present.
elem = modelElement->FirstChildElement("description");
if (elem)
if (elem && elem->GetText())
meta.set_description(trimmed(elem->GetText()));

// Read the authors, if any.
Expand All @@ -1016,11 +1016,13 @@ namespace ignition
{
ignition::msgs::FuelMetadata::Contact *author = meta.add_authors();
// Get the author name and email
if (elem->FirstChildElement("name"))
if (elem->FirstChildElement("name") &&
elem->FirstChildElement("name")->GetText())
{
author->set_name(trimmed(elem->FirstChildElement("name")->GetText()));
}
if (elem->FirstChildElement("email"))
if (elem->FirstChildElement("email") &&
elem->FirstChildElement("email")->GetText())
{
author->set_email(
trimmed(elem->FirstChildElement("email")->GetText()));
Expand All @@ -1034,21 +1036,24 @@ namespace ignition
math::SemanticVersion maxVer;
while (elem)
{
std::string verStr = elem->Attribute("version");
math::SemanticVersion ver(trimmed(verStr));
if (ver > maxVer)
if (elem->GetText() && elem->Attribute("version"))
{
meta.mutable_model()->mutable_file_format()->set_name("sdf");
ignition::msgs::Version *verMsg =
meta.mutable_model()->mutable_file_format()->mutable_version();
std::string verStr = elem->Attribute("version");
math::SemanticVersion ver(trimmed(verStr));
if (ver > maxVer)
{
meta.mutable_model()->mutable_file_format()->set_name("sdf");
ignition::msgs::Version *verMsg =
meta.mutable_model()->mutable_file_format()->mutable_version();

verMsg->set_major(ver.Major());
verMsg->set_minor(ver.Minor());
verMsg->set_patch(ver.Patch());
verMsg->set_prerelease(ver.Prerelease());
verMsg->set_build(ver.Build());
verMsg->set_major(ver.Major());
verMsg->set_minor(ver.Minor());
verMsg->set_patch(ver.Patch());
verMsg->set_prerelease(ver.Prerelease());
verMsg->set_build(ver.Build());

meta.mutable_model()->set_file(trimmed(elem->GetText()));
meta.mutable_model()->set_file(trimmed(elem->GetText()));
}
}

elem = elem->NextSiblingElement("sdf");
Expand Down