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
import stair_bauzil_hrp2_path as tp packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-0.135, 2, -1, 1, 0, 2.2]) ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps) #~ AFTER loading obstacles rLegId = '0rLeg' rLeg = 'RLEG_JOINT0' rLegOffset = [ 0, -0.105, 0, ] rLegNormal = [0, 1, 0] rLegx = 0.09 rLegy = 0.05
import ground_crouch_hyq_path as tp packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-6, 5, -4, 4, 0.6, 2]) from hpp.corbaserver.rbprm.problem_solver import ProblemSolver nbSamples = 20000 ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps) rootName = 'base_joint_xyz' # Creating limbs # cType is "_3_DOF": positional constraint, but no rotation (contacts are punctual) cType = "_3_DOF" # string identifying the limb rLegId = 'rfleg'
from hpp.corbaserver import Client packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [0, 6, -1, 1, 0.3, 4]) # Setting a number of sample configurations used nbSamples = 20000 ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps, viewerClient=tp.r.client) rootName = 'base_joint_xyz' cType = "_3_DOF" rLegId = 'rfleg' rLeg = 'rf_haa_joint' rfoot = 'rf_foot_joint' offset = [0., -0.021, 0.] normal = [0, 1, 0]
import sample_com_vel as scv packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-0.135,2, -1, 1, 0, 2.2]) ps = ProblemSolver( fullBody ) r = Viewer (ps) n_samples = 10000 #~ AFTER loading obstacles rLegId = '0rLeg' rLeg = 'RLEG_JOINT0' rLegOffset = [0,-0.105,0,] rLegNormal = [0,1,0] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, n_samples, "manipulability", 0.1)
rleg = 'RLEG_JOINT0' rfoot = "RLEG_JOINT5" lleg = 'LLEG_JOINT0' lfoot = "LLEG_JOINT5" rarm = "RARM_JOINT0" rhand = "RARM_JOINT5" larm = "LARM_JOINT0" lhand = "LARM_JOINT5" rLegId = 'hrp2_rleg_rom' lLegId = 'hrp2_lleg_rom' rArmId = 'hrp2_rarm_rom' lArmId = 'hrp2_larm_rom' fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-1, 2.5, 0.5, 3, 0.4, 0.8]) fullBody.setJointBounds("LLEG_JOINT3", [0.35, 2.61799]) fullBody.setJointBounds("RLEG_JOINT3", [0.35, 2.61799]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=False, displayCoM=True)
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [0,2.2, -1, 1, 0.7, 2.5]) ps = tp.ProblemSolver( fullBody ) r = tp.Viewer (ps) #~ AFTER loading obstacles rLegId = '0rLeg' rLeg = 'RLEG_JOINT0' rLegOffset = [0,-0.105,0,] rLegNormal = [0,1,0] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 10000, "manipulability", 0.03) lLegId = '1lLeg' lLeg = 'LLEG_JOINT0'
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() -1 fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-2,5, 0, 2, 0.45, 1.8]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver( fullBody ) ps.client.problem.setParameter("aMax",tp.aMax) ps.client.problem.setParameter("vMax",tp.vMax) r = tp.Viewer (ps,viewerClient=tp.r.client) #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0,0,-0.105] rLegNormal = [0,0,1] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 50000, "manipulability", 0.1)
from hpp.gepetto import Viewer packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-1,1, -4, -1, 1, 2.2]) from hpp.corbaserver.rbprm.problem_solver import ProblemSolver nbSamples = 50000 ps = ProblemSolver( fullBody ) #~ AFTER loading obstacles rLegId = '7rLeg' rLeg = 'RLEG_JOINT0' rLegOffset = [0,-0.105,0,] rLegNormal = [0,1,0] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, nbSamples, 0.01)
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" #urdfSuffix = "_reduced_safe20" urdfSuffix = "_reduced" srdfSuffix = "_disable_leg_autocol" pId = tp.ps.numberPaths() - 1 fullBody = FullBody() tPlanning = 0. fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [0, 2, 0.6, 1.1, 0.35, 1.5]) fullBody.setJointBounds("LLEG_JOINT3", [0.3, 2.61799]) fullBody.setJointBounds("RLEG_JOINT3", [0.3, 2.61799]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=False, displayCoM=True)
from viewer_library import * packageName = 'hpp-rbprm-corba' meshPackageName = 'hpp-rbprm-corba' rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "spiderman" urdfSuffix = "" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [0, 0, 0, 0, 0, 0]) """ from hpp.gepetto import Viewer psf = ProblemSolver( fullBody ); rr = Viewer (psf) q_0 = fullBody.getCurrentConfig(); rr(q_0); fullBody.isConfigValid(q_0) """ q_flexion = [ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0, 0.2, 0, -0.0, -0.3, 0, 0.2, 0.9, 0, -0.6, 0, 0, 0, -0.2, 0.9, 0, -0.6, 0, 0, 0, -1.1, -1.8, -1, 2.2, -0.9, 0, 0.0, 1.1, -1.8, 1, 2.2, -0.9, 0, 0.0 ] q_contact = [ 0, 0, 0, 1, 0, 0, 0, 0, 0.0, 0, -0.0, 0.0, 0.0, 2.2, 0.1, 0.3, -1.5, 0.8, 0, 0, -2.2, 0.1, -0.3, -1.5, -0.8, 0, 0, 0.3, -1.1, 0.2, 2, -0.8, 0, 0.0, -0.3, -1.1, -0.2, 2, -0.8, 0, 0.0
from hpp.gepetto import Viewer packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-1, 1, -4, -1, 1, 2.2]) from hpp.corbaserver.rbprm.problem_solver import ProblemSolver nbSamples = 50000 ps = ProblemSolver(fullBody) #~ AFTER loading obstacles rLegId = '7rLeg' rLeg = 'RLEG_JOINT0' rLegOffset = [ 0, -0.105, 0, ]
import ground_crouch_hyq_path as tp packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-6,5, -4, 4, 0.6, 2]) from hpp.corbaserver.rbprm.problem_solver import ProblemSolver nbSamples = 20000 ps = tp.ProblemSolver( fullBody ) r = tp.Viewer (ps) rootName = 'base_joint_xyz' # Creating limbs # cType is "_3_DOF": positional constraint, but no rotation (contacts are punctual) cType = "_3_DOF" # string identifying the limb rLegId = 'rfleg'
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.tools.plot_analytics import plotOctreeValues packageName = "anymal_bedi_description" meshPackageName = "anymal_bedi_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "anymal_bedi" urdfSuffix = "" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("root_joint", [0,0,0,0,0,0]) nbSamples = 50000 #used to be 20000 cType = "_3_DOF" rLegId = 'rfleg' rLeg = 'RF_HAA' rfoot = 'RF_MOUNT_TO_FOOT' offset = [0.,-0.034625,0.] #originally [0.,-0.031,0.] normal = [0,1,0] #hyq needs [0,1,0], also for anymal legx = 0.03; legy = 0.03 def addLimbDb(limbId, heuristicName, loadValues = True, disableEffectorCollision = False): fullBody.addLimbDatabase(str(db_dir+limbId+'.db'), limbId, heuristicName,loadValues, disableEffectorCollision) #fullBody.addLimb(rLegId,rLeg,rfoot,offset,normal, legx, legy, nbSamples, "forward", 0.1, cType)
import omniORB.any packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() - 1 fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-5.5, 5.5, -2.5, 2.5, 0.3, 0.65]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=True, displayCoM=True) q_init = [ 0, 0, 0.648702, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.261799388, 0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17, 0.261799388, -0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17, 0.0, 0.0, -0.453785606, 0.872664626,
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.tools.plot_analytics import plotOctreeValues packageName = "anymal_bedi_description" meshPackageName = "anymal_bedi_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "anymal_bedi" urdfSuffix = "" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("root_joint", [0, 0, 0, 0, 0, 0]) nbSamples = 50000 #used to be 20000 cType = "_3_DOF" rLegId = 'rfleg' rLeg = 'RF_HAA' rfoot = 'RF_MOUNT_TO_FOOT' offset = [0., -0.034625, 0.] #originally [0.,-0.031,0.] normal = [0, 1, 0] #hyq needs [0,1,0], also for anymal legx = 0.03 legy = 0.03 def addLimbDb(limbId, heuristicName,
from constraint_to_dae import * packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [0, 1.55, -0.25, -0.15, 0.2, 2]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("aMaxZ", omniORB.any.to_any(1.)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) ps.client.problem.setParameter("friction", tp.mu) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=True, displayCoM=True)
import numpy as np packageName = "talos_description" meshPackageName = "talos_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "talos" urdfSuffix = "_full_v2" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-20, 20, -20, 20, -20, 20]) rootName = "base_joint_xyz" nbSamples = 100000 q_0 = [ 0, 0, 0, 1, 0, 0, 0, # root_joint 0.0, 0.0, -0.411354,
meshPackageName = 'hpp-rbprm-corba' rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "spiderman" urdfSuffix = "" srdfSuffix = "" #~ V0list = tp.V0list #~ Vimplist = tp.Vimplist base_joint_xyz_limits = tp.base_joint_xyz_limits fullBody = FullBody() robot = fullBody.client.basic.robot fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", base_joint_xyz_limits) #psf = ProblemSolver(fullBody); rr = Viewer (psf); gui = rr.client.gui ps = path_planner.ProblemSolver(fullBody) r = path_planner.Viewer(ps, viewerClient=path_planner.r.client) rr = r #~ psf = tp.ProblemSolver( fullBody ); rr = tp.Viewer (psf); gui = rr.client.gui pp = PathPlayer(fullBody.client.basic, rr) pp.speed = 0.6 q_0 = fullBody.getCurrentConfig() rr(q_0) rLegId = 'RFoot' lLegId = 'LFoot' rarmId = 'RHand' larmId = 'LHand'
db_dir = ins_dir+"/install/share/hyq-rbprm/database/hyq_" packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-2,5, -1, 1, 0.3, 4]) # Setting a number of sample configurations used nbSamples = 20000 ps = tp.ProblemSolver(fullBody) r = tp.Viewer (ps) rootName = 'base_joint_xyz' # 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
from hpp.gepetto import Viewer import quaternion as quat packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "_6D" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-20,20, -20, 20, -20, 20]) # Setting a number of sample configurations used nbSamples = 100000 rootName = 'base_joint_xyz' # Creating limbs # cType is "_3_DOF": positional constraint, but no rotation (contacts are punctual) cType = "_6_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_Z'
import omniORB.any packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() - 1 fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-3, 4.5, -2, 2.5, 0.55, 0.6]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=True, displayCoM=True) q_init = [ 0, 0, 0.648702, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.261799388, 0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17, 0.261799388, -0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17, 0.0, 0.0, -0.453785606, 0.872664626,
import time packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [0, 3, -2, 0, 0.3, 1]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", tp.aMax) ps.client.problem.setParameter("vMax", tp.vMax) r = tp.Viewer(ps, viewerClient=tp.r.client) #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0, 0, -0.105] rLegNormal = [0, 0, 1] rLegx = 0.09 rLegy = 0.05 fullBody.addLimb(rLegId, rLeg, '', rLegOffset, rLegNormal, rLegx, rLegy, 20000,
meshPackageName = 'hpp-rbprm-corba' rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "spiderman" urdfSuffix = "" srdfSuffix = "" V0list = tp.V0list Vimplist = tp.Vimplist base_joint_xyz_limits = tp.base_joint_xyz_limits fullBody = FullBody() robot = fullBody.client.basic.robot fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", base_joint_xyz_limits) #psf = ProblemSolver(fullBody); rr = Viewer (psf); gui = rr.client.gui r = tp.r ps = tp.ps psf = tp.ProblemSolver(fullBody) rr = tp.Viewer(psf) gui = rr.client.gui pp = PathPlayer(fullBody.client.basic, rr) pp.speed = 0.6 q_0 = fullBody.getCurrentConfig() rr(q_0) flexion = [ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0, 0.2, 0, -0.0, -0.3, 0, 0.2, 0.9, 0, -0.6, 0, 0, 0, -0.2, 0.9, 0, -0.6, 0, 0, 0, -1.1, -1.8, -1, 2.2, -0.9, 0,
from hpp.corbaserver.rbprm.rbprmstate import State, StateHelper packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-0.7, 0.7, -0.7, 0.7, 0.6, 0.7]) fullBody.setJointBounds("CHEST_JOINT0", [0., 0.]) fullBody.setJointBounds("CHEST_JOINT1", [0., 0.]) fullBody.setJointBounds("HEAD_JOINT0", [0., 0.]) fullBody.setJointBounds("HEAD_JOINT1", [0., 0.]) fullBody.setJointBounds("LARM_JOINT0", [0.261799388, 0.261799388]) fullBody.setJointBounds("LARM_JOINT1", [0.174532925, 0.174532925]) fullBody.setJointBounds("LARM_JOINT2", [0., 0.]) fullBody.setJointBounds("LARM_JOINT3", [-0.523598776, -0.523598776]) fullBody.setJointBounds("LARM_JOINT4", [0., 0.]) fullBody.setJointBounds("LARM_JOINT5", [0., 0.]) fullBody.setJointBounds("LARM_JOINT6", [0.17, 0.17]) fullBody.setJointBounds("RARM_JOINT0", [0.261799388, 0.261799388]) fullBody.setJointBounds("RARM_JOINT1", [-0.174532925, -0.174532925]) fullBody.setJointBounds("RARM_JOINT2", [0., 0.]) fullBody.setJointBounds("RARM_JOINT3", [-0.523598776, -0.523598776])
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() -1 fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-2,4, 0.5, 1.5, 0.3, 1.8]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver( fullBody ) ps.client.problem.setParameter("aMax",omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax",omniORB.any.to_any(tp.vMax)) r = tp.Viewer (ps,viewerClient=tp.r.client) #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0,0,-0.105] rLegNormal = [0,0,1] rLegx = 0.09; rLegy = 0.05 #fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 50000, "forward", 0.1) fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 50000, "dynamic", 0.1)
packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.setJointBounds("base_joint_xyz", [-6, 6, -2.5, 2.5, 0.0, 1.]) # Setting a number of sample configurations used nbSamples = 20000 dynamic = True ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client) rootName = 'base_joint_xyz' def addLimbDb(limbId, heuristicName,
from hpp.corbaserver import Client packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-4, 6, -1, 1, 0.3, 2.5]) # Setting a number of sample configurations used nbSamples = 20000 ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps, viewerClient=tp.r.client) rootName = 'base_joint_xyz' cType = "_3_DOF" rLegId = 'rfleg' rLeg = 'rf_haa_joint' rfoot = 'rf_foot_joint' offset = [0., -0.021, 0.] normal = [0, 1, 0]
import time packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-2, 5, -1, 1, 0, 2.2]) ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps, viewerClient=tp.r.client) rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0, 0, -0.105] rLegNormal = [0, 0, 1] rLegx = 0.09 rLegy = 0.05 fullBody.addLimb(rLegId, rLeg, '', rLegOffset, rLegNormal, rLegx, rLegy, 10000, "manipulability", 0.1) lLegId = 'hrp2_lleg_rom' lLeg = 'LLEG_JOINT0'
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-1,2, -2, 1, 0.5, 2.5]) ps = tp.ProblemSolver( fullBody ) r = tp.Viewer (ps) #~ AFTER loading obstacles #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0,-0.105,0,] rLegNormal = [0,1,0] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 10000, "static", 0.03) lLegId = 'hrp2_lleg_rom' lLeg = 'LLEG_JOINT0'
import omniORB.any packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() - 1 fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-1.2, 1.5, -0.05, 0.05, 0.55, 0.85]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds( [-0, 0, -0, 0, -0, 0, 0, 0, 0, 0, 0, 0]) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", omniORB.any.to_any(tp.aMax)) ps.client.problem.setParameter("vMax", omniORB.any.to_any(tp.vMax)) r = tp.Viewer(ps, viewerClient=tp.r.client, displayArrows=True, displayCoM=True) q_init = [ 0, 0, 0.648702, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.261799388, 0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17, 0.261799388, -0.174532925,
packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.setJointBounds("base_joint_xyz", [0.8, 5.6, -0.5, 0.5, 0.4, 1.2]) # Setting a number of sample configurations used nbSamples = 20000 dynamic = True ps = tp.ProblemSolver(fullBody) r = tp.Viewer(ps, viewerClient=tp.r.client) rootName = 'base_joint_xyz' def addLimbDb(limbId, heuristicName, loadValues=True, disableEffectorCollision=False):
import talos.airbus_no_plane_bigStairs_path as tp import time from planning.robot_config.talos import * from display_tools import * tPlanning = tp.tPlanning ## # Information to retrieve urdf and srdf files. pId = tp.ps.numberPaths() - 1 fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("base_joint_xyz", [-13, 10, -3.85, -3.75, -1.75, 0.5]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds( [-0, 0, -0, 0, -0, 0, 0, 0, 0, 0, 0, 0]) ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", tp.aMax) ps.client.problem.setParameter("vMax", tp.vMax) r = tp.Viewer(ps, viewerClient=tp.r.client, displayCoM=True) q_ref = [ 0.0, 0.0, 1.0232773, 1, 0.0, 0.0,
tPlanning = tp.tPlanning packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" pId = tp.ps.numberPaths() -1 fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-1,2, -0.5, 0.5, 0.5, 0.8]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.client.basic.robot.setExtraConfigSpaceBounds([-1,1,-1,1,-0.5,0.5,0,0,0,0,0,0]) ps = tp.ProblemSolver( fullBody ) ps.client.problem.setParameter("aMax",tp.aMax) ps.client.problem.setParameter("vMax",tp.vMax) r = tp.Viewer (ps,viewerClient=tp.r.client,displayArrows = True, displayCoM = True) q_init =[0., 0., 0.648702, 1.0, 0.0 , 0.0, 0.0,0.0, 0.0, 0.0, 0.0,0.261799388, 0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17,0.261799388, -0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17,0.0, 0.0, -0.453785606, 0.872664626, -0.41887902, 0.0,0.0, 0.0, -0.453785606, 0.872664626, -0.41887902, 0.0,0,0,0,0,0,0]; r (q_init) q_ref = q_init[::] fullBody.setCurrentConfig (q_init) qfar=q_ref[::] qfar[2] = -5
pathId = tp.ps.numberPaths()-1 packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.setJointBounds ("base_joint_xyz", [-1.25,5, 0, 2, 0.3, 1.8]) # Setting a number of sample configurations used nbSamples = 20000 dynamic=True ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax",tp.aMax) ps.client.problem.setParameter("vMax",tp.vMax) r = tp.Viewer (ps,viewerClient=tp.r.client) rootName = 'base_joint_xyz' def addLimbDb(limbId, heuristicName, loadValues = True, disableEffectorCollision = False): fullBody.addLimbDatabase(str(db_dir+limbId+'.db'), limbId, heuristicName,loadValues, disableEffectorCollision)
from hpp.corbaserver import Client packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds("root_joint", [-2, 5, -1, 1, 0.3, 4]) # Setting a number of sample configurations used nbSamples = 10000 ps = ProblemSolver(fullBody) r = Viewer(ps) q_init = hyq_ref[:] r(q_init) from hppy_ik import * from numpy import array from numpy.linalg import norm
packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced" srdfSuffix = "" fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-1,2, -2, 1, 0.5, 2.5]) ps = tp.ProblemSolver( fullBody ) r = tp.Viewer (ps) #~ AFTER loading obstacles #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom' rLeg = 'RLEG_JOINT0' rLegOffset = [0,-0.105,0,] rLegNormal = [0,1,0] rLegx = 0.09; rLegy = 0.05 fullBody.addLimb(rLegId,rLeg,'',rLegOffset,rLegNormal, rLegx, rLegy, 10000, "manipulability", 0.03, "_6_DOF") lLegId = 'hrp2_lleg_rom' lLeg = 'LLEG_JOINT0'
packageName = "hyq_description" meshPackageName = "hyq_description" rootJointType = "freeflyer" # Information to retrieve urdf and srdf files. urdfName = "hyq" urdfSuffix = "" srdfSuffix = "" # This time we load the full body model of HyQ fullBody = FullBody() fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) fullBody.setJointBounds("base_joint_xyz", [-2.5, 2.5, -6, 6, 0.6, 0.65]) # Setting a number of sample configurations used nbSamples = 20000 dynamic = True ps = tp.ProblemSolver(fullBody) ps.client.problem.setParameter("aMax", tp.aMax) ps.client.problem.setParameter("vMax", tp.vMax) r = tp.Viewer(ps, viewerClient=tp.r.client) rootName = 'base_joint_xyz' def addLimbDb(limbId, heuristicName,
tPlanning = tp.tPlanning packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14" urdfSuffix = "_reduced_kinematics" srdfSuffix = "" pId = tp.ps.numberPaths() -1 fullBody = FullBody () fullBody.loadFullBodyModel(urdfName, rootJointType, meshPackageName, packageName, urdfSuffix, srdfSuffix) fullBody.setJointBounds ("base_joint_xyz", [-5,5, -1.5, 1.5, 0.5, 0.8]) fullBody.client.basic.robot.setDimensionExtraConfigSpace(tp.extraDof) ps = tp.ProblemSolver( fullBody ) ps.client.problem.setParameter("aMax",tp.aMax) ps.client.problem.setParameter("vMax",tp.vMax) r = tp.Viewer (ps,viewerClient=tp.r.client,displayArrows = True, displayCoM = True) q_init =[0.1, -0.82, 0.648702, 1.0, 0.0 , 0.0, 0.0,0.0, 0.0, 0.0, 0.0,0.261799388, 0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17,0.261799388, -0.174532925, 0.0, -0.523598776, 0.0, 0.0, 0.17,0.0, 0.0, -0.453785606, 0.872664626, -0.41887902, 0.0,0.0, 0.0, -0.453785606, 0.872664626, -0.41887902, 0.0,0,0,0,0,0,0]; r (q_init) q_ref = q_init[::] fullBody.setCurrentConfig (q_init) #~ AFTER loading obstacles rLegId = 'hrp2_rleg_rom'