Nav2 Navigation Stack - humble
humble
ROS 2 Navigation Stack
|
An object to find kNNs of the graph to determining the start and end nodes to utilize for planning in a free-space-style request of start and goal poses. Since the graph does not change over time, we can precompute this quadtree and reuse it over many requests. More...
#include <nav2_route/include/nav2_route/node_spatial_tree.hpp>
Public Member Functions | |
NodeSpatialTree ()=default | |
Constructor. | |
~NodeSpatialTree () | |
Destructor. | |
void | computeTree (Graph &graph) |
Compute the kd-tree based on the graph node information. More... | |
bool | findNearestGraphNodesToPose (const geometry_msgs::msg::PoseStamped &pose_in, std::vector< unsigned int > &node_ids) |
Find the closest node to a given pose. More... | |
void | setNumOfNearestNodes (int num_of_nearest_nodes) |
Set the number of nodes to search in local area for. More... | |
Protected Attributes | |
kd_tree_t * | kdtree_ |
GraphAdaptor * | adaptor_ |
Graph * | graph_ |
int | num_of_nearest_nodes_ {3} |
An object to find kNNs of the graph to determining the start and end nodes to utilize for planning in a free-space-style request of start and goal poses. Since the graph does not change over time, we can precompute this quadtree and reuse it over many requests.
Definition at line 67 of file node_spatial_tree.hpp.
void nav2_route::NodeSpatialTree::computeTree | ( | Graph & | graph | ) |
Compute the kd-tree based on the graph node information.
graph | The graph of nodes for the route |
Definition at line 42 of file node_spatial_tree.cpp.
bool nav2_route::NodeSpatialTree::findNearestGraphNodesToPose | ( | const geometry_msgs::msg::PoseStamped & | pose_in, |
std::vector< unsigned int > & | node_ids | ||
) |
Find the closest node to a given pose.
pose_in | Pose to find node near |
node_id | The return ID of the node |
Definition at line 60 of file node_spatial_tree.cpp.
void nav2_route::NodeSpatialTree::setNumOfNearestNodes | ( | int | num_of_nearest_nodes | ) |
Set the number of nodes to search in local area for.
num | Numbers of nearest nodes to return |
Definition at line 37 of file node_spatial_tree.cpp.