Commit b13ae375 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[transition test] add python method 'addState' to fullBody

parent 92ead616
......@@ -279,6 +279,12 @@ module hpp
/// \param contactLimbs ids of the limb in contact for the state
void setStartState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
/// Add a state to fullBody, defined by it's configuration and contacts
/// \param dofArray configuration of the robot
/// \param contactLimbs ids of the limb in contact for the state
short addState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
/// Compute effector contact points and normals for a given configuration
/// in local coordinates
/// \param dofArray configuration of the robot
......
......@@ -291,6 +291,13 @@ class FullBody (object):
def setStartState(self, configuration, contacts):
return self.client.rbprm.rbprm.setStartState(configuration, contacts)
## Add a state to fullBody, defined by it's configurations and contacts
#
# \param configuration the desired state configuration
# \param contacts the array of limbs in contact
def addState(self, configuration, contacts):
return self.client.rbprm.rbprm.addState(configuration, contacts)
## Create a state given a configuration and contacts
#
# \param configuration the desired start configuration
......
......@@ -1260,6 +1260,24 @@ namespace hpp {
}
}
CORBA::Short RbprmBuilder::addState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error)
{
try
{
State state;
std::vector<std::string> names = stringConversion(contactLimbs);
SetPositionAndNormal(state,fullBody(), configuration, names);
lastStatesComputed_.push_back(state);
lastStatesComputedTime_.push_back(std::make_pair(0.,state));
}
catch(std::runtime_error& e)
{
throw Error(e.what());
}
return lastStatesComputed_.size()-1;
}
double RbprmBuilder::getTimeAtState(unsigned short stateId)throw (hpp::Error){
try
{
......
......@@ -248,6 +248,7 @@ namespace hpp {
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);
virtual CORBA::Short addState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
virtual hpp::floatSeq* computeContactForConfig(const hpp::floatSeq& configuration, const char* limbNam) throw (hpp::Error);
virtual hpp::floatSeqSeq* computeContactPoints(unsigned short cId) throw (hpp::Error);
virtual hpp::floatSeqSeq* computeContactPointsAtState(unsigned short cId, unsigned short isIntermediate) 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