10 #ifndef GRID_COLLISION_CHECKER_H_
11 #define GRID_COLLISION_CHECKER_H_
13 #include "API/Grids/gridsAPI.hpp"
16 #include "planner/Greedy/BodySurfaceSampler.hpp"
17 #include "planner/Greedy/CollisionPoint.hpp"
31 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
34 virtual ~CollisionSpace();
37 Robot* getRobot() {
return m_Robot; }
40 inline int getNbCellsOverX(
void){
return _nbCellsX;}
41 inline int getNbCellsOverY(
void){
return _nbCellsY;}
42 inline int getNbCellsOverZ(
void){
return _nbCellsZ;}
53 std::vector<CollisionSpaceCell*> getCellListForObject(obj* obj,
const Eigen::Affine3d& Trans);
54 std::vector<CollisionSpaceCell*> getOccupiedCells() {
return m_OccupationCells; }
55 void resetOccupationCells();
56 void updateRobotOccupationCells(
Robot* rob);
59 bool areCellsValid(
const std::vector<CollisionSpaceCell*>& cells);
61 void unvalidObjectCells(obj* obj);
62 bool collisionCheck();
67 void addRobotBody(
Joint* jnt);
68 void addRobot(
Robot* rob);
69 void addAllPointsToField();
70 double addPointsToField(
const std::vector<Eigen::Vector3d>& points);
72 void initNeighborhoods();
73 int getDirectionNumber(
int dx,
int dy,
int dz)
const;
77 const Eigen::Vector3d& collision_point_pos,
80 Eigen::Vector3d& gradient)
const;
87 void drawSquaredDist();
90 void drawCollisionPoints();
95 unsigned int x,
unsigned int y,
unsigned int z );
99 double getDistanceFromCell(
int x,
int y,
int z)
const;
106 std::vector<CollisionSpaceCell*> m_OccupationCells;
109 double m_invTwiceResolution;
113 double m_MaxClearance;
119 std::vector<double> m_SqrtTable;
120 std::vector<std::vector<std::vector<std::vector<int> > > > m_Neighborhoods;
121 std::vector<std::vector<int> > m_DirectionNumberToDirection;
void drawStaticVoxels()
Draws a sphere in all voxels the color of the sphere represent the distance to the nearest obstacle...
Definition: CollisionSpace.cpp:670
Definition: CollisionPoint.hpp:48
void draw()
Draw a openGl view of the grid.
Definition: CollisionSpace.cpp:787
bool getCollisionPointPotentialGradient(const CollisionPoint &collision_point, const Eigen::Vector3d &collision_point_pos, double &distance, double &potential, Eigen::Vector3d &gradient) const
The distance potential and the gradient is computed for a collision point First the distance d of the...
Definition: CollisionSpace.cpp:559
void drawGradient()
Definition: CollisionSpace.cpp:679
Definition: ThreeDGrid.hpp:24
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
double getDistanceGradient(const Eigen::Vector3d &point, Eigen::Vector3d &gradient) const
Computes the finiate differenting gradient.
Definition: CollisionSpace.cpp:521
API::ThreeDCell * createNewCell(unsigned int index, unsigned int x, unsigned int y, unsigned int z)
Virtual function that creates a new Cell.
Definition: CollisionSpace.cpp:88
This class holds a Joint and is associated with a Body (Link) It's the basic element of a kinematic c...
Definition: joint.hpp:27
Definition: CollisionSpace.hpp:27
Definition: ThreeDCell.hpp:25
Definition: CollisionSpaceCell.hpp:16
Definition: BodySurfaceSampler.hpp:27
bool isRobotColliding(double &distance) const
Goes through all points and computes whether the robot is colliding Computes the transform of all poi...
Definition: CollisionSpace.cpp:606