Waypoints#
#include "navground/sim/tasks/waypoints.h"
A sequence of points to reach.
This class implement a task that makes the agent reach a sequence of waypoints, calling navground::core::Controller::go_to_position for the next waypoint after the current has been reached within a tolerance.
The task notifies when a new waypoint is set by calling a callback.
Registered properties:
waypoints
(list of navground::core::Vector2, get_waypoints)loop
(bool, get_loop)random
(bool, get_random)tolerance
(bool, get_tolerance)
Public Functions
Constructs a new instance.
- Parameters:
waypoints – [in] The waypoints
loop – [in] Whether it should start from begin after reaching the last waypoint
tolerance – [in] The goal tolerance applied to each waypoint.
random – [in] Whether to pick the next waypoint randomly
The size of the data passed to callbacks when events occur, see TaskCallback and Task::add_callback.
The data is composed of 4 numbers:
[time, target_x, target_y, target_theta]
- Returns:
4
Sets the waypoints.
- Parameters:
value – [in] The desired waypoints
Sets the goal tolerance applied to each waypoint.
- Parameters:
value – [in] The desired value
Sets whether it should start from begin after reaching the last waypoint.
- Parameters:
value – [in] The desired value
Gets the waypoints.
- Returns:
The waypoints.
Gets the goal tolerance applied to each waypoint.
- Returns:
The tolerance.
Gets whether it should start from begin after reaching the last waypoint.
- Returns:
True if it should loop.
Gets whether to pick the next waypoint randomly.
- Returns:
True if it should pick randomly.
Sets whether to pick the next waypoint randomly.
- Parameters:
value – [in] The desired value
Public Static Attributes
Whether by default the task loops.
The default goal tolerance.
By default moves in sequence.