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")