struct mrpt::nav::TWaypointStatusSequence

Overview

The struct for querying the status of waypoints navigation.

Used in CWaypointsNavigator::getWaypointNavStatus().

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

struct TWaypointStatusSequence
{
    // fields

    std::vector<TWaypointStatus> waypoints;
    mrpt::system::TTimeStamp timestamp_nav_started = INVALID_TIMESTAMP;
    bool final_goal_reached {false};
    int waypoint_index_current_goal {-1};
    mrpt::math::TPose2D last_robot_pose {       TWaypoint::INVALID_NUM, TWaypoint::INVALID_NUM, TWaypoint::INVALID_NUM};

    // construction

    TWaypointStatusSequence();

    // methods

    std::string getAsText() const;
    void getAsOpenglVisualization(mrpt::opengl::CSetOfObjects& obj, const mrpt::nav::TWaypointsRenderingParams& params = mrpt::nav::TWaypointsRenderingParams()) const;
};

Fields

std::vector<TWaypointStatus> waypoints

Waypoints parameters and status (reached, skipped, etc.)

mrpt::system::TTimeStamp timestamp_nav_started = INVALID_TIMESTAMP

Timestamp of user navigation command.

bool final_goal_reached {false}

Whether the final waypoint has been reached successfuly.

int waypoint_index_current_goal {-1}

Index in waypoints of the waypoint the navigator is currently trying to reach.

This will point to the last waypoint after navigation ends successfully. Its value is -1 if navigation has not started yet

mrpt::math::TPose2D last_robot_pose {       TWaypoint::INVALID_NUM, TWaypoint::INVALID_NUM, TWaypoint::INVALID_NUM}

Robot pose at last time step (has INVALID_NUM fields upon initialization)

Methods

std::string getAsText() const

Ctor with default values.

Gets navigation params as a human-readable format

void getAsOpenglVisualization(mrpt::opengl::CSetOfObjects& obj, const mrpt::nav::TWaypointsRenderingParams& params = mrpt::nav::TWaypointsRenderingParams()) const

Renders the sequence of waypoints (previous contents of obj are cleared)