コード例 #1
0
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")
コード例 #2
0
#!/usr/bin/env python

from hpp.corbaserver import Benchmark
import argparse

parser = argparse.ArgumentParser\
    (description='Print results obtained with class hpp.corbaserver.Benchmark')
parser.add_argument('input_file',
                    type=str,
                    nargs=1,
                    help='input file containing the saved results')
parser.add_argument('output_file',
                    type=str,
                    nargs='?',
                    default=None,
                    help='output file (standard output is used if omitted)')

args = parser.parse_args()

b = Benchmark(None, None, None)
b.resumeFrom(args.input_file[0])
if args.output_file:
    with open(args.output_file, 'w') as f:
        f.write(str(b))
else:
    print b