Commit 13215417 authored by Steve Tonneau's avatar Steve Tonneau
Browse files

can choose not to load all computed values for a limb database

parent 8824abb9
......@@ -187,7 +187,8 @@ module hpp
/// \param databasepath filepath to the database
/// \param id user given name of the new limb
/// \param heuristicName heuristic used to bias sample selection
void addLimbDatabase(in string databasepath, in string id, in string heuristicName) raises (Error);
/// \param loadValues whether other values computed for the limb database should be loaded
void addLimbDatabase(in string databasepath, in string id, in string heuristicName, in double loadValues) raises (Error);
/// Set the start state of a contact generation problem
/// environment, ordered by their efficiency
......
......@@ -100,8 +100,12 @@ class FullBody (object):
# \param limbId: user defined id for the limb. Must be unique.
# The id is used if several contact points are defined for the same limb (ex: the knee and the foot)
# \param heuristicName: name of the selected heuristic for configuration evaluation
def addLimbDatabase(self, databasepath, limbId, heuristicName):
self.client.rbprm.rbprm.addLimbDatabase(databasepath, limbId, heuristicName)
# \param loadValues: whether values computed, other than the static ones, should be loaded in memory
def addLimbDatabase(self, databasepath, limbId, heuristicName, loadValues = True):
boolVal = 0.
if(loadValues):
boolVal = 1.
self.client.rbprm.rbprm.addLimbDatabase(databasepath, limbId, heuristicName, boolVal)
## Add a limb to the model
#
......
......@@ -477,14 +477,14 @@ namespace hpp {
}
void RbprmBuilder::addLimbDatabase(const char* databasePath, const char* id, const char* heuristicName) throw (hpp::Error)
void RbprmBuilder::addLimbDatabase(const char* databasePath, const char* id, const char* heuristicName, double loadValues) throw (hpp::Error)
{
if(!fullBodyLoaded_)
throw Error ("No full body robot was loaded");
try
{
std::string fileName(databasePath);
fullBody_->AddLimb(fileName, std::string(id), problemSolver_->collisionObstacles(), heuristicName);
fullBody_->AddLimb(fileName, std::string(id), problemSolver_->collisionObstacles(), heuristicName, loadValues > 0.5);
}
catch(std::runtime_error& e)
{
......
......@@ -119,7 +119,7 @@ namespace hpp {
virtual void addLimb(const char* id, const char* limb, const char* effector, const hpp::floatSeq& offset, const hpp::floatSeq& normal, double x, double y,
unsigned short samples, const char *heuristicName, double resolution, const char *contactType) throw (hpp::Error);
virtual void addLimbDatabase(const char* databasePath, const char* id, const char* heuristicName) throw (hpp::Error);
virtual void addLimbDatabase(const char* databasePath, const char* id, const char* heuristicName, double loadValues) throw (hpp::Error);
virtual void setStartState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
virtual void setEndState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
......
Supports Markdown
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