srmainwaring / asv_sim

This package contains plugins and models for the simulation of surface vessels in Gazebo.
GNU General Public License v3.0
14 stars 5 forks source link

Upgrade Anemometer plugin to Gazebo Garden #13

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

Add an Anemometer sensor and Anemometer system.

Closes #11

Use the sensor system in gz-sensors to add an anemometer. The sensor publishes a msgs::Vector3d with time stamped header and frame_id. There is no need for a custom message in gz-sim7.

The implementation closely follows the custom sensor and custom sensor system tutorials.

Testing

Wind in world file is set to:

<wind>
  <linear_velocity>-5 0 0</linear_velocity>
</wind>

Figure: falling anemometer subject to a uniform background wind of (-5, 0, 0) m/s. anemometer-falling

$ gz topic -e -t /anemometer -n 1
header {
  stamp {
    sec: 58
    nsec: 596000000
  }
  data {
    key: "frame_id"
    value: "anemometer::base_link::anemometer"
  }
  data {
    key: "seq"
    value: "58595"
  }
}
x: -5
y: 1.959765959893313e-16
z: 25.675000101061269