global_planner_tests.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017, Locus Robotics
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef GLOBAL_PLANNER_TESTS_GLOBAL_PLANNER_TESTS_H
36 #define GLOBAL_PLANNER_TESTS_GLOBAL_PLANNER_TESTS_H
37 
39 #include <string>
40 #include <vector>
41 #include <utility>
42 
43 namespace global_planner_tests
44 {
45 
46 using PoseList = std::vector<nav_2d_msgs::Pose2DStamped>;
47 
57 void groupCells(const nav_core2::Costmap& costmap, PoseList& free_cells, PoseList& occupied_cells,
58  bool include_edges = true);
59 
66 
73 PoseList subsetPoseList(const PoseList& cells, unsigned int num_cells);
74 
81 bool planExists(nav_core2::GlobalPlanner& planner, nav_2d_msgs::Pose2DStamped start, nav_2d_msgs::Pose2DStamped goal);
82 
91 bool checkValidPathCoverage(nav_core2::GlobalPlanner& planner, const PoseList& free_cells,
92  bool verbose = false, bool quit_early = true);
93 
117  const PoseList& start_cells, const PoseList& goal_cells,
118  const std::string& test_name,
119  bool check_exception_type = true, bool verbose = false, bool quit_early = true,
120  bool invalid_starts = true);
121 
145  const PoseList& start_cells, const PoseList& goal_cells,
146  const std::string& test_name,
147  bool check_exception_type = true, bool verbose = false, bool quit_early = true,
148  bool invalid_starts = true);
149 
173  int max_failure_cases = 10, bool check_exception_type = true,
174  bool verbose = false, bool quit_early = true);
175 
186 bool hasNoPaths(nav_core2::GlobalPlanner& planner, const nav_core2::Costmap& costmap,
187  bool check_exception_type = true, bool verbose = false, bool quit_early = true);
188 } // namespace global_planner_tests
189 
190 #endif // GLOBAL_PLANNER_TESTS_GLOBAL_PLANNER_TESTS_H
PoseList createPosesOutsideCostmap(const nav_core2::Costmap &costmap)
Create a list of poses that are outside the costmap&#39;s bounds.
std::vector< nav_2d_msgs::Pose2DStamped > PoseList
bool checkValidPathCoverage(nav_core2::GlobalPlanner &planner, const PoseList &free_cells, bool verbose=false, bool quit_early=true)
Check if a path exists between every pair of free_cells.
PoseList subsetPoseList(const PoseList &cells, unsigned int num_cells)
Create a new list of poses from cells that is num_cells long.
bool checkOccupiedPathCoverage(nav_core2::GlobalPlanner &planner, const PoseList &start_cells, const PoseList &goal_cells, const std::string &test_name, bool check_exception_type=true, bool verbose=false, bool quit_early=true, bool invalid_starts=true)
Check if the appropriate exception is thrown when attempting to plan to or from an occupied cell...
bool hasCompleteCoverage(nav_core2::GlobalPlanner &planner, const nav_core2::Costmap &costmap, int max_failure_cases=10, bool check_exception_type=true, bool verbose=false, bool quit_early=true)
Run a bunch of tests, assuming there is a valid path from any free cell to any other free cell...
bool checkOutOfBoundsPathCoverage(nav_core2::GlobalPlanner &planner, const PoseList &start_cells, const PoseList &goal_cells, const std::string &test_name, bool check_exception_type=true, bool verbose=false, bool quit_early=true, bool invalid_starts=true)
Check if the appropriate exception is thrown when attempting to plan to or from a pose off the costma...
bool planExists(nav_core2::GlobalPlanner &planner, nav_2d_msgs::Pose2DStamped start, nav_2d_msgs::Pose2DStamped goal)
Simple check to see if a plan exists. Returns a boolean instead of returning path or throwing an exce...
void groupCells(const nav_core2::Costmap &costmap, PoseList &free_cells, PoseList &occupied_cells, bool include_edges=true)
Populate two lists of poses from a costmap. one with all the free cells, the other with all the occup...
bool hasNoPaths(nav_core2::GlobalPlanner &planner, const nav_core2::Costmap &costmap, bool check_exception_type=true, bool verbose=false, bool quit_early=true)
Run a bunch of tests, assuming there are no valid paths from any free cell to any other free cell...


global_planner_tests
Author(s):
autogenerated on Sun Jan 10 2021 04:08:30