selfdriving
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mpp::Waypoint Struct Reference

#include <mpp/data/Waypoints.h>

Inheritance diagram for mpp::Waypoint:
mpp::WaypointStatus

Public Member Functions

 Waypoint ()=default
 
 Waypoint (double target_x, double target_y, double allowed_distance, bool allow_skip=true, std::optional< double > target_heading_=std::nullopt, double speed_ratio_=1.0)
 
mrpt::math::TPose2D targetAsPose () const
 
bool isValid () const
 
std::string getAsText () const
 
mrpt::containers::yaml asYAML () const
 

Static Public Member Functions

static Waypoint FromYAML (const mrpt::containers::yaml &d)
 

Public Attributes

mrpt::math::TPoint2D target {INVALID_NUM, INVALID_NUM}
 
std::optional< double > targetHeading
 
std::string targetFrameId = "map"
 
double allowedDistance = INVALID_NUM
 
double speedRatio = 1.0
 
bool allowSkip = true
 
bool preferNotToSkip = false
 

Static Public Attributes

static constexpr int INVALID_NUM {-100000}
 

Detailed Description

A single waypoint within WaypointSequence.

Constructor & Destructor Documentation

◆ Waypoint() [1/2]

mpp::Waypoint::Waypoint ( )
default

Ctor with default values

◆ Waypoint() [2/2]

mpp::Waypoint::Waypoint ( double  target_x,
double  target_y,
double  allowed_distance,
bool  allow_skip = true,
std::optional< double >  target_heading_ = std::nullopt,
double  speed_ratio_ = 1.0 
)

Member Function Documentation

◆ asYAML()

mrpt::containers::yaml mpp::Waypoint::asYAML ( ) const

Save waypoint as YAML

◆ FromYAML()

static Waypoint mpp::Waypoint::FromYAML ( const mrpt::containers::yaml &  d)
static

Load waypoint from YAML

◆ getAsText()

std::string mpp::Waypoint::getAsText ( ) const

get in human-readable format

◆ isValid()

bool mpp::Waypoint::isValid ( ) const

Check whether all the minimum mandatory fields have been filled by the user.

◆ targetAsPose()

mrpt::math::TPose2D mpp::Waypoint::targetAsPose ( ) const

Returns the target as a SE(2) pose, with its correct heading if targetHeading is defined, or heading=0 otherwise.

Member Data Documentation

◆ allowedDistance

double mpp::Waypoint::allowedDistance = INVALID_NUM

[Mandatory] How close should the robot get to this waypoint for it to be considered reached.

◆ allowSkip

bool mpp::Waypoint::allowSkip = true

[Default=true] Whether it is allowed to the navigator to proceed to a more advanced waypoint in the sequence if it determines that it is easier to skip this one (e.g. it seems blocked by dynamic obstacles). This value is ignored for the last waypoint in a sequence, since it is always considered to be the ultimate goal and hence not subject to be skipped.

See also
preferNotToSkip

◆ INVALID_NUM

constexpr int mpp::Waypoint::INVALID_NUM {-100000}
static

The default value of fields (used to detect non-set values)

◆ preferNotToSkip

bool mpp::Waypoint::preferNotToSkip = false

This modifies the behavior of TWaypoint::allowSkip according to:

* +------------+-----------------+---------------------------+
* | allowSkip  | preferNotToSkip |    Waypoint obstructed    |
* |            |                 |      with obstacles?      |
* |            |                 +------------+--------------+
* |            |                 |     Yes    |      No      |
* +------------+-----------------+------------+--------------+
* |    false   |      false      |  Trigger   | Pass through |
* |  (default) +-----------------+ rnav error |   waypoint   |
* |            |       true      |            |              |
* +------------+-----------------+------------+--------------+
* |    true    |  false(default) |   Skipped  |    Skipped   |
* +------------+-----------------+            +--------------+
* |    true    |       true      |            |  Not skipped |
* +------------+-----------------+------------+--------------+
* 

◆ speedRatio

double mpp::Waypoint::speedRatio = 1.0

(Default=1.0) Desired robot speed at the target, as a ratio of the full robot speed. That is: speed_ratio=1 means that the user wants the robot to navigate to the target and smoothly continue to the next one when reached. speed_ratio=0 on the other hand means that the robot should approach this waypoint slowing down and end up totally stopped.

◆ target

mrpt::math::TPoint2D mpp::Waypoint::target {INVALID_NUM, INVALID_NUM}

[Mandatory] Coordinates of desired target location (world/global coordinates).

See also
target_heading, targetAsPose()

◆ targetFrameId

std::string mpp::Waypoint::targetFrameId = "map"

(Default="map") Frame ID in which target is given. Optional, use only for submapping applications.

◆ targetHeading

std::optional<double> mpp::Waypoint::targetHeading

Set to the optional desired orientation [radians] of the robot at this waypoint. (Default: none=any heading).

Some navigator implementations may ignore this preferred heading, read the docs of each implementation to find it out.

See also
targetAsPose()

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