collision_robot.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011, 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 #ifndef MOVEIT_COLLISION_DETECTION_COLLISION_ROBOT_
38 #define MOVEIT_COLLISION_DETECTION_COLLISION_ROBOT_
39 
43 #include <moveit_msgs/LinkPadding.h>
44 #include <moveit_msgs/LinkScale.h>
45 
46 namespace collision_detection
47 {
48 MOVEIT_CLASS_FORWARD(CollisionRobot);
49 
55 {
56 public:
62  CollisionRobot(const robot_model::RobotModelConstPtr& model, double padding = 0.0, double scale = 1.0); // NOLINT
63 
65  CollisionRobot(const CollisionRobot& other);
66 
67  virtual ~CollisionRobot()
68  {
69  }
70 
76  virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
77  const robot_state::RobotState& state) const = 0;
78 
85  virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
86  const robot_state::RobotState& state, const AllowedCollisionMatrix& acm) const = 0;
87 
94  virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
95  const robot_state::RobotState& state1,
96  const robot_state::RobotState& state2) const = 0;
97 
105  virtual void checkSelfCollision(const CollisionRequest& req, CollisionResult& res,
106  const robot_state::RobotState& state1, const robot_state::RobotState& state2,
107  const AllowedCollisionMatrix& acm) const = 0;
108 
116  virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
117  const robot_state::RobotState& state, const CollisionRobot& other_robot,
118  const robot_state::RobotState& other_state) const = 0;
119 
128  virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
129  const robot_state::RobotState& state, const CollisionRobot& other_robot,
130  const robot_state::RobotState& other_state,
131  const AllowedCollisionMatrix& acm) const = 0;
132 
143  virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
144  const robot_state::RobotState& state1, const robot_state::RobotState& state2,
145  const CollisionRobot& other_robot, const robot_state::RobotState& other_state1,
146  const robot_state::RobotState& other_state2) const = 0;
147 
159  virtual void checkOtherCollision(const CollisionRequest& req, CollisionResult& res,
160  const robot_state::RobotState& state1, const robot_state::RobotState& state2,
161  const CollisionRobot& other_robot, const robot_state::RobotState& other_state1,
162  const robot_state::RobotState& other_state2,
163  const AllowedCollisionMatrix& acm) const = 0;
164 
166  virtual double distanceSelf(const robot_state::RobotState& state) const = 0;
167 
170  virtual double distanceSelf(const robot_state::RobotState& state, const AllowedCollisionMatrix& acm) const = 0;
171 
176  virtual double distanceOther(const robot_state::RobotState& state, const CollisionRobot& other_robot,
177  const robot_state::RobotState& other_state) const = 0;
178 
185  virtual double distanceOther(const robot_state::RobotState& state, const CollisionRobot& other_robot,
186  const robot_state::RobotState& other_state, const AllowedCollisionMatrix& acm) const = 0;
187 
189  const robot_model::RobotModelConstPtr& getRobotModel() const
190  {
191  return robot_model_;
192  }
193 
198  void setLinkPadding(const std::string& link_name, double padding);
199 
201  double getLinkPadding(const std::string& link_name) const;
202 
204  void setLinkPadding(const std::map<std::string, double>& padding);
205 
207  const std::map<std::string, double>& getLinkPadding() const;
208 
210  void setLinkScale(const std::string& link_name, double scale);
211 
213  double getLinkScale(const std::string& link_name) const;
214 
216  void setLinkScale(const std::map<std::string, double>& scale);
217 
219  const std::map<std::string, double>& getLinkScale() const;
220 
222  void setPadding(double padding);
223 
225  void setScale(double scale);
226 
228  void setPadding(const std::vector<moveit_msgs::LinkPadding>& padding);
229 
231  void getPadding(std::vector<moveit_msgs::LinkPadding>& padding) const;
232 
234  void setScale(const std::vector<moveit_msgs::LinkScale>& scale);
235 
237  void getScale(std::vector<moveit_msgs::LinkScale>& scale) const;
238 
239 protected:
246  virtual void updatedPaddingOrScaling(const std::vector<std::string>& links);
247 
249  robot_model::RobotModelConstPtr robot_model_;
250 
252  std::map<std::string, double> link_padding_;
253 
255  std::map<std::string, double> link_scale_;
256 };
257 }
258 
259 #endif
void setScale(double scale)
Set the link scaling (for every link)
std::map< std::string, double > link_scale_
The internally maintained map (from link names to scaling)
virtual void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state) const =0
Check for self collision. Any collision between any pair of links is checked for, NO collisions are i...
void setPadding(double padding)
Set the link padding (for every link)
const std::map< std::string, double > & getLinkPadding() const
Get the link paddings as a map (from link names to padding value)
const robot_model::RobotModelConstPtr & getRobotModel() const
The kinematic model corresponding to this collision model.
CollisionRobot(const robot_model::RobotModelConstPtr &model, double padding=0.0, double scale=1.0)
Constructor.
virtual void updatedPaddingOrScaling(const std::vector< std::string > &links)
When the scale or padding is changed for a set of links by any of the functions in this class...
Generic interface to collision detection.
void getScale(std::vector< moveit_msgs::LinkScale > &scale) const
Get the link scaling as a vector of messages.
robot_model::RobotModelConstPtr robot_model_
The kinematic model corresponding to this collision model.
void getPadding(std::vector< moveit_msgs::LinkPadding > &padding) const
Get the link padding as a vector of messages.
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
void setLinkScale(const std::string &link_name, double scale)
Set the scaling for a particular link.
This class represents a collision model of the robot and can be used for self collision checks (to ch...
std::map< std::string, double > link_padding_
The internally maintained map (from link names to padding)
virtual void checkOtherCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state, const CollisionRobot &other_robot, const robot_state::RobotState &other_state) const =0
Check for collision with a different robot (possibly a different kinematic model as well)...
void setLinkPadding(const std::string &link_name, double padding)
Set the link padding for a particular link.
const std::map< std::string, double > & getLinkScale() const
Get the link scaling as a map (from link names to scale value)
MOVEIT_CLASS_FORWARD(CollisionDetectorAllocator)
virtual double distanceOther(const robot_state::RobotState &state, const CollisionRobot &other_robot, const robot_state::RobotState &other_state) const =0
The distance to another robot instance.
Representation of a robot&#39;s state. This includes position, velocity, acceleration and effort...
Definition: robot_state.h:82
virtual double distanceSelf(const robot_state::RobotState &state) const =0
The distance to self-collision given the robot is at state state.


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Mon Jan 15 2018 03:50:44