Skip to content

Commit

Permalink
simulation with external force
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailChaikovskii committed Nov 1, 2023
1 parent 86b10a2 commit 110c895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/mcts_run_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ def config_independent_torque(grasp_object_blueprint):


def config_tendon(grasp_object_blueprint):

simulation_manager = GraspScenario(hp.TIME_STEP_SIMULATION, hp.TIME_SIMULATION, TendonController_2p)
obj_forces = []
obj_forces.append(f_ext.RandomForces(1e6, 100, 20))
obj_forces.append(f_ext.NullGravity(0))
obj_forces = f_ext.ExternalForces(obj_forces)
simulation_manager = GraspScenario(hp.TIME_STEP_SIMULATION, hp.TIME_SIMULATION, TendonController_2p, obj_external_forces=obj_forces)

simulation_manager.grasp_object_callback = grasp_object_blueprint
event_contact_builder = EventContactBuilder()
Expand Down Expand Up @@ -136,7 +139,7 @@ def config_tendon(grasp_object_blueprint):
hp.FINAL_POSITION_CRITERION_WEIGHT)
tendon_controller_cfg = get_tendon_cfg()
tendon_optivar = TendonForceOptiVar(tendon_controller_cfg, simulation_rewarder, -45)
tendon_optivar.is_vis = False
tendon_optivar.is_vis = True
brute_tendon = BruteForceOptimisation1D(hp.TENDON_DISCRETE_FORCES, [simulation_manager],
tendon_optivar,
num_cpu_workers=1)
Expand Down
2 changes: 1 addition & 1 deletion app/one_graph_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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)
Expand Down

0 comments on commit 110c895

Please sign in to comment.