moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
1.06k stars 516 forks source link

[moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 10.000000 seconds. #2906

Open Divyam-uga opened 3 months ago

Divyam-uga commented 3 months ago

Hello Everyone,

@peterdavidfagan I have set up a Gazebo simulation with 2 UR manipulators and I'm attempting to control one UR robot using moveit_py. I've followed the necessary configuration steps from "moveit2_tutorials", and I am also setting 'use_sim_time' to true in Gazebo and all related nodes. However, I'm encountering an issue where 'current_state_monitor.cpp' is not receiving joint_angles with recent timestamps.

I've verified that joint states are being published in the correct sim time using "ros2 topic echo /joint_states" and "ros2 topic echo /clock", but it seems that the requested time reflects my PC's total run time instead of the current simulation time step. I tried several ways to set the 'use_sim_time' param to true globally before initializing 'moveit_py' but it's not working out.

Any guidance on resolving this would be greatly appreciated.

Thank you.

Error message: Screenshot from 2024-07-12 11-06-16

'ur_sort.py': Screenshot from 2024-07-12 11-11-31

ron007d commented 2 months ago

I guess you are using gazebo by adding use_sim_time: True in the moveit config dict you'll be able to get to monitor planning running but it will fetch another error

terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterValueException'
  what():  parameter 'qos_overrides./clock.subscription.durability' could not be set: 
Aborted (core dumped)

Python code

moveit_config_dict.update({'use_sim_time' : True})
github-actions[bot] commented 1 month ago

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

Jelmerdw commented 5 days ago

I experience the same problem when using the moveit_servo servo_node in combination with Gazebo simulation. I launch all nodes with the 'use_sim_time' set to True, however the current_state_monitor still seems to use wall time. Did you found a solution?