Ask Your Question
3

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 -0600

cybodroid 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?

Thanks.

edit retag flag offensive close merge delete

Comments

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 imageZNJ ( 2019-05-18 00:19:46 -0600 )edit

3 Answers

Sort by » oldest newest most voted
6

answered 2019-02-28 16:54:17 -0600

skyofyao@gmail.com 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

Comments

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 imagejarvisschultz ( 2019-02-28 17:34:23 -0600 )edit
1

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

jarvisschultz gravatar imagejarvisschultz ( 2019-02-28 17:39:43 -0600 )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 imagecybodroid ( 2019-03-07 00:34:25 -0600 )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 imageWithered_Shadow ( 2019-05-20 03:14:31 -0600 )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 http://wiki.ros.org/dynamic_reconfigu... . 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 imagecybodroid ( 2019-05-25 16:06:14 -0600 )edit
7

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

sapan gravatar image

updated 2019-03-06 22:55:26 -0600

http://answers.gazebosim.org/question... Adding pid gains in following format worked for me.

/gazebo_ros_control:   
  pid_gains:
    shoulder_pan_joint:
      p: 100.0
      i: 0.01 
      d: 10.0
edit flag offensive delete link more
1

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

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

Comments

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

mgruhler gravatar imagemgruhler ( 2019-05-20 02:55:53 -0600 )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

3 followers

Stats

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

Seen: 4,195 times

Last updated: May 18