Commit 24cc85a8 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[transition test] add python method 'isDynamicallyReachable'

parent c183228b
......@@ -699,6 +699,9 @@ module hpp
boolean isReachableFromState(in unsigned short stateFrom, in unsigned short stateTo)raises (Error);
boolean isDynamicallyReachableFromState(in unsigned short stateFrom, in unsigned short stateTo)raises (Error);
}; // interface Robot
}; // module rbprm
}; // module corbaserver
......
......@@ -1076,8 +1076,9 @@ class FullBody (object):
def areKinematicsConstraintsVerifiedForState(self,stateFrom, point):
return self.client.rbprm.rbprm.areKinematicsConstraintsVerifiedForState(stateFrom,point)
def isReachableFromState(self,stateFrom,stateTo):
return self.client.rbprm.rbprm.isReachableFromState(stateFrom,stateTo)
def isDynamicallyReachableFromState(self,stateFrom,stateTo):
return self.client.rbprm.rbprm.isDynamicallyReachableFromState(stateFrom,stateTo)
......@@ -3042,6 +3042,18 @@ assert(s2 == s1 +1);
bool RbprmBuilder::isDynamicallyReachableFromState(unsigned short stateFrom,unsigned short stateTo)throw (hpp::Error){
if(!fullBodyLoaded_){
throw std::runtime_error ("fullBody not loaded");
}
if(stateTo >= lastStatesComputed_.size() || stateFrom >= lastStatesComputed_.size()){
throw std::runtime_error ("Unexisting state ID");
}
reachability::Result res = reachability::isReachableDynamic(fullBody(),lastStatesComputed_[stateFrom],lastStatesComputed_[stateTo]);
return (res.success());
}
} // namespace impl
} // namespace rbprm
} // namespace hpp
......@@ -341,6 +341,7 @@ namespace hpp {
virtual bool areKinematicsConstraintsVerified(const hpp::floatSeq &point)throw (hpp::Error);
virtual bool areKinematicsConstraintsVerifiedForState(unsigned short stateId,const hpp::floatSeq &point)throw (hpp::Error);
virtual bool isReachableFromState(unsigned short stateFrom,unsigned short stateTo)throw (hpp::Error);
virtual bool isDynamicallyReachableFromState(unsigned short stateFrom,unsigned short stateTo)throw (hpp::Error);
void selectFullBody (const char* name) 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