UAV Simulator
|
Stores and manages a list of 3D waypoints for trajectory following or mission execution. More...
#include <waypoint_list.h>
Public Member Functions | |
WaypointList () | |
WaypointList (const std::vector< easy3d::vec3 > &waypoints) | |
Constructor to initialize the waypoint list. | |
const easy3d::vec3 & | currentWaypoint () const |
Returns the currently active waypoint. | |
void | advanceToNext () |
Advances the pointer to the next waypoint. If already at the last waypoint, it will stay there. | |
bool | missionComplete () const |
Checks whether all waypoints have been processed. | |
void | draw (easy3d::Viewer &viewer) const |
Renders the waypoints in the provided Easy3D viewer. | |
const std::vector< easy3d::vec3 > & | getWaypoints () const |
Private Attributes | |
std::vector< easy3d::vec3 > | waypoints_ |
List of waypoints in 3D space. | |
size_t | current_index_ |
Index of the current active waypoint. | |
Stores and manages a list of 3D waypoints for trajectory following or mission execution.
This class is responsible for holding a sequence of spatial waypoints (easy3d::vec3
) and tracking progress through them. It allows you to:
WaypointList::WaypointList | ( | ) |
WaypointList::WaypointList | ( | const std::vector< easy3d::vec3 > & | waypoints | ) |
Constructor to initialize the waypoint list.
Constructs a WaypointList with the provided set of waypoints.
waypoints | A vector of 3D coordinates representing waypoints in space. |
waypoints | A vector of 3D points representing the mission trajectory. |
void WaypointList::advanceToNext | ( | ) |
Advances the pointer to the next waypoint. If already at the last waypoint, it will stay there.
Advances the mission to the next waypoint, if available. If the current waypoint is the last one, no change occurs.
const easy3d::vec3 & WaypointList::currentWaypoint | ( | ) | const |
Returns the currently active waypoint.
Retrieves the current active waypoint in the mission.
void WaypointList::draw | ( | easy3d::Viewer & | viewer | ) | const |
Renders the waypoints in the provided Easy3D viewer.
Visualizes all waypoints in the viewer as yellow points.
viewer | Reference to the Easy3D viewer for rendering the points. |
This function adds a PointsDrawable
to the viewer to render all mission waypoints. Each point appears with a fixed size and color.
viewer | Reference to the Easy3D viewer for rendering. |
|
inline |
bool WaypointList::missionComplete | ( | ) | const |
Checks whether all waypoints have been processed.
Checks whether the mission has reached or passed the final waypoint.
|
private |
Index of the current active waypoint.
|
private |
List of waypoints in 3D space.