Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-7800 committed Apr 20, 2024
1 parent cc59566 commit 5ba2178
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion examples/OctopusArmControl/arm_simulator_with_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ def locomotion_reset(self):

""" Set up arm simulator """
self.one_arm_fixed_sim = OneArmSimulator()
self.one_arm_fixed_sim.append(self.mesh_surface)
if self.mesh_surface is not None:
self.one_arm_fixed_sim.append(self.mesh_surface)
else:
self.one_arm_fixed_sim.append(self.plane)
self.shearable_rods = []

self.angle_list = (
Expand Down
4 changes: 2 additions & 2 deletions examples/OctopusArmControl/octopus_with_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"arm_c_per": 1.013,
"arm_c_tan": 0.0256,
"target_radius": 0.02,
"env_idx": 0, # 0 for flat ground, 1 for m32_Viekoda_Bay, 2 for mars-landscape
"env_idx": 2, # 0 for flat ground, 1 for m32_Viekoda_Bay, 2 for mars-landscape
}

task = {}
Expand Down Expand Up @@ -86,7 +86,7 @@ def main(filename):
activations.append(np.zeros(current_muscle_groups[m].activation.shape))
activations_octopus.append(activations)

i_arm = 3
i_arm = 1

for k_sim in tqdm(range(total_steps)):
time, systems, done = env.step(time, activations_octopus)
Expand Down
4 changes: 2 additions & 2 deletions examples/OctopusArmControl/surface_import_and_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

n_elem = 100 # number of discretized elements of the arm
base_length = 0.2 # total length of the arm
env_idx = 1 # 1 for m32_Viekoda_Bay, 2 for mars-landscape
env_idx = 2 # 1 for m32_Viekoda_Bay, 2 for mars-landscape

# radius_tip = 0.0012 # radius of the arm at the tip
# radius_base = 0.012 # radius of the arm at the base
Expand All @@ -30,7 +30,7 @@
mesh.translate(-np.array(mesh.mesh_center))
mesh.rotate(axis=np.array([1.0, 0.0, 0.0]), angle=90)
mesh.scale(np.array([10.0, 10.0, 10.0]) / np.max(mesh.mesh_scale))
mesh.translate(np.array([0.0, 0.0, 0.0]))
mesh.translate(np.array([0.0, 0.0, 0.05]))
filename = "mars-landscape/grid_mars-landscape.dat"

grid_size = max(2 * max(radius_mean), base_length / n_elem)
Expand Down

0 comments on commit 5ba2178

Please sign in to comment.