DUNE: Uniform Navigational Environment  2.4.2
DUNE::Parsers::PlanConfigParser Class Reference

Detailed Description

Utility class to parse simple plans from DUNE's .ini format.

Static Public Member Functions

static void parse (Parsers::Config &parser, std::string section, IMC::Goto &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::StationKeeping &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::Loiter &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::PopUp &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::Teleoperation &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::IdleManeuver &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::FollowPath &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::Rows &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::YoYo &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::Elevator &maneuver)
 
static void parse (Parsers::Config &parser, std::string section, IMC::CompassCalibration &maneuver)
 
static void parse (Parsers::Config &parser, IMC::PlanSpecification &plan)
 
static void parseActions (Parsers::Config &cfg, const std::vector< std::string > &sections, IMC::MessageList< IMC::Message > &actions)
 
template<typename T >
static void parseSpeed (Parsers::Config &parser, std::string section, T &man)
 
template<typename T >
static void parseCoordinate (Parsers::Config &parser, std::string section, T &msg)
 
template<typename T >
static void parseAngle (Parsers::Config &parser, std::string section, std::string key, T &value, T dfl)
 
template<typename T >
static void parseTimeout (Parsers::Config &parser, std::string section, T &man)
 
template<typename T >
static void parseDuration (Parsers::Config &parser, std::string section, T &man)
 
template<typename T >
static void parseZ (Parsers::Config &parser, std::string section, T &man)
 
static void parseZUnits (Parsers::Config &parser, std::string section, uint8_t &zunits, std::string label="Z Units")
 
template<typename Type >
static void parseZUnits (Parsers::Config &parser, std::string section, Type &man, std::string label="Z Units")
 

Member Function Documentation

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::Goto maneuver 
)
static

Parse a Goto maneuver specification from plan definition file.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver specification.

References parseCoordinate(), parseSpeed(), parseTimeout(), parseZ(), and parseZUnits().

Referenced by parse().

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::StationKeeping maneuver 
)
static

Parse a StationKeeping maneuver specification from plan definition file.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver specification.

References DUNE::Parsers::Config::get(), parseCoordinate(), parseDuration(), parseSpeed(), parseZ(), parseZUnits(), and DUNE::IMC::StationKeeping::radius.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::Loiter maneuver 
)
static
void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::PopUp maneuver 
)
static

Parse a Popup maneuver specification from plan definition file.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver specification.

References DUNE::IMC::PopUp::flags, DUNE::Parsers::Config::get(), parseCoordinate(), parseDuration(), parseSpeed(), parseTimeout(), parseZ(), parseZUnits(), and DUNE::IMC::PopUp::radius.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::Teleoperation maneuver 
)
static

Parse a Teleoperation maneuver specification from plan definition file.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver specification.

References DUNE::IMC::Teleoperation::custom, and DUNE::Parsers::Config::get().

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::IdleManeuver maneuver 
)
static

Parse an Idle Maneuver specification.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver.

References parseDuration().

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::FollowPath maneuver 
)
static

Parse a FollowPath specification.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver.

References DUNE::Parsers::Config::get(), parseCoordinate(), parseSpeed(), parseTimeout(), parseZ(), parseZUnits(), DUNE::IMC::FollowPath::points, DUNE::IMC::MessageList< Type >::push_back(), DUNE::Math::Matrix::readFromConfig(), DUNE::Math::Matrix::rows(), DUNE::IMC::PathPoint::x, DUNE::IMC::PathPoint::y, and DUNE::IMC::PathPoint::z.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::Rows maneuver 
)
static

Parse a Rows maneuver specification.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver.

References DUNE::IMC::Rows::alternation, DUNE::IMC::Rows::bearing, DUNE::IMC::Rows::coff, DUNE::IMC::Rows::cross_angle, DUNE::IMC::Rows::flags, DUNE::Parsers::Config::get(), DUNE::IMC::Rows::hstep, DUNE::IMC::Rows::length, parseAngle(), parseCoordinate(), parseSpeed(), parseZ(), parseZUnits(), and DUNE::IMC::Rows::width.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::YoYo maneuver 
)
static

Parse a Yoyo maneuver specification.

Parameters
[in]parserconfiguration parser handle
[in]sectionsection that contais the maneuver specification
[out]maneuveroutput maneuver.

References DUNE::IMC::YoYo::amplitude, DUNE::Parsers::Config::get(), parseAngle(), parseCoordinate(), parseSpeed(), parseZ(), parseZUnits(), and DUNE::IMC::YoYo::pitch.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::Elevator maneuver 
)
static

Parse an Elevator maneuver specification.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver.

