Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

can i use a pr2 controller for my own urdf

hi i am trying to make a control loop for a urdf file that i built, can i use a pr2 controller or it won't work?

thanks nachum

can i use a pr2 controller for my own urdf

hi i am trying to make a control loop for a urdf file that i built, can i use a pr2 controller or it won't work?

the urdf i built is of an inverted pendelum. it looks as if there is already control on it because if i move it and it falls it stands up again. how can i stop that control?

the urdf

<?xml version="1.0" ?>
<robot name="pendelum">
  <link name="rod">
   <inertial>
     <mass value="0.001"/>
     <origin xyz="0 0 0" rpy="0 0 0"/>

     <inertia ixx="0.00"  ixy="0"  ixz="0" iyy="0.00" iyz="0" izz="0.00" />
   </inertial>
<physics type="ode" update_rate="100">
    <gravity xyz="0 0 -9.8"/>
         <ode>
           <solver type="quick" dt="0.01" iters="100" sor="1.3"/>
          </ode>
   </physics>
   <visual>
     <origin xyz="0 0 0.5" rpy="0 0 0" />
     <geometry>
      <cylinder radius="0.02" length="1"/>
     </geometry>
   </visual>

 <collision>
     <origin xyz="0 0 0.5" rpy="0 0 0"/>
     <geometry>
       <cylinder radius="0.02" length="1"/>
     </geometry>
   </collision>

 </link>

  <link name="cmass"> 
    <inertial>
      <mass value="10.0" />
      <origin xyz="0 0 0" /> 
      <inertia  ixx="0.1" ixy="0.0"  ixz="0.0"  iyy="10"  iyz="0.0"  izz="0.1" />
    </inertial>
    <visual>
      <origin xyz="0 0 1" rpy="0 0 0" />
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 1" rpy="0 0 0" />
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </collision>


  </link>

<joint name="weld" type="fixed">
    <parent link="rod" />
    <child link="cmass" />

  </joint>

<link name="wor"> 
    <inertial>
      <mass value="100000" />
      <!-- center of mass (com) is defined w.r.t. link local coordinate system -->
      <origin xyz="0 0 0" /> 
      <inertia  ixx="1000.0" ixy="0.0"  ixz="0.0"  iyy="1000.0"  iyz="0.0"  izz="1000.0" />
    </inertial>
    <visual>
      <origin xyz="0 0 0.0005" rpy="0 0 0" />
      <geometry>
        <box size="0.4 0.4 0.001"/>
      </geometry>
    </visual>


<collision>
      <origin xyz="0 0 0.0005" rpy="0 0 0" />
      <geometry>
        <box size="0.4 0.4 0.001"/>
      </geometry>
    </collision>
  </link>

<joint name="floor" type="revolute">
   <parent link="wor" />
    <child link="rod" />
    <origin xyz="0 0 0" rpy="0 0 0" />
    <axis xyz="0 1 0"/>
<limit upper="3.15" lower="-3.15" effort="1000.00" velocity="1000.00"/>
<joint_properties damping="0.1" friction="1.0" />
</joint>
 <gazebo>
    <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>1000.0</updateRate>
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
    </controller:gazebo_ros_controller_manager>
  </gazebo>

<gazebo reference="cmass">
    <turnGravityOff>false</turnGravityOff>
    <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="rod">
    <turnGravityOff>false</turnGravityOff>
    <material>Gazebo/Red</material>
  </gazebo>
<gazebo reference="wor">
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Red</material>
  </gazebo>



</robot>

thanks nachum

can i use a pr2 controller for my own urdf

hi i am trying to make a control loop for a urdf file that i built, can i use a pr2 controller or it won't work?

the urdf i built is of an inverted pendelum. it looks as if there is already control on it because if i move it and it falls it stands up again. how can i stop that control?

the urdf

<?xml version="1.0" ?>
<robot name="pendelum">
  <link name="rod">
   <inertial>
     <mass value="0.001"/>
     <origin xyz="0 0 0" rpy="0 0 0"/>

     <inertia ixx="0.00"  ixy="0"  ixz="0" iyy="0.00" iyz="0" izz="0.00" />
   </inertial>
<physics type="ode" update_rate="100">
    <gravity xyz="0 0 -9.8"/>
         <ode>
           <solver type="quick" dt="0.01" iters="100" sor="1.3"/>
          </ode>
   </physics>
   <visual>
     <origin xyz="0 0 0.5" rpy="0 0 0" />
     <geometry>
      <cylinder radius="0.02" length="1"/>
     </geometry>
   </visual>

 <collision>
     <origin xyz="0 0 0.5" rpy="0 0 0"/>
     <geometry>
       <cylinder radius="0.02" length="1"/>
     </geometry>
   </collision>

 </link>

  <link name="cmass"> 
    <inertial>
      <mass value="10.0" />
      <origin xyz="0 0 0" /> 
      <inertia  ixx="0.1" ixy="0.0"  ixz="0.0"  iyy="10"  iyz="0.0"  izz="0.1" />
    </inertial>
    <visual>
      <origin xyz="0 0 1" rpy="0 0 0" />
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 1" rpy="0 0 0" />
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </collision>


  </link>

<joint name="weld" type="fixed">
    <parent link="rod" />
    <child link="cmass" />

  </joint>

<link name="wor"> 
    <inertial>
      <mass value="100000" />
      <!-- center of mass (com) is defined w.r.t. link local coordinate system -->
      <origin xyz="0 0 0" /> 
      <inertia  ixx="1000.0" ixy="0.0"  ixz="0.0"  iyy="1000.0"  iyz="0.0"  izz="1000.0" />
    </inertial>
    <visual>
      <origin xyz="0 0 0.0005" rpy="0 0 0" />
      <geometry>
        <box size="0.4 0.4 0.001"/>
      </geometry>
    </visual>


<collision>
      <origin xyz="0 0 0.0005" rpy="0 0 0" />
      <geometry>
        <box size="0.4 0.4 0.001"/>
      </geometry>
    </collision>
  </link>

<joint name="floor" type="revolute">
   <parent link="wor" />
    <child link="rod" />
    <origin xyz="0 0 0" rpy="0 0 0" />
    <axis xyz="0 1 0"/>
<limit upper="3.15" lower="-3.15" effort="1000.00" velocity="1000.00"/>
<joint_properties damping="0.1" friction="1.0" />
</joint>
 <gazebo>
    <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>1000.0</updateRate>
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
    </controller:gazebo_ros_controller_manager>
  </gazebo>

<gazebo reference="cmass">
    <turnGravityOff>false</turnGravityOff>
    <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="rod">
    <turnGravityOff>false</turnGravityOff>
    <material>Gazebo/Red</material>
  </gazebo>
<gazebo reference="wor">
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Red</material>
  </gazebo>



</robot>

thanks nachum

can i use a pr2 controller for my own urdf

hi i am trying to make a control loop for a urdf file that i built, can i use a pr2 controller or it won't work?

thanks nachum

i was able to insert the code given below and spawn my model- i tried to run the controller single_joint_position_action by , rosrun bin/single_joint_position_action [floor] that gave me the error [rospack] Error: stack/package bin/single_joint_position_action not found. also by bin/single_joint_position_action [floor] and got error [FATAL] [1346922550.250377578]: No joint given.

how should i use it?

thanks Nachum