Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know about pressure sensors, but in order to get accelerometers and rotational rates you can use IMU sensor plugin, by adding to your URDF file the following block :

<!--IMU : joint , link , sensor  -->
 <joint name="IMU_joint" type="fixed">
    <axis xyz="1 0 0"/>      
    <origin xyz="0 0 0.105"/>
    <parent link="base_link"/>
    <child link="IMU_link"/>
  </joint>
<link name="IMU_link">
  <inertial>
    <mass value="0.001"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.000001" iyz="0" izz="0.0001"/>
  </inertial>
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <box size="0.01 0.01 0.01"/>
    </geometry>
    <material name="red"/>  
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <box size=".01 .01 .01"/>
    </geometry>
  </collision>
</link>
<gazebo>
  <controller:gazebo_ros_imu name="dany_car_IMU_controller" plugin="libgazebo_ros_imu.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>50.0</updateRate> 
    <bodyName>IMU_link</bodyName>
    <topicName>/dany_car_sensors/IMU/data</topicName>
    <gaussianNoise>2.89e-08</gaussianNoise>
    <xyzOffsets>0 0 0</xyzOffsets>
    <rpyOffsets>0 0 0</rpyOffsets>
    <interface:position name="imu_position"/>
  </controller:gazebo_ros_imu>
  <material>Gazebo/Red</material>
</gazebo>