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

how to add pressure sensors, gyroscopes, and accelerometers to an URDF model?

asked 2012-11-23 09:24:31 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Please can you tell me how to add pressure sensors, gyroscopes, and accelerometers to an URDF model?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2012-11-26 18:04:35 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

The link 1Daniel1 posted has the correct information about how to add a pressure sensor (also known as a bumper) to the URDF of a model. However, whenever you try to listen to the contact sensor topic, you'll most likely get a variation on this message:

Error [ContactSensor.cc:237] Contact Sensor[contact_sensor] has no collision[base_link_geom]

This is because the contact sensor implementation is broken in the version of Gazebo that comes with Fuerte. The comment thread on Gazebo bitbucket issue 13 has information about how to get a version of Gazebo with working contact sensors. (I'd link to it, but I don't have enough karma.)

edit flag offensive delete link more
3

answered 2012-11-23 20:40:13 -0500

dmeltz gravatar image

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>
edit flag offensive delete link more

Comments

2

That was a great answer. I am a newbie in gazebo and I am trying to learn how to add gazebo elements using plugns. I am unable to find any official documentation that explains how to add an IMU plugin for gazebo. How do you know which tags to use for which plugins? Is there any conventional method?

suryaprakaz gravatar image suryaprakaz  ( 2015-09-27 09:20:14 -0500 )edit
0

answered 2012-11-23 23:20:45 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Good answer @1Daniel1, but do you know how to add force sensors?

edit flag offensive delete link more

Comments

I didn't tried to do that by myself yet. still maybe the following discussion would help you : http://answers.ros.org/question/29158/how-do-i-use-force-sensor-bumper-sensor-in-gazebo/

dmeltz gravatar image dmeltz  ( 2012-11-24 00:32:08 -0500 )edit

Question Tools

6 followers

Stats

Asked: 2012-11-23 09:24:31 -0500

Seen: 27,328 times

Last updated: Nov 27 '12