From 99f34ba7883a5d2df9413ca7d96509b7aee8a87a Mon Sep 17 00:00:00 2001 From: Jelmer de Wolde Date: Tue, 15 Oct 2024 12:05:03 +0000 Subject: [PATCH] Obtain time from node. Signed-off-by: Jelmer de Wolde --- moveit_ros/moveit_servo/src/servo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moveit_ros/moveit_servo/src/servo.cpp b/moveit_ros/moveit_servo/src/servo.cpp index 329e4a84a8..c62488660f 100644 --- a/moveit_ros/moveit_servo/src/servo.cpp +++ b/moveit_ros/moveit_servo/src/servo.cpp @@ -648,8 +648,8 @@ KinematicState Servo::getCurrentRobotState(bool block_for_current_state) const bool have_current_state = false; while (rclcpp::ok() && !have_current_state) { - have_current_state = planning_scene_monitor_->getStateMonitor()->waitForCurrentState( - rclcpp::Clock(RCL_ROS_TIME).now(), ROBOT_STATE_WAIT_TIME /* s */); + have_current_state = + planning_scene_monitor_->getStateMonitor()->waitForCurrentState(node_->now(), ROBOT_STATE_WAIT_TIME /* s */); if (!have_current_state) { RCLCPP_WARN(logger_, "Waiting for the current state");