Spaces:
Sleeping
Sleeping
update to load talos first
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ ROBOTS = [r for r in erd.ROBOTS]
|
|
| 8 |
|
| 9 |
|
| 10 |
# keep one MeshCat session alive
|
| 11 |
-
robot = LiveRobot("
|
| 12 |
|
| 13 |
# how many sliders we allow at most (raise if you have bigger robots)
|
| 14 |
MAX_SLIDERS = 32
|
|
@@ -47,10 +47,11 @@ def _slider_updates_for_current_robot():
|
|
| 47 |
|
| 48 |
with gr.Blocks(title="Pinocchio + MeshCat — Live") as demo:
|
| 49 |
gr.Markdown("### 🤖 Pinocchio + MeshCat — Live Viewer\n"
|
| 50 |
-
"Sliders update the robot in real time
|
|
|
|
| 51 |
|
| 52 |
with gr.Row():
|
| 53 |
-
robot_dd = gr.Dropdown(ROBOTS, value="
|
| 54 |
neutral_btn = gr.Button("Neutral")
|
| 55 |
|
| 56 |
viewer = gr.HTML(robot.iframe())
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
# keep one MeshCat session alive
|
| 11 |
+
robot = LiveRobot("talos")
|
| 12 |
|
| 13 |
# how many sliders we allow at most (raise if you have bigger robots)
|
| 14 |
MAX_SLIDERS = 32
|
|
|
|
| 47 |
|
| 48 |
with gr.Blocks(title="Pinocchio + MeshCat — Live") as demo:
|
| 49 |
gr.Markdown("### 🤖 Pinocchio + MeshCat — Live Viewer\n"
|
| 50 |
+
"Sliders update the robot in real time.\n"
|
| 51 |
+
"Select a robot from the dropdown to load it.")
|
| 52 |
|
| 53 |
with gr.Row():
|
| 54 |
+
robot_dd = gr.Dropdown(ROBOTS, value="talos", label="Robot")
|
| 55 |
neutral_btn = gr.Button("Neutral")
|
| 56 |
|
| 57 |
viewer = gr.HTML(robot.iframe())
|
robots.py
CHANGED
|
@@ -6,6 +6,7 @@ import meshcat.geometry as g
|
|
| 6 |
from pinocchio.visualize import MeshcatVisualizer
|
| 7 |
import time
|
| 8 |
|
|
|
|
| 9 |
def _actuated_dof_indices(model):
|
| 10 |
idxs, labels, bounds = [], [], []
|
| 11 |
for j in range(1, len(model.joints)):
|
|
@@ -28,7 +29,7 @@ class LiveRobot:
|
|
| 28 |
Starts a local MeshCat ZMQ+Web server and keeps a persistent connection.
|
| 29 |
The web UI is proxied at /meshcat/ by nginx (see nginx.conf).
|
| 30 |
"""
|
| 31 |
-
def __init__(self, robot_name="
|
| 32 |
self.vis = meshcat.Visualizer(zmq_url="tcp://127.0.0.1:6001")
|
| 33 |
print(f"Zmq URL: {self.vis.window.zmq_url}, web URL: {self.vis.window.web_url}")
|
| 34 |
|
|
|
|
| 6 |
from pinocchio.visualize import MeshcatVisualizer
|
| 7 |
import time
|
| 8 |
|
| 9 |
+
|
| 10 |
def _actuated_dof_indices(model):
|
| 11 |
idxs, labels, bounds = [], [], []
|
| 12 |
for j in range(1, len(model.joints)):
|
|
|
|
| 29 |
Starts a local MeshCat ZMQ+Web server and keeps a persistent connection.
|
| 30 |
The web UI is proxied at /meshcat/ by nginx (see nginx.conf).
|
| 31 |
"""
|
| 32 |
+
def __init__(self, robot_name="talos"):
|
| 33 |
self.vis = meshcat.Visualizer(zmq_url="tcp://127.0.0.1:6001")
|
| 34 |
print(f"Zmq URL: {self.vis.window.zmq_url}, web URL: {self.vis.window.web_url}")
|
| 35 |
|