-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from aimclub/feature/independent_events
add event builders
- Loading branch information
Showing
8 changed files
with
311 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
from mcts_run_setup import config_independent_torque, config_with_tendon | ||
from mcts_run_setup import config_tendon | ||
|
||
from rostok.library.obj_grasp.objects import get_object_sphere | ||
from rostok.library.rule_sets.simple_designs import ( | ||
get_three_link_one_finger, get_three_link_one_finger_independent) | ||
from rostok.simulation_chrono.simulation_utils import SimulationResult | ||
get_three_link_one_finger, get_three_link_one_finger_independent, get_two_link_three_finger, ) | ||
|
||
# create blueprint for object to grasp | ||
grasp_object_blueprint = get_object_sphere(0.05) | ||
grasp_object_blueprint = get_object_sphere(0.05, mass=0.2) | ||
|
||
# create reward counter using run setup function | ||
# control_optimizer = config_with_const_troques(grasp_object_blueprint) | ||
control_optimizer = config_independent_torque(grasp_object_blueprint) | ||
control_optimizer = config_with_tendon(grasp_object_blueprint) | ||
|
||
simulation_rewarder = control_optimizer.rewarder | ||
simulation_manager = control_optimizer.simulation_scenario | ||
|
||
control_optimizer = config_tendon(grasp_object_blueprint) | ||
|
||
graph = get_three_link_one_finger_independent() | ||
graph = get_three_link_one_finger() | ||
control = [10] | ||
|
||
data = control_optimizer.optim_parameters2data_control(control, graph) | ||
|
||
vis = True | ||
|
||
#simulation_output: SimulationResult = simulation_manager.run_simulation(graph, data, [[-45.0, 0.0],[-45,0],[-45,0]], vis, True) | ||
simulation_output: SimulationResult = simulation_manager.run_simulation(graph, data, [[0.0, 0, 0]], vis, True) | ||
graph = graph = get_two_link_three_finger() | ||
|
||
res = simulation_rewarder.calculate_reward(simulation_output) | ||
print('reward', res) | ||
rewsss = control_optimizer.calculate_reward(graph) | ||
pass |
Oops, something went wrong.