Skip to main content

AvoidPointsInCoveragePath Class

Modifies a coverage path to route around obstacle points using semicircular detours. More...

Declaration

class moveit_pro::behaviors::AvoidPointsInCoveragePath { ... }

Included Headers

#include <avoid_points_in_coverage_path.hpp>

Base class

classBT::SyncActionNode

Public Constructors Index

AvoidPointsInCoveragePath (const std::string &name, const BT::NodeConfiguration &config)

Constructor. More...

Public Member Functions Index

BT::NodeStatustick () override

Execute the behavior: modify the coverage path to avoid obstacle points. More...

Public Static Functions Index

static BT::PortsListprovidedPorts ()

Declare input and output ports. More...

static BT::KeyValueVectormetadata ()

Provide metadata for the MoveIt Studio Developer Tool UI. More...

Private Static Functions Index

static std::vector< size_t >filterRelevantObstacles (const std::vector< geometry_msgs::msg::PoseStamped > &coverage_path, const std::vector< geometry_msgs::msg::PoseStamped > &points_to_avoid, double boustrophedon_spacing)

Find indices of obstacles within boustrophedon spacing of any path point. More...

static intfindClosestObstacle (const geometry_msgs::msg::PoseStamped &current_point, const std::vector< geometry_msgs::msg::PoseStamped > &points_to_avoid, const std::vector< size_t > &relevant_obstacles, double avoidance_radius)

Return the index of the closest obstacle within avoidance_radius, or -1 if none. More...

static size_tinsertSemicircularDetour (const std::vector< geometry_msgs::msg::PoseStamped > &coverage_path, const std::vector< geometry_msgs::msg::PoseStamped > &points_to_avoid, int obstacle_idx, double avoidance_radius, int loop_segments, size_t current_i, std::vector< geometry_msgs::msg::PoseStamped > &modified_path)

Insert a semicircular detour for one obstacle into modified_path. More...

Description

Modifies a coverage path to route around obstacle points using semicircular detours.

For each obstacle point that falls within the boustrophedon spacing of the path, the behavior inserts a semicircular detour on the opposite side of the path from the obstacle. Points that fall within the avoidance radius of an obstacle are removed from the output path and replaced by the arc.

Data Port NamePort TypeObject Type
coverage_pathinputstd::vector<geometry_msgs::msg::PoseStamped>
points_to_avoidinputstd::vector<geometry_msgs::msg::PoseStamped>
stride_spacinginputdouble
avoidance_radiusinputdouble
loop_segmentsinputint
modified_pathoutputstd::vector<geometry_msgs::msg::PoseStamped>

Definition at line 32 of file avoid_points_in_coverage_path.hpp.

Public Constructors

AvoidPointsInCoveragePath()

moveit_pro::behaviors::AvoidPointsInCoveragePath::AvoidPointsInCoveragePath (const std::string & name, const BT::NodeConfiguration & config)

Constructor.

Parameters
name

The name of a particular instance of this Behavior.

config

Runtime configuration for this Behavior, including port mappings.

Declaration at line 40 of file avoid_points_in_coverage_path.hpp, definition at line 73 of file avoid_points_in_coverage_path.cpp.

Public Member Functions

tick()

BT::NodeStatus moveit_pro::behaviors::AvoidPointsInCoveragePath::tick ()

Execute the behavior: modify the coverage path to avoid obstacle points.

Returns

SUCCESS after producing the modified path, FAILURE if required ports are missing.

Declaration at line 58 of file avoid_points_in_coverage_path.hpp, definition at line 260 of file avoid_points_in_coverage_path.cpp.

Public Static Functions

metadata()

BT::KeyValueVector moveit_pro::behaviors::AvoidPointsInCoveragePath::metadata ()
static

Provide metadata for the MoveIt Studio Developer Tool UI.

Returns

A BT::KeyValueVector containing the Behavior metadata.

Declaration at line 52 of file avoid_points_in_coverage_path.hpp, definition at line 94 of file avoid_points_in_coverage_path.cpp.

providedPorts()

BT::PortsList moveit_pro::behaviors::AvoidPointsInCoveragePath::providedPorts ()
static

Declare input and output ports.

Returns

The list of ports for this behavior.

Declaration at line 46 of file avoid_points_in_coverage_path.hpp, definition at line 78 of file avoid_points_in_coverage_path.cpp.

Private Static Functions

filterRelevantObstacles()

std::vector< size_t > moveit_pro::behaviors::AvoidPointsInCoveragePath::filterRelevantObstacles (const std::vector< geometry_msgs::msg::PoseStamped > & coverage_path, const std::vector< geometry_msgs::msg::PoseStamped > & points_to_avoid, double boustrophedon_spacing)
static

Find indices of obstacles within boustrophedon spacing of any path point.

Declaration at line 65 of file avoid_points_in_coverage_path.hpp, definition at line 101 of file avoid_points_in_coverage_path.cpp.

findClosestObstacle()

int moveit_pro::behaviors::AvoidPointsInCoveragePath::findClosestObstacle (const geometry_msgs::msg::PoseStamped & current_point, const std::vector< geometry_msgs::msg::PoseStamped > & points_to_avoid, const std::vector< size_t > & relevant_obstacles, double avoidance_radius)
static

Return the index of the closest obstacle within avoidance_radius, or -1 if none.

Declaration at line 72 of file avoid_points_in_coverage_path.hpp, definition at line 122 of file avoid_points_in_coverage_path.cpp.

insertSemicircularDetour()

size_t moveit_pro::behaviors::AvoidPointsInCoveragePath::insertSemicircularDetour (const std::vector< geometry_msgs::msg::PoseStamped > & coverage_path, const std::vector< geometry_msgs::msg::PoseStamped > & points_to_avoid, int obstacle_idx, double avoidance_radius, int loop_segments, size_t current_i, std::vector< geometry_msgs::msg::PoseStamped > & modified_path)
static

Insert a semicircular detour for one obstacle into modified_path.

Returns

The next path index to process after the detour.

Declaration at line 81 of file avoid_points_in_coverage_path.hpp, definition at line 143 of file avoid_points_in_coverage_path.cpp.


The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.