LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
link_indicators.h
Go to the documentation of this file.
1 
7 namespace or_lemur
8 {
9 
11 {
12 public:
14  bool operator()(const std::vector<OpenRAVE::dReal> & values) const
15  {
16  abort();
17  }
18 };
19 
21 {
22 public:
23  const OpenRAVE::RobotBasePtr _robot;
24  const OpenRAVE::CollisionCheckerBasePtr _baked_checker;
25  const OpenRAVE::KinBodyConstPtr _baked_check;
26  BakedCheckIndicator(const OpenRAVE::RobotBasePtr & robot,
27  const OpenRAVE::CollisionCheckerBasePtr baked_checker,
28  const OpenRAVE::KinBodyConstPtr baked_check):
29  _robot(robot), _baked_checker(baked_checker), _baked_check(baked_check)
30  {
31  }
32  bool operator()(const std::vector<OpenRAVE::dReal> & values) const
33  {
34  _robot->SetActiveDOFValues(values);
35  bool collides = _baked_checker->CheckStandaloneSelfCollision(_baked_check);
36  if (collides)
37  return false;
38  return true;
39  }
40 };
41 
43 {
44 public:
45  const OpenRAVE::CollisionCheckerBasePtr _cc;
46  const OpenRAVE::RobotBasePtr _robot;
47  const std::set< std::pair<OpenRAVE::KinBody::LinkConstPtr, OpenRAVE::KinBody::LinkConstPtr> > _pairs;
48 
49  AllPairsIndicator(const OpenRAVE::RobotBasePtr & robot,
50  const std::set< std::pair<OpenRAVE::KinBody::LinkConstPtr, OpenRAVE::KinBody::LinkConstPtr> > & pairs):
51  _cc(robot->GetEnv()->GetCollisionChecker()), _robot(robot), _pairs(pairs)
52  {
53  }
54 
55  bool operator()(const std::vector<OpenRAVE::dReal> & values) const
56  {
57  _robot->SetActiveDOFValues(values);
58  for (std::set< std::pair<OpenRAVE::KinBody::LinkConstPtr, OpenRAVE::KinBody::LinkConstPtr> >::iterator
59  it=_pairs.begin(); it!=_pairs.end(); it++)
60  {
61  if (_cc->CheckCollision(it->first, it->second))
62  return false;
63  }
64 
65  return true;
66  }
67 };
68 
69 
70 } // namespace or_lemur
Definition: link_indicators.h:10
Definition: link_indicators.h:42
Definition: link_indicators.h:20