Commit 0b75436b authored by Akseppal's avatar Akseppal
Browse files

Merge remote-tracking branch 'stonneau/devel' into affMerge

Conflicts:
	CMakeLists.txt
	src/rbprmbuilder.impl.cc
parents 4504fba6 3adcaf4d
......@@ -167,6 +167,6 @@ install(FILES
data/meshes/hyq/hyq_lfleg_rom.stl
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/meshes/hyq
)
SETUP_PROJECT_FINALIZE()
# Blender MTL File: 'A320-200NFATA53_no_plane.blend'
# Material Count: 4
newmtl Material
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.616045 0.640000 0.090784
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Material.001
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.055034 0.640000 0.143793
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
newmtl Shape
Ns 19.607843
Ka 0.000000 0.000000 0.000000
Kd 0.658823 0.658823 0.800000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
This diff is collapsed.
<?xml version="1.0"?>
<robot name="plane">
</robot>
<robot name="plane">
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hpp-rbprm-corba/meshes/plane.obj"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hpp-rbprm-corba/meshes/plane.obj"/>
</geometry>
</collision>
</link>
</robot>
......@@ -126,6 +126,23 @@ module hpp
/// and the selected sample
floatSeq getSamplePosition(in string sampleName, in unsigned short sampleId) raises (Error);
/// Get the end effector position of a given limb configuration
/// \param limbName name of the limb from which to retrieve a sample
/// \return number of samples generated for the limb
unsigned short getNumSamples(in string limbName) raises (Error);
/// Get the number of octree nodes for a limb database
/// \param limbName name of the limb from which to retrieve octree number
/// \return ids of the nodes in the octree
floatSeq getOctreeNodeIds(in string limbName) raises (Error);
/// Get the sample value for a given analysis
/// \param limbName name of the limb from which to retrieve a sample
/// \param valueName name of the analytic measure desired
/// \param sampleId id of the considered sample
/// \return the value computed for the given sample and analytics
double getSampleValue(in string limbName, in string valueName, in unsigned short sampleId) raises (Error);
/// Generate all possible contact in a given configuration
/// \param dofArray initial configuration of the robot
/// \param direction desired direction of motion for the robot
......@@ -140,7 +157,12 @@ module hpp
/// \return transformed configuration for which all possible contacts have been created
floatSeq getContactSamplesIds(in string name, in floatSeq dofArray, in floatSeq direction) raises (Error);
/// Specifies a subchain of the robot as a limb, which can be used to create contacts.
/// get Ids of limb in an octree cell
/// \param name name of the considered limb
/// \param octreeNodeId considered configuration of the robot
/// \return list of ids in the cell
floatSeq getSamplesIdsInOctreeNode(in string name, in double octreeNodeId) raises (Error);
/// A limb must consist in a simple kinematic chain, where every node has only one child
/// \param id user given name of the new limb
/// \param limb robot joint corresponding to the root of the limb (ex a shoulder or ankle joint)
......@@ -154,9 +176,20 @@ module hpp
/// \param heuristicName heuristic used to bias sample selection
/// \param resolution resolution of the octree used to store the samples (a typical value is 0.01 meters)
/// \param contactType whether the contact is punctual ("_3_DOF") or surfacic ("_6_DOF")
/// \param disableEffectorCollision whether collision detection should be disabled for the end effector bones
void addLimb(in string id, in string limb, in string effector, in floatSeq offset, in floatSeq normal,
in double x, in double y, in unsigned short samples, in string heuristicName,
in double resolution, in string contactType) raises (Error);
in double resolution, in string contactType, in double disableEffectorCollision) raises (Error);
/// Specifies a subchain of the robot as a limb, which can be used to create contacts.
/// A limb must consist in a simple kinematic chain, where every node has only one child
/// \param databasepath filepath to the database
/// \param id user given name of the new limb
/// \param heuristicName heuristic used to bias sample selection
/// \param loadValues whether other values computed for the limb database should be loaded
/// \param disableEffectorCollision whether collision detection should be disabled for the end effector bones
void addLimbDatabase(in string databasepath, in string id, in string heuristicName, in double loadValues,
in double disableEffectorCollision) raises (Error);
/// Set the start state of a contact generation problem
/// environment, ordered by their efficiency
......@@ -186,17 +219,34 @@ module hpp
/// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
floatSeqSeq interpolateConfigs(in floatSeqSeq configs, in double robustnessTreshold) raises (Error);
/// Provided a path has already been computed and interpolated, generate a continuous path
/// between two indicated states. Will fail if the index of the states do not exist
/// \param state1
/// \param state2 index of second state.
void interpolateBetweenStates(in double state1, in double state2) raises (Error);
/// Saves the last computed states by the function interpolate in a filename.
/// Raises an error if interpolate has not been called, or the file could not be opened.
/// \param filename name of the file used to save the contacts.
void saveComputedStates(in string filename) raises (Error);
/// Saves a sample database into a file
/// Raises an ifthe file could not be opened.
/// \param limbname name of the limb used to save the samples.
/// \param filename name of the file used to save the samples.
void saveLimbDatabase(in string limbname, in string filename) raises (Error);
/// returns the size and transforms of all boxes of the octree for a limb
/// \param limbname name of the considered limb
/// \param dofArray considered configuration of the robot
/// \return transformed configuration for which all possible contacts have been created
floatSeqSeq GetOctreeBoxes(in string limbname, in floatSeq dofArray) raises (Error);
floatSeqSeq getOctreeBoxes(in string limbname, in floatSeq dofArray) raises (Error);
/// returns the size and transforms of all boxes of the octree for a limb
/// \param limbname name of the considered limb
/// \param dofArray considered configuration of the robot
/// \return transformed configuration for which all possible contacts have been created
floatSeq getOctreeBox(in string limbname, in double sampleId) raises (Error);
/// returns octree transform for a given robot configuration
/// \param limbname name of the considered limb
......@@ -211,6 +261,20 @@ module hpp
/// \return whether the configuration is quasi-statically balanced
short isConfigBalanced(in floatSeq config, in Names_t contacts, in double robustnessTreshold) raises (Error);
/// run and store an analysis on all limb databases
/// \param analysis name of the analysis existing if analysis ="all",
/// all tests are run.
/// \param isstatic 1 is becomes new static value of database, 0 otherwise
void runSampleAnalysis(in string analysis, in double isstatic) raises (Error);
/// run and store an analysis on a limb database
/// \param limbname name of the limb to perform the analysis to
/// \param analysis name of the analysis existing if analysis ="all",
/// all tests are run.
/// \param isstatic 1 is becomes new static value of database, 0 otherwise
/// \return min and max values obtained
floatSeq runLimbSampleAnalysis(in string limbname, in string analysis, in double isstatic) raises (Error);
}; // interface Robot
}; // module rbprm
}; // module corbaserver
......
......@@ -38,37 +38,28 @@ rLeg = 'rf_haa_joint'
# Last joint of the limb, as in urdf file
rfoot = 'rf_foot_joint'
# Specifying the distance between last joint and contact surface
rLegOffset = [0.,0,0.]
offset = [0.,-0.021,0.]
# Specifying the contact surface direction when the limb is in rest pose
rLegNormal = [0,1,0]
normal = [0,1,0]
# Specifying the rectangular contact surface length
rLegx = 0.02; rLegy = 0.02
legx = 0.02; legy = 0.02
# remaining parameters are the chosen heuristic (here, manipulability), and the resolution of the octree (here, 10 cm).
fullBody.addLimb(rLegId,rLeg,rfoot,rLegOffset,rLegNormal, rLegx, rLegy, nbSamples, "manipulability", 0.1, cType)
fullBody.addLimb(rLegId,rLeg,rfoot,offset,normal, legx, legy, nbSamples, "manipulability", 0.1, cType)
lLegId = 'lhleg'
lLeg = 'lh_haa_joint'
lfoot = 'lh_foot_joint'
lLegOffset = [0,0,0]
lLegNormal = [0,1,0]
lLegx = 0.02; lLegy = 0.02
fullBody.addLimb(lLegId,lLeg,lfoot,lLegOffset,rLegNormal, lLegx, lLegy, nbSamples, "manipulability", 0.05, cType)
fullBody.addLimb(lLegId,lLeg,lfoot,offset,normal, legx, legy, nbSamples, "manipulability", 0.05, cType)
rarmId = 'rhleg'
rarm = 'rh_haa_joint'
rHand = 'rh_foot_joint'
rArmOffset = [0.,0,-0.]
rArmNormal = [0,1,0]
rArmx = 0.02; rArmy = 0.02
fullBody.addLimb(rarmId,rarm,rHand,rArmOffset,rArmNormal, rArmx, rArmy, nbSamples, "manipulability", 0.05, cType)
fullBody.addLimb(rarmId,rarm,rHand,offset,normal, legx, legy, nbSamples, "manipulability", 0.05, cType)
larmId = 'lfleg'
larm = 'lf_haa_joint'
lHand = 'lf_foot_joint'
lArmOffset = [0.,0,-0.]
lArmNormal = [0,1,0]
lArmx = 0.02; lArmy = 0.02
fullBody.addLimb(larmId,larm,lHand,lArmOffset,lArmNormal, lArmx, lArmy, nbSamples, "forward", 0.05, cType)
fullBody.addLimb(larmId,larm,lHand,offset,normal, legx, legy, nbSamples, "forward", 0.05, cType)
q_0 = fullBody.getCurrentConfig();
q_init = fullBody.getCurrentConfig(); q_init[0:7] = tp.q_init[0:7]
......
......@@ -57,4 +57,4 @@ t = ps.solve ()
# Playing the computed path
from hpp.gepetto import PathPlayer
pp = PathPlayer (rbprmBuilder.client.basic, r)
pp (1)
#~ pp (1)
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.corbaserver.rbprm.problem_solver import ProblemSolver
from hpp.gepetto import Viewer
import ground_crouch_hyq_path as tp
......@@ -26,45 +27,43 @@ r = tp.Viewer (ps)
rootName = 'base_joint_xyz'
#~ AFTER loading obstacles
# Creating limbs
# cType is "_3_DOF": positional constraint, but no rotation (contacts are punctual)
cType = "_3_DOF"
# string identifying the limb
rLegId = 'rfleg'
# First joint of the limb, as in urdf file
rLeg = 'rf_haa_joint'
# Last joint of the limb, as in urdf file
rfoot = 'rf_foot_joint'
rLegOffset = [0.,0,0.]
rLegNormal = [0,1,0]
rLegx = 0.02; rLegy = 0.02
fullBody.addLimb(rLegId,rLeg,rfoot,rLegOffset,rLegNormal, rLegx, rLegy, nbSamples, "forward", 0.1,cType)
# Specifying the distance between last joint and contact surface
offset = [0.,-0.021,0.]
# Specifying the contact surface direction when the limb is in rest pose
normal = [0,1,0]
# Specifying the rectangular contact surface length
legx = 0.02; legy = 0.02
# remaining parameters are the chosen heuristic (here, manipulability), and the resolution of the octree (here, 10 cm).
fullBody.addLimb(rLegId,rLeg,rfoot,offset,normal, legx, legy, nbSamples, "forward", 0.1, cType)
lLegId = 'lhleg'
lLeg = 'lh_haa_joint'
lfoot = 'lh_foot_joint'
lLegOffset = [0,0,0]
lLegNormal = [0,1,0]
lLegx = 0.02; lLegy = 0.02
fullBody.addLimb(lLegId,lLeg,lfoot,lLegOffset,rLegNormal, lLegx, lLegy, nbSamples, "backward", 0.05,cType)
fullBody.addLimb(lLegId,lLeg,lfoot,offset,normal, legx, legy, nbSamples, "backward", 0.05, cType)
rarmId = 'rhleg'
rarm = 'rh_haa_joint'
rHand = 'rh_foot_joint'
rArmOffset = [0.,0,-0.]
rArmNormal = [0,1,0]
rArmx = 0.02; rArmy = 0.02
fullBody.addLimb(rarmId,rarm,rHand,rArmOffset,rArmNormal, rArmx, rArmy, nbSamples, "backward", 0.05,cType)
fullBody.addLimb(rarmId,rarm,rHand,offset,normal, legx, legy, nbSamples, "backward", 0.05, cType)
larmId = 'lfleg'
larm = 'lf_haa_joint'
lHand = 'lf_foot_joint'
lArmOffset = [0.,0,-0.]
lArmNormal = [0,1,0]
lArmx = 0.02; lArmy = 0.02
fullBody.addLimb(larmId,larm,lHand,lArmOffset,lArmNormal, lArmx, lArmy, nbSamples, "forward", 0.05,cType)
fullBody.addLimb(larmId,larm,lHand,offset,normal, legx, legy, nbSamples, "forward", 0.05, cType)
q_0 = fullBody.getCurrentConfig();
q_init = fullBody.getCurrentConfig(); q_init[0:7] = tp.q_init[0:7]
q_goal = fullBody.getCurrentConfig(); q_goal[0:7] = tp.q_goal[0:7]
fullBody.setCurrentConfig (q_init)
q_init = fullBody.generateContacts(q_init, [0,0,1])
q_0 = fullBody.getCurrentConfig();
......@@ -84,9 +83,9 @@ r.loadObstacleModel ('hpp-rbprm-corba', "groundcrouch", "contact")
i = 0;
r (configs[i]); i=i+1; i-1
q0 = configs[2]
q0 = fullBody.generateContacts(q0, [0,0,1])
r(q0)
#~ q0 = configs[2]
#~ q0 = fullBody.generateContacts(q0, [0,0,1])
#~ r(q0)
c = fullBody.getContactSamplesIds("rfleg",q_init, [0,0,1])
r(fullBody.getSample("rfleg",int(c[i]))); i = i+1
#~ r(fullBody.getSample("rfleg",int(c[i]))); i = i+1
......@@ -30,9 +30,7 @@ r = Viewer (ps)
q_init = rbprmBuilder.getCurrentConfig ();
q_init [0:3] = [-5, 0, 0.63]; rbprmBuilder.setCurrentConfig (q_init); r (q_init)
q_goal = q_init [::]
q_goal [0:3] = [5, 0, 0.63]; r (q_goal)
ps.addPathOptimizer("RandomShortcut")
......@@ -44,6 +42,8 @@ ps.client.problem.selectPathValidation("RbprmPathValidation",0.01)
r.loadObstacleModel (packageName, "groundcrouch", "planning")
#~ ps.solve ()
t = ps.solve ()
if isinstance(t, list):
t = t[0]* 3600000 + t[1] * 60000 + t[2] * 1000 + t[3]
f = open('log.txt', 'a')
......
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
import hpp.corbaserver.rbprm.tools.plot_analytics as plot_ana
def loadRobot(packageName,meshPackageName,rootJointType,urdfName,urdfSuffix,srdfSuffix, limbId, limbRoot, limbEffector):
fullBody = FullBody ()
fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix)
fullBody.setJointBounds ("base_joint_xyz", [0,0,0,0,0,0])
limbOffset = [0,0,0] #inutile ici
limbNormal = [0,1,0] #inutile ici
limbx = 0.09; limby = 0.05 #inutile ici
fullBody.addLimb(limbId,limbRoot,'',limbOffset,limbNormal, limbx, limby, 1000, "manipulability", 0.1)
return fullBody
def runall(lid, valueNames):
res = {} #dictionnaire des values min / max pour chaque critere
#~ fullBody.runLimbSampleAnalysis(lid, "jointLimitsDistance", False)
for valueName in valueNames:
test = fullBody.runLimbSampleAnalysis(lid, valueName, False)
res [valueName] = test
return res
def retrieveOctreeValues(fullBody, valueNames,limbId):
res = {}
for valueName in valueNames:
res [valueName] = plot_ana.getOctreeValues(fullBody, valueName, limbId)
return res
def rescaleOctreeValue(valueName, robotData):
r1_min = robotData[0]["valueBounds"][valueName][0]
r2_min = robotData[1]["valueBounds"][valueName][0]
r1_max = robotData[0]["valueBounds"][valueName][1]
r2_max = robotData[1]["valueBounds"][valueName][1]
r_min = min(r1_min, r2_min)
r_max = max(r1_max, r2_max)
for i in range(0,len(robotData[0]["octreeValues"][valueName]['values'])):
val = robotData[0]["octreeValues"][valueName]['values'][i]
robotData[0]["octreeValues"][valueName]['values'][i] = ((val * r1_max + r1_min) - r_min) / r_max
for i in range(0,len(robotData[1]["octreeValues"][valueName]['values'])):
val = robotData[1]["octreeValues"][valueName]['values'][i]
robotData[1]["octreeValues"][valueName]['values'][i] = ((val * r2_max + r2_min) - r_min) / r_max
def rescaleOctreeValues(valueNames, robotData):
for valueName in valueNames:
rescaleOctreeValue(valueName, robotData)
#define values to analyze #EDIT
valueNames = [
#~ "isotropy", #whole jacobian
#~ "isotropyRot", #rotation jacobian
#~ "isotropyTr", #translation jacobian
"minimumSingularValue",
"minimumSingularValueRot",
"minimumSingularValueTr",
"maximumSingularValue",
"maximumSingularValueRot",
"maximumSingularValueTr",
"manipulabilityRot",
"manipulabilityTr",
"manipulability"
]
robotData = [{},{}]
#first load first robot data
packageName = "laas_design" #EDIT
meshPackageName = "laas_design" #EDIT
rootJointType = "freeflyer" #EDIT
# Information to retrieve urdf and srdf files.
urdfName = "laas_arm_wrist_ZXZ" #EDIT
urdfSuffix = "" #EDIT
srdfSuffix = "" #EDIT
limbId = '0' #nom que tu souhaites, peu importe #EDIT
limbRoot = 'shoulder_joint' #joint racine de la chaine a analyser #EDIT
limbEffector = '' # joint qui correspond a l'effecteur, laisse vide si dernier joint #EDIT
fullBody = loadRobot(packageName,meshPackageName,rootJointType,urdfName,urdfSuffix,srdfSuffix, limbId, limbRoot, limbEffector)
# run analysis
limbValueBounds = runall(limbId, valueNames)
# compute normalized octree cube values
robotData[0]["octreeValues"] = retrieveOctreeValues(fullBody, valueNames, limbId)
robotData[0]["valueBounds"] = limbValueBounds
robotData[0]["name"] = urdfName + limbId
#now to the second robot
packageName = "laas_design" #EDIT
meshPackageName = "laas_design" #EDIT
rootJointType = "freeflyer" #EDIT
# Information to retrieve urdf and srdf files.
urdfName = "laas_arm_wrist_ZXY" #EDIT
urdfSuffix = "" #EDIT
srdfSuffix = "" #EDIT
limbId = '1' #EDIT
limbRoot = 'shoulder_joint' #EDIT
limbEffector = '' #EDIT
fullBody = loadRobot(packageName,meshPackageName,rootJointType,urdfName,urdfSuffix,srdfSuffix, limbId, limbRoot, limbEffector)
# run analysis
limbValueBounds = runall(limbId, valueNames)
# compute normalized octree cube values
robotData[1]["octreeValues"] = retrieveOctreeValues(fullBody, valueNames, limbId)
robotData[1]["valueBounds"] = limbValueBounds
robotData[1]["name"] = urdfName + limbId
rescaleOctreeValues(valueNames, robotData)
for valueName in valueNames:
plot_ana.compareOctreeValues(robotData[0]["name"], robotData[1]["name"], robotData[0]["octreeValues"][valueName], robotData[1]["octreeValues"][valueName], valueName)
import matplotlib.pyplot as plt
plt.show()
......@@ -45,7 +45,8 @@ rHand = 'RARM_JOINT5'
rArmOffset = [0,0,-0.1]
rArmNormal = [0,0,1]
rArmx = 0.024; rArmy = 0.024
fullBody.addLimb(rarmId,rarm,rHand,rArmOffset,rArmNormal, rArmx, rArmy, 10000, "manipulability", 0.05)
#disabling collision for hook
fullBody.addLimb(rarmId,rarm,rHand,rArmOffset,rArmNormal, rArmx, rArmy, 10000, "manipulability", 0.05, "_6_DOF", True)
#~ AFTER loading obstacles
......
function [] = effectorRomToObj(filename, outname)
delimiterIn = ',';
headerlinesIn = 0;
points = importdata(filename,delimiterIn,headerlinesIn);
k = convhull(points);
vertface2obj(points,k,outname)
function vertface2obj(v,f,name)
% VERTFACE2OBJ Save a set of vertice coordinates and faces as a Wavefront/Alias Obj file
% VERTFACE2OBJ(v,f,fname)
% v is a Nx3 matrix of vertex coordinates.
% f is a Mx3 matrix of vertex indices.
% fname is the filename to save the obj file.
fid = fopen(name,'w');
for i=1:size(v,1)
fprintf(fid,'v %f %f %f\n',v(i,1),v(i,2),v(i,3));
end
fprintf(fid,'g foo\n');
for i=1:size(f,1);
fprintf(fid,'f %d %d %d\n',f(i,1),f(i,2),f(i,3));
end
fprintf(fid,'g\n');
fclose(fid);
......@@ -127,10 +127,16 @@ INSTALL(
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/client.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmbuilder.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmfullbody.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/problem_solver.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/problem_solver.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm
)
INSTALL(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools//generateROMs.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/plot_analytics.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm/tools
)
# Stand alone corba server
ADD_EXECUTABLE (hpp-rbprm-server hpp-rbprm-corba.cc)
TARGET_LINK_LIBRARIES (hpp-rbprm-server ${LIBRARY_NAME} hpp-rbprm)
......
......@@ -94,6 +94,23 @@ class FullBody (object):
def addLimb(self, limbId, name, effectorname, offset, normal, x, y, samples):
self.client.rbprm.rbprm.addLimb(limbId, name, effectorname, offset, normal, x, y, samples, "EFORT", 0.03)
## Add a limb to the model
#
# \param databasepath: path to the database describing the robot
# \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
# \param loadValues: whether values computed, other than the static ones, should be loaded in memory
# \param disableEffectorCollision: whether collision detection should be disabled for end effector bones
def addLimbDatabase(self, databasepath, limbId, heuristicName, loadValues = True, disableEffectorCollision = False):
boolVal = 0.
boolValEff = 0.
if(loadValues):
boolVal = 1.
if(disableEffectorCollision):
boolValEff = 1.
self.client.rbprm.rbprm.addLimbDatabase(databasepath, limbId, heuristicName, boolVal,boolValEff)
## Add a limb to the model
#
# \param id: user defined id for the limb. Must be unique.
......@@ -111,8 +128,12 @@ class FullBody (object):
# of the unit voxel of the octree. The larger they are, the more samples will be considered as candidates for contact.
# This can be problematic in terms of performance. The default value is 3 cm.
# \param contactType whether the contact is punctual ("_3_DOF") or surfacic ("_6_DOF")
def addLimb(self, limbId, name, effectorname, offset, normal, x, y, samples, heuristicName, resolution, contactType="_6_DOF"):
self.client.rbprm.rbprm.addLimb(limbId, name, effectorname, offset, normal, x, y, samples, heuristicName, resolution,contactType)
# \param disableEffectorCollision: whether collision detection should be disabled for end effector bones
def addLimb(self, limbId, name, effectorname, offset, normal, x, y, samples, heuristicName, resolution, contactType="_6_DOF",disableEffectorCollision = False):
boolValEff = 0.
if(disableEffectorCollision):
boolValEff = 1.
self.client.rbprm.rbprm.addLimb(limbId, name, effectorname, offset, normal, x, y, samples, heuristicName, resolution,contactType, boolValEff)
## Returns the configuration of a limb described by a sample
#
......@@ -145,7 +166,35 @@ class FullBody (object):
# \param direction a 3d vector specifying the desired direction of motion
def getContactSamplesIds(self, name, configuration, direction):
return self.client.rbprm.rbprm.getContactSamplesIds(name, configuration, direction)
## Retrieves the samples IDs In a given octree cell
#
# \param name id of the limb considered
# \param configuration the considered robot configuration
# \param direction a 3d vector specifying the desired direction of motion
def getSamplesIdsInOctreeNode(self, limbName, octreeNodeId):
return self.client.rbprm.rbprm.getSamplesIdsInOctreeNode(limbName, octreeNodeId)
## Get the number of samples generated for a limb
#
# \param limbName name of the limb from which to retrieve a sample
def getNumSamples(self, limbName):
return self.client.rbprm.rbprm.getNumSamples(limbName)
## Get the number of octreeNodes
#
# \param limbName name of the limb from which to retrieve a sample
def getOctreeNodeIds(self, limbName):
return self.client.rbprm.rbprm.getOctreeNodeIds(limbName)
## Get the sample value for a given analysis
#
# \param limbName name of the limb from which to retrieve a sample
# \param valueName name of the analytic measure desired
# \param sampleId id of the considered sample
def getSampleValue(self, limbName, valueName, sampleId):
return self.client.rbprm.rbprm.getSampleValue(limbName, valueName, sampleId)
## Initialize the first configuration of the path discretization
# with a balanced configuration for the interpolation problem;