DUNE: Uniform Navigational Environment
2019.02.1
|
Utility class to compute offline speed conversions.
Consider ONLY positive speed. Negative values means failure to convert
Public Member Functions | |
SpeedModel (Parsers::Config *config) | |
SpeedModel (const std::vector< float > &act, const std::vector< float > &rpm, const std::vector< float > &mps, float time_factor=5.0, float max_speed=2.0) | |
float | toMPS (float value, uint8_t units) const |
float | toRPM (float value, uint8_t units) const |
float | toAct (float value, uint8_t units) const |
void | validate (void) const |
float | getTimeFactor (void) const |
DUNE::Plans::SpeedModel::SpeedModel | ( | Parsers::Config * | config | ) |
Constructor.
[in] | config | pointer to config parser |
References DUNE::Parsers::Config::get(), DUNE::IMC::SUNITS_METERS_PS, DUNE::IMC::SUNITS_PERCENTAGE, and DUNE::IMC::SUNITS_RPM.
DUNE::Plans::SpeedModel::SpeedModel | ( | const std::vector< float > & | act, |
const std::vector< float > & | rpm, | ||
const std::vector< float > & | mps, | ||
float | time_factor = 5.0 , |
||
float | max_speed = 2.0 |
||
) |
Constructor.
[in] | act | values for the actuation |
[in] | rpm | values for the rpms |
[in] | mps | values for the meters per second |
[in] | time_factor | time of arrival factor |
References DUNE::IMC::SUNITS_METERS_PS, DUNE::IMC::SUNITS_PERCENTAGE, and DUNE::IMC::SUNITS_RPM.
|
inline |
Get time of arrival factor.
float DUNE::Plans::SpeedModel::toAct | ( | float | value, |
uint8_t | units | ||
) | const |
Convert to Actuation.
[in] | value | speed value from which to convert |
[in] | units | speed units of the given value |
References DUNE::IMC::SUNITS_PERCENTAGE.
float DUNE::Plans::SpeedModel::toMPS | ( | float | value, |
uint8_t | units | ||
) | const |
Convert to meters per second.
[in] | value | speed value from which to convert |
[in] | units | speed units of the given value |
References DUNE::IMC::SUNITS_METERS_PS.
float DUNE::Plans::SpeedModel::toRPM | ( | float | value, |
uint8_t | units | ||
) | const |
Convert to RPMs.
[in] | value | speed value from which to convert |
[in] | units | speed units of the given value |
References DUNE::IMC::SUNITS_RPM.
void DUNE::Plans::SpeedModel::validate | ( | void | ) | const |
Validate the speed model.
References DUNE::Math::piecewiseLI(), DUNE::IMC::SUNITS_METERS_PS, DUNE::IMC::SUNITS_PERCENTAGE, and DUNE::IMC::SUNITS_RPM.