Skip to content
Snippets Groups Projects
Commit b5b451a7 authored by Akseppal's avatar Akseppal
Browse files

create affordance map object within bindShooter (). Initialised only in...

create affordance map object within bindShooter (). Initialised only in createPathValidation --> is this a good idea?
parent f369d280
No related branches found
No related tags found
2 merge requests!2new release of the planner with clean demos / tutorials,!3release of rbprm-corba for ijrr resubmission
...@@ -46,14 +46,11 @@ namespace hpp { ...@@ -46,14 +46,11 @@ namespace hpp {
hpp::rbprm::RbPrmShooterPtr_t create (const hpp::model::DevicePtr_t& robot) hpp::rbprm::RbPrmShooterPtr_t create (const hpp::model::DevicePtr_t& robot)
{ {
hpp::model::RbPrmDevicePtr_t robotcast = boost::static_pointer_cast<hpp::model::RbPrmDevice>(robot); hpp::model::RbPrmDevicePtr_t robotcast = boost::static_pointer_cast<hpp::model::RbPrmDevice>(robot);
std::map<std::string, std::vector<boost::shared_ptr<model::CollisionObject> > > affMap = if (affMap_.empty ()) {
problemSolver_->map
<std::vector<boost::shared_ptr<model::CollisionObject> > > ();
if (affMap.empty ()) {
throw hpp::Error ("No affordances found. Unable to create shooter object."); throw hpp::Error ("No affordances found. Unable to create shooter object.");
} }
rbprm::RbPrmShooterPtr_t shooter = hpp::rbprm::RbPrmShooter::create rbprm::RbPrmShooterPtr_t shooter = hpp::rbprm::RbPrmShooter::create
(robotcast, problemSolver_->problem ()->collisionObstacles(), affMap, (robotcast, problemSolver_->problem ()->collisionObstacles(), affMap_,
romFilter_,affFilter_,shootLimit_,displacementLimit_); romFilter_,affFilter_,shootLimit_,displacementLimit_);
if(!so3Bounds_.empty()) if(!so3Bounds_.empty())
shooter->BoundSO3(so3Bounds_); shooter->BoundSO3(so3Bounds_);
...@@ -63,7 +60,13 @@ namespace hpp { ...@@ -63,7 +60,13 @@ namespace hpp {
hpp::core::PathValidationPtr_t createPathValidation (const hpp::model::DevicePtr_t& robot, const hpp::model::value_type& val) hpp::core::PathValidationPtr_t createPathValidation (const hpp::model::DevicePtr_t& robot, const hpp::model::value_type& val)
{ {
hpp::model::RbPrmDevicePtr_t robotcast = boost::static_pointer_cast<hpp::model::RbPrmDevice>(robot); hpp::model::RbPrmDevicePtr_t robotcast = boost::static_pointer_cast<hpp::model::RbPrmDevice>(robot);
hpp::rbprm::RbPrmValidationPtr_t validation(hpp::rbprm::RbPrmValidation::create(robotcast, romFilter_, affFilter_)); affMap_ = problemSolver_->map
<std::vector<boost::shared_ptr<model::CollisionObject> > > ();
if (affMap_.empty ()) {
throw hpp::Error ("No affordances found. Unable to create Path Validaton object.");
}
hpp::rbprm::RbPrmValidationPtr_t validation
(hpp::rbprm::RbPrmValidation::create(robotcast, romFilter_, affFilter_, affMap_));
hpp::core::DiscretizedCollisionCheckingPtr_t collisionChecking = hpp::core::DiscretizedCollisionChecking::create(robot,val); hpp::core::DiscretizedCollisionCheckingPtr_t collisionChecking = hpp::core::DiscretizedCollisionChecking::create(robot,val);
collisionChecking->add (validation); collisionChecking->add (validation);
return collisionChecking; return collisionChecking;
...@@ -75,6 +78,7 @@ namespace hpp { ...@@ -75,6 +78,7 @@ namespace hpp {
std::size_t shootLimit_; std::size_t shootLimit_;
std::size_t displacementLimit_; std::size_t displacementLimit_;
std::vector<double> so3Bounds_; std::vector<double> so3Bounds_;
std::map<std::string, std::vector<boost::shared_ptr<model::CollisionObject> > > affMap_;
}; };
class RbprmBuilder : public virtual POA_hpp::corbaserver::rbprm::RbprmBuilder class RbprmBuilder : public virtual POA_hpp::corbaserver::rbprm::RbprmBuilder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment