From 1aa0f75efe1841eaea7880a55b9a602ab60bd085 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:52:14 +0100 Subject: [PATCH] Use portable versio for usleep (backport #237) (#238) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use portable versio for usleep (#237) Signed-off-by: Alejandro Hernández Cordero (cherry picked from commit 0bdf13e6986c613c99a595889a587da1db6d7f69) # Conflicts: # ign_ros2_control/src/ign_ros2_control_plugin.cpp * fixed merge Signed-off-by: Alejandro Hernández Cordero --------- Signed-off-by: Alejandro Hernández Cordero Co-authored-by: Alejandro Hernández Cordero --- ign_ros2_control/src/ign_ros2_control_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ign_ros2_control/src/ign_ros2_control_plugin.cpp b/ign_ros2_control/src/ign_ros2_control_plugin.cpp index a08e671a..9e0fefa5 100644 --- a/ign_ros2_control/src/ign_ros2_control_plugin.cpp +++ b/ign_ros2_control/src/ign_ros2_control_plugin.cpp @@ -12,9 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + +#include #include #include #include +#include #include #include @@ -219,7 +223,7 @@ std::string IgnitionROS2ControlPluginPrivate::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");