From 6154d65fe6a1de81deb9221fdf2f7d0e4c43f94e Mon Sep 17 00:00:00 2001 From: MikhailChaikovskii Date: Thu, 27 Jul 2023 23:35:47 +0300 Subject: [PATCH] slap --- app/handle_one_graph.py | 7 +++++-- rostok/library/rule_sets/simple_designs.py | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/handle_one_graph.py b/app/handle_one_graph.py index d85c148f..6ddac5ef 100644 --- a/app/handle_one_graph.py +++ b/app/handle_one_graph.py @@ -12,7 +12,7 @@ from rostok.graph_grammar.node import GraphGrammar from rostok.library.obj_grasp.objects import get_object_parametrized_sphere, get_object_ellipsoid from rostok.library.rule_sets.ruleset_old_style import create_rules -from rostok.library.rule_sets.simple_designs import get_two_link_three_finger, get_one_finger_one_link, get_three_link_one_finger, get_three_same_link_one_finger, get_four_same_link_one_finger +from rostok.library.rule_sets.simple_designs import get_one_finger_one_link, get_two_link_three_finger, get_one_finger_one_link, get_three_link_one_finger, get_three_same_link_one_finger, get_four_same_link_one_finger from rostok.simulation_chrono.basic_simulation import SimulationResult # create rule vocabulary rule_vocabul = create_rules() @@ -49,7 +49,9 @@ #graph=get_two_link_three_finger() #control = [10.5, 4.166667, 10.5, 10.5, 10.5, 10.5] #control = [1.05 , 1.683, 1.683, 0.417, 1.05 , 0.417] + graph=get_one_finger_one_link() control = [1.683, 1.05, 0.3] + control = [5] print('control:', control) data = control_optimizer.optim_parameters2data_control(control, graph) print(data) @@ -61,7 +63,8 @@ velocity_data_idx = list(simulation_output.robot_final_ds.get_data("body_velocity").keys()) trajectories = simulation_output.robot_final_ds.get_data("COG")[velocity_data_idx[-1]] velocity_data = simulation_output.robot_final_ds.get_data("body_velocity")[velocity_data_idx[-1]] - velocity_data = [np.linalg.norm(x) for x in velocity_data] + #velocity_data = [np.linalg.norm(x) for x in velocity_data] + velocity_data = [x[0] for x in velocity_data] plt.plot(time_vector, velocity_data) plt.show() diff --git a/rostok/library/rule_sets/simple_designs.py b/rostok/library/rule_sets/simple_designs.py index 15351e49..3d15df9f 100644 --- a/rostok/library/rule_sets/simple_designs.py +++ b/rostok/library/rule_sets/simple_designs.py @@ -17,8 +17,7 @@ def get_palm(): def get_one_finger_one_link(): graph = GraphGrammar() rules = ["Init", - "AddFinger", "Terminal_Radial_Translate1", "Phalanx","Remove_FG", - "Terminal_Link3", + "AddFinger", "Terminal_Radial_Translate1", "Phalanx","Remove_FG", "Terminal_Link3", "RemoveFinger_N", "RemoveFinger_R", "RemoveFinger_RN",