Spaces:
Running
Running
another try
Browse files- nginx.conf +2 -1
- robots.py +4 -3
- run.sh +1 -1
nginx.conf
CHANGED
|
@@ -22,7 +22,8 @@ http {
|
|
| 22 |
proxy_http_version 1.1;
|
| 23 |
proxy_set_header Upgrade $http_upgrade;
|
| 24 |
proxy_set_header Connection $connection_upgrade;
|
| 25 |
-
proxy_pass http://meshcat/;
|
|
|
|
| 26 |
}
|
| 27 |
}
|
| 28 |
}
|
|
|
|
| 22 |
proxy_http_version 1.1;
|
| 23 |
proxy_set_header Upgrade $http_upgrade;
|
| 24 |
proxy_set_header Connection $connection_upgrade;
|
| 25 |
+
# proxy_pass http://meshcat/;
|
| 26 |
+
proxy_pass http://meshcat/static/;
|
| 27 |
}
|
| 28 |
}
|
| 29 |
}
|
robots.py
CHANGED
|
@@ -30,8 +30,9 @@ class LiveRobot:
|
|
| 30 |
"""
|
| 31 |
def __init__(self, robot_name="ur5"):
|
| 32 |
# Start one MeshCat server (zmq + web) and connect
|
| 33 |
-
self.proc, self.zmq_url, self.web_url = start_zmq_server_as_subprocess(server_args=[])
|
| 34 |
-
|
|
|
|
| 35 |
self.vis = meshcat.Visualizer(zmq_url=self.zmq_url)
|
| 36 |
|
| 37 |
self.rdata = erd.load(robot_name)
|
|
@@ -63,4 +64,4 @@ class LiveRobot:
|
|
| 63 |
|
| 64 |
def iframe(self, width="100%", height=640):
|
| 65 |
# nginx proxies the MeshCat web app at /meshcat/
|
| 66 |
-
return f'<iframe src="/meshcat
|
|
|
|
| 30 |
"""
|
| 31 |
def __init__(self, robot_name="ur5"):
|
| 32 |
# Start one MeshCat server (zmq + web) and connect
|
| 33 |
+
#self.proc, self.zmq_url, self.web_url = start_zmq_server_as_subprocess( server_args=[])
|
| 34 |
+
self.zmq_url = "tcp://0.0.0.0:6001"
|
| 35 |
+
#print(f"MeshCat ZMQ server at {self.zmq_url}, web at {self.web_url}")
|
| 36 |
self.vis = meshcat.Visualizer(zmq_url=self.zmq_url)
|
| 37 |
|
| 38 |
self.rdata = erd.load(robot_name)
|
|
|
|
| 64 |
|
| 65 |
def iframe(self, width="100%", height=640):
|
| 66 |
# nginx proxies the MeshCat web app at /meshcat/
|
| 67 |
+
return f'<iframe src="/meshcat" style="width:{width};height:{height}px;border:0"></iframe>'
|
run.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
set -euo pipefail
|
| 3 |
|
| 4 |
# 1) start MeshCat (websocket server) on 6001 in the background
|
| 5 |
-
|
| 6 |
|
| 7 |
# 2) start nginx (daemonizes to background by default; uses /workspace/nginx.conf)
|
| 8 |
nginx
|
|
|
|
| 2 |
set -euo pipefail
|
| 3 |
|
| 4 |
# 1) start MeshCat (websocket server) on 6001 in the background
|
| 5 |
+
meshcat-server --z tcp://127.0.0.1:6001 &
|
| 6 |
|
| 7 |
# 2) start nginx (daemonizes to background by default; uses /workspace/nginx.conf)
|
| 8 |
nginx
|