From a5b7a19516e8329c2100d7a77c1b01b245dd2a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Sat, 12 Mar 2022 03:58:25 +0100 Subject: [PATCH 1/5] Added option to visualize light in GUI (#877) Signed-off-by: ahcorde Signed-off-by: Louise Poubel Co-authored-by: Louise Poubel --- include/sdf/Light.hh | 8 ++++++++ sdf/1.8/light.sdf | 4 ++++ src/Light.cc | 18 ++++++++++++++++++ src/Light_TEST.cc | 12 ++++++++++++ 4 files changed, 42 insertions(+) diff --git a/include/sdf/Light.hh b/include/sdf/Light.hh index 210026aca..dfc8a40fa 100644 --- a/include/sdf/Light.hh +++ b/include/sdf/Light.hh @@ -134,6 +134,14 @@ namespace sdf /// \param[in] _cast True to indicate that the light is on, False otherwise. public: void SetLightOn(const bool _isLightOn); + /// \brief Whether light visualization in the GUI is enabled. + /// \return True if visualization is enabled. + public: bool Visualize() const; + + /// \brief Set whether light visualization in the GUI is enabled. + /// \param[in] _visualize True to view the light on the GUI. + public: void SetVisualize(const bool _visualize); + /// \brief Get the light intensity /// \return The light intensity public: double Intensity() const; diff --git a/sdf/1.8/light.sdf b/sdf/1.8/light.sdf index a6939ac48..356bad19a 100644 --- a/sdf/1.8/light.sdf +++ b/sdf/1.8/light.sdf @@ -18,6 +18,10 @@ When true, the light is on. + + If true, the light is visualized in the GUI + + Scale factor to set the relative power of a light. diff --git a/src/Light.cc b/src/Light.cc index c35850e78..b95e3e123 100644 --- a/src/Light.cc +++ b/src/Light.cc @@ -86,6 +86,9 @@ class sdf::Light::Implementation /// \brief Is light on ? public: bool isLightOn = true; + + /// \brief is visual light enabled ? + public: bool visualize = true; }; ///////////////////////////////////////////////// @@ -147,6 +150,9 @@ Errors Light::Load(ElementPtr _sdf) this->dataPtr->isLightOn = _sdf->Get("light_on", this->dataPtr->isLightOn).first; + this->dataPtr->visualize = _sdf->Get("visualize", + this->dataPtr->visualize).first; + this->dataPtr->castShadows = _sdf->Get("cast_shadows", this->dataPtr->castShadows).first; @@ -334,6 +340,18 @@ void Light::SetLightOn(const bool _isLightOn) this->dataPtr->isLightOn = _isLightOn; } +///////////////////////////////////////////////// +bool Light::Visualize() const +{ + return this->dataPtr->visualize; +} + +///////////////////////////////////////////////// +void Light::SetVisualize(const bool _visualize) +{ + this->dataPtr->visualize = _visualize; +} + ///////////////////////////////////////////////// ignition::math::Color Light::Diffuse() const { diff --git a/src/Light_TEST.cc b/src/Light_TEST.cc index 5ac8ed77a..7d43b3898 100644 --- a/src/Light_TEST.cc +++ b/src/Light_TEST.cc @@ -59,6 +59,10 @@ TEST(DOMLight, DefaultConstruction) light.SetLightOn(false); EXPECT_FALSE(light.LightOn()); + EXPECT_TRUE(light.Visualize()); + light.SetVisualize(false); + EXPECT_FALSE(light.Visualize()); + EXPECT_FALSE(light.CastShadows()); light.SetCastShadows(true); EXPECT_TRUE(light.CastShadows()); @@ -118,6 +122,7 @@ TEST(DOMLight, CopyConstructor) light.SetPoseRelativeTo("ground_plane"); light.SetCastShadows(true); light.SetLightOn(false); + light.SetVisualize(false); light.SetDiffuse(ignition::math::Color(0.4f, 0.5f, 0.6f, 1.0)); light.SetSpecular(ignition::math::Color(0.8f, 0.9f, 0.1f, 1.0)); light.SetAttenuationRange(3.2); @@ -137,6 +142,7 @@ TEST(DOMLight, CopyConstructor) EXPECT_EQ("ground_plane", light2.PoseRelativeTo()); EXPECT_TRUE(light2.CastShadows()); EXPECT_FALSE(light2.LightOn()); + EXPECT_FALSE(light2.Visualize()); EXPECT_EQ(ignition::math::Color(0.4f, 0.5f, 0.6f, 1), light2.Diffuse()); EXPECT_EQ(ignition::math::Color(0.8f, 0.9f, 0.1f, 1), light2.Specular()); EXPECT_DOUBLE_EQ(3.2, light2.AttenuationRange()); @@ -160,6 +166,7 @@ TEST(DOMLight, CopyAssignmentOperator) light.SetPoseRelativeTo("ground_plane"); light.SetCastShadows(true); light.SetLightOn(false); + light.SetVisualize(false); light.SetDiffuse(ignition::math::Color(0.4f, 0.5f, 0.6f, 1.0)); light.SetSpecular(ignition::math::Color(0.8f, 0.9f, 0.1f, 1.0)); light.SetAttenuationRange(3.2); @@ -180,6 +187,7 @@ TEST(DOMLight, CopyAssignmentOperator) EXPECT_EQ("ground_plane", light2.PoseRelativeTo()); EXPECT_TRUE(light2.CastShadows()); EXPECT_FALSE(light2.LightOn()); + EXPECT_FALSE(light2.Visualize()); EXPECT_EQ(ignition::math::Color(0.4f, 0.5f, 0.6f, 1), light2.Diffuse()); EXPECT_EQ(ignition::math::Color(0.8f, 0.9f, 0.1f, 1), light2.Specular()); EXPECT_DOUBLE_EQ(3.2, light2.AttenuationRange()); @@ -203,6 +211,7 @@ TEST(DOMLight, MoveConstructor) light.SetPoseRelativeTo("ground_plane"); light.SetCastShadows(true); light.SetLightOn(false); + light.SetVisualize(false); light.SetDiffuse(ignition::math::Color(0.4f, 0.5f, 0.6f, 1.0)); light.SetSpecular(ignition::math::Color(0.8f, 0.9f, 0.1f, 1.0)); light.SetAttenuationRange(3.2); @@ -222,6 +231,7 @@ TEST(DOMLight, MoveConstructor) EXPECT_EQ("ground_plane", light2.PoseRelativeTo()); EXPECT_TRUE(light2.CastShadows()); EXPECT_FALSE(light2.LightOn()); + EXPECT_FALSE(light2.Visualize()); EXPECT_EQ(ignition::math::Color(0.4f, 0.5f, 0.6f, 1), light2.Diffuse()); EXPECT_EQ(ignition::math::Color(0.8f, 0.9f, 0.1f, 1), light2.Specular()); EXPECT_DOUBLE_EQ(3.2, light2.AttenuationRange()); @@ -245,6 +255,7 @@ TEST(DOMLight, MoveAssignment) light.SetPoseRelativeTo("ground_plane"); light.SetCastShadows(true); light.SetLightOn(false); + light.SetVisualize(false); light.SetDiffuse(ignition::math::Color(0.4f, 0.5f, 0.6f, 1.0)); light.SetSpecular(ignition::math::Color(0.8f, 0.9f, 0.1f, 1.0)); light.SetAttenuationRange(3.2); @@ -265,6 +276,7 @@ TEST(DOMLight, MoveAssignment) EXPECT_EQ("ground_plane", light2.PoseRelativeTo()); EXPECT_TRUE(light2.CastShadows()); EXPECT_FALSE(light2.LightOn()); + EXPECT_FALSE(light2.Visualize()); EXPECT_EQ(ignition::math::Color(0.4f, 0.5f, 0.6f, 1), light2.Diffuse()); EXPECT_EQ(ignition::math::Color(0.8f, 0.9f, 0.1f, 1), light2.Specular()); EXPECT_DOUBLE_EQ(3.2, light2.AttenuationRange()); From b0647c9210c9796cb51e06283ccab37300db886a Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Mon, 14 Mar 2022 14:36:17 -0700 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=8E=88=2011.4.0=20(#879)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Louise Poubel Co-authored-by: Alejandro Hernández Cordero --- CMakeLists.txt | 2 +- Changelog.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 687c3cad6..2c123e0e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0004 NEW) endif(COMMAND CMAKE_POLICY) -project (sdformat11 VERSION 11.3.0) +project (sdformat11 VERSION 11.4.0) # The protocol version has nothing to do with the package version. # It represents the current version of SDFormat implemented by the software diff --git a/Changelog.md b/Changelog.md index 4829f6554..4b2dc4eff 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,94 @@ ## libsdformat 11.X +### libsdformat 11.4.0 (2022-03-14) + +1. Added option to visualize light on the GUI + * [Pull request #877](https://github.com/ignitionrobotics/sdformat/pull/877) + +1. Fix joint parent/child frame existence checks to include interface elements + * [Pull request #855](https://github.com/ignitionrobotics/sdformat/pull/855) + +1. Added to light whether it is on or off + * [Pull request #851](https://github.com/ignitionrobotics/sdformat/pull/851) + +1. Allow model frames (__model__) to be used as joint parent or child + * [Pull request #833](https://github.com/ignitionrobotics/sdformat/pull/833) + +1. Add ParserConfig flag for preserveFixedJoint + * [Pull request #815](https://github.com/ignitionrobotics/sdformat/pull/815) + +1. Fix compiler warnings + * [Pull request #808](https://github.com/ignitionrobotics/sdformat/pull/808) + +1. `sdf_custom`: fix nested model expectations + * [Pull request #807](https://github.com/ignitionrobotics/sdformat/pull/807) + +1. Fix test compilation with `USE_INTERNAL_URDF` + * [Pull request #800](https://github.com/ignitionrobotics/sdformat/pull/800) + +1. Replace custom CMake code with `ign-cmake2` + * [Pull request #780](https://github.com/ignitionrobotics/sdformat/pull/780) + +1. Fix loading nested include with custom attributes + * [Pull request #789](https://github.com/ignitionrobotics/sdformat/pull/789) + +1. Documentation + 1. Clarify behavior of `//model/model/static` + * [Pull request #713](https://github.com/ignitionrobotics/sdformat/pull/713) + 1. Only allow one `canonical_link` attribute for model + * [Pull request #716](https://github.com/ignitionrobotics/sdformat/pull/716) + 1. Don't mention elements that can't be included + * [Pull request #715](https://github.com/ignitionrobotics/sdformat/pull/715) + 1. Clarify documentation on `//pose/@relative_to` in the spec + * [Pull request #666](https://github.com/ignitionrobotics/sdformat/pull/666) + 1. Remove duplicate link documentation + * [Pull request #702](https://github.com/ignitionrobotics/sdformat/pull/702) + +1. Fix URDF fixed joint reduction of plugins + * [Pull request #745](https://github.com/ignitionrobotics/sdformat/pull/745) + +1. Add `enable_orientation` to 1.6 spec + * [Pull request #686](https://github.com/ignitionrobotics/sdformat/pull/686) + +1. Remove outdated deprecation note from `parser_urdf.hh` + * [Pull request #740](https://github.com/ignitionrobotics/sdformat/pull/740) + +1. Add Joint DOM API to access joint sensors + * [Pull request #517](https://github.com/ignitionrobotics/sdformat/pull/517) + +1. Add force torque sensor + * [Pull request #393](https://github.com/ignitionrobotics/sdformat/pull/393) + * [Pull request #669](https://github.com/ignitionrobotics/sdformat/pull/669) + +1. Check joint parent link names in `Model::Load` + * [Pull request #726](https://github.com/ignitionrobotics/sdformat/pull/726) + +1. Check joint parent/child names in `Root::Load` + * [Pull request #727](https://github.com/ignitionrobotics/sdformat/pull/727) + +1. Remove empty `//inertial/pose/@relative_to` during 1_7->1.8 conversion + * [Pull request #720](https://github.com/ignitionrobotics/sdformat/pull/720) + +1. Fix `xyz` and `rpy` offsets in fixed joint reduction + * [Pull request #500](https://github.com/ignitionrobotics/sdformat/pull/500) + +1. Infrastructure updates + * [Pull request #674](https://github.com/ignitionrobotics/sdformat/pull/674) + * [Pull request #650](https://github.com/ignitionrobotics/sdformat/pull/650) + * [Pull request #626](https://github.com/ignitionrobotics/sdformat/pull/626) + * [Pull request #258](https://github.com/ignitionrobotics/sdformat/pull/258) + * [Pull request #237](https://github.com/ignitionrobotics/sdformat/pull/237) + * [Pull request #730](https://github.com/ignitionrobotics/sdformat/pull/730) + +1. Translate poses of nested models inside other nested models + * [Pull request #596](https://github.com/ignitionrobotics/sdformat/pull/596) + +1. Fix flattening logic for nested model names + * [Pull request #597](https://github.com/ignitionrobotics/sdformat/pull/597) + +1. Parse `rpyOffset` as radians + * [Pull request #497](https://github.com/ignitionrobotics/sdformat/pull/497) + ### libsdformat 11.3.0 (2021-09-10) 1. Fix world-complete.sdf and add particle_scatter_ratio to v1.8 From f9e3e3d85246022ea47e1c04e23b3cea12e3bb29 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 21 Mar 2022 14:58:26 -0700 Subject: [PATCH 3/5] Install sdf/1.8 to versioned path (#890) Fixes a mistake from merging forward in #808. Signed-off-by: Steve Peters --- sdf/1.8/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdf/1.8/CMakeLists.txt b/sdf/1.8/CMakeLists.txt index d074806f5..30555b39a 100644 --- a/sdf/1.8/CMakeLists.txt +++ b/sdf/1.8/CMakeLists.txt @@ -82,5 +82,5 @@ add_custom_target(schema1_8 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) +install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) From cd0e8735771dbf8e4c74422e49ce5b5eb97d8810 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 21 Mar 2022 14:59:16 -0700 Subject: [PATCH 4/5] Install sdf/1.8 and sdf/1.9 to versioned paths (#891) * Install sdf/1.8 to versioned path * Install sdf/1.9 to a versioned path. Fixes a mistake from merging forward in #808 and #810. Signed-off-by: Steve Peters --- sdf/1.8/CMakeLists.txt | 4 ++-- sdf/1.9/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdf/1.8/CMakeLists.txt b/sdf/1.8/CMakeLists.txt index d074806f5..30555b39a 100644 --- a/sdf/1.8/CMakeLists.txt +++ b/sdf/1.8/CMakeLists.txt @@ -82,5 +82,5 @@ add_custom_target(schema1_8 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) +install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) diff --git a/sdf/1.9/CMakeLists.txt b/sdf/1.9/CMakeLists.txt index 209d63043..7778acafd 100644 --- a/sdf/1.9/CMakeLists.txt +++ b/sdf/1.9/CMakeLists.txt @@ -82,5 +82,5 @@ add_custom_target(schema1_9 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_8.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.9) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.9) +install(FILES 1_8.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.9) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.9) From 75b17a2ff6172e42df9b576a74219b95708e0523 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 21 Mar 2022 17:11:23 -0700 Subject: [PATCH 5/5] Prepare for 11.4.1 patch release (#892) Signed-off-by: Steve Peters --- CMakeLists.txt | 2 +- Changelog.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c123e0e7..ddcd6e2fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0004 NEW) endif(COMMAND CMAKE_POLICY) -project (sdformat11 VERSION 11.4.0) +project (sdformat11 VERSION 11.4.1) # The protocol version has nothing to do with the package version. # It represents the current version of SDFormat implemented by the software diff --git a/Changelog.md b/Changelog.md index 4b2dc4eff..47d0a25b2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ ## libsdformat 11.X +### libsdformat 11.4.1 (2022-03-21) + +1. Install sdf/1.8 to versioned path + * [Pull request #898](https://github.com/ignitionrobotics/sdformat/pull/898) + ### libsdformat 11.4.0 (2022-03-14) 1. Added option to visualize light on the GUI