Gazebo Sim

API Reference

7.9.0
EnvironmentalSensorSystem Class Reference

Sensor for reading environmental data loaded from outside world. To use, add this system to the world file, then instantiate sensors of custom type with gz:type="environmental_sensor/{field_name}", where field_name refers to the type of data you would like to output. Alternatively, if you would like to specify a custom field name you may do so using the <environment_variable> tag. More...

#include <EnvironmentalSensorSystem.hh>

Public Member Functions

 EnvironmentalSensorSystem ()
 
void Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &) override
 Documentation inherited. More...
 
void PostUpdate (const UpdateInfo &_info, const EntityComponentManager &_ecm) final
 
void PreUpdate (const UpdateInfo &_info, EntityComponentManager &_ecm) final
 
- Public Member Functions inherited from System
 System ()=default
 Constructor. More...
 
virtual ~System ()=default
 Destructor. More...
 

Detailed Description

Sensor for reading environmental data loaded from outside world. To use, add this system to the world file, then instantiate sensors of custom type with gz:type="environmental_sensor/{field_name}", where field_name refers to the type of data you would like to output. Alternatively, if you would like to specify a custom field name you may do so using the <environment_variable> tag.

Additionally, the environment sensor supports scenarios where the data is in the form of vector fields. For instance in the case of wind or ocean currents.

Tags: <output_format> - Either "scalar" or "vector3" depending on type of output data desired. <environment_variable> - Only for scalar type. The name of the column of the CSV file to be used. <environment_variable_x> - The name of the field to be used as the x value in global frame for vector3 fields. Note: If this is left out and vector3 is set, then the x value defaults to zero. <environment_variable_y> - The name of the field to be used as the y value in global frame for vector3 fields. Note: If this is left out and vector3 is set, then the y value defaults to zero. <environment_variable_z> - The name of the field to be used as the z value in global frame vector3 fields. Note: If this is left out and vector3 is set, then the z value defaults to zero. <transform_type> - When handling vector2 or vector3 types it may be in our interest to transform them to local coordinate frames. For instance measurements of ocean currents or wind depend on the orientation and velocity of the sensor. This field can have 4 values:

  • GLOBAL - Don't transform the vectors to a local frame.
  • LOCAL - Transform the vector to a local frame.
  • ADD_VELOCITY_GLOBAL - Don't transform to local frame but account for velocity change.
  • ADD_VELOCITY_LOCAL - Transform to local frame and account for sensor velocity. If you're working with wind or ocean currents, this is probably the option you want.

Constructor & Destructor Documentation

◆ EnvironmentalSensorSystem()

Member Function Documentation

◆ Configure()

void Configure ( const Entity _entity,
const std::shared_ptr< const sdf::Element > &  _sdf,
EntityComponentManager _ecm,
EventManager  
)
overridevirtual

Documentation inherited.

Implements ISystemConfigure.

◆ PostUpdate()

void PostUpdate ( const UpdateInfo _info,
const EntityComponentManager _ecm 
)
finalvirtual

Implements ISystemPostUpdate.

◆ PreUpdate()

void PreUpdate ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
finalvirtual

Implements ISystemPreUpdate.


The documentation for this class was generated from the following file: