Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #28 from pFernbach/topic/posture_weights
Browse files Browse the repository at this point in the history
add API for posture weights
  • Loading branch information
stonneau authored Apr 16, 2019
2 parents ef97abb + 76ef67f commit f9c3a8d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions idl/hpp/corbaserver/rbprm/rbprmbuilder.idl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ module hpp
void setReferenceConfig(in floatSeq referenceConfig)
raises (Error);

/// set the weights used when computing a postural task
void setPostureWeights(in floatSeq postureWeights)
raises (Error);

/// set a reference position of the end effector for the given ROM
void setReferenceEndEffector(in string romName, in floatSeq ref)
raises (Error);
Expand Down
5 changes: 5 additions & 0 deletions src/hpp/corbaserver/rbprm/rbprmfullbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,11 @@ def setStaticStability(self,staticStability):
def setReferenceConfig(self,referenceConfig):
return self.clientRbprm.rbprm.setReferenceConfig(referenceConfig)

## set the weights used when computing a postural task
# \param postureWeights dofArray, must be of same size as device->numberDof
def setPostureWeights(self,postureWeights):
return self.clientRbprm.rbprm.setPostureWeights(postureWeights)

## return the time at the given state index (in the path computed during the first phase)
# \param stateId : index of the state
def getTimeAtState(self,stateId):
Expand Down
7 changes: 7 additions & 0 deletions src/rbprmbuilder.impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,13 @@ namespace hpp {
fullBody()->referenceConfig(config);
}

void RbprmBuilder::setPostureWeights(const hpp::floatSeq& postureWeights) throw (hpp::Error){
if(!fullBodyLoaded_)
throw Error ("No full body robot was loaded");
Configuration_t config(dofArrayToConfig (fullBody()->device_->numberDof(), postureWeights));
fullBody()->postureWeights(config);
}

void RbprmBuilder::setReferenceEndEffector(const char* romName, const hpp::floatSeq &ref) throw(hpp::Error){
std::string name (romName);
hpp::pinocchio::RbPrmDevicePtr_t device = boost::dynamic_pointer_cast<hpp::pinocchio::RbPrmDevice>(problemSolver()->robot ());
Expand Down
1 change: 1 addition & 0 deletions src/rbprmbuilder.impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ namespace hpp {
void setStaticStability(const bool staticStability) throw (hpp::Error);

void setReferenceConfig(const hpp::floatSeq &referenceConfig) throw (hpp::Error);
void setPostureWeights(const hpp::floatSeq &postureWeights) throw (hpp::Error);
void setReferenceEndEffector(const char* romName, const hpp::floatSeq &ref) throw(hpp::Error);

virtual void setFilter(const hpp::Names_t& roms) throw (hpp::Error);
Expand Down

0 comments on commit f9c3a8d

Please sign in to comment.