collision_world_hybrid.cpp
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 the 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: E. Gil Jones */
36 
38 
39 namespace collision_detection
40 {
41 CollisionWorldHybrid::CollisionWorldHybrid(Eigen::Vector3d size, Eigen::Vector3d origin, bool use_signed_distance_field,
42  double resolution, double collision_tolerance,
43  double max_propogation_distance)
45  , cworld_distance_(new collision_detection::CollisionWorldDistanceField(
46  getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
47 
48 {
49 }
50 
51 CollisionWorldHybrid::CollisionWorldHybrid(const WorldPtr& world, Eigen::Vector3d size, Eigen::Vector3d origin,
52  bool use_signed_distance_field, double resolution,
53  double collision_tolerance, double max_propogation_distance)
54  : CollisionWorldFCL(world)
56  getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
57 {
58 }
59 
61  : CollisionWorldFCL(other, world)
64 {
65 }
66 
68  const CollisionRobot& robot,
69  const robot_state::RobotState& state) const
70 {
71  cworld_distance_->checkCollision(req, res, robot, state);
72 }
73 
75  const CollisionRobot& robot,
76  const robot_state::RobotState& state,
77  GroupStateRepresentationPtr& gsr) const
78 {
79  cworld_distance_->checkCollision(req, res, robot, state, gsr);
80 }
81 
83  const CollisionRobot& robot,
84  const robot_state::RobotState& state,
85  const AllowedCollisionMatrix& acm) const
86 {
87  cworld_distance_->checkCollision(req, res, robot, state, acm);
88 }
89 
91  const CollisionRobot& robot,
92  const robot_state::RobotState& state,
93  const AllowedCollisionMatrix& acm,
94  GroupStateRepresentationPtr& gsr) const
95 {
96  cworld_distance_->checkCollision(req, res, robot, state, acm, gsr);
97 }
98 
100  const CollisionRobot& robot,
101  const robot_state::RobotState& state) const
102 {
103  cworld_distance_->checkRobotCollision(req, res, robot, state);
104 }
105 
107  const CollisionRobot& robot,
108  const robot_state::RobotState& state,
109  GroupStateRepresentationPtr& gsr) const
110 {
111  cworld_distance_->checkRobotCollision(req, res, robot, state, gsr);
112 }
113 
115  const CollisionRobot& robot,
116  const robot_state::RobotState& state,
117  const AllowedCollisionMatrix& acm) const
118 {
119  cworld_distance_->checkRobotCollision(req, res, robot, state, acm);
120 }
121 
123  const CollisionRobot& robot,
124  const robot_state::RobotState& state,
125  const AllowedCollisionMatrix& acm,
126  GroupStateRepresentationPtr& gsr) const
127 {
128  cworld_distance_->checkRobotCollision(req, res, robot, state, acm, gsr);
129 }
130 
131 void CollisionWorldHybrid::setWorld(const WorldPtr& world)
132 {
133  if (world == getWorld())
134  return;
135 
136  cworld_distance_->setWorld(world);
138 }
139 
141  const CollisionRobot& robot, const robot_state::RobotState& state,
142  const AllowedCollisionMatrix* acm,
143  GroupStateRepresentationPtr& gsr) const
144 {
145  cworld_distance_->getCollisionGradients(req, res, robot, state, acm, gsr);
146 }
147 
149  const CollisionRobot& robot, const robot_state::RobotState& state,
150  const AllowedCollisionMatrix* acm, GroupStateRepresentationPtr& gsr) const
151 {
152  cworld_distance_->getAllCollisions(req, res, robot, state, acm, gsr);
153 }
154 }
155 
void getCollisionGradients(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state, const AllowedCollisionMatrix *acm, GroupStateRepresentationPtr &gsr) const
void checkRobotCollisionDistanceField(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state) const
void getAllCollisions(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state, const AllowedCollisionMatrix *acm, GroupStateRepresentationPtr &gsr) const
CollisionWorldDistanceFieldPtr cworld_distance_
virtual void setWorld(const WorldPtr &world)
Generic interface to collision detection.
virtual void setWorld(const WorldPtr &world)
static const double resolution
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
This class represents a collision model of the robot and can be used for self collision checks (to ch...
void checkCollisionDistanceField(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state) const
Representation of a robot's state. This includes position, velocity, acceleration and effort...
Definition: robot_state.h:123
const CollisionWorldDistanceFieldConstPtr getCollisionWorldDistanceField() const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionWorldHybrid(Eigen::Vector3d size=Eigen::Vector3d(3, 3, 4), Eigen::Vector3d origin=Eigen::Vector3d(0, 0, 0), bool use_signed_distance_field=false, double resolution=.02, double collision_tolerance=0.0, double max_propogation_distance=.25)


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Sun Oct 18 2020 13:16:33