Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

I am working with Gazebo 7 and the file that includes the plugin is a modify version of wireless_sensors.world:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <!-- Ground -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <!-- Wireless transmitter sensor model -->
    <model name="wirelessTransmitter">
      <static>true</static>
      <pose>0 0 0.025 0 0 0</pose>
      <link name="link">
        <inertial>
          <mass>0.1</mass>
        </inertial>
        <visual name="base">
          <geometry>
            <box>
              <size>.05 .05 .05</size>
            </box>
          </geometry>
        </visual>
        <visual name="antenna">
          <pose>0 0 .04 0 0 0</pose>
          <geometry>
            <cylinder>
              <radius>.005</radius>
              <length>.07</length>
            </cylinder>
          </geometry>
        </visual>
        <sensor name="wirelessTransmitter" type="wireless_transmitter">
          <always_on>1</always_on>
          <update_rate>1</update_rate>
          <visualize>true</visualize>
          <transceiver>
            <essid>osrf</essid>
            <frequency>2442.0</frequency>
            <power>14.5</power>
            <gain>2.6</gain>
          </transceiver>
        </sensor>
      </link>
    </model>
    <!-- Wireless receiver sensor model -->
    <model name="wirelessReceiver">
      <static>true</static>
      <pose>0 -5 0.025 0 0 0</pose>
      <link name="link">
        <inertial>
          <mass>0.1</mass>
        </inertial>
        <visual name="base">
          <geometry>
            <box>
              <size>.05 .05 .05</size>
            </box>
          </geometry>
        </visual>
        <visual name="antenna">
          <pose>0 0 .04 0 0 0</pose>
          <geometry>
            <cylinder>
              <radius>.005</radius>
              <length>.07</length>
            </cylinder>
          </geometry>
        </visual>
        <sensor name="wirelessReceiver" type="wireless_receiver">
                <plugin name="receiver_plugin" filename="libwirelessReceiver.so"/>
          <always_on>1</always_on>
          <update_rate>1</update_rate>
          <visualize>true</visualize>
          <transceiver>
            <min_frequency>2412.0</min_frequency>
            <max_frequency>2484.0</max_frequency>
            <power>14.5</power>
            <gain>2.5</gain>
            <sensitivity>-90.0</sensitivity>
          </transceiver>
        </sensor>
      </link>
    </model>
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
  </world>
</sdf>

The received signal has the initial value 14.5, but the gazebo topic (/gazebo/default/wirelessReceiver/link/wirelessReceiver/transceiver) publishes another value:

node {
  essid: "osrf"
  frequency: 2442
  signal_level: -30.926731914521884
}

The message type of this topic is msgs::WirelessNodes but I do not know how to obtain this vaule from sensors::WirelessReceiver sensor.

My final goal is to create a gazebo ros plugin.

Thanks in advance!