Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
33 changes: 33 additions & 0 deletions robotnik_CopeliaSim/launch_scripts/launch_scene.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import subprocess
import time
import os
import sys

# Ruta al ejecutable de CoppeliaSim
COPPELIA_SIM_PATH = "/home/albert/CoppeliaSim_Edu_V4_9_0_rev6_Ubuntu22_04/coppeliaSim.sh"

# Carpeta donde están guardadas todas las escenas
SCENE_DIR = "/home/albert/CoppeliaSim_Edu_V4_9_0_rev6_Ubuntu22_04/scenes"

# Verificar que se ha pasado un argumento con el nombre de la escena
if len(sys.argv) != 2:
print("Uso: python3 lanzar_escena.py <nombre_escena.ttt>")
sys.exit(1)

scene_name = sys.argv[1]
scene_path = os.path.join(SCENE_DIR, scene_name)

# Verificar que la escena existe
if not os.path.isfile(scene_path):
print(f"Error: escena no encontrada en {scene_path}")
sys.exit(1)

# Lanzar CoppeliaSim con la escena especificada
print(f"Lanzando CoppeliaSim con la escena: {scene_name}")
subprocess.Popen([COPPELIA_SIM_PATH, scene_path])

# Esperar unos segundos para asegurarse de que la escena cargue
time.sleep(5)

print("CoppeliaSim lanzado. Escena cargada.")

Binary file added robotnik_CopeliaSim/launch_scripts/spawn_model.py
Binary file not shown.
Binary file added robotnik_CopeliaSim/robots/rb_robout.ttm
Binary file not shown.
Binary file added robotnik_CopeliaSim/robots/rb_watcher.ttm
Binary file not shown.
Loading