Class Planner::Debug

Nested Relationships

This class is a nested type of Class Planner.

Nested Types

Class Documentation

class Debug

This class exists only for debugging purposes. It is not to be used in live production, and its API is to be considered unstable at all times. Any minor version increment

Public Types

using ConstNodePtr = std::shared_ptr<const Node>

Public Functions

Debug(const Planner &planner)

Create a debugger for a planner.

Progress begin(const std::vector<Start> &starts, Goal goal, Options options) const

Begin debugging a plan. Call step() on the Progress object until it returns a plan or until the queue is empty (the Progress object can be treated as a boolean for this purpose).

Public Static Functions

static std::size_t queue_size(const Planner::Result &result)

Get the current size of the frontier queue of a Planner Result.

static std::size_t expansion_count(const Planner::Result &result)

Get the number of search nodes that have been expanded for a Planner Result

static std::size_t node_count(const Planner::Result &result)

Get the current number of nodes that have been created for this Planner Result. This is equal to queue_size(r) + expansion_count(r).

struct Node

A Node in the planning search. A final Planning solution will be a chain of these Nodes, aggregated into a Plan data structure.

Public Types

using SearchQueue = std::priority_queue<ConstNodePtr, std::vector<ConstNodePtr>, Compare>
using Vector = std::vector<ConstNodePtr>

Public Members

ConstNodePtr parent

The parent of this Node. If this is a nullptr, then this was a starting node.

std::vector<Route> route_from_parent

The route that goes from the parent Node to this Node.

double remaining_cost_estimate

An estimate of the remaining cost, based on the heuristic.

double current_cost

The actual cost that has accumulated on the way to this Node.

rmf_utils::optional<std::size_t> waypoint

The waypoint that this Node stops on.

double orientation

The orientation that this Node ends with.

agv::Graph::Lane::EventPtr event

A pointer to an event that occured on the way to this Node.

rmf_utils::optional<std::size_t> start_set_index

If this is a starting node, then this will be the index.

std::size_t id

A unique ID that sticks with this node for its entire lifetime. This will also (roughly) reflect the order of node creation.

struct Compare

Public Functions

inline bool operator()(const ConstNodePtr &a, const ConstNodePtr &b)
class Progress

Public Functions

rmf_utils::optional<Plan> step()

Step the planner forward one time. This will expand the current highest priority Node in the queue and move it to the back of expanded_nodes. The nodes that result from the expansion will all be added to the queue.

inline operator bool() const

Implicitly cast the Progress instance to a boolean. The value will be true if the plan can keep expanding, and it will be false if it cannot expand any further.

After finding a solution, it may be possible to continue expanding, but there is no point because the first solution returned is guaranteed to be the optimal one.

const Node::SearchQueue &queue() const

A priority queue of unexpanded Nodes. They are sorted based on g(n)+h(n) in ascending order (see Node::Compare).

const Node::Vector &expanded_nodes() const

The set of Nodes that have been expanded. They are sorted in the order that they were chosen for expansion.

const Node::Vector &terminal_nodes() const

The set of Nodes which terminated, meaning it was not possible to expand from them.