Пример #1
0
def save(env, problem_fn):
  while True:
    env.Reset()
    problem = problem_fn(env)
    problem_name = raw_input('Save problem?\n')
    if problem_name != '': break

  problem.name = problem_name
  problem.env_file = ENV_FORMAT%problem_name
  env_file = GENERATED_DIR + problem.env_file
  env.Save(env_file, Environment.SelectionOptions.Everything) #https://github.com/rdiankov/openrave/blob/master/test/test_collada.py
  print 'Saved', env_file

  problem_file = GENERATED_DIR + PROBLEM_FORMAT%problem_name
  write_pickle(problem_file, problem)
  print 'Saved', problem_file
def save_custom_ir(robot, ir_database):
  filename = FILENAME%get_ir_hash(robot)
  write_pickle(filename, ir_database)
  if DEBUG: print 'Saved', filename