[ros-users] Gazebo Vehicle Simulation

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: David Ferguson
Date:  
To: ros-users
Subject: [ros-users] Gazebo Vehicle Simulation
Hi,

I am trying to write create a gazebo simulation of a 4 wheeled vehicle
(think golf cart). I am having an issue with trying to create forces in the
simulation. I want to apply a torque the rear wheels (equivalent to pressing
the gas pedal). I can't figure out however how to use the gazebo plugin
which is supposed to apply the force. In the .h file for the plugin it says
to use it as such:

This is a controller that collects data from a ROS topic and applies
wrench to a body accordingly.

  Example Usage:
  \verbatim
  <model:physical name="box_model">
    <body:empty name="box_body">
     ...
    </body:empty>
    <controller:gazebo_ros_force name="box_force_controller"
plugin="libgazebo_ros_force.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>15.0</updateRate>
        <topicName>box_force</topicName>
        <bodyName>box_body</bodyName>
    </controller:gazebo_ros_force>
  </model:phyiscal>
  \endverbatim


To test it I essentially copied the tutorial showing how to use the iface
plugin (sets a models position). My urdf file is below:

<robot name="object_model"
       xmlns:controller="
http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
       xmlns:interface="
http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" >
  <!-- urdf requires at least one joint and one link, so here's the joint
-->
  <joint name="my_mug_joint" type="floating" >
    <!-- axis is in the parent link frame coordintates -->
    <axis xyz="0 0 0" />
    <parent link="world" />
    <child link="object_link" />
    <!-- initial pose of my_mug joint/link in the parent frame coordiantes
-->
    <origin xyz="0 0 0" rpy="0 0 0" />
  </joint>
  <!-- one floating link -->
  <link name="object_link">
    <inertial>
      <mass value="1"/>
      <origin xyz="0 0 0.0"/>
      <inertia ixx="0.05" ixy="0" ixz="0" iyy="0.05" iyz="0" izz="0.05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0.0"/>
      <geometry>
        <box size="1.0 1.0 1.0"/>
      </geometry>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.0"/>
      <geometry>
        <box size="1.0 1.0 1.0"/>
      </geometry>
    </collision>


  </link>
  <gazebo reference="object_link">
    <material>Gazebo/Black</material>
    <mu1>10.0</mu1>
    <mu2>10.0</mu2>
    <kp>10</kp>
    <kd>1.0</kd>
    <turnGravityOff>false</turnGravityOff>
    <dampingFactor>0.01</dampingFactor>
  </gazebo>
    <gazebo>
        <controller:gazebo_ros_force name="box_force_controller"
plugin="libgazebo_ros_force.so">
         <alwaysOn>true</alwaysOn>
         <updateRate>15.0</updateRate>
         <topicName>box_force</topicName>
         <bodyName>object_link</bodyName>
        </controller:gazebo_ros_force>
    </gazebo>
</robot>


I then have a python script publishing a wrench message to the box_force
topic however no matter what settings I use it never seems to actually
affect the box in the simulation. Am I going about this completely wrong? Is
there a flag I'm not setting?

Thanks in advance for any help,

David Ferguson