Skip to content

Commit

Permalink
slap
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailChaikovskii committed Jul 27, 2023
1 parent 8c47107 commit 6154d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/handle_one_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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()

Expand Down
3 changes: 1 addition & 2 deletions rostok/library/rule_sets/simple_designs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6154d65

Please sign in to comment.