Ask Your Question
0

PID position controller in Gazebo

asked 2013-04-04 02:22:22 -0600

davinci gravatar image

updated 2014-01-28 17:16:02 -0600

ngrennan gravatar image

Can someone point me to a simple example of how to use a PID controlled actuator in Gazebo? I found an example here but there is command topic (in rostopic list) I just want to be able to send a joint to a position. Do I need an action server for this?

My urdf (sorry fo the long file, launch file is below).

    <?xml version="1.0"?>

<gazebo>   
     <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
          <alwaysOn>true</alwaysOn>
          <updateRate>1000.0</updateRate>
          <robotNamespace></robotNamespace>
          <robotParam>robot_description</robotParam>
          <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
     </controller:gazebo_ros_controller_manager>
</gazebo>

 <robot name="ar_arm">

 <link name="world" />

 <link name="arm_base">
 <inertial>
    <origin xyz="0.000000 0.000000 0.000990" rpy="0.000000 -0.000000 0.000000"/>
    <mass value="101.000000" />
    <inertia ixx="1.110000" ixy="0.000000" ixz="0.000000" iyy="100.110000" iyz="0.000000" izz="1.010000"/>
  </inertial>
  <collision name="arm_base_geom">
    <origin  xyz="0.000000 0.000000 0.050000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <box size="1.000000 1.000000 0.100000"/>
    </geometry>
  </collision>
  <visual>
    <origin xyz="0.000000 0.000000 0.050000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <box size="1.000000 1.000000 0.100000"/>
    </geometry>
    <material name="Cyan">
     <color rgba="0 1 1  1.0"/>
    </material>     
  </visual> 
</link>

<link name="arm_cylinder">
 <inertial>
     <origin xyz="0.000000 0.000000 0.600000" rpy="0.000000 -0.000000 0.000000"/>
  <mass value="1.000000" />
  <inertia ixx="0.110000" ixy="0.000000" ixz="0.000000" iyy="100.110000" iyz="0.000000" izz="1.010000"/>
  </inertial>
  <collision name="arm_base_geom_arm_trunk">
    <origin  xyz="0.000000 0.000000 0.600000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <cylinder radius="0.050000" length="1.00000"/>
    </geometry>
  </collision>
  <visual name="arm_base_geom_arm_trunk_visual" cast_shadows="1">
    <origin xyz="0.000000 0.000000 0.650000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <cylinder radius="0.050000" length="1.100000"/>
    </geometry>
    <material name="Red">
    <color rgba="255 0 0 1"/>
    </material>
  </visual>
</link>

<link name="arm_shoulder_pan">
  <inertial>  
    <mass value="1.100000"/>
    <origin xyz="0.045455 0.000000 0.000000" rpy="0.000000 -0.000000 0.000000"/>
    <inertia ixx="0.011000" ixy="0.000000" ixz="0.000000" iyy="0.022500" iyz="0.000000" izz="0.013500"/>
  </inertial>

  <collision name="arm_shoulder_pan_geom_arm_shoulder">
    <origin xyz="0.550000 0.000000 0.050000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <box size="1.000000 0.050000 0.100000"/>
    </geometry>
  </collision>
  <visual name="arm_shoulder_pan_geom_arm_shoulder_visual" cast_shadows="1">
    <origin xyz="0.550000 0.000000 0.050000" rpy="0.000000 -0.000000 0.000000"/>
    <geometry>
      <box size="1.000000 0.050000 0.100000"/>
    </geometry>
    <material name="Cyan">
     <color rgba="0 1 1  1.0"/>
    </material>
  </visual>
</link>    

<link name="arm_shoulder_pivot">
   <inertial>  
    <mass value="0.100001"/>
    <origin xyz="0.045455 0.000000 0.000000" rpy="0.000000 -0.000000 0.000000"/>
    <inertia ixx="0.011000" ixy="0.000000" ixz="0.000000" iyy="0.022500" iyz="0.000000" izz="0.013500"/>
  </inertial>
<collision name="arm_shoulder_pan_geom">
    <origin pose="0.000000 0.000000 0.050000 0.000000 -0.000000 0.000000"/>
    <geometry>
      <cylinder ...
(more)
edit retag flag offensive close merge delete

Comments

http://gazebosim.org/wiki/Tutorials/1.3/intermediate/pid_control_joint

inflo gravatar imageinflo ( 2013-04-05 06:46:19 -0600 )edit

@inflo deadlink

Mehdi. gravatar imageMehdi. ( 2018-11-20 15:29:00 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2013-04-04 04:10:05 -0600

cagatay gravatar image

updated 2013-04-04 04:12:52 -0600

hello, there is a tutorial that can help you with implementing a pid controller in gazebo please check out here

edit flag offensive delete link more
0

answered 2013-04-05 05:51:20 -0600

SL Remy gravatar image

A different style of coding, but the folks at TU Darmstadt have a nice implementation here as well.

edit flag offensive delete link more

Comments

deadlink..

Mehdi. gravatar imageMehdi. ( 2018-11-20 15:29:11 -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

Stats

Asked: 2013-04-04 02:22:22 -0600

Seen: 3,177 times

Last updated: Apr 05 '13