Model of Katana arm jumps around violently in Gazebo
I am modeling the Katana arm in Gazebo and use the pr2_controller_manager to control the joints. Everything works great except if I command a trajectory that (slowly) moves one joint past a certain point, the arm jumps around extremely violently.
Steps to reproduce (under Diamondback):
- download and unzip this archive
rosmake katana_arm_gazebo
roslaunch katana_arm_gazebo katana_arm.launch
# (be patient, it takes some time until Gazebo loads the arm model)rosrun katana_arm_gazebo min_max_trajectory
# to make the arm move up slowly
I also sometimes get the following error shortly after the jump, although that could be a side-effect rather than the cause of the arm jumping around:
gazebo: /tmp/buildd/ros-diamondback-visualization-common-1.4.2/debian/ros-diamondback-visualization-common/opt/ros/diamondback/stacks/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/include/OgreAxisAlignedBox.h:252: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.
Edit (in response to @hsu's answer):
Thank you @hsu, that solved my problem. Some observations:
- Adding viscous joint damping to all joints always resulted in the gazebo crash mentioned above right when the arm model is spawned. (is this a bug?)
- Adding viscious joint damping only to the offending joint didn't crash gazebo, but didn't fix the jumping behaviour either.
- Changing the PID parameters to the values you suggested worked perfectly!