DUNE: Uniform Navigational Environment  2019.02.1
Simulators::DepthSensor::Task Struct Reference

Detailed Description

DepthSensor simulator task.

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onResourceAcquisition (void)
 
void onResourceRelease (void)
 
void consume (const IMC::SimulatedState *msg)
 
void task (void)
 

Public Attributes

IMC::SimulatedState m_sstate
 
IMC::Depth m_depth
 
Random::Generatorm_prng
 
Arguments m_args
 

Constructor & Destructor Documentation

Simulators::DepthSensor::Task::Task ( const std::string &  name,
Tasks::Context &  ctx 
)
inline

Member Function Documentation

void Simulators::DepthSensor::Task::consume ( const IMC::SimulatedState *  msg)
inline

Requests activation if not already active and updates m_sstate with the value of #msg.

void Simulators::DepthSensor::Task::onResourceAcquisition ( void  )
inline

Acquire resources. Initializes random number generator.

References Simulators::DepthSensor::Arguments::prng_seed, and Simulators::DepthSensor::Arguments::prng_type.

void Simulators::DepthSensor::Task::onResourceRelease ( void  )
inline

Release resources.

void Simulators::DepthSensor::Task::task ( void  )
inline

Dispatches a DUNE::IMC::Depth message with the depth stored in m_sstate plus some gaussian noise (according to parametrized standard deviation).

If task is not active, returns immediately.

References DUNE::Math::Random::Generator::gaussian(), and Simulators::DepthSensor::Arguments::std_dev.

Member Data Documentation

Arguments Simulators::DepthSensor::Task::m_args

Task arguments.

IMC::Depth Simulators::DepthSensor::Task::m_depth

Current depth.

Random::Generator* Simulators::DepthSensor::Task::m_prng

PRNG handle.

IMC::SimulatedState Simulators::DepthSensor::Task::m_sstate

Last received simulated state.

Collaboration diagram for Simulators::DepthSensor::Task:
Collaboration graph