LocalGuidance
A library that generates velocity references to follow a path.
any_worker::RateOptions Struct Reference

#include <RateOptions.hpp>

Inheritance diagram for any_worker::RateOptions:
Inheritance graph

Public Member Functions

 RateOptions (const std::string &name="", const double timeStep=0.0, const double maxTimeStepFactorWarning=1.0, const double maxTimeStepFactorError=10.0, const bool enforceRate=true, const clockid_t clockId=CLOCK_MONOTONIC)
 
 RateOptions (const RateOptions &other)
 
 RateOptions (RateOptions &&other)
 
RateOptionsoperator= (const RateOptions &other)
 
virtual ~RateOptions ()
 
virtual bool isValid () const
 

Public Attributes

std::string name_
 Name for printing. More...
 
std::atomic< double > timeStep_
 Time step in seconds. More...
 
std::atomic< double > maxTimeStepFactorWarning_
 If the awake time is bigger than the time step multiplied by this factor, it counts as an warning. More...
 
std::atomic< double > maxTimeStepFactorError_
 If the awake time is bigger than the time step multiplied by this factor, it counts as an error. More...
 
std::atomic< bool > enforceRate_
 Boolean indicating whether the rate should be enforced. More...
 
std::atomic< clockid_t > clockId_
 Linux clock ID. More...
 

Detailed Description

RateOptions class.

Constructor & Destructor Documentation

any_worker::RateOptions::RateOptions ( const std::string &  name = "",
const double  timeStep = 0.0,
const double  maxTimeStepFactorWarning = 1.0,
const double  maxTimeStepFactorError = 10.0,
const bool  enforceRate = true,
const clockid_t  clockId = CLOCK_MONOTONIC 
)
inline

Constructor. Starts the clock. Call reset() to restart it if you do not intend to call sleep() immediately.

Parameters
nameName for printing.
timeStepTime step in seconds.
maxTimeStepFactorWarningMax time step factor for warnings.
maxTimeStepFactorErrorMax time step factor for errors.
enforceRateEnforce the rate.
clockIdLinux clock ID.
any_worker::RateOptions::RateOptions ( const RateOptions other)
inline

Copy constructor.

Parameters
otherRate options to copy from.
any_worker::RateOptions::RateOptions ( RateOptions &&  other)
inline

Move constructor.

Parameters
otherRate options to move.
virtual any_worker::RateOptions::~RateOptions ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual bool any_worker::RateOptions::isValid ( ) const
inlinevirtual

Check if the rate options are valid.

Returns
True if rate options are valid.
RateOptions& any_worker::RateOptions::operator= ( const RateOptions other)
inline

Assignment operator.

Parameters
otherRate options.

Member Data Documentation

std::atomic<clockid_t> any_worker::RateOptions::clockId_

Linux clock ID.

std::atomic<bool> any_worker::RateOptions::enforceRate_

Boolean indicating whether the rate should be enforced.

std::atomic<double> any_worker::RateOptions::maxTimeStepFactorError_

If the awake time is bigger than the time step multiplied by this factor, it counts as an error.

std::atomic<double> any_worker::RateOptions::maxTimeStepFactorWarning_

If the awake time is bigger than the time step multiplied by this factor, it counts as an warning.

std::string any_worker::RateOptions::name_

Name for printing.

std::atomic<double> any_worker::RateOptions::timeStep_

Time step in seconds.


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