From 272d00b7e83aeb415dadf020d2b8b8d9acb7ae28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Wed, 14 Feb 2024 09:55:01 +0100 Subject: [PATCH] Use portable versio for usleep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- gz_ros2_control/src/gz_ros2_control_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gz_ros2_control/src/gz_ros2_control_plugin.cpp b/gz_ros2_control/src/gz_ros2_control_plugin.cpp index 54913710..48d1896b 100644 --- a/gz_ros2_control/src/gz_ros2_control_plugin.cpp +++ b/gz_ros2_control/src/gz_ros2_control_plugin.cpp @@ -14,9 +14,11 @@ #include +#include #include #include #include +#include #include #include @@ -231,7 +233,7 @@ std::string GazeboSimROS2ControlPluginPrivate::getURDF() const " URDF in parameter [%s] on the ROS param server.", this->robot_description_.c_str()); } - usleep(100000); + std::this_thread::sleep_for(std::chrono::microseconds(100000)); } RCLCPP_INFO(node_->get_logger(), "Received URDF from param server");