From 6459d026841e10f9457a5ac058099cba44134eb3 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 21 May 2024 17:47:50 -0500 Subject: [PATCH 1/8] Disable failing windows tests (#255) * Disable `ManagerTest.RunLs` test on windows * Add dependency on ign-utils * Use Pathname to determine if path is absolute * Disable ign_TEST on windows, disable ManagerTest.RunEnvPre because it timesout * Disable one more test on windows --------- Signed-off-by: Addisu Z. Taddese --- src/CMakeLists.txt | 1 + src/Manager_TEST.cc | 8 ++++---- src/cmd/CMakeLists.txt | 5 +++++ src/cmd/cmdlaunch.rb.in | 6 +++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 79180720..7833ae32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,7 @@ ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${PROJECT_LIBRARY_TARGET_NAME} ignition-common${IGN_COMMON_MAJOR_VER}::ignition-common${IGN_COMMON_MAJOR_VER} + ignition-utils${IGN_UTILS_VER}::core ) add_subdirectory(cmd) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index 14c9aac1..e23c288b 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -112,7 +112,7 @@ TEST_F(ManagerTest, RunBadXml) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunLs) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunLs)) { std::string cmd; @@ -137,7 +137,7 @@ TEST_F(ManagerTest, RunLs) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPre) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPre)) { // Test that environment is applied regardless of order #ifndef _WIN32 @@ -175,7 +175,7 @@ TEST_F(ManagerTest, RunEnvPre) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPost) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPost)) { // Test that environment is applied regardless of order #ifndef _WIN32 diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index c940669a..9b773c5f 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -2,6 +2,11 @@ # "gtest_sources" variable. ign_get_libsources_and_unittests(sources gtest_sources) +# Disable tests that need CLI if ign-tools is not found +if (MSVC OR NOT IGN_TOOLS_PROGRAM) + list(REMOVE_ITEM gtest_sources ign_TEST.cc) +endif() + add_library(ign STATIC ign.cc) target_include_directories(ign PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(ign PUBLIC diff --git a/src/cmd/cmdlaunch.rb.in b/src/cmd/cmdlaunch.rb.in index 6f28304e..a57abfa8 100755 --- a/src/cmd/cmdlaunch.rb.in +++ b/src/cmd/cmdlaunch.rb.in @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'pathname' # Constants. LIBRARY_VERSION = '@PROJECT_VERSION_FULL@' COMMANDS = { @@ -28,9 +29,8 @@ class Cmd command = args[0] exe_name = COMMANDS[command] - if exe_name[0] == '/' - # If the first character is a slash, we'll assume that we've been given an - # absolute path to the executable. This is only used during test mode. + if Pathname.new(exe_name).absolute? + # The exe_name can be absolute path during test. We'll leave it unchanged else # We're assuming that the library path is relative to the current # location of this script. From 61eaf3722b7a2f7f2820dd2a58b60d41f035d5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crist=C3=B3bal=20Arroyo?= Date: Fri, 24 May 2024 11:17:54 -0500 Subject: [PATCH 2/8] Fix windows warnings (#199) (#258) * Fix windows warnings (#199) * Fix windows warnings Signed-off-by: Nate Koenig * Fix more windows warnings Signed-off-by: Nate Koenig * Added string include Signed-off-by: Nate Koenig --------- Signed-off-by: Nate Koenig Signed-off-by: Nate Koenig Co-authored-by: Nate Koenig * Include vector Signed-off-by: Crola1702 --------- Signed-off-by: Nate Koenig Signed-off-by: Nate Koenig Signed-off-by: Crola1702 Co-authored-by: Nate Koenig Co-authored-by: Nate Koenig --- plugins/joy_to_twist/JoyToTwist.cc | 51 ++++++++---- plugins/joy_to_twist/JoyToTwist.hh | 6 +- src/Manager.hh | 2 +- src/vendor/backward.hpp | 120 +++++++++++++++-------------- 4 files changed, 102 insertions(+), 77 deletions(-) diff --git a/plugins/joy_to_twist/JoyToTwist.cc b/plugins/joy_to_twist/JoyToTwist.cc index ccbc118e..1c1d550e 100644 --- a/plugins/joy_to_twist/JoyToTwist.cc +++ b/plugins/joy_to_twist/JoyToTwist.cc @@ -19,10 +19,11 @@ #include #ifndef _WIN32 #include -#else - #endif +#include +#include + #include #include #include @@ -48,6 +49,22 @@ void setVectorFromString(const std::string &_str, } } +////////////////////////////////////////////////// +// String to vector helper function. +void setVectorFromString(const std::string &_str, + gz::math::Vector3i &_v) +{ + std::string str = gz::common::trimmed(_str); + + std::vector parts = gz::common::split(str, " "); + if (parts.size() == 3) + { + _v.X(std::stoi(parts[0])); + _v.Y(std::stoi(parts[1])); + _v.Z(std::stoi(parts[2])); + } +} + ///////////////////////////////////////////////// JoyToTwist::JoyToTwist() : Plugin() @@ -129,18 +146,21 @@ void JoyToTwist::OnJoy(const ignition::msgs::Joy &_msg) if (this->enableTurboButton >= 0 && _msg.buttons(this->enableTurboButton)) { cmdVelMsg.mutable_linear()->set_x( - _msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X()); + _msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X()); cmdVelMsg.mutable_linear()->set_y( - _msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y()); + _msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y()); cmdVelMsg.mutable_linear()->set_z( - _msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z()); + _msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z()); cmdVelMsg.mutable_angular()->set_x( - _msg.axes(this->axisAngular.X()) * this->scaleAngularTurbo.X()); + _msg.axes(static_cast(this->axisAngular.X())) * + this->scaleAngularTurbo.X()); cmdVelMsg.mutable_angular()->set_y( - _msg.axes(this->axisAngular.Y()) * this->scaleAngularTurbo.Y()); + _msg.axes(static_cast(this->axisAngular.Y())) * + this->scaleAngularTurbo.Y()); cmdVelMsg.mutable_angular()->set_z( - _msg.axes(this->axisAngular.Z()) * this->scaleAngularTurbo.Z()); + _msg.axes(static_cast(this->axisAngular.Z())) * + this->scaleAngularTurbo.Z()); this->cmdVelPub.Publish(cmdVelMsg); this->sentDisableMsg = false; @@ -149,18 +169,21 @@ void JoyToTwist::OnJoy(const ignition::msgs::Joy &_msg) else if (_msg.buttons(this->enableButton)) { cmdVelMsg.mutable_linear()->set_x( - _msg.axes(this->axisLinear.X()) * this->scaleLinear.X()); + _msg.axes(this->axisLinear.X()) * this->scaleLinear.X()); cmdVelMsg.mutable_linear()->set_y( - _msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y()); + _msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y()); cmdVelMsg.mutable_linear()->set_z( - _msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z()); + _msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z()); cmdVelMsg.mutable_angular()->set_x( - _msg.axes(this->axisAngular.X()) * this->scaleAngular.X()); + _msg.axes(static_cast(this->axisAngular.X())) * + this->scaleAngular.X()); cmdVelMsg.mutable_angular()->set_y( - _msg.axes(this->axisAngular.Y()) * this->scaleAngular.Y()); + _msg.axes(static_cast(this->axisAngular.Y())) * + this->scaleAngular.Y()); cmdVelMsg.mutable_angular()->set_z( - _msg.axes(this->axisAngular.Z()) * this->scaleAngular.Z()); + _msg.axes(static_cast(this->axisAngular.Z())) * + this->scaleAngular.Z()); this->cmdVelPub.Publish(cmdVelMsg); this->sentDisableMsg = false; diff --git a/plugins/joy_to_twist/JoyToTwist.hh b/plugins/joy_to_twist/JoyToTwist.hh index 517e802e..39ae6ebf 100644 --- a/plugins/joy_to_twist/JoyToTwist.hh +++ b/plugins/joy_to_twist/JoyToTwist.hh @@ -92,9 +92,9 @@ namespace ignition private: int enableButton = 0; private: int enableTurboButton = -1; - private: ignition::math::Vector3d axisLinear{1.0, 0.0, 0.0}; - private: ignition::math::Vector3d scaleLinear{0.5, 0.0, 0.0}; - private: ignition::math::Vector3d scaleLinearTurbo{0.5, 0.0, 0.0}; + private: gz::math::Vector3i axisLinear{1, 0, 0}; + private: gz::math::Vector3d scaleLinear{0.5, 0.0, 0.0}; + private: gz::math::Vector3d scaleLinearTurbo{0.5, 0.0, 0.0}; private: ignition::math::Vector3d axisAngular{0.0, 0.0, 0.0}; private: ignition::math::Vector3d scaleAngular{0.0, 0.0, 0.5}; diff --git a/src/Manager.hh b/src/Manager.hh index a44a22a7..9e7d33d9 100644 --- a/src/Manager.hh +++ b/src/Manager.hh @@ -54,7 +54,7 @@ namespace ignition /// \brief Private data pointer. // IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING private: std::unique_ptr dataPtr; - // IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING + // IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING }; } } diff --git a/src/vendor/backward.hpp b/src/vendor/backward.hpp index c39a599e..af92de36 100644 --- a/src/vendor/backward.hpp +++ b/src/vendor/backward.hpp @@ -51,13 +51,13 @@ // You can define one of the following (or leave it to the auto-detection): // // #define BACKWARD_SYSTEM_LINUX -// - specialization for linux +// - specialization for linux // // #define BACKWARD_SYSTEM_DARWIN -// - specialization for Mac OS X 10.5 and later. +// - specialization for Mac OS X 10.5 and later. // // #define BACKWARD_SYSTEM_UNKNOWN -// - placebo implementation, does nothing. +// - placebo implementation, does nothing. // #if defined(BACKWARD_SYSTEM_LINUX) #elif defined(BACKWARD_SYSTEM_DARWIN) @@ -132,9 +132,9 @@ // - object filename // - function name // - source filename -// - line and column numbers -// - source code snippet (assuming the file is accessible) -// - variables name and values (if not optimized out) +// - line and column numbers +// - source code snippet (assuming the file is accessible) +// - variables name and values (if not optimized out) // - You need to link with the lib "dw": // - apt-get install libdw-dev // - g++/clang++ -ldw ... @@ -144,8 +144,8 @@ // - object filename // - function name // - source filename -// - line numbers -// - source code snippet (assuming the file is accessible) +// - line numbers +// - source code snippet (assuming the file is accessible) // - You need to link with the lib "bfd": // - apt-get install binutils-dev // - g++/clang++ -lbfd ... @@ -191,8 +191,8 @@ #include #include #ifdef __ANDROID__ -// Old Android API levels define _Unwind_Ptr in both link.h and -// unwind.h Rename the one in link.h as we are not going to be using +// Old Android API levels define _Unwind_Ptr in both link.h and +// unwind.h Rename the one in link.h as we are not going to be using // it #define _Unwind_Ptr _Unwind_Ptr_Custom #include @@ -320,7 +320,9 @@ #include typedef SSIZE_T ssize_t; +#ifndef NOMINMAX #define NOMINMAX +#endif #include #include @@ -1129,14 +1131,14 @@ class TraceResolverLinuxImpl // Now we get in symbol_info: // .dli_fname: - // pathname of the shared object that contains the address. + // pathname of the shared object that contains the address. // .dli_fbase: - // where the object is loaded in memory. + // where the object is loaded in memory. // .dli_sname: - // the name of the nearest symbol to trace.addr, we expect a - // function name. + // the name of the nearest symbol to trace.addr, we expect a + // function name. // .dli_saddr: - // the exact address corresponding to .dli_sname. + // the exact address corresponding to .dli_sname. if (symbol_info.dli_sname) { trace.object_function = demangle(symbol_info.dli_sname); @@ -1218,47 +1220,47 @@ class TraceResolverLinuxImpl trace.inliners = backtrace_inliners(fobj, *details_selected); #if 0 - if (trace.inliners.size() == 0) { - // Maybe the trace was not inlined... or maybe it was and we - // are lacking the debug information. Let's try to make the - // world better and see if we can get the line number of the - // function (trace.source.function) now. - // - // We will get the location of where the function start (to be - // exact: the first instruction that really start the - // function), not where the name of the function is defined. - // This can be quite far away from the name of the function - // btw. - // - // If the source of the function is the same as the source of - // the trace, we cannot say if the trace was really inlined or - // not. However, if the filename of the source is different - // between the function and the trace... we can declare it as - // an inliner. This is not 100% accurate, but better than - // nothing. - - if (symbol_info.dli_saddr) { - find_sym_result details = find_symbol_details(fobj, - symbol_info.dli_saddr, - symbol_info.dli_fbase); - - if (details.found) { - ResolvedTrace::SourceLoc diy_inliner; - diy_inliner.line = details.line; - if (details.filename) { - diy_inliner.filename = details.filename; - } - if (details.funcname) { - diy_inliner.function = demangle(details.funcname); - } else { - diy_inliner.function = trace.source.function; - } - if (diy_inliner != trace.source) { - trace.inliners.push_back(diy_inliner); - } - } - } - } + if (trace.inliners.size() == 0) { + // Maybe the trace was not inlined... or maybe it was and we + // are lacking the debug information. Let's try to make the + // world better and see if we can get the line number of the + // function (trace.source.function) now. + // + // We will get the location of where the function start (to be + // exact: the first instruction that really start the + // function), not where the name of the function is defined. + // This can be quite far away from the name of the function + // btw. + // + // If the source of the function is the same as the source of + // the trace, we cannot say if the trace was really inlined or + // not. However, if the filename of the source is different + // between the function and the trace... we can declare it as + // an inliner. This is not 100% accurate, but better than + // nothing. + + if (symbol_info.dli_saddr) { + find_sym_result details = find_symbol_details(fobj, + symbol_info.dli_saddr, + symbol_info.dli_fbase); + + if (details.found) { + ResolvedTrace::SourceLoc diy_inliner; + diy_inliner.line = details.line; + if (details.filename) { + diy_inliner.filename = details.filename; + } + if (details.funcname) { + diy_inliner.function = demangle(details.funcname); + } else { + diy_inliner.function = trace.source.function; + } + if (diy_inliner != trace.source) { + trace.inliners.push_back(diy_inliner); + } + } + } + } #endif } @@ -3434,9 +3436,9 @@ class SourceFile { lines_t &get_lines(unsigned line_start, unsigned line_count, lines_t &lines) { using namespace std; // This function make uses of the dumbest algo ever: - // 1) seek(0) - // 2) read lines one by one and discard until line_start - // 3) read line one by one until line_start + line_count + // 1) seek(0) + // 2) read lines one by one and discard until line_start + // 3) read line one by one until line_start + line_count // // If you are getting snippets many time from the same file, it is // somewhat a waste of CPU, feel free to benchmark and propose a From 13496cd60f39d738b75f882694c263a9ea42cae5 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 19 Mar 2024 13:58:19 -0500 Subject: [PATCH 3/8] Fix msvc warning (#250) Signed-off-by: Addisu Z. Taddese --- src/Manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.cc b/src/Manager.cc index 9ca71c87..2861f365 100644 --- a/src/Manager.cc +++ b/src/Manager.cc @@ -382,7 +382,7 @@ ManagerPrivate::ManagerPrivate() const auto pid_seed = std::hash()( std::this_thread::get_id()); std::seed_seq seed_value{time_seed, pid_seed}; - std::vector seeds(1); + std::vector seeds(1); seed_value.generate(seeds.begin(), seeds.end()); math::Rand::Seed(seeds[0]); } From e2a18dde4607db5c51c5fe5efe30aec24198a744 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 19 Mar 2024 13:58:19 -0500 Subject: [PATCH 4/8] Fix msvc warning (#250) Signed-off-by: Addisu Z. Taddese --- src/Manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.cc b/src/Manager.cc index 4e17272f..a3446976 100644 --- a/src/Manager.cc +++ b/src/Manager.cc @@ -381,7 +381,7 @@ ManagerPrivate::ManagerPrivate() const auto pid_seed = std::hash()( std::this_thread::get_id()); std::seed_seq seed_value{time_seed, pid_seed}; - std::vector seeds(1); + std::vector seeds(1); seed_value.generate(seeds.begin(), seeds.end()); math::Rand::Seed(seeds[0]); } From 5e1d18ee2a320e0a2311f25030a7092b4ae8e206 Mon Sep 17 00:00:00 2001 From: Jorge Perez Date: Wed, 29 May 2024 15:42:19 -0300 Subject: [PATCH 5/8] Disable failing windows tests (#264) Signed-off-by: Jorge J. Perez --- src/Manager_TEST.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index b2742249..a4141c9d 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -112,7 +112,7 @@ TEST_F(ManagerTest, RunBadXml) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunLs) +TEST_F(ManagerTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RunLs)) { std::string cmd; @@ -137,7 +137,7 @@ TEST_F(ManagerTest, RunLs) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPre) +TEST_F(ManagerTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPre)) { // Test that environment is applied regardless of order #ifndef _WIN32 @@ -175,7 +175,7 @@ TEST_F(ManagerTest, RunEnvPre) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPost) +TEST_F(ManagerTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPost)) { // Test that environment is applied regardless of order #ifndef _WIN32 From bdaacf58ec68826caa71d9b5d2cde11ef41f9fed Mon Sep 17 00:00:00 2001 From: Jorge Perez Date: Wed, 29 May 2024 16:33:15 -0300 Subject: [PATCH 6/8] Supress msvc dll exported interface warning (#263) * Supress msvc dll exported interface warning * Add missing linked library * Add missing linked library * Add mising linked library * Add linked library * Add missing linked library Signed-off-by: Jorge J. Perez --------- Signed-off-by: Jorge J. Perez --- src/CMakeLists.txt | 1 + src/Manager.hh | 6 +++--- src/cmd/CMakeLists.txt | 4 +++- test/integration/CMakeLists.txt | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7833ae32..f644a1b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,6 +20,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ignition-common${IGN_COMMON_MAJOR_VER}::ignition-common${IGN_COMMON_MAJOR_VER} ignition-math${IGN_MATH_MAJOR_VER}::ignition-math${IGN_MATH_MAJOR_VER} + ignition-utils${IGN_UTILS_VER}::core ${BACKWARD_LIBRARIES} ) diff --git a/src/Manager.hh b/src/Manager.hh index 9e7d33d9..d5abaebf 100644 --- a/src/Manager.hh +++ b/src/Manager.hh @@ -20,7 +20,7 @@ #include #include -// #include +#include #include @@ -52,9 +52,9 @@ namespace ignition public: bool Stop(); /// \brief Private data pointer. - // IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING + IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING private: std::unique_ptr dataPtr; - // IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING + IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 9b773c5f..3f96e61a 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(ign PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(ign PUBLIC ${PROJECT_LIBRARY_TARGET_NAME} ignition-common${IGN_COMMON_MAJOR_VER}::ignition-common${IGN_COMMON_MAJOR_VER} + ignition-utils${IGN_UTILS_VER}::core ) set(launch_executable ign-launch) @@ -20,6 +21,7 @@ target_link_libraries(${launch_executable} ign ignition-utils${IGN_UTILS_VER}::cli ignition-common${IGN_COMMON_MAJOR_VER}::ignition-common${IGN_COMMON_MAJOR_VER} + ignition-utils${IGN_UTILS_VER}::core ) install( @@ -35,7 +37,7 @@ ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${EXTRA_TEST_LIB_DEPS}) foreach(test ${test_list}) - target_link_libraries(${test} ign) + target_link_libraries(${test} ign ignition-utils${IGN_UTILS_VER}::core) # Inform each test of its output directory so it knows where to call the # auxiliary files from. Using a generator expression here is useful for diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index 8284bfea..d64e47b1 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -12,6 +12,7 @@ if(NOT WIN32) ign_build_tests(TYPE INTEGRATION SOURCES ${tests} TEST_LIST test_targets) foreach(test ${test_targets}) + target_link_libraries(${test} ignition-utils${IGN_UTILS_VER}::core) target_compile_definitions(${test} PRIVATE "bad_plugins_LIB=\"$\"") endforeach() From 2cb58a1e5add0017dd229f9090aea7614ae18930 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 29 May 2024 17:59:50 -0500 Subject: [PATCH 7/8] Remove indirect dependencies (#265) Signed-off-by: Addisu Z. Taddese --- .github/ci/packages.apt | 5 ----- CMakeLists.txt | 2 -- package.xml | 5 ----- 3 files changed, 12 deletions(-) diff --git a/.github/ci/packages.apt b/.github/ci/packages.apt index 8ea6d0b6..50695400 100644 --- a/.github/ci/packages.apt +++ b/.github/ci/packages.apt @@ -2,19 +2,14 @@ binutils-dev libgflags-dev libgz-cmake3-dev libgz-common5-dev -libgz-fuel-tools9-dev libgz-sim8-dev libgz-gui8-dev libgz-math7-dev libgz-math7-eigen3-dev libgz-msgs10-dev -libgz-physics7-dev libgz-plugin2-dev -libgz-rendering8-dev -libgz-sensors8-dev libgz-tools2-dev libgz-transport13-dev -libsdformat14-dev libtinyxml2-dev libwebsockets-dev libxi-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index a6e0a3b8..5e1ca9b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,10 +133,8 @@ gz_create_docs( TAGFILES "${GZ-MATH_DOXYGEN_TAGFILE} = ${GZ-MATH_API_URL}" "${GZ-MSGS_DOXYGEN_TAGFILE} = ${GZ-MSGS_API_URL}" - "${GZ-PHYSICS_DOXYGEN_TAGFILE} = ${GZ-PHYSICS_API_URL}" "${GZ-PLUGIN_DOXYGEN_TAGFILE} = ${GZ-PLUGIN_API_URL}" "${GZ-TRANSPORT_DOXYGEN_TAGFILE} = ${GZ-TRANSPORT_API_URL}" - "${GZ-SENSORS_DOXYGEN_TAGFILE} = ${GZ-SENSORS_API_URL}" "${GZ-COMMON_DOXYGEN_TAGFILE} = ${GZ-COMMON_API_URL}" "${GZ-SIM_DOXYGEN_TAGFILE} = ${GZ-SIM_API_URL}" "${GZ-GUI_DOXYGEN_TAGFILE} = ${GZ-GUI_API_URL}" diff --git a/package.xml b/package.xml index bb45074e..f44b42bb 100644 --- a/package.xml +++ b/package.xml @@ -13,14 +13,10 @@ binutils gz-cmake3 gz-common5 - gz-fuel-tools9 gz-gui8 gz-math7 gz-msgs10 - gz-physics7 gz-plugin2 - gz-rendering8 - gz-sensors8 gz-sim8 gz-tools2 gz-transport13 @@ -29,7 +25,6 @@ libxi-dev libxmu-dev libyaml-dev - sdformat14 tinyxml2 uuid From 455cfecf3ed9a7aae6ba1c6bd48f88b523990c4c Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Wed, 24 Jul 2024 07:00:12 -0700 Subject: [PATCH 8/8] Fix libwebsocket shutdown behavior (#267) Signed-off-by: Nate Koenig --- plugins/websocket_server/WebsocketServer.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/websocket_server/WebsocketServer.cc b/plugins/websocket_server/WebsocketServer.cc index 72935a27..d713a9f4 100644 --- a/plugins/websocket_server/WebsocketServer.cc +++ b/plugins/websocket_server/WebsocketServer.cc @@ -613,9 +613,14 @@ void WebsocketServer::Run() while (this->run) { - // The second parameter is a timeout that is no longer used by - // libwebsockets. - lws_service(this->context, 0); + // The second parameter is used to control lws's event wait time. + // A -1 does not wait for an event, and 0 causes lws to wait + // for an event. When shutting down the websocket server, the + // wait time could be over 30 seconds if 0 is used. + // + // We are running lws in a separate thread with out our own + // condition variable. So, we will not use lws's event wait. + lws_service(this->context, -1); // Wait for (1/60) seconds or an event. std::unique_lock lock(this->runMutex);