moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
#include <BenchmarkExecutor.h>
Classes | |
struct | BenchmarkRequest |
struct | PathConstraints |
struct | StartState |
struct | TrajectoryConstraints |
Public Types | |
typedef std::map< std::string, std::string > | PlannerRunData |
Structure to hold information for a single run of a planner. More... | |
typedef std::vector< PlannerRunData > | PlannerBenchmarkData |
Structure to hold information for a single planner's benchmark data. More... | |
typedef std::function< void(const moveit_msgs::msg::MotionPlanRequest &request, planning_scene::PlanningScenePtr)> | QueryStartEventFunction |
Definition of a query-start benchmark event function. Invoked before a new query is benchmarked. More... | |
typedef std::function< void(const moveit_msgs::msg::MotionPlanRequest &request, planning_scene::PlanningScenePtr)> | QueryCompletionEventFunction |
Definition of a query-end benchmark event function. Invoked after a query has finished benchmarking. More... | |
typedef std::function< void(const moveit_msgs::msg::MotionPlanRequest &request, PlannerBenchmarkData &benchmark_data)> | PlannerStartEventFunction |
typedef std::function< void(const moveit_msgs::msg::MotionPlanRequest &request, PlannerBenchmarkData &benchmark_data)> | PlannerCompletionEventFunction |
typedef std::function< void(moveit_msgs::msg::MotionPlanRequest &request)> | PreRunEventFunction |
Definition of a pre-run benchmark event function. Invoked immediately before each planner calls solve(). More... | |
typedef std::function< void(const moveit_msgs::msg::MotionPlanRequest &request, const planning_interface::MotionPlanDetailedResponse &response, PlannerRunData &run_data)> | PostRunEventFunction |
Definition of a post-run benchmark event function. Invoked immediately after each planner calls solve(). More... | |
Public Member Functions | |
BenchmarkExecutor (const rclcpp::Node::SharedPtr &node, const std::string &robot_description_param="robot_description") | |
virtual | ~BenchmarkExecutor () |
void | initialize (const std::vector< std::string > &plugin_classes) |
void | addPreRunEvent (const PreRunEventFunction &func) |
void | addPostRunEvent (const PostRunEventFunction &func) |
void | addPlannerStartEvent (const PlannerStartEventFunction &func) |
void | addPlannerCompletionEvent (const PlannerCompletionEventFunction &func) |
void | addQueryStartEvent (const QueryStartEventFunction &func) |
void | addQueryCompletionEvent (const QueryCompletionEventFunction &func) |
virtual void | clear () |
virtual bool | runBenchmarks (const BenchmarkOptions &opts) |
Protected Member Functions | |
virtual bool | initializeBenchmarks (const BenchmarkOptions &opts, moveit_msgs::msg::PlanningScene &scene_msg, std::vector< BenchmarkRequest > &queries) |
virtual bool | loadBenchmarkQueryData (const BenchmarkOptions &opts, moveit_msgs::msg::PlanningScene &scene_msg, std::vector< StartState > &start_states, std::vector< PathConstraints > &path_constraints, std::vector< PathConstraints > &goal_constraints, std::vector< TrajectoryConstraints > &traj_constraints, std::vector< BenchmarkRequest > &queries) |
Initialize benchmark query data from start states and constraints. More... | |
virtual void | collectMetrics (PlannerRunData &metrics, const planning_interface::MotionPlanDetailedResponse &mp_res, bool solved, double total_time) |
void | computeAveragePathSimilarities (PlannerBenchmarkData &planner_data, const std::vector< planning_interface::MotionPlanDetailedResponse > &responses, const std::vector< bool > &solved) |
bool | computeTrajectoryDistance (const robot_trajectory::RobotTrajectory &traj_first, const robot_trajectory::RobotTrajectory &traj_second, double &result_distance) |
virtual void | writeOutput (const BenchmarkRequest &brequest, const std::string &start_time, double benchmark_duration) |
void | shiftConstraintsByOffset (moveit_msgs::msg::Constraints &constraints, const std::vector< double > &offset) |
bool | plannerConfigurationsExist (const std::map< std::string, std::vector< std::string >> &planners, const std::string &group_name) |
Check that the desired planner plugins and algorithms exist for the given group. More... | |
bool | queriesAndPlannersCompatible (const std::vector< BenchmarkRequest > &requests, const std::map< std::string, std::vector< std::string >> &planners) |
Check that the given requests can be run on the set of planner plugins and algorithms. More... | |
bool | loadPlanningScene (const std::string &scene_name, moveit_msgs::msg::PlanningScene &scene_msg) |
Load the planning scene with the given name from the warehouse. More... | |
bool | loadStates (const std::string ®ex, std::vector< StartState > &start_states) |
Load all states matching the given regular expression from the warehouse. More... | |
bool | loadPathConstraints (const std::string ®ex, std::vector< PathConstraints > &constraints) |
Load all constraints matching the given regular expression from the warehouse. More... | |
bool | loadTrajectoryConstraints (const std::string ®ex, std::vector< TrajectoryConstraints > &constraints) |
Load all trajectory constraints from the warehouse that match the given regular expression. More... | |
bool | loadQueries (const std::string ®ex, const std::string &scene_name, std::vector< BenchmarkRequest > &queries) |
Load all motion plan requests matching the given regular expression from the warehouse. More... | |
void | createRequestCombinations (const BenchmarkRequest &brequest, const std::vector< StartState > &start_states, const std::vector< PathConstraints > &path_constraints, std::vector< BenchmarkRequest > &combos) |
Duplicate the given benchmark request for all combinations of start states and path constraints. More... | |
void | runBenchmark (moveit_msgs::msg::MotionPlanRequest request, const std::map< std::string, std::vector< std::string >> &planners, int runs) |
Execute the given motion plan request on the set of planners for the set number of runs. More... | |
Protected Attributes | |
planning_scene_monitor::PlanningSceneMonitor * | psm_ |
moveit_warehouse::PlanningSceneStorage * | pss_ |
moveit_warehouse::PlanningSceneWorldStorage * | psws_ |
moveit_warehouse::RobotStateStorage * | rs_ |
moveit_warehouse::ConstraintsStorage * | cs_ |
moveit_warehouse::TrajectoryConstraintsStorage * | tcs_ |
rclcpp::Node::SharedPtr | node_ |
warehouse_ros::DatabaseLoader | dbloader |
planning_scene::PlanningScenePtr | planning_scene_ |
BenchmarkOptions | options_ |
std::map< std::string, planning_pipeline::PlanningPipelinePtr > | planning_pipelines_ |
std::vector< PlannerBenchmarkData > | benchmark_data_ |
std::vector< PreRunEventFunction > | pre_event_fns_ |
std::vector< PostRunEventFunction > | post_event_fns_ |
std::vector< PlannerStartEventFunction > | planner_start_fns_ |
std::vector< PlannerCompletionEventFunction > | planner_completion_fns_ |
std::vector< QueryStartEventFunction > | query_start_fns_ |
std::vector< QueryCompletionEventFunction > | query_end_fns_ |
A class that executes motion plan requests and aggregates data across multiple runs Note: This class operates outside of MoveGroup and does NOT use PlanningRequestAdapters
Definition at line 61 of file BenchmarkExecutor.h.
typedef std::vector<PlannerRunData> moveit_ros_benchmarks::BenchmarkExecutor::PlannerBenchmarkData |
Structure to hold information for a single planner's benchmark data.
Definition at line 67 of file BenchmarkExecutor.h.
typedef std::function<void(const moveit_msgs::msg::MotionPlanRequest& request, PlannerBenchmarkData& benchmark_data)> moveit_ros_benchmarks::BenchmarkExecutor::PlannerCompletionEventFunction |
Definition of a planner-switch benchmark event function. Invoked after a planner completes all runs for a particular query.
Definition at line 85 of file BenchmarkExecutor.h.
typedef std::map<std::string, std::string> moveit_ros_benchmarks::BenchmarkExecutor::PlannerRunData |
Structure to hold information for a single run of a planner.
Definition at line 65 of file BenchmarkExecutor.h.
typedef std::function<void(const moveit_msgs::msg::MotionPlanRequest& request, PlannerBenchmarkData& benchmark_data)> moveit_ros_benchmarks::BenchmarkExecutor::PlannerStartEventFunction |
Definition of a planner-switch benchmark event function. Invoked before a planner starts any runs for a particular query.
Definition at line 80 of file BenchmarkExecutor.h.
typedef std::function<void(const moveit_msgs::msg::MotionPlanRequest& request, const planning_interface::MotionPlanDetailedResponse& response, PlannerRunData& run_data)> moveit_ros_benchmarks::BenchmarkExecutor::PostRunEventFunction |
Definition of a post-run benchmark event function. Invoked immediately after each planner calls solve().
Definition at line 93 of file BenchmarkExecutor.h.
typedef std::function<void(moveit_msgs::msg::MotionPlanRequest& request)> moveit_ros_benchmarks::BenchmarkExecutor::PreRunEventFunction |
Definition of a pre-run benchmark event function. Invoked immediately before each planner calls solve().
Definition at line 88 of file BenchmarkExecutor.h.
typedef std::function<void(const moveit_msgs::msg::MotionPlanRequest& request, planning_scene::PlanningScenePtr)> moveit_ros_benchmarks::BenchmarkExecutor::QueryCompletionEventFunction |
Definition of a query-end benchmark event function. Invoked after a query has finished benchmarking.
Definition at line 75 of file BenchmarkExecutor.h.
typedef std::function<void(const moveit_msgs::msg::MotionPlanRequest& request, planning_scene::PlanningScenePtr)> moveit_ros_benchmarks::BenchmarkExecutor::QueryStartEventFunction |
Definition of a query-start benchmark event function. Invoked before a new query is benchmarked.
Definition at line 71 of file BenchmarkExecutor.h.
BenchmarkExecutor::BenchmarkExecutor | ( | const rclcpp::Node::SharedPtr & | node, |
const std::string & | robot_description_param = "robot_description" |
||
) |
|
virtual |
Definition at line 107 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addPlannerCompletionEvent | ( | const PlannerCompletionEventFunction & | func | ) |
Definition at line 206 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addPlannerStartEvent | ( | const PlannerStartEventFunction & | func | ) |
Definition at line 201 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addPostRunEvent | ( | const PostRunEventFunction & | func | ) |
Definition at line 196 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addPreRunEvent | ( | const PreRunEventFunction & | func | ) |
Definition at line 191 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addQueryCompletionEvent | ( | const QueryCompletionEventFunction & | func | ) |
Definition at line 216 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::addQueryStartEvent | ( | const QueryStartEventFunction & | func | ) |
Definition at line 211 of file BenchmarkExecutor.cpp.
|
virtual |
Definition at line 154 of file BenchmarkExecutor.cpp.
|
protectedvirtual |
Definition at line 868 of file BenchmarkExecutor.cpp.
|
protected |
Compute the similarity of each (final) trajectory to all other (final) trajectories in the experiment and write the results to planner_data metrics
Definition at line 937 of file BenchmarkExecutor.cpp.
|
protected |
Helper function used by computeAveragePathSimilarities() for computing a heuristic distance metric between two robot trajectories. This function aligns both trajectories in a greedy fashion and computes the mean waypoint distance averaged over all aligned waypoints. Using a greedy approach is more efficient than dynamic time warping, and seems to be sufficient for similar trajectories.
Definition at line 982 of file BenchmarkExecutor.cpp.
|
protected |
Duplicate the given benchmark request for all combinations of start states and path constraints.
Definition at line 481 of file BenchmarkExecutor.cpp.
void BenchmarkExecutor::initialize | ( | const std::vector< std::string > & | plugin_classes | ) |
|
protectedvirtual |
|
protectedvirtual |
Initialize benchmark query data from start states and constraints.
Reimplemented in moveit_ros_benchmarks::CombinePredefinedPosesBenchmark.
Definition at line 420 of file BenchmarkExecutor.cpp.
|
protected |
Load all constraints matching the given regular expression from the warehouse.
Definition at line 707 of file BenchmarkExecutor.cpp.
|
protected |
Load the planning scene with the given name from the warehouse.
Definition at line 588 of file BenchmarkExecutor.cpp.
|
protected |
Load all motion plan requests matching the given regular expression from the warehouse.
Definition at line 624 of file BenchmarkExecutor.cpp.
|
protected |
Load all states matching the given regular expression from the warehouse.
Definition at line 669 of file BenchmarkExecutor.cpp.
|
protected |
Load all trajectory constraints from the warehouse that match the given regular expression.
Definition at line 742 of file BenchmarkExecutor.cpp.
|
protected |
Check that the desired planner plugins and algorithms exist for the given group.
Definition at line 529 of file BenchmarkExecutor.cpp.
|
protected |
Check that the given requests can be run on the set of planner plugins and algorithms.
Definition at line 273 of file BenchmarkExecutor.cpp.
|
protected |
Execute the given motion plan request on the set of planners for the set number of runs.
Definition at line 778 of file BenchmarkExecutor.cpp.
|
virtual |
|
protected |
Definition at line 459 of file BenchmarkExecutor.cpp.
|
protectedvirtual |
|
protected |
Definition at line 217 of file BenchmarkExecutor.h.
|
protected |
Definition at line 206 of file BenchmarkExecutor.h.
|
protected |
Definition at line 210 of file BenchmarkExecutor.h.
|
protected |
Definition at line 209 of file BenchmarkExecutor.h.
|
protected |
Definition at line 213 of file BenchmarkExecutor.h.
|
protected |
Definition at line 222 of file BenchmarkExecutor.h.
|
protected |
Definition at line 221 of file BenchmarkExecutor.h.
|
protected |
Definition at line 215 of file BenchmarkExecutor.h.
|
protected |
Definition at line 211 of file BenchmarkExecutor.h.
|
protected |
Definition at line 220 of file BenchmarkExecutor.h.
|
protected |
Definition at line 219 of file BenchmarkExecutor.h.
|
protected |
Definition at line 202 of file BenchmarkExecutor.h.
|
protected |
Definition at line 203 of file BenchmarkExecutor.h.
|
protected |
Definition at line 204 of file BenchmarkExecutor.h.
|
protected |
Definition at line 224 of file BenchmarkExecutor.h.
|
protected |
Definition at line 223 of file BenchmarkExecutor.h.
|
protected |
Definition at line 205 of file BenchmarkExecutor.h.
|
protected |
Definition at line 207 of file BenchmarkExecutor.h.