How to check if arm_controller is up and running or not?

I have a Gazebo simulation running with a spawned robot. I also have initialized two trajectory-based controllers using JointEffortInterface for Gazebo-ROS plugin - arm_controller and gripper_controller. I am using MoveIt Group Commander for these two controllers.

I suspect these controllers are shut down at some point in time of the simulation and throw the following error when trying to read /joint_states topic:

[ERROR]: Didn't receive robot state (joint angles) with recent timestamp within 1 seconds.
Check clock synchronization if your are running ROS across multiple machines!


Is there a way I can check if these controllers are enabled and running at any time during the simulation?

• Do you mean like these are ROS services? Something else? It's not clear to me what's throwing your errors, but when you say you get an error when trying to read /joint_states topic I would guess the error there is with whatever is supposed to be publishing the /joint_states topic (I would think this should be Gazebo) and not with the thing subscribing to the topic (the controllers). First thing I would do is look at rostopic info /joint_states and see what the publisher is. Aug 2 at 18:30
• Also if you're in simulation, especially if the simulation is running slower than realtime, you may need to rosparam set /use_sim_time true before running your simulations. Remember that nodes/services won't pick up that parameter if you set it after starting them, so be sure to restart any nodes/services after setting /use_sim_time true. Aug 2 at 18:31
• Thanks for your responses! The error was being thrown since the simulation was paused and my MoveIt /move_group node was not able to access the /joint_states topic. Your point about the issue being with the publisher got me thinking - thanks! Aug 4 at 14:04
• I already had the use_sim_time parameter set True. Thanks again for providing the explanation on its usage! Aug 4 at 14:05

import rospy