Rosanswers logo

Hello everyone,

I am simulating a simple manipulator in Gazebo, and controlling joints via ros_control using a simplified version of this controller class. The robot model spawns normally in Gazebo every time, and sometimes the controllers function as expected.

My problem is that I sometimes see unexpected behavior, occurring instantly after launching the controller nodes:

  1. Roughly half the time, the Gazebo link states all instantly become zero, and all the robot pieces jumble together at the origin, motionless. The rostopic /gazebo/link_states shows all links at exactly x, y, z = 0.

  2. Rarely, the robot links appear to fly around, cycling rapidly through many random positions in space.

I notice that the issues never occur if the controller gains are set to zero, so they seem to depend on sending a nonzero input to the setCommand member function of hardware_interface::JointHandle.

Does anyone have any ideas about what might be the issue, or where I should focus troubleshooting?

I'm using ROS Indigo on Ubuntu 14.04.

Thanks in advance for any help!

Originally posted by ColinG on ROS Answers with karma: 68 on 2015-04-25

Post score: 2


1 Answer 1


Rosanswers logo

I believe I tracked down the issue. I overlooked that "setCommand" was running at first without the command variables initialized to any value, so I assume they were just some unpredictable junk number. It seems like this explains the inconsistent behavior. In any case, initializing those in the init function appears to have resolved the issue.

If anyone has more insight as to what exactly was happening on the hardware_interface end, I would be glad to hear it. Thanks to anyone that read this.

Originally posted by ColinG with karma: 68 on 2015-04-25

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.