16 wrapper.tasks = func.tasks
31 values = req.observation_values
32 start = json.loads(req.start_signals)
33 end = json.loads(req.end_signals)
35 params = json.loads(req.experiments[0].parameters)
36 func = req.experiments[0].objective
38 funcs = function.load_functions()
40 tasks = [ (funcs[task.function], task.args, task.return_var, task.has_script, task.script)
if not task.has_script
41 else (
None, [],
None, task.has_script, task.script)
42 for task
in func.tasks ]
45 retvar = func.return_var,
46 types = func.arg_types )
53 src_topic =
"/haptix_deka_controller/command" 54 dst_topic =
"/haptix_deka_controller/command" 81 funcs = { name: func
for name, func
in function.load_functions().items()
82 if not req.args
or func.validate(tuple(req.args)) }
84 return {
'functions': map(str, funcs) }
87 rospy.loginfo(
"I heard %s",req)
91 rospy.init_node(
'dyn_tune_backbone')
95 opt_srv = rospy.Service(
'optimize', dyn_tune.srv.Optimize, optimize_callback)
96 list_srv = rospy.Service(
'list_available_functions', dyn_tune.srv.ListAvailableFunctions, list_functions_callback)
97 save_srv = rospy.Service(
'create_function', dyn_tune.srv.CreateUserFunction, save_function_callback)
100 while not rospy.is_shutdown():
103 if dyn_tuner !=
None:
104 dyn_tuner.tune_params()
105 print dyn_tuner._src_topic
106 print dyn_tuner._dst_topic
107 print dyn_tuner._real_bag_file
108 print dyn_tuner._sim_bag_file
109 print dyn_tuner._objective
110 print dyn_tuner._objective.tasks
111 print dyn_tuner._params_desc
118 if __name__ ==
'__main__':
def optimize_callback(req)
def list_functions_callback(req)
def save_function_callback(req)