.. _program_listing_file_include_reach_utils.h: Program Listing for File utils.h ================================ |exhale_lsh| :ref:`Return to documentation for file ` (``include/reach/utils.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright 2019 Southwest Research Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef REACH_UTILS_GENERAL_UTILS_H #define REACH_UTILS_GENERAL_UTILS_H #include #include #include #include #include #include #include #include namespace reach { template static std::map zip(const std::vector& keys, const std::vector& values) { std::map map; for (std::size_t i = 0; i < keys.size(); ++i) { map[keys[i]] = values.at(i); } return map; } std::tuple, double> evaluateIK(const Eigen::Isometry3d& target, const std::map& seed, IKSolver::ConstPtr ik_solver, Evaluator::ConstPtr evaluator); using SearchTreePtr = pcl::search::KdTree::Ptr; SearchTreePtr createSearchTree(const VectorIsometry3d& poses); std::map reachNeighborsDirect(const ReachResult& db, const ReachRecord& rec, IKSolver::ConstPtr solver, Evaluator::ConstPtr evaluator, const double radius, SearchTreePtr search_tree = nullptr); struct NeighborReachResult { std::vector reached_pts; double joint_distance = 0; }; void reachNeighborsRecursive(const ReachResult& db, const ReachRecord& msg, IKSolver::ConstPtr solver, Evaluator::ConstPtr evaluator, const double radius, NeighborReachResult& result, SearchTreePtr search_tree = nullptr); std::vector extractSubset(const std::map& input, const std::vector& keys); } // namespace reach #endif // REACH_UTILS_GENERAL_UTILS_H