ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

What is the fix for 'No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/back_right_wheel_joint ' ros melodic?

asked 2018-06-11 17:20:39 -0500

cybodroid gravatar image

updated 2022-01-22 16:09:51 -0500

Evgeny gravatar image

Hi, I am using gazebo_ros_control package from ROS melodic. I am geting error like

[ERROR] [1528754765.222507207, 9.660000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/back_right_wheel_joint

I believe I may need to change something in yaml file but I am quite not sure what do I need to change. Can somebody please point me out?


edit retag flag offensive close merge delete


gazbo_ros_control package not working with my simulated mobile robot I have the following output when launch the gazebo simulator No p gain specified for pid.gazebo_ros_control/pid_gains/left_whee and also for the right_wheel where I can modify the P gain I did follow the tutorials for make a config and a launch files but no nothing remove that error and it cause a leak of movement during the test in Rviz.

ZNJ gravatar image ZNJ  ( 2019-05-18 00:19:46 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2019-02-28 16:54:17 -0500 gravatar image

I had the same question. The PID parameters are optional if you are using gazebo_ros_control. The error comes because when initializing RobotHWSim, the robot_ros_control tries to load the pid_gains. The source code and corresponding comments are here.

Basically, if pid parameters were found, gazebo_ros_control will use pid controllers in ROS to control the joints (velocity or position) by effort. Otherwise, the joints will be controlled with gazebo methods.

edit flag offensive delete link more


This answer seems correct to me. I'd also add that the ERROR from OP is not really an error. It's a sign that you aren't using PID controllers to control the joints (because you didn't specify pid_gains). I'm not sure about the decision to print ERRORS every time someone uses a non-PID controller

jarvisschultz gravatar image jarvisschultz  ( 2019-02-28 17:34:23 -0500 )edit

The commit that added the printouts is here. I think the choice to add these error messages stemmed from a different bug

jarvisschultz gravatar image jarvisschultz  ( 2019-02-28 17:39:43 -0500 )edit

That is right. After a long investigation, I did think that it is not an error but developers changed codes in ROS Melodic. Previous versions had bugs so the way I was using PID controls in Yaml would actually not do anything specific. @sapan mentions the correct way to include PID values.

cybodroid gravatar image cybodroid  ( 2019-03-07 00:34:25 -0500 )edit

Thanks, the format specified got it working. One last thing. What happens if I ignore this error. Does my bot still work as expected. Also why is it that the format in which I have specified works in another system where I installed ROS long back. Was there any official changes I missed. And lastly what are the Gazebo default PID parameters?

Withered_Shadow gravatar image Withered_Shadow  ( 2019-05-20 03:14:31 -0500 )edit

In my case, if I don't specify PID values, my bot still works, however, you will have to look at gazebo ros control source code to understand what exactly they do. It is better not to put any PID in the yaml file rather than putting the wrong value. To find suitable PID values use . However, this is not easy especially when systems are coupled. This is really a hard problem to find a PID value. I am going to write a custom control for my work which eventually won't use gazebo ros control.

cybodroid gravatar image cybodroid  ( 2019-05-25 16:06:14 -0500 )edit

so,how to solve the error???

LR gravatar image LR  ( 2020-10-13 22:05:12 -0500 )edit

answered 2019-03-06 22:54:37 -0500

sapan gravatar image

updated 2019-03-06 22:55:26 -0500 Adding pid gains in following format worked for me.

      p: 100.0
      i: 0.01 
      d: 10.0
edit flag offensive delete link more


hai . I am new to ROS. where can i find this yaml file? what command should i press on the terminal so that i can find and edit the file?

mohan_pannirselvam gravatar image mohan_pannirselvam  ( 2020-05-05 15:34:25 -0500 )edit

you have to create this .yaml file inside your config folder to use Controller in order to control a robot joints

utkarsh singh gravatar image utkarsh singh  ( 2020-06-11 08:25:22 -0500 )edit

How to add these pid values if you have more than one joint? Should i just add different joint names and values below it?

jaiswalharsh gravatar image jaiswalharsh  ( 2020-07-17 08:24:41 -0500 )edit

If you have more than one joints, you can do as follows:

gazebo_ros_control/pid_gains: r_wheel_joint: {p: 1.0, i: 0.0, d: 1.0} l_wheel_joint: {p: 1.0, i: 0.0, d: 1.0} # more joint

KavitShah gravatar image KavitShah  ( 2020-09-28 00:44:00 -0500 )edit You can follow this link to check about how to add params for multiple joints

KavitShah gravatar image KavitShah  ( 2020-09-28 00:56:34 -0500 )edit

For velocity_controllers/JointVelocityController, you don't need PID gains at all since it is a forward controller. Gazebo developers need to address this issue. There is no need for even warning.

CroCo gravatar image CroCo  ( 2022-05-28 11:30:49 -0500 )edit

answered 2018-06-12 02:57:32 -0500

mgruhler gravatar image

Seems like you configured a Joint (back_right_wheel_joint) to be controlled using, e.g. a JointPositionController. Obviously, you Need to specify the respective PID-Gains.

Check out the tutorial. There it is described how the yaml file looks.

For more Debugging help, please provide us with the respective Launch and configuration files.

edit flag offensive delete link more



unmarking this as correct since the other answers below are much more relevant by now...

mgruhler gravatar image mgruhler  ( 2019-05-20 02:55:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-06-11 17:20:39 -0500

Seen: 22,694 times

Last updated: May 18 '19