ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Model of Katana arm jumps around violently in Gazebo

asked 2011-08-23 02:19:53 -0600

updated 2011-08-23 21:59:08 -0600

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!
edit retag flag offensive close merge delete

Comments

Viscous damping can lead to numerical instability of the simulation integrator (not to be confused with dynamic instability of the pid controllers), looks like that might be what's happening when you added viscous damping. Reducing time step size will help, but that also fix the pid instability :-)
hsu gravatar image hsu  ( 2011-08-23 22:07:12 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2011-08-23 12:07:41 -0600

hsu gravatar image

updated 2011-08-23 14:33:49 -0600

Pretty sure it's controller instability. I tried two things

  • reduced time step size from 1ms to 0.7ms
  • changed i-terms to 0 and reduced d-term by half.

more specifically, this controller yaml worked for me:

katana_arm_controller:
  type: "robot_mechanism_controllers/JointTrajectoryActionController"
  joints:
    - katana_motor1_pan_joint
    - katana_motor2_lift_joint
    - katana_motor3_lift_joint
    - katana_motor4_lift_joint
    - katana_motor5_wrist_roll_joint
  gains:
    katana_motor1_pan_joint: {p: 6.0, d: 4.0, i: 0.0, i_clamp: 0.3}
    katana_motor2_lift_joint: {p: 4.0, d: 3.0, i: 0.0, i_clamp: 0.3}
    katana_motor3_lift_joint: {p: 2.0, d: 1.5, i: 0.0, i_clamp: 0.3}
    katana_motor4_lift_joint: {p: 1.0, d: 1.0, i: 0.0, i_clamp: 0.3}
    katana_motor5_wrist_roll_joint: {p: 0.1, d: 0.05, i: 0.00, i_clamp: 0.01}
  joint_trajectory_action_node:
    joints:
      - katana_motor1_pan_joint
      - katana_motor2_lift_joint
      - katana_motor3_lift_joint
      - katana_motor4_lift_joint
      - katana_motor5_wrist_roll_joint
    constraints:
      goal_time: 0.6
      katana_motor1_pan_joint:
        goal: 0.02
      katana_motor2_lift_joint:
        goal: 0.02
      katana_motor3_lift_joint:
        goal: 0.02
      katana_motor4_lift_joint:
        goal: 0.02
      katana_motor5_wrist_roll_joint:
        goal: 0.02

Either one of these changes made the system stable. Alternatively, if the inertia values are correct and you wanted to keep the controller gains unmodified, you can play around with viscous joint damping by adding dynamics block to your urdf, e.g.:

<joint ...>
  ...
  <dynamics damping="1"/>
</joint>
edit flag offensive delete link more
0

answered 2018-11-04 09:23:55 -0600

Navaneeth gravatar image

In your urdf file add the damping and friction <dynamics damping="50" friction="1"/>

this will reduce the jumping in gazebo

edit flag offensive delete link more

Comments

This question is 7 years old by now, and already has an accepted answer that solved the problem.

Martin Günther gravatar image Martin Günther  ( 2018-11-05 02:59:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2011-08-23 02:19:53 -0600

Seen: 2,145 times

Last updated: Aug 23 '11