Esempio n. 1
0
cg.setConstraints (graph = True, lockDof = lockAll)

res = ps.client.manipulation.problem.applyConstraints (cg.nodes['free'], q_init)
if not res[0]:
  raise Exception ('Init configuration could not be projected.')
q_init_proj = res [1]

res = ps.client.manipulation.problem.applyConstraints (cg.nodes['free'], q_goal)
if not res[0]:
  raise Exception ('Goal configuration could not be projected.')
q_goal_proj = res [1]

ps.setInitialConfig (q_init_proj)
ps.addGoalConfig (q_goal_proj)

from hpp.corbaserver import Benchmark
import random, sys
b = Benchmark (robot.client.basic, robot, ps)
b.seedRange = random.sample (xrange (100000), 20)
# b.iterPerCase = 3

b.tryResumeAndDelete ()

try:
    results = b.do()
except:
    sys.exit(1)

b.writeResume (filename = "results.pickle")
res = ps.client.manipulation.problem.applyConstraints (cg.nodes['free'], q_goal_monotone)
if not res[0]:
  raise Exception ('Goal configuration could not be projected.')
q_goal_monotone_proj = res [1]

res = ps.client.manipulation.problem.applyConstraints (cg.nodes['free'], q_goal_inverted)
if not res[0]:
  raise Exception ('Goal configuration could not be projected.')
q_goal_inverted_proj = res [1]

ps.setInitialConfig (q_init_proj)
# ps.addGoalConfig (q_goal_monotone_proj)
ps.addGoalConfig (q_goal_inverted_proj)

# from hpp.corbaserver import Benchmark
import sys
from hpp.corbaserver import Benchmark
b = Benchmark (robot.client.basic, robot, ps)
b.seedRange = xrange (20)
b.iterPerCase = 1

b.tryResumeAndDelete ()

try:
    b.do()
except:
    sys.exit(1)

b.writeResume (filename = "results.pickle")
q_init = [2.1, -5.81216, -1, 1 , 0, 0, 0]
q_goal = [-3, -4.3, 1, 0.7071, 0.7071, 0, 0]
v(q_init)

robot.setJointBounds ('base_joint_xyz', [-5.5, 6.5, -12, 0, -5, 6])
# robot.setJointBounds ('base_joint_SO3', [-pi, pi, -pi, pi, -pi, pi, -pi, pi])
ps.setInitialConfig (q_init)
ps.addGoalConfig (q_goal)

from hpp.corbaserver import Benchmark
benchmark = Benchmark (robot.client, robot, ps)
ps.client.problem.setRandomSeed(1927402002)
benchmark.seedRange = range (50)
benchmark.iterPerCase = 1
results = benchmark.do()

benchmark.writeDatabase("dbHPP.db","abstract","abstractLogs.log",True)

#------------------------------------------------------------------
# name = cubicles
# robot = cubicles_robot
# world = cubicles_env
from math import pi
from hpp.corbaserver.hpp_ompl_benchmark.cubicles import Robot
robot = Robot('ompl')
from hpp.corbaserver import ProblemSolver
ps = ProblemSolver (robot)
from hpp.gepetto import Viewer

v = Viewer (ps)