10 double ompl_resolution(
11 const OpenRAVE::RobotBasePtr & robot,
12 const std::vector<int> & dofs);
15 OpenRAVE::PlannerBase::PlannerParametersConstPtr params);
26 const OpenRAVE::RobotBasePtr & robot,
27 const std::vector<int> & dofs,
37 const OpenRAVE::EnvironmentBasePtr env;
38 const OpenRAVE::RobotBasePtr robot;
40 mutable size_t num_checks;
41 mutable boost::chrono::high_resolution_clock::duration dur_checks;
45 boost::function<void ()> bake_begin;
46 boost::function<OpenRAVE::KinBodyPtr ()> bake_end;
47 boost::function<bool (OpenRAVE::KinBodyConstPtr, OpenRAVE::CollisionReportPtr)> baked_checker;
49 OpenRAVE::CollisionCheckerBasePtr baked_cc;
50 OpenRAVE::KinBodyPtr baked_kinbody;
54 const OpenRAVE::EnvironmentBasePtr env,
55 const OpenRAVE::RobotBasePtr robot,
59 env(env), robot(robot), dim(dim),
66 throw std::runtime_error(
"state space is not real vector!");
74 OpenRAVE::CollisionCheckerBasePtr cc = env->GetCollisionChecker();
76 throw std::runtime_error(
"no collision checker set!");
79 std::stringstream sinput(
"BakeGetType BakeBegin BakeEnd"), soutput;
82 success = cc->SendCommand(soutput, sinput);
84 catch (
const OpenRAVE::openrave_exception & exc)
86 throw std::runtime_error(
"collision checker doesn't support baked checks!");
89 if (!success) std::runtime_error(
"BakeGetType failed!");
90 std::string kinbody_type = soutput.str();
91 success = cc->SendCommand(soutput, sinput);
92 if (!success) std::runtime_error(
"BakeBegin failed!");
93 OpenRAVE::KinBodyPtr kb = OpenRAVE::RaveCreateKinBody(env,kinbody_type);
94 if (!baked_kinbody) std::runtime_error(
"RaveCreateKinBody failed!");
95 env->CheckCollision(robot);
96 robot->CheckSelfCollision();
97 success = cc->SendCommand(soutput, sinput);
98 if (!success) std::runtime_error(
"BakeEnd failed!");
106 baked_kinbody.reset();
110 boost::chrono::high_resolution_clock::time_point time_begin
111 = boost::chrono::high_resolution_clock::now();
114 std::vector<OpenRAVE::dReal> adofvals(q, q+dim);
115 robot->SetActiveDOFValues(adofvals, OpenRAVE::KinBody::CLA_Nothing);
118 collided = baked_cc->CheckStandaloneSelfCollision(baked_kinbody);
120 collided = env->CheckCollision(robot) || robot->CheckSelfCollision();
121 dur_checks += boost::chrono::high_resolution_clock::now() - time_begin;
126 #ifdef OR_LEMUR_HAS_BOOSTSMARTPTRS
127 typedef boost::shared_ptr<OrChecker> OrCheckerPtr;
129 typedef std::shared_ptr<OrChecker> OrCheckerPtr;
135 boost::function<bool (std::vector<OpenRAVE::dReal> &)> indicator;
137 mutable size_t num_checks;
138 mutable boost::chrono::high_resolution_clock::duration dur_checks;
141 boost::function<
bool (std::vector<OpenRAVE::dReal> &)> indicator):
143 indicator(indicator), dim(si->getStateDimension()),
144 num_checks(0), dur_checks()
149 boost::chrono::high_resolution_clock::time_point time_begin
150 = boost::chrono::high_resolution_clock::now();
153 std::vector<OpenRAVE::dReal> adofvals(q, q+dim);
154 bool is_valid = indicator(adofvals);
155 dur_checks += boost::chrono::high_resolution_clock::now() - time_begin;
160 typedef boost::shared_ptr<OrIndicatorChecker> OrIndicatorCheckerPtr;
Definition: or_ompl_conversions.h:132
Definition: or_ompl_conversions.h:34