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

No p gain specified for pid. for velocity controller

asked 2022-05-20 18:25:36 -0500

CroCo gravatar image

I'm trying to get the velocity controller to work but I'm keep getting errors. I have a robot that has a single joint to keep the problem minimized, see the picture below. The yaml file is shown below.

rrbot:
  # Publish all joint states ------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

  # Velocity Controllers ----------------------------
  joint1_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: joint1
    pid: {p: 500.0, i: 10.0, d: 5.0}

The part of robot.xacro that is related to joint is

<!-- Joint Between Base Link and Middle Link -->
     <joint name="joint1" type="revolute">
        <parent link="base_link"/>
        <child link="mid_link"/>
        <origin xyz="0 ${width} ${height1-axle_offset}" rpy="0 0 0"/>
        <axis xyz="0 1 0"/>
        <dynamics damping="${damp}"/>
        <limit effort="100.0" velocity="0.5" lower="-3.14" upper="3.14"/>
    </joint>
 <!-- ros_control pluging -->
    <gazebo>
        <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
            <robotNamespace>/rrbot</robotNamespace>
            <robotSimType>
                gazebo_ros_control/DefaultRobotHWSim
            </robotSimType>
        </plugin>
    </gazebo>
 <transmission name="transmission1">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="joint1">
          <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
        </joint>
        <actuator name="motor1">
          <hardwareInterface>VelocityJointInterface</hardwareInterface>
          <mechanicalReduction>1</mechanicalReduction>
        </actuator>
    </transmission>

I run the simulation in Gazebo 9 and melodic, I get this error

No p gain specified for pid.  Namespace: /rrbot/gazebo_ros_control/pid_gains/joint1

Even with this error, it seems the simulation works fine. Some people also are complaining about this exact problem. Some suggest to add the following lines in .yaml file

  gazebo_ros_control:
    pid_gains:
      joint1: 
        p: 500.0
        i: 10.0
        d: 5.0

The .yaml look likes this

rrbot:
  # Publish all joint states ------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

  # Velocity Controllers ----------------------------
  joint1_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: joint1
    pid: {p: 500.0, i: 10.0, d: 5.0}

  gazebo_ros_control:
    pid_gains:
      joint1: 
        p: 500.0
        i: 10.0
        d: 5.0

The error disappears but the simulation is not working properly. The arm doesn't response to any command and it keeps falling down. Notice that using position controller with effort interface, I have no problem. The problem pops up only with velocity controller.

image description

image description

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-09-27 02:37:18 -0500

I also have the same problem. I'm trying to use a velocity joint to control the car's wheel. Without the declarfying the gazebo_ros_control parameters it's still working.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-05-20 18:25:36 -0500

Seen: 176 times

Last updated: May 20 '22