struct mrpt::nav::TWaypoint

A single waypoint within TWaypointSequence.

#include <mrpt/nav/reactive/TWaypoint.h>

struct TWaypoint
{
    //
fields

    mrpt::math::TPoint2D target;
    double target_heading;
    std::string target_frame_id;
    double allowed_distance;
    double speed_ratio;
    bool allow_skip {true};
    static const int INVALID_NUM {-100000};

    // construction

    TWaypoint();

    TWaypoint(
        double target_x,
        double target_y,
        double allowed_distance,
        bool allow_skip = true,
        double target_heading_ = INVALID_NUM,
        double speed_ratio_ = 1.0
        );

    //
methods

    bool isValid() const;
    std::string getAsText() const;
};

// direct descendants

struct TWaypointStatus;

Fields

mrpt::math::TPoint2D target

[Must be set by the user] Coordinates of desired target location (world/global coordinates).

See also:

target_heading

double target_heading

[Default=any heading] Optionally, set to the desired orientation [radians] of the robot at this waypoint.

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

std::string target_frame_id

(Default=”map”) Frame ID in which target is given.

Optional, use only for submapping applications.

double allowed_distance

[Must be set by the user] How close should the robot get to this waypoint for it to be considered reached.

double speed_ratio

(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.

bool allow_skip {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.

static const int INVALID_NUM {-100000}

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

Construction

TWaypoint()

Ctor with default values.

Methods

bool isValid() const

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

std::string getAsText() const

get in human-readable format