# Gazebo_ros_pkgs: No p gain specified for pid in PositionJointInterface

I have built gazebo_ros_pkgs in the catkin workspace and working with some Joint Position Controllers (successfully - I can control my joint controllers via rqt or topics). The building part in the catkin workspace is needed for the new features to work in version 2.3.4 (see pull request #135).

However, my robot keeps sliding on the ground (slowly but sliding). Here's a video of that behavior. At first I thought it was because I hadn't included friction on my links. I did include friction but nothing changed. Also, at first I had collada models for collision, but changed them to stl. Same behavior though. I suspect visual-collision misalignment (exists in my case) problems in gazebo.

Gazebo throws some errors (not fatal ones though and continues). Here's an example:

[ERROR] [1392128262.341496657, 0.791000000]: No p gain specified for pid.  Namespace: /nao_robot/gazebo_ros_control/pid_gains/RAnklePitch_Roll_Joint


I haven't created effort joint controllers as the robot I'm trying to simulate has servo motors. I am not sure if that is entirely correct. Maybe I need effort joint controllers.

Any ideas? Thanks..

edit retag close merge delete

Sort by » oldest newest most voted

What type of hardware interface did you specify in your URDF file? PositionJointInterface? EffortJointInterface? If you are using PositionJointInterface, try specifying PID controller gains in a file similar to this:

# gazebo_ros_control_params.yaml
gazebo_ros_control/pid_gains:
shoulder_joint: {p: 1.0, i: 0.0, d: 1.0}
# More joints...


In your launch file, load the PID gains in a manner similar to this:

<rosparam file="\$(find yourrobot_gazebo)/config/gazebo_ros_control_params.yaml" command="load"/>


Using PositionJointInterface without a PID controller works sometimes, but not always. In particular, friction does not work well without a PID controller. This problem is discussed in the comments for pull request #135, which you mentioned above.

more

Well, I tried it and it seems to tackle the problem. I haven't been able to find the pid values corresponding to the servo motors of the robot, but playing around with the pid values points to that direction in order to solve the problem. Thanks. I will post an answer when I've finally solved it for sure.

( 2014-02-11 16:58:36 -0500 )edit

@Jim Rothrock

The problem was solved using pid gains for Position Joint Controllers (Interfaces).

But I still believe that this should be fixed in a later version. When you specify a position joint controller, not having pid gains is exactly what you want (in some cases - in my case too, because I don't have access to the robot's motors specifications and the robot uses servo motors).

Anyway, thanks for the reply and I've finally solved my issue. :)

more