collision_robot.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2011, 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 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: Ioan Sucan */
00036 
00037 #ifndef MOVEIT_COLLISION_DETECTION_COLLISION_ROBOT_
00038 #define MOVEIT_COLLISION_DETECTION_COLLISION_ROBOT_
00039 
00040 #include <moveit/collision_detection/collision_matrix.h>
00041 #include <moveit/macros/class_forward.h>
00042 #include <moveit/robot_state/robot_state.h>
00043 #include <moveit_msgs/LinkPadding.h>
00044 #include <moveit_msgs/LinkScale.h>
00045 
00046 namespace collision_detection
00047 {
00048 MOVEIT_CLASS_FORWARD(CollisionRobot);
00049 
00054 class CollisionRobot
00055 {
00056 public:
00062   CollisionRobot(const robot_model::RobotModelConstPtr& model, double padding = 0.0, double scale = 1.0);
00063 
00065   CollisionRobot(const CollisionRobot& other);
00066 
00067   virtual ~CollisionRobot()
00068   {
00069   }
00070 
00076   virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
00077                                   const robot_state::RobotState& state) const = 0;
00078 
00085   virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
00086                                   const robot_state::RobotState& state, const AllowedCollisionMatrix& acm) const = 0;
00087 
00094   virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
00095                                   const robot_state::RobotState& state1,
00096                                   const robot_state::RobotState& state2) const = 0;
00097 
00105   virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
00106                                   const robot_state::RobotState& state1, const robot_state::RobotState& state2,
00107                                   const AllowedCollisionMatrix& acm) const = 0;
00108 
00116   virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
00117                                    const robot_state::RobotState& state, const CollisionRobot& other_robot,
00118                                    const robot_state::RobotState& other_state) const = 0;
00119 
00128   virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
00129                                    const robot_state::RobotState& state, const CollisionRobot& other_robot,
00130                                    const robot_state::RobotState& other_state,
00131                                    const AllowedCollisionMatrix& acm) const = 0;
00132 
00143   virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
00144                                    const robot_state::RobotState& state1, const robot_state::RobotState& state2,
00145                                    const CollisionRobot& other_robot, const robot_state::RobotState& other_state1,
00146                                    const robot_state::RobotState& other_state2) const = 0;
00147 
00159   virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
00160                                    const robot_state::RobotState& state1, const robot_state::RobotState& state2,
00161                                    const CollisionRobot& other_robot, const robot_state::RobotState& other_state1,
00162                                    const robot_state::RobotState& other_state2,
00163                                    const AllowedCollisionMatrix& acm) const = 0;
00164 
00166   virtual double distanceSelf(const robot_state::RobotState& state) const = 0;
00167 
00170   virtual double distanceSelf(const robot_state::RobotState& state, const AllowedCollisionMatrix& acm) const = 0;
00171 
00176   virtual double distanceOther(const robot_state::RobotState& state, const CollisionRobot& other_robot,
00177                                const robot_state::RobotState& other_state) const = 0;
00178 
00185   virtual double distanceOther(const robot_state::RobotState& state, const CollisionRobot& other_robot,
00186                                const robot_state::RobotState& other_state, const AllowedCollisionMatrix& acm) const = 0;
00187 
00189   const robot_model::RobotModelConstPtr& getRobotModel() const
00190   {
00191     return robot_model_;
00192   }
00193 
00198   void setLinkPadding(const std::string& link_name, double padding);
00199 
00201   double getLinkPadding(const std::string& link_name) const;
00202 
00204   void setLinkPadding(const std::map<std::string, double>& padding);
00205 
00207   const std::map<std::string, double>& getLinkPadding() const;
00208 
00210   void setLinkScale(const std::string& link_name, double scale);
00211 
00213   double getLinkScale(const std::string& link_name) const;
00214 
00216   void setLinkScale(const std::map<std::string, double>& scale);
00217 
00219   const std::map<std::string, double>& getLinkScale() const;
00220 
00222   void setPadding(double padding);
00223 
00225   void setScale(double scale);
00226 
00228   void setPadding(const std::vector<moveit_msgs::LinkPadding>& padding);
00229 
00231   void getPadding(std::vector<moveit_msgs::LinkPadding>& padding) const;
00232 
00234   void setScale(const std::vector<moveit_msgs::LinkScale>& scale);
00235 
00237   void getScale(std::vector<moveit_msgs::LinkScale>& scale) const;
00238 
00239 protected:
00246   virtual void updatedPaddingOrScaling(const std::vector<std::string>& links);
00247 
00249   robot_model::RobotModelConstPtr robot_model_;
00250 
00252   std::map<std::string, double> link_padding_;
00253 
00255   std::map<std::string, double> link_scale_;
00256 };
00257 }
00258 
00259 #endif


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Mon Jul 24 2017 02:20:43