collision_world_hybrid.cpp
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2012, Willow Garage, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of the Willow Garage nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *********************************************************************/
00034 
00035 /* Author: E. Gil Jones */
00036 
00037 #include <moveit/collision_distance_field/collision_world_hybrid.h>
00038 
00039 namespace collision_detection
00040 {
00041 CollisionWorldHybrid::CollisionWorldHybrid(Eigen::Vector3d size, Eigen::Vector3d origin, bool use_signed_distance_field,
00042                                            double resolution, double collision_tolerance,
00043                                            double max_propogation_distance)
00044   : CollisionWorldFCL()
00045   , cworld_distance_(new collision_detection::CollisionWorldDistanceField(
00046         getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
00047 
00048 {
00049 }
00050 
00051 CollisionWorldHybrid::CollisionWorldHybrid(const WorldPtr& world, Eigen::Vector3d size, Eigen::Vector3d origin,
00052                                            bool use_signed_distance_field, double resolution,
00053                                            double collision_tolerance, double max_propogation_distance)
00054   : CollisionWorldFCL(world)
00055   , cworld_distance_(new collision_detection::CollisionWorldDistanceField(
00056         getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
00057 {
00058 }
00059 
00060 CollisionWorldHybrid::CollisionWorldHybrid(const CollisionWorldHybrid& other, const WorldPtr& world)
00061   : CollisionWorldFCL(other, world)
00062   , cworld_distance_(
00063         new collision_detection::CollisionWorldDistanceField(*other.getCollisionWorldDistanceField(), world))
00064 {
00065 }
00066 
00067 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00068                                                        const CollisionRobot& robot,
00069                                                        const robot_state::RobotState& state) const
00070 {
00071   cworld_distance_->checkCollision(req, res, robot, state);
00072 }
00073 
00074 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00075                                                        const CollisionRobot& robot,
00076                                                        const robot_state::RobotState& state,
00077                                                        boost::shared_ptr<GroupStateRepresentation>& gsr) const
00078 {
00079   cworld_distance_->checkCollision(req, res, robot, state, gsr);
00080 }
00081 
00082 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00083                                                        const CollisionRobot& robot,
00084                                                        const robot_state::RobotState& state,
00085                                                        const AllowedCollisionMatrix& acm) const
00086 {
00087   cworld_distance_->checkCollision(req, res, robot, state, acm);
00088 }
00089 
00090 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00091                                                        const CollisionRobot& robot,
00092                                                        const robot_state::RobotState& state,
00093                                                        const AllowedCollisionMatrix& acm,
00094                                                        boost::shared_ptr<GroupStateRepresentation>& gsr) const
00095 {
00096   cworld_distance_->checkCollision(req, res, robot, state, acm, gsr);
00097 }
00098 
00099 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00100                                                             const CollisionRobot& robot,
00101                                                             const robot_state::RobotState& state) const
00102 {
00103   cworld_distance_->checkRobotCollision(req, res, robot, state);
00104 }
00105 
00106 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00107                                                             const CollisionRobot& robot,
00108                                                             const robot_state::RobotState& state,
00109                                                             boost::shared_ptr<GroupStateRepresentation>& gsr) const
00110 {
00111   cworld_distance_->checkRobotCollision(req, res, robot, state, gsr);
00112 }
00113 
00114 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00115                                                             const CollisionRobot& robot,
00116                                                             const robot_state::RobotState& state,
00117                                                             const AllowedCollisionMatrix& acm) const
00118 {
00119   cworld_distance_->checkRobotCollision(req, res, robot, state, acm);
00120 }
00121 
00122 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00123                                                             const CollisionRobot& robot,
00124                                                             const robot_state::RobotState& state,
00125                                                             const AllowedCollisionMatrix& acm,
00126                                                             boost::shared_ptr<GroupStateRepresentation>& gsr) const
00127 {
00128   cworld_distance_->checkRobotCollision(req, res, robot, state, acm, gsr);
00129 }
00130 
00131 void CollisionWorldHybrid::setWorld(const WorldPtr& world)
00132 {
00133   if (world == getWorld())
00134     return;
00135 
00136   cworld_distance_->setWorld(world);
00137   CollisionWorldFCL::setWorld(world);
00138 }
00139 
00140 void CollisionWorldHybrid::getCollisionGradients(const CollisionRequest& req, CollisionResult& res,
00141                                                  const CollisionRobot& robot, const robot_state::RobotState& state,
00142                                                  const AllowedCollisionMatrix* acm,
00143                                                  boost::shared_ptr<GroupStateRepresentation>& gsr) const
00144 {
00145   cworld_distance_->getCollisionGradients(req, res, robot, state, acm, gsr);
00146 }
00147 
00148 void CollisionWorldHybrid::getAllCollisions(const CollisionRequest& req, CollisionResult& res,
00149                                             const CollisionRobot& robot, const robot_state::RobotState& state,
00150                                             const AllowedCollisionMatrix* acm,
00151                                             boost::shared_ptr<GroupStateRepresentation>& gsr) const
00152 {
00153   cworld_distance_->getAllCollisions(req, res, robot, state, acm, gsr);
00154 }
00155 }
00156 
00157 #include <moveit/collision_distance_field/collision_detector_allocator_hybrid.h>
00158 const std::string collision_detection::CollisionDetectorAllocatorHybrid::NAME_("HYBRID");


moveit_experimental
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley , Jorge Nicho
autogenerated on Mon Jul 24 2017 02:21:02