Commit 1ff5010e authored by Steve Tonneau's avatar Steve Tonneau
Browse files

corba server robust to problem solver maps

parent 12b88f4c
......@@ -102,6 +102,12 @@ module hpp
void setFilter (in Names_t roms)
raises (Error);
/// Called if several problem solvers are used
/// is colliding with the environment.
///
void initNewProblemSolver ()
raises (Error);
/// Set Rom surface constraints for the configuration shooter
/// a Rom configuration will only be valid it collides with a surface
/// that forms a given affordance (support, lean, etc.)
......
......@@ -22,6 +22,7 @@
# include <hpp/corba/template/server.hh>
# include <hpp/corbaserver/rbprm/config.hh>
# include <hpp/corbaserver/problem-solver-map.hh>
namespace hpp {
namespace rbprm {
......@@ -35,7 +36,7 @@ namespace hpp {
const std::string& poaName = "child");
~Server ();
/// Set planner that will be controlled by server
void setProblemSolver (hpp::core::ProblemSolverPtr_t problemSolver);
void setProblemSolverMap (hpp::corbaServer::ProblemSolverMapPtr_t psMap);
/// Start corba server
......@@ -43,7 +44,7 @@ namespace hpp {
void startCorbaServer(const std::string& contextId,
const std::string& contextKind,
const std::string& objectId);
private:
public:
corba::Server <impl::RbprmBuilder>* rbprmBuilder_;
}; // class Server
} // namespace rbprm
......
......@@ -31,16 +31,15 @@ int main (int argc, char* argv [])
AffordanceServer affordanceServer (argc, const_cast<const char**> (argv),
true);
affordanceServer.setProblemSolver (problemSolver);
affordanceServer.setProblemSolverMap(corbaServer.problemSolverMap());
RbprmServer rbprmServer (argc, const_cast<const char**> (argv),
true, "rbprmChild");
rbprmServer.setProblemSolver (problemSolver);
rbprmServer.setProblemSolverMap (corbaServer.problemSolverMap());
corbaServer.startCorbaServer ();
affordanceServer.startCorbaServer ("hpp", "corbaserver",
"affordanceCorba", "affordance");
rbprmServer.startCorbaServer ("hpp", "corbaserver",
"rbprm");
rbprmServer.startCorbaServer ("hpp", "corbaserver", "rbprm");
corbaServer.processRequest(true);
}
......@@ -58,6 +58,7 @@ class Builder (object):
self.client.rbprm.rbprm.loadRobotRomModel(urdfNamerom, rootJointType, packageName, urdfNamerom, urdfSuffix, srdfSuffix)
else:
self.client.rbprm.rbprm.loadRobotRomModel(urdfNameroms, rootJointType, packageName, urdfNameroms, urdfSuffix, srdfSuffix)
self.client.rbprm.rbprm.initNewProblemSolver()
self.client.rbprm.rbprm.loadRobotCompleteModel(urdfName, rootJointType, packageName, urdfName, urdfSuffix, srdfSuffix)
self.name = urdfName
self.displayName = urdfName
......
This diff is collapsed.
......@@ -30,6 +30,8 @@
# include <hpp/core/problem-solver.hh>
# include <hpp/core/discretized-collision-checking.hh>
# include <hpp/core/straight-path.hh>
#include <hpp/corbaserver/affordance/server.hh>
# include <hpp/corbaserver/problem-solver-map.hh>
#include <hpp/fcl/BVH/BVH_model.h>
......@@ -63,7 +65,7 @@ namespace hpp {
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);
affMap_ = problemSolver_->map
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.");
......@@ -231,11 +233,16 @@ namespace hpp {
virtual hpp::floatSeq* computeTargetTransform(const char* limbName, const hpp::floatSeq& configuration, const hpp::floatSeq& p, const hpp::floatSeq& n) throw (hpp::Error);
public:
void SetProblemSolver (hpp::core::ProblemSolverPtr_t problemSolver);
void SetProblemSolverMap (hpp::corbaServer::ProblemSolverMapPtr_t psMap);
void initNewProblemSolver ();
private:
/// \brief Pointer to hppPlanner object of hpp::corbaServer::Server.
core::ProblemSolverPtr_t problemSolver_;
corbaServer::ProblemSolverMapPtr_t psMap_;
core::ProblemSolverPtr_t problemSolver()
{
return psMap_->selected();
}
private:
model::T_Rom romDevices_;
......
......@@ -33,9 +33,9 @@ namespace hpp {
delete rbprmBuilder_;
}
void Server::setProblemSolver (hpp::core::ProblemSolverPtr_t problemSolver)
void Server::setProblemSolverMap (hpp::corbaServer::ProblemSolverMapPtr_t psMap)
{
rbprmBuilder_->implementation ().SetProblemSolver(problemSolver);
rbprmBuilder_->implementation ().SetProblemSolverMap(psMap);
}
/// Start corba server
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment