Spaces:
Runtime error
Runtime error
project setup
Browse files- README.md +15 -0
- backend/config_builder.py +28 -0
- setup.sh +13 -0
README.md
CHANGED
|
@@ -11,3 +11,18 @@ short_description: 'A fast way to get ready the robot. '
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Interfaz para Simulaciones LeRobot
|
| 18 |
+
|
| 19 |
+
## Pasos para instalar:
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
git clone https://github.com/TU_USUARIO/lerobot-interface
|
| 23 |
+
cd lerobot-interface
|
| 24 |
+
bash setup.sh
|
| 25 |
+
source env/bin/activate
|
| 26 |
+
python interface_config_builder.py
|
| 27 |
+
|
| 28 |
+
|
backend/config_builder.py
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from lerobot.simulations import aloha, pusht, xarm
|
| 3 |
+
|
| 4 |
+
def run_simulation(sim_type):
|
| 5 |
+
if sim_type == "aloha":
|
| 6 |
+
env = aloha.make_env()
|
| 7 |
+
elif sim_type == "pusht":
|
| 8 |
+
env = pusht.make_env()
|
| 9 |
+
elif sim_type == "xarm":
|
| 10 |
+
env = xarm.make_env()
|
| 11 |
+
else:
|
| 12 |
+
return "Simulaci贸n no reconocida"
|
| 13 |
+
|
| 14 |
+
obs = env.reset()
|
| 15 |
+
frame = env.render()
|
| 16 |
+
return frame # Devolver imagen inicial
|
| 17 |
+
|
| 18 |
+
with gr.Blocks() as demo:
|
| 19 |
+
gr.Markdown("# Simulador LeRobot Interface")
|
| 20 |
+
|
| 21 |
+
sim_selector = gr.Dropdown(
|
| 22 |
+
["aloha", "pusht", "xarm"], label="Selecciona simulaci贸n"
|
| 23 |
+
)
|
| 24 |
+
output = gr.Image(label="Vista previa del entorno")
|
| 25 |
+
|
| 26 |
+
sim_selector.change(fn=run_simulation, inputs=sim_selector, outputs=output)
|
| 27 |
+
|
| 28 |
+
demo.launch()
|
setup.sh
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
echo "[INFO] Creando entorno virtual 'env'..."
|
| 2 |
+
python3 -m venv env
|
| 3 |
+
source env/bin/activate
|
| 4 |
+
|
| 5 |
+
echo "[INFO] Actualizando pip..."
|
| 6 |
+
pip install --upgrade pip
|
| 7 |
+
|
| 8 |
+
echo "[INFO] Instalando dependencias..."
|
| 9 |
+
pip install -r requirements.txt
|
| 10 |
+
|
| 11 |
+
echo "[INFO] Instalaci贸n completa."
|
| 12 |
+
echo "Ejecuta ahora con:"
|
| 13 |
+
echo "source env/bin/activate && python interface_config_builder.py"
|