DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Plans::TimeProfile Class Reference

Detailed Description

Utility class to estimate a plan's duration and speed profiles.

Classes

struct  Profile
 
struct  SpeedProfile
 

Public Types

typedef std::map< std::string, ProfileProfileMap
 
typedef ProfileMap::const_iterator const_iterator
 

Public Member Functions

 TimeProfile (const SpeedModel *speed_model)
 
 ~TimeProfile (void)
 
void parse (const std::vector< IMC::PlanManeuver * > &nodes, const IMC::EstimatedState *state)
 
void clear (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
size_t size (void) const
 
const_iterator find (const std::string &str) const
 
const std::string & lastValid (void) const
 
bool isDurationFinite (void) const
 

Member Typedef Documentation

typedef ProfileMap::const_iterator DUNE::Plans::TimeProfile::const_iterator

Const iterator for this map.

typedef std::map< std::string, Profile> DUNE::Plans::TimeProfile::ProfileMap

Mapping between maneuver IDs and their profiles.

Constructor & Destructor Documentation

DUNE::Plans::TimeProfile::TimeProfile ( const SpeedModel speed_model)
inline

Constructor.

DUNE::Plans::TimeProfile::~TimeProfile ( void  )
inline

Destructor.

References DUNE::Memory::clear(), and parse().

Member Function Documentation

const_iterator DUNE::Plans::TimeProfile::begin ( void  ) const
inline

First position of the vector.

Returns
const iterator to begin()
void DUNE::Plans::TimeProfile::clear ( void  )
inline

Clear the vector.

const_iterator DUNE::Plans::TimeProfile::end ( void  ) const
inline

Last position of the vector.

Returns
const iterator to end()
const_iterator DUNE::Plans::TimeProfile::find ( const std::string &  str) const
inline

Find function for the map.

Parameters
[in]strmap's key of object to find
Returns
const iterator to the map's object
bool DUNE::Plans::TimeProfile::isDurationFinite ( void  ) const
inline
const std::string& DUNE::Plans::TimeProfile::lastValid ( void  ) const
inline

ID of last maneuver with a valid duration.

Returns
ID string of the maneuver
void DUNE::Plans::TimeProfile::parse ( const std::vector< IMC::PlanManeuver * > &  nodes,
const IMC::EstimatedState state 
)

Parse plan duration and speeds from vector of plan maneuver nodes.

Parameters
[in]nodesvector of plan maneuver nodes
[in]statecurrent estimated state

References DUNE::Memory::clear(), DUNE::Plans::TimeProfile::Profile::durations, DUNE::IMC::Message::getId(), and DUNE::Plans::TimeProfile::Profile::speeds.

Referenced by isDurationFinite(), and ~TimeProfile().

size_t DUNE::Plans::TimeProfile::size ( void  ) const
inline

Size of the map.

Returns
size of the map

Referenced by isDurationFinite().

Collaboration diagram for DUNE::Plans::TimeProfile:
Collaboration graph