moveit2
The MoveIt Motion Planning Framework for ROS 2.
constraint_approximations.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
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 Willow Garage 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 OWNER 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 /* Author: Ioan Sucan */
36 
37 #pragma once
38 
42 #include <ompl/base/StateStorage.h>
43 #include <visualization_msgs/msg/marker_array.hpp>
44 
45 namespace ompl_interface
46 {
47 typedef ompl::base::StateStorageWithMetadata<std::vector<std::size_t> > ConstraintApproximationStateStorage;
48 typedef std::function<bool(const ompl::base::State*, const ompl::base::State*)> ConstraintStateStorageOrderFn;
49 
51 {
52  ConstraintApproximation(const planning_models::RobotModelConstPtr& kinematic_model, const std::string& group,
53  const std::string& factory, const std::string& serialization, const std::string& filename,
54  const ompl::base::StateStoragePtr& storage);
55  ConstraintApproximation(const planning_models::RobotModelConstPtr& kinematic_model, const std::string& group,
56  const std::string& factory, const moveit_msgs::msg::Constraints& msg,
57  const std::string& filename, const ompl::base::StateStoragePtr& storage);
58 
59  void visualizeDistribution(const std::string& link_name, unsigned int count,
60  visualization_msgs::msg::MarkerArray& arr) const;
61 
62  std::string group_;
63  std::string factory_;
64  std::string serialization_;
65  moveit_msgs::msg::Constraints constraint_msg_;
66  planning_models::RobotModelConstPtr robot_model_;
67  kinematic_constraints::KinematicConstraintSetPtr kconstraints_set_;
68  std::vector<int> space_signature_;
69 
70  std::string ompldb_filename_;
71  ompl::base::StateStoragePtr state_storage_ptr_;
73 };
74 
75 MOVEIT_DECLARE_PTR(ConstraintApproximations, std::vector<ConstraintApproximation>)
76 } // namespace ompl_interface
#define MOVEIT_DECLARE_PTR(Name, Type)
Definition: declare_ptr.h:54
The MoveIt interface to OMPL.
std::function< bool(const ompl::base::State *, const ompl::base::State *)> ConstraintStateStorageOrderFn
ompl::base::StateStorageWithMetadata< std::vector< std::size_t > > ConstraintApproximationStateStorage
ConstraintApproximationStateStorage * state_storage_
void visualizeDistribution(const std::string &link_name, unsigned int count, visualization_msgs::msg::MarkerArray &arr) const
kinematic_constraints::KinematicConstraintSetPtr kconstraints_set_
ConstraintApproximation(const planning_models::RobotModelConstPtr &kinematic_model, const std::string &group, const std::string &factory, const moveit_msgs::msg::Constraints &msg, const std::string &filename, const ompl::base::StateStoragePtr &storage)
ConstraintApproximation(const planning_models::RobotModelConstPtr &kinematic_model, const std::string &group, const std::string &factory, const std::string &serialization, const std::string &filename, const ompl::base::StateStoragePtr &storage)
planning_models::RobotModelConstPtr robot_model_