moveit2
The MoveIt Motion Planning Framework for ROS 2.
contact_checker_common.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (Apache License)
3  *
4  * Copyright (c) 2017, Southwest Research Institute
5  * All rights reserved.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *********************************************************************/
18 
19 /* Author: Levi Armstrong */
20 
21 #pragma once
22 
23 #include <LinearMath/btConvexHullComputer.h>
24 #include <cstdio>
25 #include <Eigen/Geometry>
26 #include <fstream>
27 
31 
33 {
40 inline std::pair<std::string, std::string> getObjectPairKey(const std::string& obj1, const std::string& obj2)
41 {
42  return obj1 < obj2 ? std::make_pair(obj1, obj2) : std::make_pair(obj2, obj1);
43 }
44 
50 inline bool isLinkActive(const std::vector<std::string>& active, const std::string& name)
51 {
52  return active.empty() || (std::find(active.begin(), active.end(), name) != active.end());
53 }
54 
59  const std::pair<std::string, std::string>& key, bool found);
60 
73 int createConvexHull(AlignedVector<Eigen::Vector3d>& vertices, std::vector<int>& faces,
74  const AlignedVector<Eigen::Vector3d>& input, double shrink = -1, double shrinkClamp = -1);
75 
76 } // namespace collision_detection_bullet
collision_detection::Contact * processResult(ContactTestData &cdata, collision_detection::Contact &contact, const std::pair< std::string, std::string > &key, bool found)
Stores a single contact result in the requested way.
std::pair< std::string, std::string > getObjectPairKey(const std::string &obj1, const std::string &obj2)
Get a key for two object to search the collision matrix.
bool isLinkActive(const std::vector< std::string > &active, const std::string &name)
This will check if a link is active provided a list. If the list is empty the link is considered acti...
int createConvexHull(AlignedVector< Eigen::Vector3d > &vertices, std::vector< int > &faces, const AlignedVector< Eigen::Vector3d > &input, double shrink=-1, double shrinkClamp=-1)
Create a convex hull from vertices using Bullet Convex Hull Computer.
name
Definition: setup.py:7
KeyboardReader input
Definition of a contact point.