hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
collision-validation-report.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_COLLISION_VALIDATION_REPORT_HH
20 # define HPP_CORE_COLLISION_VALIDATION_REPORT_HH
21 
22 # include <hpp/util/indent.hh>
23 
24 # include <hpp/pinocchio/collision-object.hh>
26 # include <hpp/fcl/collision_data.h>
27 
28 namespace hpp {
29  namespace core {
32 
35  struct HPP_CORE_DLLAPI CollisionValidationReport : public ValidationReport
36  {
38 
41  const fcl::CollisionResult& r) : object1 (o1), object2 (o2), result(r)
42  {}
43 
45  const fcl::CollisionResult& r) :
46  object1 (pair.first),
47  object2 (pair.second),
48  result(r)
49  {}
50 
53  std::string objectName1;
56  std::string objectName2;
60  virtual std::ostream& print (std::ostream& os) const
61  {
62  os << "Collision between object " << (object1 ? object1->name() : objectName1) << " and "
63  << (object2 ? object2->name() : objectName2);
64  return os;
65  }
66  }; // class CollisionValidationReport
67 
71  {
73 
77  {}
78 
81  {}
82 
83  std::vector<CollisionValidationReportPtr_t> collisionReports;
84  virtual std::ostream& print (std::ostream& os) const
85  {
86  os <<" Number of collisions : "<<collisionReports.size()<<"."<<incendl;
87  for(std::vector<CollisionValidationReportPtr_t>::const_iterator it = collisionReports.begin() ; it != collisionReports.end() ; ++it){
88  os << **it << iendl;
89  }
90  return os << decindent;
91  }
92  }; // class AllCollisionsValidationReport
94  } // namespace core
95 } // namespace hpp
96 
97 #endif // HPP_CORE_COLLISION_VALIDATION_REPORT_HH
HPP_UTIL_DLLAPI std::ostream & incendl(std::ostream &o)
Definition: validation-report.hh:36
Definition: collision-validation-report.hh:70
virtual std::ostream & print(std::ostream &os) const
Write report in a stream.
Definition: collision-validation-report.hh:60
CollisionValidationReport()
Definition: collision-validation-report.hh:37
CollisionValidationReport(CollisionObjectConstPtr_t o1, CollisionObjectConstPtr_t o2, const fcl::CollisionResult &r)
Definition: collision-validation-report.hh:39
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
AllCollisionsValidationReport()
Definition: collision-validation-report.hh:72
FCL_REAL r
std::pair< CollisionObjectConstPtr_t, CollisionObjectConstPtr_t > CollisionPair_t
Definition: fwd.hh:219
virtual std::ostream & print(std::ostream &os) const
Write report in a stream.
Definition: collision-validation-report.hh:84
HPP_UTIL_DLLAPI std::ostream & decindent(std::ostream &o)
Definition: collision-validation-report.hh:35
CollisionObjectConstPtr_t object2
Second object in collision.
Definition: collision-validation-report.hh:55
CollisionObjectConstPtr_t object1
First object in collision.
Definition: collision-validation-report.hh:52
AllCollisionsValidationReport(CollisionObjectConstPtr_t o1, CollisionObjectConstPtr_t o2, const fcl::CollisionResult &r)
Definition: collision-validation-report.hh:74
std::string objectName2
Definition: collision-validation-report.hh:56
std::string objectName1
Definition: collision-validation-report.hh:53
std::vector< CollisionValidationReportPtr_t > collisionReports
Definition: collision-validation-report.hh:83
fcl::CollisionResult result
fcl collision results
Definition: collision-validation-report.hh:58
AllCollisionsValidationReport(const CollisionPair_t &pair, const fcl::CollisionResult &r)
Definition: collision-validation-report.hh:79
pinocchio::CollisionObjectConstPtr_t CollisionObjectConstPtr_t
Definition: fwd.hh:90
CollisionValidationReport(const CollisionPair_t &pair, const fcl::CollisionResult &r)
Definition: collision-validation-report.hh:44