References DUNE::IMC::Elevator::end_z, DUNE::IMC::Elevator::end_z_units, DUNE::IMC::Elevator::flags, DUNE::Parsers::Config::get(), parseCoordinate(), parseSpeed(), parseZUnits(), DUNE::IMC::Elevator::radius, DUNE::IMC::Elevator::start_z, and DUNE::IMC::Elevator::start_z_units.

void DUNE::Parsers::PlanConfigParser::parse ( Parsers::Config parser,
std::string  section,
IMC::CompassCalibration maneuver 
)
static

Parse a CompassCalibration maneuver specification from plan definition file.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection that contains the maneuver specification.
[out]maneuveroutput maneuver specification.

References DUNE::IMC::CompassCalibration::amplitude, DUNE::IMC::CompassCalibration::direction, DUNE::Parsers::Config::get(), DUNE::IMC::Loiter::LD_CCLOCKW, DUNE::IMC::Loiter::LD_CLOCKW, parseAngle(), parseCoordinate(), parseDuration(), parseSpeed(), parseTimeout(), parseZ(), parseZUnits(), DUNE::IMC::CompassCalibration::pitch, and DUNE::IMC::CompassCalibration::radius.

void DUNE::Parsers::PlanConfigParser::parseActions ( Parsers::Config cfg,
const std::vector< std::string > &  sections,
IMC::MessageList< IMC::Message > &  actions 
)
static

Parse actions from a set vector of sections.

Parameters
[in]cfgConfig object to use
[in]sectionsvector of sections to look for and parse
[out]actionsmessage list to fill in with parsed data

References DUNE::Parsers::Config::get(), DUNE::IMC::EntityParameter::name, DUNE::IMC::SetEntityParameters::name, DUNE::Parsers::Config::options(), DUNE::IMC::SetEntityParameters::params, DUNE::IMC::MessageList< Type >::push_back(), and DUNE::IMC::EntityParameter::value.

Referenced by parse().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseAngle ( Parsers::Config parser,
std::string  section,
std::string  key,
T &  value,
dfl 
)
inlinestatic

Parse angle.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[in]keyconfiguration key.
[out]valuevalue reference.
[in]dfldefault value.

References DUNE::Parsers::Config::get(), DUNE::Math::Angles::radians(), and DUNE::uncastLexical().

Referenced by parse(), and parseCoordinate().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseCoordinate ( Parsers::Config parser,
std::string  section,
T &  msg 
)
inlinestatic

Parse latitute/longitude specification for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]msgdestination message.

References DUNE::Coordinates::WGS84::displace(), DUNE::Parsers::Config::get(), and parseAngle().

Referenced by parse().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseDuration ( Parsers::Config parser,
std::string  section,
T &  man 
)
inlinestatic

Parse duration specification for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]mandestination maneuver.

References DUNE::Parsers::Config::get().

Referenced by parse().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseSpeed ( Parsers::Config parser,
std::string  section,
T &  man 
)
inlinestatic

Parse speed and speed units for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionsection configuration section.
[out]mandestination maneuver.

References DUNE::Parsers::Config::get(), DUNE::IMC::SUNITS_METERS_PS, DUNE::IMC::SUNITS_PERCENTAGE, and DUNE::IMC::SUNITS_RPM.

Referenced by parse().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseTimeout ( Parsers::Config parser,
std::string  section,
T &  man 
)
inlinestatic

Parse timeout specification for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]mandestination maneuver.

References DUNE::Parsers::Config::get().

Referenced by parse().

template<typename T >
static void DUNE::Parsers::PlanConfigParser::parseZ ( Parsers::Config parser,
std::string  section,
T &  man 
)
inlinestatic

Parse depth specification for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]mandestination maneuver.

References DUNE::Parsers::Config::get().

Referenced by parse().

static void DUNE::Parsers::PlanConfigParser::parseZUnits ( Parsers::Config parser,
std::string  section,
uint8_t &  zunits,
std::string  label = "Z Units" 
)
inlinestatic

Parse z units specification for a maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]zunitsdestination variable.
[in]labellabel.

References DUNE::Parsers::Config::get(), DUNE::Utils::String::str(), DUNE::IMC::Z_ALTITUDE, DUNE::IMC::Z_DEPTH, DUNE::IMC::Z_HEIGHT, and DUNE::IMC::Z_NONE.

Referenced by parse(), and parseZUnits().

template<typename Type >
static void DUNE::Parsers::PlanConfigParser::parseZUnits ( Parsers::Config parser,
std::string  section,
Type &  man,
std::string  label = "Z Units" 
)
inlinestatic

Parse z units specification for maneuver.

Parameters
[in]parserconfiguration parser handle.
[in]sectionconfiguration section.
[out]mandestination maneuver.
[in]labellabel.

References parseZUnits().

Collaboration diagram for DUNE::Parsers::PlanConfigParser:
Collaboration graph