Collision Checker
shape.h
Go to the documentation of this file.
1 #ifndef SHAPE_H_
2 #define SHAPE_H_
3 
4 #include <Eigen/Dense>
5 #include <iostream>
6 
10 
11 namespace collision {
12 
13 enum ShapeType {
20 };
21 
23 
26  public:
27  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28 
31  }
32 
33  virtual const ISolverEntity_FCL *getFclInterface() const override {
34  return this;
35  }
36 
37  Shape(const Shape &copy);
38  virtual Shape *clone() const = 0;
39 
41  Eigen::Vector2d center() const;
42  double center_x() const;
43  double center_y() const;
44 
46  void set_center(const Eigen::Vector2d &_center);
47 
49  virtual void print(std::ostringstream &stream) const = 0;
51  int time_idx, CollisionObjectConstPtr shared_ptr_this) const;
52 
54  virtual ShapeType type() const = 0;
55 
57  double radius() const;
58 
59  // virtual ShapeConstPtr scale(double factor) const = 0;
60  // virtual ShapeConstPtr shrink(double value) const = 0;
61 
62  virtual ~Shape();
63 
64 #if ENABLE_SERIALIZER
65  virtual serialize::ICollisionObjectExport *exportThis(void) const = 0;
66 #endif
67 
68  protected:
69  Shape(const Eigen::Vector2d &_center) : center_(_center) {}
70 
71  protected:
72  Eigen::Vector2d center_;
73  double radius_;
74 };
75 
76 typedef std::shared_ptr<const Shape> ShapeConstPtr;
77 
78 } // namespace collision
79 
80 #endif
void set_center(const Eigen::Vector2d &_center)
Set geometric center of shape.
Definition: shape.cc:22
std::shared_ptr< const Shape > ShapeConstPtr
double radius_
Definition: shape.h:73
virtual Shape * clone() const =0
Shape(const Eigen::Vector2d &_center)
Definition: shape.h:69
std::shared_ptr< const CollisionObject > CollisionObjectConstPtr
virtual const ISolverEntity_FCL * getFclInterface() const override
Definition: shape.h:33
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionObjectClass getCollisionObjectClass() const override
Definition: shape.h:29
virtual CollisionObjectConstPtr timeSlice(int time_idx, CollisionObjectConstPtr shared_ptr_this) const
Definition: shape.cc:11
virtual ~Shape()
Definition: shape.cc:5
Shape(const Shape &copy)
Definition: shape.cc:7
double radius() const
Get radius.
Definition: shape.cc:27
ShapeType
Definition: shape.h:13
Base prototype for the shape of an obstacle.
Definition: shape.h:25
virtual void print(std::ostringstream &stream) const =0
Print all parameters of the shape.
double center_x() const
Definition: shape.cc:18
virtual ShapeType type() const =0
Get shape type.
double center_y() const
Definition: shape.cc:20
Eigen::Vector2d center_
Definition: shape.h:72
Eigen::Vector2d center() const
Get geometric center of shape.
Definition: shape.cc:16
Provides functionality to use different collision solvers.